/* ═══════════════════════════════════════════════════════════
   X9PRO — cinematic scroll landing
   Tone: industrial / engineered-device. Dark void + amber accent.
   ═══════════════════════════════════════════════════════════ */

:root {
  /* Scale tokens — sampled from the product render */
  --void:        #06090f;
  --void-lift:   #0b111a;
  --bone:        #ede9e3;
  --bone-deep:   #ddd7cf;
  --ink:         #12161d;
  --amber:       #f0832b;
  --amber-lift:  #ff9640;
  --ion:         #35b4e8;

  /* Semantic — dark is the default scene */
  --bg:             var(--void);
  --bg-inverse:     var(--bone);
  --text-primary:   #e4e8ee;
  --text-secondary: #8c96a5;
  --text-inverse:   #e4e8ee;
  --rule:           rgba(228, 232, 238, 0.14);
  --accent:         var(--amber);
  /* Accent used as *text*. Amber reads at ~1.4:1 on the bone surface, so the
     light zone gets a burnt variant instead of the raw brand orange. */
  --accent-text:    var(--amber);

  /* Type */
  --font-display: 'IBM Plex Sans KR', sans-serif;
  --font-body:    'IBM Plex Sans KR', sans-serif;
  --font-mono:    'IBM Plex Mono', 'IBM Plex Sans KR', monospace;

  /* Type scale — major third (1.25) */
  --text-xs:   0.64rem;
  --text-sm:   0.8rem;
  --text-base: 1rem;
  --text-lg:   1.25rem;
  --text-xl:   1.563rem;
  --text-2xl:  1.953rem;
  --text-3xl:  2.441rem;
  --text-4xl:  3.052rem;

  /* Space */
  --space-1: 0.25rem;  --space-2: 0.5rem;   --space-3: 0.75rem;
  --space-4: 1rem;     --space-6: 1.5rem;   --space-8: 2rem;
  --space-12: 3rem;    --space-16: 4rem;    --space-24: 6rem;
  --space-32: 8rem;

  /* Engine */
  --scroll-height: 950vh;
  --scroll-height-mobile: 660vh;
  --frame-scale: 0.86;
  --frame-speed: 2.0;
  --theme-transition: 1.2s cubic-bezier(0.22, 1, 0.36, 1);
}

[data-active-theme="light"] {
  --bg:             var(--bone);
  --text-primary:   var(--ink);
  --text-secondary: #3c424c;   /* 5.1:1 on the veiled bone surface */
  --text-inverse:   var(--ink);
  --rule:           rgba(18, 22, 29, 0.16);
  --accent-text:    #733005;   /* 4.9:1 on the veiled bone surface */
}


/* ── Reset ─────────────────────────────────────────────── */

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto; }

body {
  font-family: var(--font-body);
  font-weight: 400;
  background: var(--bg);
  color: var(--text-primary);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  transition: background var(--theme-transition), color var(--theme-transition);
}

img, video { max-width: 100%; display: block; }
a { color: inherit; }

::selection { background: var(--amber); color: #0a0a0a; }

:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 3px;
}


/* ── Accessibility ─────────────────────────────────────── */

.skip-link {
  position: fixed; top: -100%; left: 50%;
  transform: translateX(-50%);
  background: var(--amber); color: #0a0a0a;
  padding: 0.8rem 1.6rem;
  font-family: var(--font-mono); font-size: var(--text-sm); font-weight: 500;
  z-index: 10000; text-decoration: none;
  transition: top 0.2s;
}
.skip-link:focus { top: 0; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .parallax-layer, .marquee-wrap, .custom-cursor { display: none !important; }
  .scroll-section { opacity: 1 !important; transform: none !important; }
}


/* ── Loader ────────────────────────────────────────────── */

