/* LOGOFF 01
Layers, back to front:
chapter colour → giant type (z 1) → shoe canvas (z 2) → copy (z 3) → callouts (z 4) → nav (z 10)
Chapters must not create stacking contexts, or their copy would drop behind the shoe. */

:root {
  --cobalt: #2b36ff;
  --pink: #ff3c8e;
  --tang: #ff5b14;
  --grass: #13b76b;
  --ink: #101014;
  --bone: #f4eee0;
  --lime: #d4ff3a;
  --lilac: #b9a3ff;
  --display: "Unbounded", "Arial Black", system-ui, sans-serif;
  --body: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "DM Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --pad: clamp(18px, 4.4vw, 68px);
  --nav-h: 76px;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--cobalt);
  color: var(--bone);
  font: 400 1.0625rem/1.5 var(--body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

p, h1, h2, dl, dd, fieldset, legend { margin: 0; padding: 0; }
[hidden] { display: none !important; }
fieldset { border: 0; min-width: 0; }
a { color: inherit; }

:focus-visible { outline: 3px solid var(--lime); outline-offset: 3px; border-radius: 4px; }
.chapter--buy :focus-visible { outline-color: var(--ink); }

.skip {
  position: fixed; left: 12px; top: -80px; z-index: 20;
  padding: .7em 1em; border-radius: 999px;
  background: var(--lime); color: var(--ink);
  font: 500 .8rem var(--mono); text-transform: uppercase; text-decoration: none;
}
.skip:focus { top: 12px; }

/* ---------------------------------------------------------------- stage */
#stage {
  position: fixed; inset: 0 auto auto 0;
  width: 100vw; height: 100vh; height: 100lvh;
  z-index: 2;
  pointer-events: none;
}
.no-webgl #stage { display: none; }

/* ------------------------------------------------------------------ nav */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 16px var(--pad);
  pointer-events: none;
}
.nav > * { pointer-events: auto; }

.pill {
  display: inline-flex; align-items: center; gap: .55em;
  min-height: 44px; padding: 0 1.15em;
  border-radius: 999px;
  background: var(--ink); color: var(--bone);
  box-shadow: 0 0 0 1px rgba(244, 238, 224, .16);
  font: 500 .78rem/1 var(--mono); letter-spacing: .04em; text-transform: uppercase; text-decoration: none;
}
.nav__logo span { font: 900 .98rem/1 var(--display); letter-spacing: -.03em; text-transform: lowercase; }
.nav__logo svg { color: var(--lime); }

.nav__links { gap: 1.7em; }
.nav__links a { text-decoration: none; padding: .9em 0; }
.nav__links a:hover, .nav__bag:hover { color: var(--lime); }

#bag-count {
  display: inline-grid; place-items: center;
  min-width: 1.7em; height: 1.7em; border-radius: 999px;
  background: var(--bone); color: var(--ink);
  transition: background-color .3s;
}
#bag-count.is-full { background: var(--lime); }

.nav__right { display: flex; align-items: center; gap: 8px; }
.nav__colors { gap: 7px; padding: 0 10px 0 1.15em; }
.nav__colors-name { min-width: 14ch; margin-right: .3em; }
.no-webgl .nav__colors { display: none; }

/* a colorway: two-tone disc with an accent dot */
.swatch {
  --a: #fff; --b: #ccc; --c: #000;
  position: relative;
  width: 26px; height: 26px; padding: 0; flex: none;
  border: 1.5px solid rgba(244, 238, 224, .4); border-radius: 50%;
  background:
    radial-gradient(circle, var(--c) 0 27%, transparent 29%),
    linear-gradient(135deg, var(--a) 50%, var(--b) 50%);
  cursor: pointer;
  transition: transform .25s cubic-bezier(.2, .9, .3, 1.5), box-shadow .2s;
}
.swatch::before { content: ""; position: absolute; inset: -4px -3px; border-radius: 50%; }
.swatch:hover { transform: scale(1.14); }
.swatch[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--ink), 0 0 0 4px var(--bone); }

