/* ==========================================================================
   Earbuds One — scroll-driven product showcase
   Every scene gets --p (0 → 1) from main.js while it is pinned on screen.
   ========================================================================== */

@font-face {
  font-family: "Archivo";
  src: url("../fonts/archivo.woff2") format("woff2-variations"), url("../fonts/archivo.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
}

@property --shell { syntax: "<color>"; inherits: true; initial-value: #eef0ee; }
@property --tip   { syntax: "<color>"; inherits: true; initial-value: #d9dddf; }
@property --accent{ syntax: "<color>"; inherits: true; initial-value: #9fb3bf; }

:root {
  --mist:  #e6ebef;
  --pearl: #f7f9fa;
  --ink:   #1d232b;
  --muted: #5e6873;
  --dusk:  #262b44;
  --line:  rgba(29, 35, 43, .14);
  --bar-h: 52px;
  --pad: clamp(20px, 5vw, 64px);
  --ease: cubic-bezier(.2, .8, .2, 1);
  color-scheme: light;
}

/* Colourways: any element with data-tone (and <body data-color>) sets the paint. */
[data-tone="pearl"],  body[data-color="pearl"]  { --shell: #eef0ee; --tip: #d6dadc; --accent: #9fb3bf; }
[data-tone="lagoon"], body[data-color="lagoon"] { --shell: #3f8c8f; --tip: #2c6a6e; --accent: #4fb3ae; }
[data-tone="night"],  body[data-color="night"]  { --shell: #363d5a; --tip: #252b42; --accent: #7d8cd6; }
[data-tone="coral"],  body[data-color="coral"]  { --shell: #ee8f78; --tip: #d46d59; --accent: #f2a08a; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--mist);
  color: var(--ink);
  font: 400 17px/1.5 "Archivo", system-ui, sans-serif;
  font-stretch: 100%;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
h1, h2, h3, p, dl, dd, ol, ul { margin: 0; }
ol, ul { padding: 0; list-style: none; }
a { color: inherit; }
img, svg { display: block; }
:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; border-radius: 4px; }

.skip { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--ink); color: var(--pearl); padding: 10px 14px; border-radius: 8px; }
.skip:focus { top: 12px; }

h2 {
  font-weight: 750;
  font-stretch: 88%;
  font-size: clamp(1.8rem, 4.6vw, 4rem);
  overflow-wrap: break-word;
  line-height: 1.02;
  letter-spacing: -.025em;
  text-wrap: balance;
}
.lead { font-size: clamp(1.05rem, 1.5vw, 1.25rem); color: var(--muted); max-width: 46ch; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: 0 22px;
  border-radius: 999px; border: 0;
  background: var(--ink); color: var(--pearl);
  font: inherit; font-weight: 600; font-size: 15px; text-decoration: none;
  cursor: pointer; transition: background .2s, transform .2s var(--ease);
}
.btn:hover { background: #34404d; }
.btn:active { transform: scale(.97); }
.btn-sm { min-height: 32px; padding: 0 14px; font-size: 13px; }
.btn-lg { min-height: 54px; padding: 0 32px; font-size: 17px; }
.link { font-weight: 600; text-underline-offset: 4px; }

/* ---------- top bar ---------- */
.bar {
  position: fixed; inset: 0 0 auto; z-index: 50; height: var(--bar-h);
  background: color-mix(in srgb, var(--mist) 72%, transparent);
  backdrop-filter: saturate(1.6) blur(18px); -webkit-backdrop-filter: saturate(1.6) blur(18px);
  border-bottom: 1px solid var(--line);
}
.bar-in { height: 100%; max-width: 1180px; margin: 0 auto; padding: 0 var(--pad); display: flex; align-items: center; gap: 22px; }
.logo { display: flex; align-items: center; gap: 8px; text-decoration: none; font-weight: 700; font-stretch: 112%; letter-spacing: -.01em; }
.logo svg { width: 30px; height: 10px; }
.lang-switch { display: flex; gap: 2px; font-size: 12px; font-weight: 600; margin-left: auto; }
.lang-switch a { text-decoration: none; padding: 4px 6px; border-radius: 6px; opacity: .55; }
.lang-switch a[aria-current] { opacity: 1; background: rgba(29, 35, 43, .08); }

/* ---------- scenes ---------- */
.scene { position: relative; --p: 1; }
.sticky { position: relative; min-height: 100vh; padding: calc(var(--bar-h) + 40px) var(--pad) 60px; }

@media (prefers-reduced-motion: no-preference) {
  .js .scene { --p: 0; height: var(--h, 220vh); }
  .js .sticky { position: sticky; top: 0; height: 100vh; min-height: 0; overflow: hidden; }
}

/* ---------- 1 · hero: product off-centre, specs as callouts, name bottom-left ---------- */
.scene.hero { --h: 230vh; --p: 0; }
.hero .sticky {
  display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto;
  grid-template-areas: "stage stage" "copy foot"; gap: 0 32px;
  padding-top: calc(var(--bar-h) + 2vh); padding-bottom: 76px;
}
.hero-stage { grid-area: stage; position: relative; display: flex; justify-content: flex-end; align-items: center; min-height: 0; padding-right: 8vw; }
.hero-bud { height: min(58vh, 560px); width: auto; flex: none; }
.hero-bud-l { transform: translate(calc(14% - var(--p) * 24%), calc(var(--p) * -6vh)) rotate(calc(-18deg + var(--p) * 22deg)) scale(calc(1 + var(--p) * .22)); }
.hero-bud-r { transform: translate(calc(-16% + var(--p) * 22%), calc(6vh - var(--p) * 8vh)) scaleX(-1) rotate(calc(-10deg + var(--p) * 24deg)) scale(calc(.9 + var(--p) * .2)); }
.callout { position: absolute; display: grid; gap: 2px; padding-left: 14px; border-left: 1px solid var(--ink); font-size: .82rem; color: var(--muted); opacity: clamp(0, calc(1 - var(--p) * 3), 1); }
.callout strong { font-weight: 700; font-stretch: 70%; font-size: 1.6rem; line-height: 1; color: var(--ink); font-variant-numeric: tabular-nums; }
.callout::before { content: ""; position: absolute; left: -1px; top: 50%; width: clamp(40px, 7vw, 120px); height: 1px; background: var(--ink); transform: translateX(-100%); }
.callout.c0 { left: 16%; top: 16%; }
.callout.c1 { right: 3%; top: 30%; }
.callout.c1::before { left: auto; right: auto; transform: translateX(-100%); }
.callout.c2 { left: 28%; bottom: 12%; }
.hero-copy { grid-area: copy; align-self: end; }
.hero-title {
  font-weight: 800; font-size: clamp(2.3rem, 8.2vw, 8.2rem); line-height: .84; letter-spacing: -.035em;
  font-stretch: calc((125 - var(--p) * 63) * 1%); white-space: nowrap; margin: 0 0 14px -.04em;
  opacity: clamp(0, calc(1 - var(--p) * 2.2), 1); transform: translateY(calc(var(--p) * -6vh));
}
.hero-tagline { font-size: clamp(1.1rem, 1.8vw, 1.5rem); font-weight: 500; font-stretch: 96%; opacity: clamp(0, calc(1 - var(--p) * 2.4), 1); }
.hero-foot { grid-area: foot; align-self: end; justify-self: end; display: grid; gap: 14px; justify-items: end; text-align: right; opacity: clamp(0, calc(1 - var(--p) * 2.4), 1); }
.hero-foot p { color: var(--muted); font-size: 15px; }
.hero-ctas { display: flex; align-items: center; gap: 22px; }
@media (prefers-reduced-motion: no-preference) {
  .hero-stage { animation: rise 1.6s var(--ease) both .1s; }
  .hero-title { animation: settle 1.4s var(--ease) both; }
}
@keyframes rise { from { opacity: 0; transform: translateY(14vh); filter: blur(12px); } }
@keyframes settle { from { opacity: 0; letter-spacing: .04em; } }
@media (max-width: 760px) {
  .hero .sticky { grid-template-columns: minmax(0, 1fr); grid-template-areas: "stage" "copy" "foot"; gap: 16px; }
  .hero-title { font-size: 11.5vw; }
  .hero-stage { justify-content: center; padding-right: 0; }
  .hero-bud { height: 40vh; }
  .callout { display: none; }
  .hero-foot { justify-self: start; justify-items: start; text-align: left; }
}

/* ---------- chapter bar ---------- */
.chapters { position: fixed; left: 50%; bottom: 18px; z-index: 40; transform: translateX(-50%); }
.chapters ol { display: flex; gap: 4px; padding: 6px; border-radius: 12px; background: color-mix(in srgb, var(--pearl) 78%, transparent); backdrop-filter: blur(16px) saturate(1.4); -webkit-backdrop-filter: blur(16px) saturate(1.4); box-shadow: inset 0 0 0 1px var(--line); }
.chapters a { display: grid; gap: 6px; width: clamp(62px, 9vw, 118px); padding: 6px 8px 7px; border-radius: 8px; text-decoration: none; font-size: 12px; color: var(--muted); transition: background .2s, color .2s; }
.chapters a:hover { background: rgba(29, 35, 43, .06); color: var(--ink); }
.chapters a.on { color: var(--ink); }
.seg { display: block; height: 2px; background: rgba(29, 35, 43, .14); overflow: hidden; }
.seg i { display: block; height: 100%; background: var(--ink); transform-origin: left; transform: scaleX(var(--seg, 0)); }
.chapters .lbl { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 760px) {
  .chapters { bottom: 10px; width: calc(100% - 20px); }
  .chapters ol { justify-content: space-between; }
  .chapters a { width: auto; flex: 1; padding: 6px 4px; }
  .chapters .lbl { display: none; }
  .seg { height: 3px; }
}

/* ---------- 2 · statement ---------- */
.statement { --h: 230vh; }
.statement .sticky { display: grid; place-items: center; }
.statement-text {
  max-width: 24ch;
  font-size: clamp(1.9rem, 4.8vw, 4.3rem);
  font-weight: 700; font-stretch: 92%;
  line-height: 1.12; letter-spacing: -.02em;
  text-wrap: pretty;
}
.statement-text span { opacity: clamp(.14, calc(var(--p) * var(--n) * 1.25 - var(--w)), 1); }

/* ---------- 3 · inside / exploded ---------- */
.inside { --h: 340vh; --x: clamp(0, calc(var(--p) * 1.5 - .05), 1); }
.inside .sticky {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center; gap: clamp(24px, 5vw, 80px);
  max-width: 1180px; margin: 0 auto;
}
.inside-copy { display: grid; gap: 18px; }
.layers { display: grid; gap: 14px; margin-top: 12px; counter-reset: l; }
.layers li {
  display: grid; gap: 2px; padding-left: 16px; border-left: 2px solid var(--line);
  opacity: clamp(.22, calc(var(--p) * 7 - var(--i) - .6), 1);
  border-left-color: color-mix(in srgb, var(--ink) calc(clamp(0, calc(var(--p) * 7 - var(--i) - .6), 1) * 100%), transparent);
}
.layers strong { font-weight: 650; font-stretch: 94%; font-size: 1.05rem; }
.layers span { font-size: .93rem; color: var(--muted); max-width: 44ch; }
.inside-art { display: grid; place-items: center; height: 100%; max-height: calc(100vh - var(--bar-h) - 60px); }
.exploded { height: 100%; width: auto; max-width: 100%; overflow: visible; }
.exploded .layer { transform: translateY(calc((var(--i) - 2) * (var(--x) - 1) * 84px)); }

@media (max-width: 760px) {
  .inside .sticky { grid-template-columns: 1fr; align-content: start; gap: 10px; padding-top: calc(var(--bar-h) + 18px); }
  .inside-art { order: -1; height: 34vh; overflow: visible; }
  .exploded { height: 34vh; }
  .inside-copy .lead { display: none; }
  .layers { gap: 8px; margin-top: 4px; }
  .layers span { font-size: .84rem; line-height: 1.35; }
  .layers strong { font-size: .95rem; }
}

/* ---------- 4 · silence ---------- */
.silence {
  --h: 340vh;
  --dark: clamp(0, calc((var(--p) - .04) * 4.5), 1);
  --flip: clamp(0, calc((var(--p) - .1) * 9), 1);
  background: color-mix(in oklab, var(--mist), var(--dusk) calc(var(--dark) * 100%));
  color: color-mix(in oklab, var(--ink), var(--pearl) calc(var(--flip) * 100%));
}
.silence .sticky { display: grid; grid-template-rows: auto 1fr auto auto; gap: 12px; padding-bottom: 40px; max-width: 1180px; margin: 0 auto; }
.silence h2 { max-width: 18ch; font-size: clamp(1.9rem, 3.6vw, 3.2rem); }
.meter { display: flex; align-items: baseline; gap: 14px; align-self: center; }
.meter-num {
  font-size: clamp(5rem, min(16vw, 24vh), 13rem); font-weight: 800; font-stretch: 62%;
  line-height: .8; letter-spacing: -.04em; font-variant-numeric: tabular-nums;
}
.meter-unit { font-size: 1.1rem; font-weight: 500; opacity: .7; max-width: 10ch; line-height: 1.2; }
.wave { width: calc(100% + 2 * var(--pad)); margin: 0 calc(-1 * var(--pad)); height: clamp(110px, 18vh, 200px); overflow: visible; }
.wave-noise { fill: none; stroke: currentColor; stroke-opacity: .35; stroke-width: 2; }
.wave-music { fill: none; stroke: var(--accent); stroke-width: 3; stroke-linecap: round; }
.modes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.modes li { display: grid; gap: 4px; padding-top: 14px; border-top: 2px solid currentColor; opacity: .3; transition: opacity .4s; }
.modes li.on { opacity: 1; }
.modes strong { font-weight: 650; }
.modes span { font-size: .92rem; opacity: .8; }
@media (max-width: 760px) {
  .modes { grid-template-columns: 1fr; gap: 10px; }
  .modes li:not(.on) span { display: none; }
}

/* ---------- 5 · battery ---------- */
.battery { --h: 240vh; background: var(--dusk); color: var(--pearl); --x: clamp(0, calc(var(--p) * 1.4), 1); }
.battery .sticky { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); align-items: center; gap: clamp(24px, 6vw, 90px); max-width: 1180px; margin: 0 auto; }
.battery-art { display: grid; place-items: center; }
.case { width: min(100%, 420px); height: auto; }
.case-fill { transform-box: fill-box; transform-origin: 50% 100%; transform: scaleY(var(--x)); }
.case-led { opacity: calc(.3 + var(--x) * .7); }
.battery-copy { display: grid; gap: 28px; }
.gauge { position: relative; width: min(280px, 60vw); }
.gauge svg { width: 100%; height: auto; transform: rotate(0deg); }
.g-track, .g-fill { fill: none; stroke-width: 6; transform: rotate(135deg); transform-origin: 120px 120px; }
.g-track { stroke: rgba(247, 249, 250, .14); stroke-dasharray: 75 100; }
.g-fill { stroke: var(--accent); stroke-dasharray: calc(var(--x) * 75) 100; stroke-linecap: round; }
.g-ticks line { stroke: rgba(247, 249, 250, .45); stroke-width: 1.5; }
.g-read { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.g-read span { font-size: clamp(3.6rem, 7vw, 5.6rem); font-weight: 800; font-stretch: 64%; line-height: .9; font-variant-numeric: tabular-nums; }
.g-read small { font-size: .82rem; opacity: .7; }
.readouts { display: grid; max-width: 440px; border-top: 1px solid rgba(247, 249, 250, .2); }
.readouts div { display: grid; grid-template-columns: 6rem 1fr; gap: 16px; padding: 12px 0; border-bottom: 1px solid rgba(247, 249, 250, .12); }
.readouts dt { font-weight: 700; font-stretch: 80%; font-variant-numeric: tabular-nums; }
.readouts dd { opacity: .75; }
.note { font-size: .92rem; opacity: .6; }
@media (max-width: 760px) {
  .battery .sticky { grid-template-columns: 1fr; gap: 14px; align-content: center; }
  .case { width: 40vw; }
  .battery-art { display: none; }
}

/* ---------- 6 · colours (horizontal) ---------- */
.colors { --h: 420vh; }
.colors .sticky { display: grid; grid-template-rows: auto 1fr; gap: 20px; padding-left: 0; padding-right: 0; padding-bottom: 0; }
.colors h2 { padding: 0 var(--pad); max-width: 20ch; }
.track { display: flex; gap: 0; width: max-content; align-items: stretch; }
.swatch {
  width: 100vw; min-height: 0;
  display: grid; grid-template-columns: 1fr 1fr; align-items: center; gap: 20px;
  padding: clamp(24px, 4vw, 56px) clamp(24px, 8vw, 140px);
  background: color-mix(in oklab, var(--accent) 34%, var(--pearl));
}
.swatch-bud { height: min(50vh, 440px); width: auto; justify-self: center; transform: rotate(-10deg); }
.swatch h3 { font-size: clamp(3rem, 9vw, 8.5rem); font-stretch: 125%; font-weight: 800; font-stretch: 115%; letter-spacing: -.03em; line-height: 1; margin-bottom: 10px; }
.swatch p { font-size: 1.05rem; color: var(--muted); max-width: 26ch; }
@media (prefers-reduced-motion: no-preference) {
  .js .colors .track { transform: translate3d(calc(var(--shift, 0) * -1px), 0, 0); will-change: transform; }
}
@media (prefers-reduced-motion: reduce) {
  .colors .track { width: auto; overflow-x: auto; scroll-snap-type: x mandatory; }
  .swatch { scroll-snap-align: start; flex: none; }
}
.no-js .colors .track { width: auto; overflow-x: auto; scroll-snap-type: x mandatory; }
.no-js .swatch { flex: none; }
@media (max-width: 760px) {
  .swatch { grid-template-columns: 1fr; text-align: left; align-content: center; width: 100vw; }
  .swatch-bud { height: 34vh; }
}

/* ---------- 7 · picker ---------- */
.picker {
  display: grid; grid-template-columns: 1.2fr 1fr; align-items: center; gap: clamp(20px, 5vw, 80px);
  max-width: 1180px; margin: 0 auto; padding: 120px var(--pad);
}
.picker-stage {
  position: relative; display: flex; justify-content: center; gap: 0;
  aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(closest-side, color-mix(in oklab, var(--accent) 45%, var(--pearl)), var(--mist));
  transition: --shell .7s var(--ease), --tip .7s var(--ease), --accent .7s var(--ease);
}
.picker-bud { height: 74%; width: auto; align-self: center; transform: rotate(-14deg) translateX(10%); }
.picker-bud-b { transform: scaleX(-1) rotate(-14deg) translate(10%, 10%); }
.picker-ui { display: grid; gap: 16px; }
.picker-name { font-size: 1.4rem; font-weight: 600; font-stretch: 110%; }
.chips { display: flex; gap: 14px; }
.chip {
  width: 48px; height: 48px; border-radius: 50%; padding: 0; cursor: pointer;
  background: var(--shell); border: 1px solid rgba(0, 0, 0, .12);
  box-shadow: inset 0 -6px 12px rgba(0, 0, 0, .14), inset 0 6px 10px rgba(255, 255, 255, .45);
  outline-offset: 4px;
  transition: transform .25s var(--ease);
}
.chip:hover { transform: scale(1.08); }
.chip[aria-checked="true"] { outline: 2px solid var(--ink); }
.hint { font-size: .9rem; color: var(--muted); }
@media (max-width: 760px) {
  .picker { grid-template-columns: 1fr; padding-top: 80px; padding-bottom: 80px; }
}

/* ---------- 8 · specs ---------- */
.specs { max-width: 1180px; margin: 0 auto; padding: 40px var(--pad) 120px; }
.specs h2 { margin-bottom: 36px; }
.specs dl > div { display: grid; grid-template-columns: minmax(140px, 1fr) 2fr; gap: 20px; padding: 18px 0; border-top: 1px solid var(--line); }
.specs dt { font-weight: 650; font-stretch: 90%; }
.specs dd { color: var(--muted); }
@media (max-width: 560px) { .specs dl > div { grid-template-columns: 1fr; gap: 2px; } }

/* ---------- 9 · pre-order ---------- */
.preorder { background: var(--pearl); padding: 120px var(--pad); }
.preorder-in { max-width: 600px; margin: 0 auto; display: grid; gap: 18px; }
.preorder form { display: grid; gap: 22px; margin-top: 14px; }
.field { display: grid; gap: 8px; border: 0; padding: 0; margin: 0; }
.field label, .field legend { font-weight: 600; font-size: .95rem; padding: 0; }
.field input[type="email"] {
  height: 54px; padding: 0 18px; border-radius: 14px;
  border: 1px solid rgba(29, 35, 43, .22); background: #fff; color: var(--ink);
  font: inherit; font-size: 1.05rem;
}
.field input[type="email"]:focus { outline: 2px solid var(--ink); outline-offset: 1px; border-color: transparent; }
.field input[aria-invalid] { border-color: #b3261e; }
.radio-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }
.radio { position: relative; }
.radio input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.radio span {
  display: inline-flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 18px 0 12px;
  border-radius: 999px; border: 1px solid rgba(29, 35, 43, .2); font-weight: 500;
}
.radio span::before { content: ""; width: 20px; height: 20px; border-radius: 50%; background: var(--shell); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .14); }
.radio input:checked + span { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.radio input:focus-visible + span { outline: 2px solid var(--ink); outline-offset: 3px; }
.check label { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; }
.check input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--ink); flex: none; }
.field-error { color: #b3261e; font-size: .88rem; }
.form-alert { padding: 12px 16px; border-radius: 12px; background: #fbe9e7; color: #8c1d18; }
.sent h2 { margin-bottom: 10px; }
.sent p { color: var(--muted); font-size: 1.1rem; }
.preorder .btn-lg { justify-self: start; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- footer ---------- */
.foot { padding: 40px var(--pad) 96px; border-top: 1px solid var(--line); display: grid; gap: 8px; font-size: .85rem; color: var(--muted); text-align: center; }
.shinpo-credit a { color: var(--ink); font-weight: 600; }

@media (max-width: 760px) {
  .hero-stage { overflow: visible; }
  .hero-bud { max-height: 44vh; }
}