#loader {
  position: fixed; inset: 0; z-index: 9999;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  background: var(--void); color: #e4e8ee;
  transition: opacity 0.5s ease;
}
.loader-brand {
  font-family: var(--font-mono); font-size: var(--text-sm);
  letter-spacing: 0.3em; text-transform: uppercase;
  margin-bottom: var(--space-8); opacity: 0.75;
}
.loader-track {
  width: min(240px, 56vw); height: 1px;
  background: rgba(228, 232, 238, 0.16); overflow: hidden;
}
#loader-bar { height: 100%; width: 0%; background: var(--amber); transition: width 0.15s linear; }
#loader-percent {
  margin-top: var(--space-4);
  font-family: var(--font-mono); font-size: var(--text-xs);
  font-variant-numeric: tabular-nums; letter-spacing: 0.12em; opacity: 0.5;
}


/* ── Header ────────────────────────────────────────────── */

.site-header {
  position: fixed; top: 0; left: 0; width: 100%;
  z-index: 200; padding: var(--space-6) clamp(1.25rem, 5vw, 3.5rem);
  pointer-events: none;
}
/* The header floats over the ride footage in the outro, whose sky is bright.
   A short top gradient keeps the logo and CTA legible anywhere on the page. */
.site-header::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  pointer-events: none;
  background: linear-gradient(to bottom, rgba(6, 9, 15, 0.8) 0%, rgba(6, 9, 15, 0) 100%);
}
.site-header nav {
  display: flex; align-items: center; justify-content: space-between;
}
/* Deliberately NOT var(--text-primary) — that flips dark on light-theme
   sections, but the header always sits on its own dark ::before scrim
   regardless of section theme. A theme-reactive color would go dark-on-dark
   the moment the page scrolls into a light zone. */
.nav-logo {
  font-family: var(--font-mono); font-size: var(--text-sm);
  font-weight: 500; letter-spacing: 0.22em; text-transform: uppercase;
  color: #e4e8ee;
}
.nav-logo em {
  font-style: normal; color: var(--amber-lift);
  text-shadow: 0 0 18px color-mix(in srgb, var(--amber) 55%, transparent);
}

/* Filled from the start, not just on hover — this is the only persistent
   call-to-action visible before the visitor has scrolled at all, so it has
   to read as clickable immediately rather than blend into the header. */
.nav-cta {
  pointer-events: auto;
  display: inline-flex; align-items: center;
  min-height: 50px;
  font-family: var(--font-mono); font-size: var(--text-sm);
  font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase;
  text-decoration: none; color: #0a0a0a;
  padding: 0 1.6rem; border: 1px solid var(--amber);
  background: var(--amber);
  box-shadow: 0 4px 18px color-mix(in srgb, var(--amber) 38%, transparent);
  transition: background 0.2s, transform 0.2s, box-shadow 0.2s;
}
.nav-cta:hover {
  background: var(--amber-lift); border-color: var(--amber-lift);
  transform: translateY(-1px);
  box-shadow: 0 8px 24px color-mix(in srgb, var(--amber) 50%, transparent);
}
.nav-cta:active { transform: translateY(0); }


/* ── Progress indicator ────────────────────────────────── */

.progress-track {
  position: fixed; right: clamp(1rem, 2.5vw, 2rem); top: 50%;
  transform: translateY(-50%);
  width: 1px; height: 32vh;
  background: var(--rule); z-index: 100;
  transition: opacity 0.4s ease;
}
.progress-fill { width: 100%; height: 0%; background: var(--amber); transition: height 0.1s linear; }
.progress-label {
  position: absolute; right: 14px; top: 0;
  font-family: var(--font-mono); font-size: var(--text-xs);
  letter-spacing: 0.14em; white-space: nowrap;
  color: var(--text-secondary);
  transform: translateY(-50%);
  transition: color var(--theme-transition);
}


/* ── Hero ──────────────────────────────────────────────── */

/* Transparent so the frame canvas reads through from the very first paint —
   legibility comes from .hero-scrim, not from an opaque panel. */
