/* ── Type & base ────────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  --bg: #04050a;
  --bg-2: #0a0b14;
  --ink: #f0efe8;
  --ink-dim: rgba(240, 239, 232, 0.40);
  --ink-faint: rgba(240, 239, 232, 0.20);
  --line: rgba(240, 239, 232, 0.04);
  --line-strong: rgba(240, 239, 232, 0.08);
  --accent: #d92020;          /* Roman Red accent */
  --accent-hot: #ff3333;
  --accent-dim: rgba(217, 32, 32, 0.35);
  --danger: #c93b3b;
  --serif: 'Space Grotesk', system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--serif);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

body {
  /* total scroll length: 8 sections × 100vh */
  min-height: 800vh;
}

/* ── Pinned 3D stage ───────────────────────────────────────────── */
#stage {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(ellipse 120% 100% at 50% 40%, #080a14 0%, var(--bg) 70%);
}
#gl { width: 100%; height: 100%; display: block; }

#grain {
  position: absolute; inset: 0;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.90  0 0 0 0 0.88  0 0 0 0 0.85  0 0 0 0.06 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  background-size: 220px 220px;
  mix-blend-mode: overlay;
  opacity: 0.25;
  pointer-events: none;
}

#vignette {
  position: absolute; inset: 0;
  background: radial-gradient(100% 80% at 50% 50%, transparent 45%, rgba(0,0,0,0.55) 100%);
  pointer-events: none;
}

/* ── Part label overlay (shown during exploded tour) ───────────── */
#part-label {
  position: absolute;
  bottom: 15%;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.5s ease;
  z-index: 10;
}
#part-label.visible { opacity: 1; }
#part-label .part-name {
  font-family: var(--serif);
  font-size: clamp(28px, 4vw, 52px);
  font-weight: 500;
  letter-spacing: -0.02em;
  color: #ffffff;
  text-shadow: 0 0 30px rgba(255,255,255,0.15);
}
#part-label .part-desc {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

/* ── Loading screen ────────────────────────────────────────────── */
#loader {
  position: fixed; inset: 0; z-index: 100;
  background: var(--bg);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 32px;
  transition: opacity 1.0s ease-out;
}
#loader.done { opacity: 0; pointer-events: none; }

.loader-mark {
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.6em;
  color: var(--accent);
  text-indent: 0.6em;
}

.loader-track {
  width: 200px; height: 1px;
  background: var(--line);
  overflow: hidden;
}
.loader-fill {
  width: 0%; height: 100%;
  background: var(--accent);
  transition: width 0.3s ease;
}
.loader-status {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--ink-faint);
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

/* ── Mobile Warning ──────────────────────────────────────────────── */
#mobile-warning {
  display: none; /* Hidden by default on desktop */
  position: fixed; inset: 0; z-index: 200;
  background: rgba(2, 1, 6, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  align-items: center; justify-content: center;
  transition: opacity 0.5s ease;
  padding: 24px;
}
.mw-inner {
  border: 1px solid var(--line);
  background: rgba(4, 4, 8, 0.6);
  padding: 40px 32px;
  text-align: center;
  max-width: 400px;
  display: flex; flex-direction: column; gap: 24px; align-items: center;
  border-radius: 4px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.8);
}
.mw-title {
  font-size: 24px;
  font-weight: 500;
  color: var(--accent);
  letter-spacing: -0.02em;
}
.mw-desc {
  font-size: 14px;
  line-height: 1.6;
  color: var(--ink-dim);
}
.mw-btn {
  background: var(--accent);
  color: #fff;
  border: 1px solid var(--accent);
  padding: 14px 32px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  text-decoration: none;
  border-radius: 2px;
  cursor: pointer;
  transition: background 0.3s, box-shadow 0.3s, border-color 0.3s;
}
.mw-btn:active, .mw-btn:hover {
  background: var(--accent-hot);
  box-shadow: 0 0 20px var(--accent-dim);
}
.mw-btn-alt {
  background: rgba(4, 4, 8, 0.4);
  border-color: var(--line);
  color: var(--ink-dim);
}
.mw-btn-alt:hover, .mw-btn-alt:active {
  background: rgba(255, 255, 255, 0.05);
  box-shadow: none;
  border-color: var(--ink-dim);
  color: #fff;
}

/* ── Top nav ───────────────────────────────────────────────────── */
#topnav {
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 20;
  padding: 24px 40px;
  display: flex; align-items: center; justify-content: space-between;
  mix-blend-mode: difference;
  color: #ffffff;
}
.brand {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.5em;
  display: flex; align-items: center; gap: 12px;
}
.brand-dot {
  display: inline-block;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent), 0 0 20px var(--accent-dim);
}
#topnav nav {
  display: flex; gap: 28px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}