/* -------------------------------------------------------------- chapters */
.chapter {
  position: relative;
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: 20px;
  min-height: 100vh; min-height: 100svh;
  padding: calc(var(--nav-h) + 2vh) var(--pad) var(--pad);
  overflow-x: clip;
}

.chapter--hero { background: var(--cobalt); color: var(--bone); }
.chapter--pink { background: var(--pink); color: var(--ink); }
.chapter--tang { background: var(--tang); color: var(--ink); }
.chapter--grass { background: var(--grass); color: var(--ink); }
.chapter--guts { background: var(--ink); color: var(--bone); }
.chapter--buy { background: var(--lime); color: var(--ink); }

/* the giant words that sit behind the shoe */
.mega {
  position: relative; z-index: 1;
  font: 900 var(--size, 20vw)/.84 var(--display);
  letter-spacing: -.045em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--bone);
  user-select: none;
}
.mega span { display: block; }

.eyebrow, .micro {
  font: 500 .76rem/1.4 var(--mono);
  letter-spacing: .06em;
  text-transform: uppercase;
}

.copy { position: relative; z-index: 3; }
.copy h2, .buy h2 {
  font: 500 clamp(1.55rem, 2.5vw, 2.4rem)/1.08 var(--display);
  letter-spacing: -.035em;
  margin: .55em 0 .6em;
  text-wrap: balance;
}
.copy > p:not(.eyebrow) { max-width: 34ch; font-size: 1.09rem; }

.specs { display: flex; gap: 2.4rem; margin-top: 1.9rem; padding-top: 1.1rem; border-top: 2px solid currentColor; }
.specs dt { font: 500 .72rem/1.3 var(--mono); letter-spacing: .06em; text-transform: uppercase; }
.specs dd { font: 900 clamp(1.3rem, 1.9vw, 1.8rem)/1.2 var(--display); letter-spacing: -.04em; margin-top: .25em; }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 52px; padding: 0 1.6em;
  border: 2px solid currentColor; border-radius: 999px;
  background: transparent; color: inherit;
  font: 500 .8rem/1 var(--mono); letter-spacing: .05em; text-transform: uppercase; text-decoration: none;
  cursor: pointer;
  transition: transform .25s cubic-bezier(.2, .9, .3, 1.4), background-color .2s, color .2s;
}
.btn:hover { transform: translateY(-3px) rotate(-1.5deg); }
.btn--solid { background: var(--lime); border-color: var(--lime); color: var(--ink); }
.btn--ink { background: var(--ink); border-color: var(--ink); color: var(--lime); }

/* ------------------------------------------------------------------ hero */
.chapter--hero { align-content: center; padding-bottom: calc(var(--pad) + 96px); }
.hero__lockup { position: relative; grid-column: 1 / -1; justify-self: center; }
.mega--hero { --size: min(18.6vw, 33vh); }
.mega--hero span:last-child { margin-left: .58em; }
.hero__tagline, .hero__aside {
  position: absolute; z-index: 3;
  font: 500 clamp(.8rem, 1.02vw, 1.05rem)/1.15 var(--display);
  letter-spacing: -.03em;
}
.hero__tagline { left: 0; bottom: 9%; }
.hero__aside { right: 0; top: 100%; margin-top: 1.1em; max-width: 21ch; text-align: right; font: 500 clamp(.95rem, 1.2vw, 1.15rem)/1.3 var(--body); letter-spacing: 0; }
.hero__foot {
  position: absolute; z-index: 3;
  left: var(--pad); right: var(--pad); bottom: var(--pad);
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: end; gap: 20px;
}
.hero__actions { display: flex; gap: 12px; }
.hero__actions .btn:not(.btn--solid) { background: var(--cobalt); }
.hero__hint { text-align: right; }
.hero__hint span { display: inline-block; animation: nudge 1.6s ease-in-out infinite; }
@keyframes nudge { 50% { transform: translateY(5px); } }