.hero-standalone {
  position: relative; z-index: 5;
  min-height: 100vh; width: 100%;
  display: flex; flex-direction: column; justify-content: center;
  padding: 0 clamp(1.5rem, 8vw, 8vw);
  background: transparent;
}
.hero-heading {
  font-family: var(--font-display);
  /* Sized so the two lines stay inside the left ~60% and clear the product */
  font-size: clamp(2.5rem, 7.4vw, 9.5rem);
  font-weight: 700; line-height: 0.98;
  letter-spacing: -0.035em;
  text-wrap: balance;
  margin-top: var(--space-6);
}
.hero-heading .word {
  display: inline-block;
  opacity: 0; transform: translateY(40px);
  will-change: transform, opacity;
}
.hero-heading .word + .word { margin-left: 0.22em; }
.hero-tagline {
  margin-top: var(--space-8);
  font-size: clamp(1rem, 1.5vw, 1.15rem);
  font-weight: 300; line-height: 1.7;
  color: var(--text-secondary);
  max-width: 42ch;
}
.scroll-cue {
  position: absolute; bottom: var(--space-12); left: clamp(1.5rem, 8vw, 8vw);
  font-family: var(--font-mono); font-size: var(--text-xs);
  letter-spacing: 0.24em; color: var(--text-secondary);
  display: flex; flex-direction: column; gap: var(--space-3);
}


/* ── Canvas ────────────────────────────────────────────── */

.canvas-wrap {
  position: fixed; inset: 0; z-index: 1;
  transition: opacity 0.5s ease;
}
.canvas-wrap canvas { width: 100%; height: 100%; display: block; }
/* Soft vignette — hints depth without drawing a visible ring in the light zone */
.canvas-vignette {
  position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse at 50% 50%, transparent 40%, rgba(0,0,0,0.3) 100%);
}
/* Hero legibility. Heavy on the left where the headline sits, near-clear over
   the product on the right. Fades out as the hero scrolls away and the scene
   veil takes over. */
.hero-scrim {
  position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(96deg,
      rgba(6, 9, 15, 0.96) 0%,
      rgba(6, 9, 15, 0.90) 26%,
      rgba(6, 9, 15, 0.58) 46%,
      rgba(6, 9, 15, 0.16) 68%,
      rgba(6, 9, 15, 0.40) 100%),
    linear-gradient(to top, rgba(6, 9, 15, 0.7) 0%, transparent 34%);
}


/* ── Parallax ──────────────────────────────────────────── */