#topnav nav a {
  color: rgba(255,255,255,0.50);
  text-decoration: none;
  transition: color 0.3s;
}
#topnav nav a:hover { color: rgba(255,255,255,0.85); }
#topnav nav .cta {
  color: rgba(255,255,255,0.85);
  border: 1px solid rgba(255,255,255,0.20);
  padding: 8px 18px;
  border-radius: 999px;
  transition: border-color 0.3s, background 0.3s;
}
#topnav nav .cta:hover {
  border-color: var(--accent);
  background: rgba(217, 32, 32, 0.08);
}

/* ── Scroll rail (right side) ──────────────────────────────────── */
#rail {
  position: fixed;
  right: 40px;
  top: 50%; transform: translateY(-50%);
  z-index: 15;
  display: flex; flex-direction: column; align-items: flex-end; gap: 14px;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
}
.rail-line {
  position: absolute;
  right: -16px; top: 0; bottom: 0;
  width: 1px;
  background: var(--line);
}
.rail-fill {
  position: absolute; top: 0; left: 0; right: 0;
  height: 0%;
  background: var(--accent);
  transition: height 0.2s linear;
}
.rail-nodes {
  list-style: none;
  display: flex; flex-direction: column; gap: 18px;
}
.rail-nodes li {
  color: var(--ink-faint);
  transition: color 0.4s, transform 0.4s;
  cursor: pointer;
  white-space: nowrap;
}
.rail-nodes li.active {
  color: var(--accent);
  transform: translateX(-8px);
}

/* ── Scroll sections ───────────────────────────────────────────── */
#scroll {
  position: relative;
  z-index: 5;
  pointer-events: none;
}
#scroll a, #scroll button, #scroll .preorder-card, #scroll .mode { pointer-events: auto; }

.sec {
  height: 100vh;
  width: 100%;
  display: flex;
  padding: 120px 80px;
  position: relative;
}
.sec-inner {
  display: flex; flex-direction: column;
  max-width: 520px;
  gap: 28px;
}
.align-bottom { align-self: flex-end; margin-top: auto; margin-bottom: 100px; }
.align-left   { align-self: flex-start; margin-right: auto; margin-top: auto; margin-bottom: auto; }
.align-right  { align-self: flex-end;   margin-left: auto;  margin-top: auto; margin-bottom: auto; }
.align-center { align-self: center; margin: auto; text-align: center; align-items: center; }

.sec-hero .sec-inner { max-width: 680px; }

.eyebrow {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.5em;
  text-transform: uppercase;
  color: var(--accent);
}

.display {
  font-size: clamp(44px, 6.5vw, 88px);
  font-weight: 500;
  line-height: 0.94;
  letter-spacing: -0.045em;
}
.display .accent { color: var(--accent); font-style: italic; font-weight: 400; }

h2 {
  font-size: clamp(36px, 5vw, 68px);
  font-weight: 500;
  line-height: 1.0;
  letter-spacing: -0.03em;
}
p {
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink-dim);
  max-width: 420px;
}

.meta {
  display: flex; gap: 36px;
  margin-top: 20px;
}
.meta > div { display: flex; flex-direction: column; gap: 5px; }
.meta .k {
  font-family: var(--mono);
  font-size: 9px;
  color: var(--ink-faint);
  letter-spacing: 0.28em;
  text-transform: uppercase;
}
.meta .v {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink);
}

.scroll-hint {
  position: absolute;
  bottom: 40px; left: 50%; transform: translateX(-50%);
  font-family: var(--mono);
  font-size: 10px;
  color: var(--ink-faint);
  letter-spacing: 0.35em;
  text-transform: uppercase;
  display: flex; align-items: center; gap: 10px;
}
.scroll-hint .arrow {
  display: inline-block;
  animation: bounce 2.5s infinite ease-in-out;
}
@keyframes bounce {
  0%,100% { transform: translateY(0); opacity: 0.4; }
  50%     { transform: translateY(5px); opacity: 0.8; }
}

.bullets {
  list-style: none;
  display: flex; flex-direction: column; gap: 12px;
  margin-top: 12px;
}
.bullets li {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-dim);
  padding-left: 22px;
  position: relative;
  letter-spacing: 0.03em;
}
.bullets li::before {
  content: '';
  position: absolute; left: 0; top: 7px;
  width: 10px; height: 1px;
  background: var(--accent);
}