/* -------------------------------------------------------------- features */
.chapter--feature { min-height: 112vh; align-content: center; row-gap: 3.5vh; }
.mega--word { grid-column: 1 / -1; --size: min(var(--fit, 20vw), 44vh); margin-left: -.04em; }
.copy--left { grid-column: 1 / span 5; }
.copy--right { grid-column: 8 / span 5; }

/* ------------------------------------------------------------------ guts */
.chapter--guts { display: block; padding: 0; height: 330vh; min-height: 0; }
.guts__word, .guts__copy {
  position: sticky; top: 0;
  height: 100vh; height: 100svh;
}
.guts__word { z-index: 1; display: grid; place-items: center; overflow: clip; }
.guts__word .mega { color: #1c1c25; margin: 0; }
.guts__copy {
  z-index: 3; margin-top: -100vh; margin-top: -100svh;
  display: flex; align-items: flex-end;
  padding: var(--pad);
  pointer-events: none;
}
.guts__copy .copy { max-width: 21rem; }
.guts__copy .eyebrow { color: var(--lime); }

/* ------------------------------------------------------------------- buy */
.chapter--buy { align-content: space-between; row-gap: 3vh; padding-bottom: calc(var(--pad) * .7); }
.mega--buy { grid-column: 1 / -1; --size: min(17.5vw, 27vh); margin-left: -.04em; color: var(--ink); }
.mega--buy span:last-child { margin-left: .5em; }
.buy {
  position: relative; z-index: 3;
  grid-column: 1 / span 5;
  display: grid; justify-items: start; gap: 12px;
}
.buy h2 { font: 500 clamp(1.15rem, 1.6vw, 1.5rem)/1.1 var(--display); margin: 0; }
.buy__price { font: 900 clamp(2.4rem, 4vw, 3.6rem)/1 var(--display); letter-spacing: -.05em; margin-bottom: .15em; }
.buy__go { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; }
.sizes legend { margin-bottom: .7em; }
.sizes__row { display: flex; flex-wrap: wrap; gap: 6px; }
.sizes label { position: relative; cursor: pointer; }
.sizes input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.sizes span {
  display: grid; place-items: center;
  width: 46px; height: 46px; border-radius: 50%;
  border: 2px solid var(--ink);
  font: 500 .85rem var(--mono);
  transition: background-color .15s, color .15s, transform .2s;
}
.sizes label:hover span { transform: translateY(-2px); }
.sizes input:checked + span { background: var(--ink); color: var(--lime); }
.sizes input:focus-visible + span { outline: 3px solid var(--ink); outline-offset: 3px; }
.buy__status { min-height: 1.4em; }
.foot { position: relative; z-index: 3; grid-column: 1 / -1; opacity: .75; }
@media (max-height: 800px) and (min-width: 821px) {
  .mega--buy { --size: min(17.5vw, 21vh); }
  .buy { gap: 9px; }
}

/* -------------------------------------------------------------- callouts */
.tags { position: fixed; inset: 0; z-index: 4; pointer-events: none; overflow: clip; }
.tag {
  --len: clamp(48px, 7vw, 120px);
  position: absolute; left: 0; top: 0;
  opacity: 0; visibility: hidden;
  color: var(--ink);
  will-change: transform, opacity;
}
.tag[data-group="guts"] { color: var(--bone); }
.tag__dot {
  position: absolute; left: -6px; top: -6px;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--lime); box-shadow: 0 0 0 2px var(--ink);
}
.tag__dot::after {
  content: ""; position: absolute; inset: -9px; border-radius: 50%;
  border: 2px solid var(--lime);
  animation: ping 1.9s cubic-bezier(.2, .7, .3, 1) infinite;
}
@keyframes ping { from { transform: scale(.45); opacity: 1; } to { transform: scale(1.5); opacity: 0; } }
.tag__line { position: absolute; top: -1px; left: 12px; width: var(--len); height: 2px; background: currentColor; }
.tag__text {
  position: absolute; top: 0; left: calc(var(--len) + 18px);
  transform: translateY(-50%);
  padding: .6em .8em; border-radius: 8px;
  background: var(--bone); color: var(--ink);
  box-shadow: 0 0 0 1.5px var(--ink);
  font: 400 .72rem/1.35 var(--mono); letter-spacing: .03em; text-transform: uppercase; white-space: nowrap;
}
.tag__text b, .tag__more { display: block; }
.tag__text b { font-weight: 500; }
.tag--left .tag__line { left: auto; right: 12px; }
.tag--left .tag__text { left: auto; right: calc(var(--len) + 18px); text-align: right; }