.parallax-layer { position: fixed; inset: 0; pointer-events: none; will-change: transform; }
.parallax-bg {
  z-index: 1;
  background:
    radial-gradient(60% 40% at 20% 15%, rgba(53, 180, 232, 0.07), transparent 70%),
    radial-gradient(50% 40% at 85% 80%, rgba(240, 131, 43, 0.07), transparent 70%);
}
.parallax-mid {
  z-index: 2; opacity: 0.5;
  background-image: radial-gradient(circle, var(--rule) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse at 50% 50%, transparent 25%, #000 90%);
  -webkit-mask-image: radial-gradient(ellipse at 50% 50%, transparent 25%, #000 90%);
}
.parallax-fg { z-index: 3; }


/* ── Scroll sections ───────────────────────────────────── */

#scroll-container { position: relative; height: var(--scroll-height); z-index: 4; }
#main-content { position: absolute; top: 0; outline: none; }

.scroll-section {
  position: absolute; width: 100%;
  display: flex; align-items: center;
  pointer-events: none; opacity: 0;
}
.scroll-section.is-visible { pointer-events: auto; }

/* GPU layer for every element the entrance/exit timelines touch */
.scroll-section .section-label,
.scroll-section .section-heading,
.scroll-section .section-body,
.scroll-section .section-note,
.scroll-section .cta-button,
.scroll-section .cta-meta,
.scroll-section .stat {
  will-change: transform, opacity;
  backface-visibility: hidden;
  transform: translateZ(0);
}

.section-inner { max-width: 40vw; }
.align-left  { padding: 0 55vw 0 clamp(1.5rem, 6vw, 6vw); justify-content: flex-start; }
.align-right { padding: 0 clamp(1.5rem, 6vw, 6vw) 0 55vw; justify-content: flex-end; }
.align-right .section-inner { text-align: right; }

.section-label {
  display: block;
  font-family: var(--font-mono); font-size: var(--text-xs);
  letter-spacing: 0.24em; text-transform: uppercase;
  color: var(--accent-text); margin-bottom: var(--space-6);
  transition: color var(--theme-transition);
}
.section-heading {
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 4.2vw, 4.2rem);
  font-weight: 700; line-height: 1.12;
  letter-spacing: -0.028em;
  margin-bottom: var(--space-6);
  text-wrap: balance;
}
.section-body {
  font-size: clamp(1rem, 1.15vw, 1.1rem);
  font-weight: 300; line-height: 1.85;
  color: var(--text-secondary);
  max-width: 46ch;
  transition: color var(--theme-transition);
}
.align-right .section-body { margin-left: auto; }
.section-note {
  margin-top: var(--space-6);
  padding-top: var(--space-4);
  border-top: 1px solid var(--rule);
  font-family: var(--font-mono); font-size: var(--text-sm);
  line-height: 1.6;
  letter-spacing: 0.04em; color: var(--text-secondary);
  transition: color var(--theme-transition), border-color var(--theme-transition);
}


/* ── Stats ─────────────────────────────────────────────── */

.section-stats { justify-content: center; padding: 0 clamp(1.5rem, 6vw, 6vw); }
.stats-inner { width: 100%; max-width: 1100px; text-align: center; }
.stats-inner .section-label { text-align: center; }
.stats-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: var(--space-12) var(--space-8);
  margin-top: var(--space-8);
}
.stat { display: flex; flex-direction: column; align-items: center; }
.stat-number {
  font-family: var(--font-display);
  font-size: clamp(2.75rem, 5.5vw, 5rem);
  font-weight: 700; line-height: 1;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.04em;
}
.stat-suffix {
  font-family: var(--font-mono); font-size: var(--text-sm);
  color: var(--amber); margin-top: var(--space-2); letter-spacing: 0.1em;
}
.stat-label {
  font-family: var(--font-mono); font-size: var(--text-xs);
  letter-spacing: 0.14em; color: var(--text-secondary);
  margin-top: var(--space-3);
}
.stats-footnote {
  margin-top: var(--space-12);
  font-family: var(--font-mono); font-size: var(--text-sm);
  color: var(--text-secondary); letter-spacing: 0.02em; line-height: 1.6;
}


/* ── Scene veil + marquee ──────────────────────────────── */

#dark-overlay {
  position: fixed; inset: 0; z-index: 3;
  background: var(--bg); opacity: 0; pointer-events: none;
  transition: background var(--theme-transition);
}
.marquee-wrap {
  position: fixed; top: 50%; left: 0; width: 100%;
  z-index: 4; transform: translateY(-50%);
  pointer-events: none; opacity: 0;
  transition: opacity 0.6s ease;
}
.marquee-text {
  font-family: var(--font-display);
  font-size: clamp(5rem, 13vw, 13vw);
  font-weight: 700; white-space: nowrap;
  letter-spacing: -0.02em;
  color: var(--text-primary); opacity: 0.055;
  will-change: transform;
}


/* ── Cursor ────────────────────────────────────────────── */

.custom-cursor { position: fixed; top: 0; left: 0; pointer-events: none; z-index: 9998; mix-blend-mode: difference; }
.cursor-dot { width: 7px; height: 7px; border-radius: 50%; background: #fff; transform: translate(-50%, -50%); position: absolute; }
.cursor-trail {
  width: 32px; height: 32px; border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.45);
  position: absolute; transform: translate(-50%, -50%);
  transition: width 0.25s, height 0.25s;
}
.cursor-hover .cursor-trail { width: 54px; height: 54px; }


