/* Slappis Watch Co.
   Direction: the object, large. Navy on white, one tangerine action.
   One typeface (General Sans), five sizes, square corners, no ornaments. */

:root {
  --bg: #ffffff;
  --surface: #f4f4f2;
  --ink: #1f2b4d;
  --muted: #5d657c;
  --accent: #f7941d;
  --accent-ink: #1f2b4d;
  --field-1: #05070a;
  --field-2: #e3e1dc;
  --dusk: #131b33;

  --step-small: clamp(0.8125rem, 0.79rem + 0.1vw, 0.875rem);
  --step-body: clamp(1.125rem, 1.05rem + 0.2vw, 1.1875rem);
  --step-lead: clamp(1.25rem, 1.1rem + 0.7vw, 1.625rem);
  --step-title: clamp(1.75rem, 1.4rem + 1.2vw, 2.25rem);
  --step-head: clamp(2.5rem, 1.6rem + 3.3vw, 4rem);

  --m: clamp(20px, 2.3vw, 32px);
  --gap: clamp(120px, 14vw, 220px);

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.76, 0, 0.24, 1);
  --t-press: 140ms;
  --t-hover: 180ms;
  --t-ui: 240ms;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "General Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: var(--step-body);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, p, ul, ol, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img, svg, canvas { display: block; max-width: 100%; }