/* ---------------------------------------------------------------- reveal */
.js .reveal { opacity: 0; transform: translateY(26px); transition: opacity .7s ease, transform .9s cubic-bezier(.2, .8, .2, 1); }
.js .reveal.is-in { opacity: 1; transform: none; }

/* ---------------------------------------------------------------- mobile */
/* Keep this query in sync with STACKED in js/main.js. */
@media (max-width: 820px), (max-aspect-ratio: 4/5) {
  :root { --nav-h: 68px; }
  .nav__links { display: none; }
  .nav__colors { padding: 0 10px; }
  .nav__colors-name { display: none; }
  .swatch { width: 24px; height: 24px; }
  .chapter--hero { grid-template-rows: auto 1fr auto auto auto; align-content: stretch; padding-top: calc(var(--nav-h) + 3vh); padding-bottom: var(--pad); }
  .hero__lockup { display: contents; }
  .mega--hero { grid-column: 1 / -1; grid-row: 1; --size: 21vw; }
  .mega--hero span:last-child { margin-left: .22em; }
  .hero__tagline, .hero__aside { position: static; grid-column: 1 / -1; }
  .hero__tagline { grid-row: 3; font-size: 1rem; }
  .hero__tagline br:last-of-type { display: none; }
  .hero__aside { grid-row: 4; margin-top: .5em; text-align: left; max-width: 30ch; font-size: .98rem; }
  .hero__foot { position: static; grid-column: 1 / -1; grid-row: 5; margin-top: 18px; grid-template-columns: 1fr; justify-items: start; gap: 14px; }
  .hero__foot > .micro:first-child { display: none; }
  .hero__actions { flex-wrap: wrap; }
  .hero__hint { text-align: left; }
  .chapter--feature { min-height: 100vh; min-height: 100svh; align-content: space-between; }
  .mega--word { --size: min(var(--fit, 20vw), 30vh); }
  .copy--left, .copy--right { grid-column: 1 / -1; }
  .copy > p:not(.eyebrow) { font-size: 1rem; }
  .specs { margin-top: 1.2rem; padding-top: .9rem; }
  .guts__copy h2 { font-size: 1.3rem; }
  .guts__copy .copy > p:not(.eyebrow) { display: none; }
  .mega--buy { --size: 24vw; }
  .mega--buy span:last-child { margin-left: .2em; }
  .buy { grid-column: 1 / -1; gap: 9px; }
  .buy__price { font-size: 2.2rem; }
  .sizes span { width: 40px; height: 40px; }
  .tag { --len: 22px; }
  .tag__text { font-size: .62rem; padding: .5em .65em; }
  /* exploded view: name-only chips that sit on the part, so nothing runs off screen */
  .tag[data-group="guts"] .tag__line, .tag[data-group="guts"] .tag__more { display: none; }
  .tag[data-group="guts"] .tag__text { left: auto; right: 14px; }
  .tag--left[data-group="guts"] .tag__text { right: auto; left: 14px; }
  /* laces and tongue sit close together up top, so their chips open away from each other */
  .tag[data-anchor="x-laces"] .tag__text { right: auto; left: 14px; }
  .tag[data-anchor="x-tongue"] .tag__text { left: auto; right: 14px; }
}

/* small desktops: drop the colorway name; very narrow phones: logo mark only */
@media (max-width: 1180px) {
  .nav__colors { padding: 0 10px; }
  .nav__colors-name { display: none; }
}
@media (max-width: 380px) {
  .nav__logo span { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .tag__dot::after, .hero__hint span { animation: none; }
  .btn:hover, .sizes label:hover span, .swatch:hover { transform: none; }
}