/* ── Buttons ───────────────────────────────────────────── */

.cta-button, .ghost-button {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 0.9rem 2rem;
  font-family: var(--font-mono); font-size: var(--text-sm); font-weight: 500;
  letter-spacing: 0.1em; text-decoration: none;
  border-radius: 2px; border: 1px solid transparent;
  transition: transform 0.2s, box-shadow 0.2s, background 0.2s, color 0.2s;
}
.cta-button {
  margin-top: var(--space-8);
  background: var(--amber); color: #0a0a0a;
}
.cta-button:hover {
  transform: translateY(-2px);
  background: var(--amber-lift);
  box-shadow: 0 10px 30px color-mix(in srgb, var(--amber) 30%, transparent);
}
.cta-button:active { transform: translateY(0); }

/* Final CTA — the one conversion moment on the page, sized up so it can't
   be scrolled past unnoticed. */
.section-cta .cta-button {
  min-height: 60px; padding: 1.2rem 2.8rem;
  font-size: var(--text-lg); font-weight: 600; letter-spacing: 0.06em;
}
.ghost-button {
  background: transparent; color: var(--text-primary); border-color: var(--rule);
}
.ghost-button:hover { border-color: var(--amber); color: var(--amber); }

.cta-meta {
  margin-top: var(--space-6);
  font-family: var(--font-mono); font-size: var(--text-xs);
  letter-spacing: 0.08em; color: var(--text-secondary);
}


/* ═══════════════════════════════════════════════════════
   Outro — normal flow, sits above the fixed canvas
   ═══════════════════════════════════════════════════════ */

.outro { position: relative; z-index: 6; background: var(--void); color: #e4e8ee; }

/* Full-bleed ride footage */
.band-video {
  position: relative; height: min(88vh, 780px);
  display: flex; align-items: flex-end;
  overflow: hidden;
}
.band-video-el {
  position: absolute; inset: 0;
  width: 100%; height: 100%; object-fit: cover;
}
/* Opaque at the very top so the footage dissolves out of the void instead of
   starting on a hard horizontal cut, and heavy at the bottom for the copy. */
.band-scrim {
  position: absolute; inset: 0;
  background: linear-gradient(to top,
    rgba(6, 9, 15, 0.94) 0%,
    rgba(6, 9, 15, 0.30) 46%,
    rgba(6, 9, 15, 0.62) 84%,
    rgba(6, 9, 15, 1) 100%);
}
.band-copy {
  position: relative; z-index: 2;
  padding: clamp(2rem, 6vw, 6rem);
  max-width: 900px;
}
.band-heading {
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 5vw, 4.5rem);
  font-weight: 700; line-height: 1.12; letter-spacing: -0.03em;
}