a { color: inherit; }
h1, h2 { font-weight: 700; letter-spacing: -0.02em; line-height: 0.95; text-wrap: balance; }
h3 { font-weight: 500; font-size: var(--step-lead); line-height: 1.2; letter-spacing: -0.01em; }
::selection { background: var(--accent); color: var(--accent-ink); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
[id] { scroll-margin-top: 0; }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 0 26px;
  background: var(--ink);
  color: #fff;
  font-weight: 500;
  font-size: var(--step-body);
  text-decoration: none;
  white-space: nowrap;
  transition: background-color var(--t-hover) var(--ease-out), transform var(--t-press) var(--ease-out);
}
.button--accent { background: var(--accent); color: var(--accent-ink); }
.button--accent:hover { background: #ffad42; }
.button:active { transform: scale(0.97); }

/* live canvas slots: the page's one WebGL canvas moves between them */
.slot { position: absolute; inset: 0; }
.slot canvas { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; transition: opacity 900ms var(--ease-out); }
.slot.is-ready canvas { opacity: 1; }

/* ---------- hero ---------- */

.hero { position: relative; --d: min(78svh, 46vw); --wtop: calc(50svh - var(--d) / 2); color: #fff; background: var(--field-1); }
.hero__stage { position: relative; height: 100svh; min-height: 600px; overflow: clip; }
.hero__picture { position: absolute; inset: 0; background: var(--field-1); }
.hero__picture img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero__window { position: absolute; left: 50%; top: var(--wtop); width: var(--d); aspect-ratio: 1; transform: translateX(-50%); visibility: hidden; pointer-events: none; }

.nav { position: absolute; z-index: 4; top: 0; left: 0; right: 0; display: flex; align-items: center; justify-content: space-between; padding: 22px var(--m); transition: color var(--t-ui) var(--ease-out); }
.nav a { text-decoration: none; }
.nav__mark { font-weight: 700; font-size: var(--step-body); letter-spacing: -0.01em; }
.nav__links { display: flex; gap: clamp(20px, 2.4vw, 36px); font-size: var(--step-small); font-weight: 500; }
.nav__links a, .card__address a, .chapter__link, .step__fact a { text-decoration: underline; text-decoration-color: transparent; text-decoration-thickness: 2px; text-underline-offset: 6px; transition: text-decoration-color var(--t-hover) var(--ease-out); }
.nav__links a:hover, .card__address a:hover, .chapter__link:hover, .step__fact a:hover { text-decoration-color: currentColor; }
.nav__menu { display: none; position: relative; font-weight: 500; font-size: var(--step-small); }
.nav__menu summary { list-style: none; cursor: pointer; padding: 8px 0; }
.nav__menu summary::-webkit-details-marker { display: none; }
.nav__sheet { position: absolute; right: 0; top: 100%; display: grid; gap: 4px; min-width: 210px; padding: 14px 18px; background: var(--ink); color: #fff; }
.nav__sheet a { padding: 10px 0; }

.hero__copy { position: absolute; z-index: 2; left: var(--m); right: var(--m); bottom: var(--m); display: flex; align-items: flex-end; justify-content: space-between; gap: 32px; }
.hero__title { font-size: var(--step-head); }
.hero__aside { display: grid; gap: 14px; justify-items: start; max-width: 27ch; }
.hero__now { font-size: var(--step-small); }
.hero__aside .button { margin-top: 6px; }
.hero__caption { display: none; }
/* without the window (reduced motion, no script) the words sit on flat tabs over the picture */
.hero:not(.has-window) .hero__title, .hero:not(.has-window) .hero__aside { padding: 16px 20px; background: var(--field-1); }

/* with motion: the picture is first seen through a round window */
.hero.has-window { height: 240svh; color: var(--ink); background: var(--bg); }
.has-window .hero__stage { position: sticky; top: 0; background: var(--bg); }
.has-window .hero__picture { clip-path: circle(var(--r, calc(var(--d) / 2)) at var(--cx, 50%) var(--cy, 50%)); will-change: clip-path; }
.has-window .hero__copy { bottom: calc(100svh - var(--wtop) - var(--d)); opacity: var(--fade, 1); transform: translateY(calc(var(--p, 0) * -56px)); }
.has-window.is-open .hero__copy { visibility: hidden; }
.has-window.is-open .nav { color: #fff; }
.has-window .hero__now { color: var(--muted); }
.has-window .hero__caption { position: absolute; z-index: 2; left: var(--m); right: var(--m); bottom: var(--m); display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; color: #fff; font-size: var(--step-lead); font-weight: 500; opacity: var(--cap, 0); }
.hero__caption span { padding: 8px 14px; background: var(--field-1); }

/* ---------- about ---------- */

.about { padding: 20px; background: var(--bg); }
.about__panel { position: relative; min-height: 110svh; padding: 56px; overflow: clip; background: var(--ink); color: #fff; display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 20px; align-content: start; }
.about__statement { grid-column: 1 / 8; font-size: var(--step-head); }
.about__text { grid-column: 9 / 13; display: grid; gap: 56px; justify-items: start; max-width: 340px; }
.about__text h3 { margin-bottom: 12px; }
.about__text p { color: #dfe3ee; }
.about__portrait { position: absolute; left: 56px; bottom: -7.6vw; width: 38vw; aspect-ratio: 1; clip-path: circle(50%); }
.about__portrait img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- collection ---------- */

.collection { background: var(--bg); }
.chapter { position: relative; height: 100svh; min-height: 640px; overflow: clip; background: var(--c-field); color: var(--c-ink); }
.chapter--dusk { --c-field: var(--dusk); --c-ink: #ffffff; --c-soft: #c9cfdf; }
.chapter--dawn { --c-field: var(--field-2); --c-ink: var(--ink); --c-soft: #4a536b; }
.chapter__portrait { position: absolute; inset: 0; display: grid; place-items: center; }
.chapter__portrait img { height: 100%; width: auto; max-width: none; aspect-ratio: 3 / 4; object-fit: cover; }
.chapter__title { position: absolute; left: var(--m); top: calc(var(--m) + 4px); font-size: var(--step-title); line-height: 1.05; }
.chapter__facts { position: absolute; right: var(--m); top: calc(var(--m) + 4px); text-align: right; font-size: var(--step-lead); line-height: 1.4; }
.chapter__facts li:first-child { color: var(--c-soft); }
.chapter__line { position: absolute; left: var(--m); bottom: var(--m); max-width: 31ch; }
.chapter__link { position: absolute; right: var(--m); bottom: var(--m); font-weight: 500; font-size: var(--step-lead); text-decoration-color: currentColor; }
.chapter__link:hover { color: var(--accent); }

/* ---------- inside the 38 ---------- */

.inside { position: relative; background: var(--field-1); color: #fff; }
.inside__stage { position: relative; padding: var(--gap) var(--m); }
.inside__poster { width: 100%; height: auto; }
.inside .slot { display: none; }
.inside__steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 56px 32px; margin-top: 64px; }
.step h2 { font-size: var(--step-head); margin-bottom: 20px; }
.step h3 { font-size: var(--step-title); font-weight: 700; letter-spacing: -0.02em; line-height: 1.05; margin-bottom: 16px; }
.step p { color: #d5d9e2; max-width: 34ch; }
.step .step__fact { margin-top: 14px; color: #fff; font-weight: 500; }
.inside__index { display: none; }

/* live: the stage is held while the page scrolls through twelve stops */
.inside.is-live { height: calc(11 * 60svh + 100svh); }
.is-live .inside__stage { position: sticky; top: 0; height: 100svh; min-height: 560px; padding: 0; overflow: clip; touch-action: pan-y; cursor: grab; }
.is-live .inside__stage.is-dragging { cursor: grabbing; }
.is-live .inside__poster { display: none; }
.is-live .slot { display: block; }
.is-live .inside__steps { position: absolute; z-index: 2; left: var(--m); top: 50%; width: min(31vw, 420px); margin: 0; transform: translateY(-50%); grid-template-columns: 1fr; gap: 0; pointer-events: none; }
.is-live .step { grid-area: 1 / 1; align-self: center; opacity: 0; visibility: hidden; transform: translateY(18px); transition: opacity 320ms var(--ease-out), transform 520ms var(--ease-out), visibility 0s linear 320ms; }
.is-live .step.is-active { opacity: 1; visibility: visible; transform: none; transition-delay: 120ms, 120ms, 0s; pointer-events: auto; }
.is-live .inside__index { position: absolute; z-index: 2; right: var(--m); top: 50%; transform: translateY(-50%); display: grid; justify-items: end; }
.inside__index button { display: flex; align-items: center; gap: 10px; padding: 7px 0; border: 0; background: none; color: #8a90a0; font: inherit; font-size: var(--step-small); font-weight: 500; cursor: pointer; transition: color var(--t-hover) var(--ease-out); }
.inside__index button::after { content: ""; width: 8px; height: 8px; background: currentColor; transform: scale(0.5); transition: transform var(--t-ui) var(--ease-out), background-color var(--t-ui) var(--ease-out); }
.inside__index button:hover { color: #fff; }
.inside__index button.is-current { color: #fff; }
.inside__index button.is-current::after { background: var(--accent); transform: scale(1); }

/* ---------- how one gets made ---------- */

.made { background: var(--bg); padding: var(--gap) var(--m); }
.made__grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 10px; row-gap: 22px; align-items: end; }
.made h2 { grid-column: 1 / 8; grid-row: 1; align-self: start; font-size: var(--step-head); }
.tile { grid-row: 1; overflow: hidden; }
.tile img { width: 100%; height: 100%; object-fit: cover; transition: transform 900ms var(--ease-out); }
.tile:hover img { transform: scale(1.04); }
.tile--a { grid-column: 1 / 4; height: 30vh; min-height: 190px; background: var(--surface); }
.tile--b { grid-column: 4 / 8; height: 44vh; min-height: 280px; background: var(--field-2); }
.tile--c { grid-column: 8 / 13; height: 60vh; min-height: 380px; background: var(--ink); }
.made__note { grid-row: 2; align-self: start; max-width: 36ch; }
.made__note h3 { margin-bottom: 8px; }
.made__note p { color: var(--muted); }
.made__note--a { grid-column: 1 / 4; }
.made__note--b { grid-column: 4 / 8; }
.made__note--c { grid-column: 8 / 13; }

/* ---------- the object returns ---------- */

.cta { position: relative; min-height: 90svh; overflow: clip; background: var(--surface); display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 20px; align-items: center; padding: 0 var(--m); }
.cta__object { position: absolute; left: 0; top: 0; bottom: 0; width: 68%; }
.cta__object img { position: absolute; left: -9%; bottom: -12%; width: 128%; max-width: none; height: auto; }
.cta__text { position: relative; grid-column: 9 / 13; display: grid; gap: 18px; justify-items: start; padding: 80px 0; }
.cta__text h2 { font-size: var(--step-title); line-height: 1.05; }
.cta__price { font-size: var(--step-lead); font-weight: 500; }

/* ---------- footer: the back of the card ---------- */

.footer { background: var(--ink); padding: clamp(90px, 11vw, 170px) var(--m) clamp(56px, 7vw, 110px); }
.card { width: calc(100% * 10 / 12); margin: 0 auto; color: var(--ink); }
.card__edge { width: 100%; aspect-ratio: 24 / 1; fill: var(--field-2); margin-bottom: -1px; }
.card__body { min-height: 380px; padding: 36px clamp(28px, 4vw, 56px) 26px; background: var(--field-2); display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr auto; gap: 40px clamp(32px, 6vw, 96px); }
.card__message h2 { font-size: var(--step-title); line-height: 1.05; margin-bottom: 18px; }
.card__message p { max-width: 38ch; }
.card__address { display: grid; gap: 12px; justify-items: start; align-content: start; font-size: var(--step-body); font-weight: 500; }
.card__stamp { justify-self: end; width: 88px; height: auto; padding: 6px; background: var(--bg); margin-bottom: 8px; transition: transform var(--t-ui) var(--ease-out); }
.card__stamp:hover { transform: rotate(-3deg); }
.card__imprint { grid-column: 1 / -1; text-align: center; font-size: var(--step-small); }

/* ---------- entrances ---------- */

@media (prefers-reduced-motion: no-preference) {
  /* parts rise in as their section arrives; content is never left hidden if the observer does not fire */
  .js [data-reveal].is-in { animation: rise 1000ms var(--ease-expo) both; animation-delay: calc(var(--i, 0) * 80ms); }
  .js .chapter { clip-path: inset(20px); transition: clip-path 1000ms var(--ease-expo); }
  .js .chapter.is-in { clip-path: inset(0); }
  .js .chapter__portrait img { transform: scale(0.92); transition: transform 1200ms var(--ease-expo); }
  .js .chapter.is-in .chapter__portrait img { transform: none; }
  .js .chapter__title, .js .chapter__facts, .js .chapter__line, .js .chapter__link { opacity: 0; transform: translateY(18px); transition: opacity 700ms var(--ease-out) 250ms, transform 900ms var(--ease-expo) 250ms, color var(--t-hover) var(--ease-out), text-decoration-color var(--t-hover) var(--ease-out); }
  .js .chapter.is-in .chapter__title, .js .chapter.is-in .chapter__facts, .js .chapter.is-in .chapter__line, .js .chapter.is-in .chapter__link { opacity: 1; transform: none; }
  .js .chapter.is-in .chapter__facts { transition-delay: 330ms; }
  .js .chapter.is-in .chapter__line { transition-delay: 410ms; }
  .js .chapter.is-in .chapter__link { transition-delay: 490ms, 490ms, 0s, 0s; }
}
@keyframes rise { from { opacity: 0; transform: translateY(28px); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .slot canvas, .step, .button, .tile img { transition: none !important; }
}

/* ---------- narrower screens ---------- */

@media (max-width: 900px) {
  .nav__links { display: none; }
  .nav__menu { display: block; }

  .hero { --d: min(78vw, 44svh); --wtop: 30svh; }
  .hero__copy { flex-direction: column; align-items: flex-start; gap: 20px; }
  .has-window .hero__copy { position: static; opacity: 1; transform: none; }
  .has-window .hero__title { position: absolute; z-index: 2; left: var(--m); top: 72px; opacity: var(--fade, 1); }
  .has-window .hero__aside { position: absolute; z-index: 2; left: var(--m); right: var(--m); top: calc(var(--wtop) + var(--d) + 22px); max-width: none; gap: 12px; opacity: var(--fade, 1); }
  .has-window .hero__now { display: none; }
  .has-window .hero__aside .button { width: 100%; margin-top: 4px; }
  .has-window .hero__caption { flex-direction: column; align-items: flex-start; gap: 0; }

  .about { padding: 10px; }
  .about__panel { min-height: 0; padding: 30px 22px 0; display: flex; flex-direction: column; }
  .about__statement { font-size: min(8.5vw, var(--step-head)); }
  .about__text { max-width: 520px; gap: 36px; margin-top: 44px; }
  .about__portrait { position: static; order: 3; align-self: center; width: 86vw; max-width: 560px; margin: 52px 0 -21vw; }

  .chapter { height: auto; min-height: 100svh; display: flex; flex-direction: column; padding: 24px var(--m) 30px; }
  .chapter__title, .chapter__facts, .chapter__line, .chapter__link { position: static; }
  .chapter__title { order: 1; }
  .chapter__portrait { position: static; order: 3; display: block; width: min(88%, 56svh); margin: 22px auto; }
  .chapter__portrait img { width: 100%; height: auto; }
  .chapter__facts { order: 2; margin-top: 10px; text-align: left; font-size: var(--step-small); line-height: 1.5; display: flex; flex-wrap: wrap; column-gap: 14px; }
  .chapter__line { order: 4; margin-top: auto; max-width: 40ch; }
  .chapter__link { order: 5; align-self: flex-start; margin-top: 14px; font-size: var(--step-body); }

  .inside__steps { grid-template-columns: 1fr; gap: 40px; }
  .is-live .inside__steps { left: 0; right: 0; top: auto; bottom: 0; width: auto; transform: none; padding: 22px var(--m) 30px; background: var(--field-1); }
  .is-live .step { align-self: end; }
  .is-live .inside__index { display: none; }
  .step h2 { margin-bottom: 12px; }
  .step h3 { margin-bottom: 10px; }
  .step p { max-width: 40ch; }

  .made__grid { grid-template-columns: 1fr; row-gap: 14px; }
  .made h2, .tile, .made__note { grid-column: 1; grid-row: auto; }
  .made h2 { margin-bottom: 14px; }
  .tile--a { order: 1; height: 34vw; min-height: 0; }
  .made__note--a { order: 2; }
  .tile--b { order: 3; height: 46vw; min-height: 0; margin-top: 14px; }
  .made__note--b { order: 4; }
  .tile--c { order: 5; height: 62vw; min-height: 0; margin-top: 14px; }
  .made__note--c { order: 6; }

  .cta { display: block; padding: 0; min-height: 0; }
  .cta__text { padding: 72px var(--m) 28px; }
  .cta__object { position: relative; width: 100%; height: 55svh; min-height: 320px; overflow: clip; }
  .cta__object img { left: -6%; bottom: -16%; width: 130%; }

  .card { width: 100%; }
  .card__edge { width: 200%; max-width: none; }
  .card { overflow: clip; }
  .card__body { grid-template-columns: 1fr; min-height: 0; gap: 28px; padding-top: 28px; position: relative; }
  .card__message { padding-right: 84px; }
  .card__stamp { position: absolute; right: 22px; top: 24px; width: 64px; }
}

@media (max-width: 900px) and (max-height: 700px) {
  .has-window .hero__title { top: 60px; }
  .hero { --wtop: 27svh; }
}
