/* Theme colours are registered so the whole page can ease between finishes */
@property --bg      { syntax: '<color>'; inherits: true; initial-value: #2a060b; }
@property --bg-lit  { syntax: '<color>'; inherits: true; initial-value: #47101a; }
@property --band    { syntax: '<color>'; inherits: true; initial-value: #f1917c; }
@property --band-d  { syntax: '<color>'; inherits: true; initial-value: #b9604f; }
@property --metal   { syntax: '<color>'; inherits: true; initial-value: #e2c49a; }
@property --metal-d { syntax: '<color>'; inherits: true; initial-value: #8a6c45; }
@property --ink     { syntax: '<color>'; inherits: true; initial-value: #ffece6; }
@property --tint    { syntax: '<color>'; inherits: true; initial-value: #ffa590; }

:root {
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --d: min(60svh, 40vw);
  --gutter: clamp(20px, 5vw, 80px);
  --display: 'Bricolage Grotesque', system-ui, sans-serif;
  --body: 'Instrument Sans', system-ui, sans-serif;
  transition: --bg .9s var(--ease-out), --bg-lit .9s var(--ease-out), --band .9s var(--ease-out),
    --band-d .9s var(--ease-out), --metal .9s var(--ease-out), --metal-d .9s var(--ease-out),
    --ink .9s var(--ease-out), --tint .9s var(--ease-out);
}
[data-theme="rosehip"]  { --bg:#2a060b; --bg-lit:#47101a; --band:#f1917c; --band-d:#b9604f; --metal:#e2c49a; --metal-d:#8a6c45; --ink:#ffece6; --tint:#ffa590; }
[data-theme="moss"]     { --bg:#3b4331; --bg-lit:#5c664c; --band:#a9bf94; --band-d:#7b906a; --metal:#c9c7b8; --metal-d:#77766a; --ink:#f3f6ea; --tint:#c6e59c; }
[data-theme="seaglass"] { --bg:#22312e; --bg-lit:#3a4f4a; --band:#cfdad5; --band-d:#97a7a1; --metal:#e3e7e7; --metal-d:#868e8e; --ink:#eef5f3; --tint:#9fdfe3; }
[data-theme="obsidian"] { --bg:#232324; --bg-lit:#48484a; --band:#1b1b1c; --band-d:#0c0c0d; --metal:#5a5a5e; --metal-d:#232325; --ink:#f1eff6; --tint:#c7b3ff; }

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 1.0625rem/1.55 var(--body);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
/* Studio light behind everything, fixed so it never scrolls */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  background: radial-gradient(110% 85% at 78% 38%, var(--bg-lit), var(--bg) 70%);
}
h1, h2 { font-family: var(--display); font-weight: 400; margin: 0; letter-spacing: -0.03em; text-wrap: balance; }
p { margin: 0; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--tint); outline-offset: 4px; border-radius: 4px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* Nav */
.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: max(18px, env(safe-area-inset-top)) var(--gutter) 18px;
  font-size: .9375rem;
}
.nav__brand { font-family: var(--display); font-weight: 500; font-size: 1.0625rem; text-decoration: none; letter-spacing: -0.01em; }
.nav__tag {
  margin-left: .5em;
  padding: .15em .6em;
  border: 1px solid color-mix(in srgb, var(--ink) 35%, transparent);
  border-radius: 99px;
  font: 500 .75rem/1.4 var(--body);
  letter-spacing: 0;
  vertical-align: middle;
}
.nav__links {
  display: none;
  gap: clamp(16px, 2.4vw, 36px);
  margin-right: -18px;
  padding: 8px 18px;
  border-radius: 99px;
  background: color-mix(in srgb, var(--bg) 62%, transparent);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}
.nav__links a { text-decoration: none; color: color-mix(in srgb, var(--ink) 80%, transparent); transition: color .2s ease; }
@media (hover: hover) and (pointer: fine) { .nav__links a:hover { color: var(--ink); } }

/* Scroll track and pinned stage */
.track { position: relative; height: 500svh; }
.mark { position: absolute; top: calc(var(--i) * 100svh); }
.stage { position: sticky; top: 0; height: 100svh; overflow: hidden; }

/* Watch */
.watch-wrap { position: absolute; inset: 0; animation: watch-in 1s var(--ease-out) both; }
.watch {
  position: absolute;
  left: 50%;
  top: 50%;
  width: var(--d);
  height: var(--d);
  margin: calc(var(--d) / -2) 0 0 calc(var(--d) / -2);
  will-change: transform;
}
.band { position: absolute; left: 0; top: -150%; width: 100%; height: 400%; filter: drop-shadow(0 0 calc(var(--d) * .06) rgba(0, 0, 0, .25)); }
.band__edge { stop-color: var(--band-d); }
.band__mid { stop-color: var(--band); }
.case {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 45%, #0b0b0c 60%, #000);
  box-shadow:
    0 0 0 calc(var(--d) * .004) rgba(255, 255, 255, .09),
    0 calc(var(--d) * .05) calc(var(--d) * .12) rgba(0, 0, 0, .5),
    inset 0 calc(var(--d) * -.012) calc(var(--d) * .02) rgba(255, 255, 255, .14);
}
.glass { position: absolute; inset: 3%; border-radius: 50%; overflow: hidden; touch-action: pan-y; cursor: crosshair; }
#face { display: block; width: 100%; height: 100%; }
.dome {
  position: absolute;
  inset: -4%;
  border-radius: 50%;
  pointer-events: none;
  background:
    radial-gradient(ellipse 60% 24% at 56% 6%, rgba(255, 255, 255, .32), rgba(255, 255, 255, 0) 70%),
    radial-gradient(ellipse 90% 50% at 50% 108%, rgba(255, 255, 255, .07), transparent 60%);
}
.crown, .side-button {
  position: absolute;
  background:
    linear-gradient(90deg, rgba(0, 0, 0, .4), transparent 35%, rgba(255, 255, 255, .28) 65%, rgba(0, 0, 0, .35)),
    var(--metal);
}
.crown {
  left: 98.6%;
  top: 43.5%;
  width: 5.6%;
  height: 13%;
  border-radius: 32% / 14%;
  background:
    linear-gradient(90deg, rgba(0, 0, 0, .4), transparent 35%, rgba(255, 255, 255, .28) 65%, rgba(0, 0, 0, .35)),
    repeating-linear-gradient(180deg, var(--metal) 0 5%, var(--metal-d) 5% 10%);
  background-size: 100% 100%, 100% 200%;
}
.side-button { left: 91.9%; top: 16.5%; width: 2.6%; height: 13%; border-radius: 99px; transform: rotate(-32deg); }

/* Data shown on the face in each mode */
.readout {
  position: absolute;
  left: 50%;
  top: 50%;
  translate: -50% -50%;
  opacity: 0;
  text-align: center;
  color: #fff;
  font-family: var(--display);
  line-height: 1;
  pointer-events: none;
  white-space: nowrap;
}
.readout b { display: block; font-weight: 500; font-size: calc(var(--d) * .12); letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.readout span { display: block; margin-top: .45em; font: 500 calc(var(--d) * .034)/1 var(--body); opacity: .75; }
.readout--pulse { top: 74%; }
.readout--pulse b { font-size: calc(var(--d) * .1); }
.readout--moon { left: 62%; top: 45%; }
.readout--moon b { font-size: calc(var(--d) * .085); }

/* Copy panels: pinned with the watch, cross-faded by scroll position */
.panel { position: absolute; opacity: 0; pointer-events: none; will-change: opacity, transform; }
.panel.is-active, .panel.is-active * { pointer-events: auto; }
.panel--hero.is-active { pointer-events: none; }
.panel h2 { font-size: clamp(2rem, 4.4vw, 4.25rem); line-height: 1; font-weight: 300; }
.panel p { margin-top: 1.1em; max-width: 34ch; color: color-mix(in srgb, var(--ink) 82%, transparent); }
.facts { list-style: none; margin: 1.6em 0 0; padding: 0; max-width: 36ch; font-size: .9375rem; }
.facts li { padding: .7em 0; border-top: 1px solid color-mix(in srgb, var(--ink) 20%, transparent); }

.panel--hero { inset: 0; }
.hero__title, .hero__side { position: absolute; bottom: clamp(28px, 7svh, 72px); }
.hero__title { left: var(--gutter); animation: rise .9s var(--ease-out) .25s both; }
.hero__side { right: var(--gutter); text-align: right; animation: rise .9s var(--ease-out) .4s both; }
h1 { font-size: clamp(2.75rem, 5.8vw, 5.75rem); line-height: .92; font-weight: 300; }
.hero__title p { max-width: 27ch; }

.picker { display: flex; gap: 14px; }
.picker__label { font-size: .9375rem; margin: 0 0 .9em !important; }
.hero__side .picker { justify-content: flex-end; }
.swatch {
  --c: #f1917c;
  appearance: none;
  border: 0;
  padding: 0;
  background: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: .6em;
  min-height: 44px;
}
.swatch::before {
  content: '';
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--c);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .28), 0 0 0 4px transparent;
  transition: box-shadow .2s var(--ease-out), transform .14s var(--ease-out);
}
.swatch[aria-pressed="true"]::before { box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px var(--ink); }
.swatch:active::before { transform: scale(.94); }
.swatch[data-set-theme="moss"] { --c: #a9bf94; }
.swatch[data-set-theme="seaglass"] { --c: #cfdad5; }
.swatch[data-set-theme="obsidian"] { --c: #1b1b1c; }

.panel--finish { left: 0; right: 0; bottom: clamp(24px, 6svh, 64px); text-align: center; display: grid; justify-items: center; }
.panel--finish h2 { font-size: clamp(2.5rem, 6vw, 5.5rem); }
.panel--finish p { margin-top: .6em; max-width: none; }
.picker--named { margin-top: 1.5em; flex-wrap: wrap; justify-content: center; gap: 6px 22px; font-size: .9375rem; }

/* Phones: watch on top, copy underneath */
@media (max-width: 899px) {
  :root { --d: min(68vw, 36svh); }
  .band { -webkit-mask-image: linear-gradient(#000 63.5%, transparent 70%); mask-image: linear-gradient(#000 63.5%, transparent 70%); }
  .panel--left, .panel--right { left: var(--gutter); right: var(--gutter); top: 57svh; }
  .panel h2 { font-size: clamp(1.75rem, 7.4vw, 2.5rem); }
  .panel p { margin-top: .7em; }
  .facts { margin-top: 1em; }
  .facts li { padding: .5em 0; }
  .hero__title { bottom: auto; top: 58svh; right: var(--gutter); }
  .hero__title p { max-width: 34ch; margin-top: .8em; font-size: 1rem; }
  .hero__side { left: var(--gutter); right: auto; bottom: max(18px, env(safe-area-inset-bottom)); text-align: left; }
  .hero__side .picker { justify-content: flex-start; }
  .picker__label { margin-bottom: .3em !important; }
  .panel--finish { bottom: auto; top: 56svh; padding: 0 var(--gutter); }
  .panel--finish h2 { font-size: clamp(2.5rem, 12vw, 3.5rem); }
  .picker--named { display: grid; grid-template-columns: auto auto; justify-content: center; gap: 2px 28px; }
}
@media (max-width: 899px) and (max-height: 700px) {
  .facts { display: none; }
}

@media (min-width: 900px) {
  .nav__links { display: flex; }
  h1 span { display: block; }
  .panel--left, .panel--right { top: 50%; translate: 0 -50%; width: min(34vw, 30rem); }
  .panel--left { left: var(--gutter); }
  .panel--right { right: var(--gutter); }
}

/* Specs */
.specs {
  position: relative;
  padding: clamp(72px, 12vw, 160px) var(--gutter);
  background: color-mix(in srgb, var(--bg) 82%, #000);
}
.specs h2 { font-size: clamp(2rem, 4.4vw, 4.25rem); font-weight: 300; line-height: 1; }
.specs__grid { margin: clamp(32px, 5vw, 64px) 0 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); column-gap: clamp(24px, 4vw, 64px); }
.specs__grid div { padding: 1.3em 0; border-top: 1px solid color-mix(in srgb, var(--ink) 20%, transparent); }
.specs dt { font-size: .875rem; color: color-mix(in srgb, var(--ink) 65%, transparent); }
.specs dd { margin: .35em 0 0; font: 400 1.3125rem/1.3 var(--display); letter-spacing: -0.01em; }
.specs__note { margin-top: 2em; max-width: 60ch; font-size: .875rem; color: color-mix(in srgb, var(--ink) 65%, transparent); }
.btn {
  display: inline-block;
  margin-top: 2.2em;
  padding: .85em 1.5em;
  border-radius: 99px;
  background: var(--ink);
  color: var(--bg);
  font-weight: 600;
  font-size: .9375rem;
  text-decoration: none;
  transition: transform .14s var(--ease-out);
}
.btn:active { transform: scale(.97); }

/* Footer */
.footer {
  padding: 32px var(--gutter) max(32px, env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--bg) 82%, #000);
  border-top: 1px solid color-mix(in srgb, var(--ink) 14%, transparent);
  font-size: .8125rem;
  color: color-mix(in srgb, var(--ink) 65%, transparent);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px 32px;
}
.footer a { color: var(--ink); text-decoration: none; transition: color .2s ease; }
.footer a:hover, .footer a:focus-visible { color: var(--tint); }
.footer__sep { display: inline-block; width: 1px; height: .9em; margin: 0 .7em; background: currentColor; opacity: .5; vertical-align: -1px; }
@media (max-width: 599px) {
  .footer__sep { display: none; }
  .footer__credit a { display: block; margin-top: .3em; }
}

@keyframes watch-in { from { opacity: 0; transform: scale(.96); } }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .watch-wrap, .hero__title, .hero__side { animation-name: fade; animation-duration: .3s; animation-delay: 0s; }
  @keyframes fade { from { opacity: 0; } }
}