/* Spec table */
.specs {
  padding: clamp(4rem, 12vw, 10rem) clamp(1.5rem, 6vw, 6vw);
  max-width: 1080px; margin-inline: auto;
}
.specs-head { margin-bottom: var(--space-16); }
.specs-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 4rem);
  font-weight: 700; letter-spacing: -0.03em;
}
.spec-list { border-top: 1px solid var(--rule); }
.spec-row {
  display: grid; grid-template-columns: minmax(140px, 220px) 1fr;
  gap: var(--space-6);
  padding: var(--space-6) 0;
  border-bottom: 1px solid var(--rule);
  align-items: baseline;
}
.spec-row dt {
  font-family: var(--font-mono); font-size: var(--text-xs);
  letter-spacing: 0.14em; text-transform: uppercase;
  color: #8c96a5;
}
.spec-row dd { font-size: var(--text-base); font-weight: 300; line-height: 1.6; }
.spec-row dd em { font-style: normal; color: #8c96a5; font-size: var(--text-sm); }

/* Footer */
.site-footer {
  padding: clamp(3rem, 8vw, 7rem) clamp(1.5rem, 6vw, 6vw) var(--space-16);
  border-top: 1px solid var(--rule);
  max-width: 1080px; margin-inline: auto;
}
.footer-kicker {
  font-family: var(--font-mono); font-size: var(--text-xs);
  letter-spacing: 0.24em; text-transform: uppercase; color: var(--amber);
  margin-bottom: var(--space-6);
}
.footer-shop {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 4vw, 3rem);
  font-weight: 700; letter-spacing: -0.03em; margin-bottom: var(--space-6);
}
.footer-line { font-size: var(--text-base); font-weight: 300; color: #8c96a5; line-height: 1.9; }

/* Text links, not boxed buttons — a small mono label sits over a larger
   value with a hairline underline that fills in on hover. Reads as an
   editorial contact line rather than a row of CTAs. */
.footer-actions {
  display: flex; flex-wrap: wrap;
  gap: var(--space-16) clamp(2rem, 5vw, 4rem);
  margin-top: var(--space-16);
}
.footer-link {
  display: flex; flex-direction: column; gap: 0.5rem;
  min-height: 44px; justify-content: center;
  text-decoration: none; color: var(--text-primary);
}
.footer-link-label {
  font-family: var(--font-mono); font-size: var(--text-xs);
  letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--text-secondary);
  transition: color 0.25s ease;
}
.footer-link-value {
  position: relative;
  font-family: var(--font-display); font-size: var(--text-base);
  font-weight: 700; letter-spacing: -0.01em;
  padding-bottom: 0.4rem;
}
.footer-link-value::after {
  content: ""; position: absolute; left: 0; right: 100%; bottom: 0;
  height: 1px; background: var(--amber);
  transition: right 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}
.footer-link:hover .footer-link-value::after { right: 0; }
.footer-link:hover .footer-link-label { color: var(--accent-text); }
.footer-legal {
  margin-top: var(--space-16);
  font-family: var(--font-mono); font-size: var(--text-sm);
  color: #8c96a5; line-height: 1.8;
}


/* ── Responsive ────────────────────────────────────────── */

@media (max-width: 900px) {
  .section-inner { max-width: 46vw; }
  .align-left  { padding: 0 48vw 0 clamp(1.25rem, 6vw, 6vw); }
  .align-right { padding: 0 clamp(1.25rem, 6vw, 6vw) 0 48vw; }
}

@media (max-width: 768px) {
  :root { --scroll-height: var(--scroll-height-mobile); }

  /* Desktop's wide padding wraps "스마트스토어에서 구매" onto a second line
     on a narrow screen — still bigger than the default button, just not
     oversized for the viewport. */
  .section-cta .cta-button {
    min-height: 54px; padding: 0.95rem 1.6rem;
    font-size: var(--text-base); white-space: nowrap;
  }

  .align-left, .align-right { padding: 0 var(--space-6); justify-content: center; }
  .align-right .section-inner, .align-right .section-body { text-align: left; margin-left: 0; }
  .section-inner {
    max-width: 100%;
    background: rgba(6, 9, 15, 0.72);
    padding: var(--space-6);
    border-left: 2px solid var(--amber);
  }
  [data-active-theme="light"] .section-inner { background: rgba(237, 233, 227, 0.82); }
  .section-body { max-width: none; }

  /* Hero copy is full-width on mobile, so the scrim has to be even, not lateral */
  .hero-scrim {
    background:
      linear-gradient(to bottom, rgba(6, 9, 15, 0.72) 0%, rgba(6, 9, 15, 0.5) 45%, rgba(6, 9, 15, 0.88) 100%);
  }

  .progress-track, .custom-cursor { display: none; }
  .site-header { padding: var(--space-4) var(--space-5); }
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: var(--space-8) var(--space-4); }
  .spec-row { grid-template-columns: 1fr; gap: var(--space-2); }
  .band-video { height: 70vh; }
}

@media (max-width: 420px) {
  .hero-heading .word + .word { margin-left: 0.16em; }
}