.layer-list {
  display: flex; flex-direction: column;
  border-top: 1px solid var(--line);
  margin-top: 16px;
}
.layer {
  display: grid;
  grid-template-columns: 36px 1fr 1fr;
  align-items: center;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 12px;
}
.layer .n { color: var(--accent); font-size: 11px; }
.layer .l { color: var(--ink-dim); }
.layer .d { color: var(--ink-faint); font-size: 10px; letter-spacing: 0.18em; text-transform: uppercase; }

.mode-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-top: 12px;
}
.mode {
  border: 1px solid var(--line);
  padding: 20px 20px;
  display: flex; flex-direction: column; gap: 6px;
  cursor: pointer;
  transition: border-color 0.5s, background 0.5s;
  background: rgba(4, 4, 8, 0.4);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: 3px;
}
.mode:hover, .mode.active {
  border-color: var(--accent-dim);
  background: rgba(217, 32, 32, 0.04);
}
.mode .mt {
  font-size: 20px;
  letter-spacing: -0.01em;
  font-weight: 500;
}
.mode .md {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--ink-faint);
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

/* ── Preorder card ─────────────────────────────────────────────── */
.preorder-card {
  border: 1px solid var(--line);
  padding: 44px 52px;
  margin-top: 36px;
  display: flex; flex-direction: column; gap: 36px;
  background: rgba(4, 4, 8, 0.5);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  min-width: 560px;
  border-radius: 4px;
  box-shadow: 0 30px 80px rgba(0,0,0,0.5);
}
.po-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 24px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 28px;
}
.po-row > div { display: flex; flex-direction: column; gap: 5px; align-items: flex-start; text-align: left; }
.po-row .k {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.30em;
  color: var(--ink-faint);
  text-transform: uppercase;
}
.po-row .v {
  font-size: 24px;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.po-cta {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 28px;
  background: var(--accent);
  color: #ffffff;
  text-decoration: none;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  font-weight: 500;
  transition: background 0.3s, box-shadow 0.3s;
  border-radius: 2px;
}
.po-cta:hover {
  background: var(--accent-hot);
  box-shadow: 0 0 30px var(--accent-dim);
}
.po-cta span { font-size: 16px; }
.po-note {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--ink-faint);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  text-align: center;
}

.page-foot {
  margin-top: 80px;
  width: 100%;
  display: flex; justify-content: space-between;
  font-family: var(--mono);
  font-size: 9px;
  color: var(--ink-faint);
  letter-spacing: 0.28em;
  text-transform: uppercase;
}

/* responsive cinematic mobile adaptation */
@media (max-width: 900px) {
  .sec { padding: 80px 24px; }
  .meta { flex-wrap: wrap; gap: 18px; }
  #rail { display: none; }
  .preorder-card { min-width: 0; width: 100%; padding: 28px 24px; }
  .po-row { grid-template-columns: 1fr; gap: 18px; }
  .page-foot { flex-direction: column; gap: 8px; align-items: flex-start; }
}

@media (max-width: 768px) {
  /* Mobile camera centers everything, so we push UI out of the middle */
  .sec-hero .sec-inner { align-self: flex-start; margin-top: auto; margin-bottom: 20vh; text-align: center; align-items: center; }
  .sec-workflow .sec-inner,
  .sec-touch .sec-inner,
  .sec-explode .sec-inner,
  .sec-precision .sec-inner {
    align-self: flex-end; 
    margin: auto auto 15vh auto;
    text-align: center;
    align-items: center;
  }
  
  .display { font-size: 42px; line-height: 1.0; }
  h2 { font-size: 32px; line-height: 1.1; }
  p { font-size: 15px; max-width: 100%; text-align: center; }
  
  .bullets { align-items: flex-start; text-align: left; margin: 20px auto 0 auto; display: inline-flex; }
  
  #topnav { padding: 18px 24px; flex-wrap: wrap; gap: 14px; justify-content: center; }
  #topnav nav { gap: 16px; font-size: 9px; }
  
  /* Exploded view layer list */
  .layer-list { width: 100%; max-width: 340px; margin-top: 24px; }
  .layer { grid-template-columns: 30px 1fr 1fr; padding: 12px 0; }
  
  /* Mode grid */
  .mode-grid { grid-template-columns: 1fr; width: 100%; max-width: 340px; }
  
  /* Part label safe zone */
  #part-label { bottom: 12%; width: 90%; text-align: center; }
  #part-label .part-name { font-size: 32px; }
  
  /* Show Mobile Warning */
  #mobile-warning { display: flex; }
}

/* ── Global Image Skeletons ──────────────────────────────────────── */
img:not(.loaded) {
  background: linear-gradient(90deg, #050508 25%, #151520 50%, #050508 75%);
  background-size: 200% 100%;
  animation: skeletonPulse 1.5s infinite linear;
  color: transparent; /* hide alt text while loading */
}
@keyframes skeletonPulse {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
