/* ==========================================================================
   Choreathon — shared styles
   Spacing uses 8px increments. Page margin 32px; merch/content sections 48px.
   Type stack: Archivo (display + headers), Roboto Mono (body + caption).
   ========================================================================== */

:root {
  /* Colour (from brand guidelines; logo files use #0D43EF) */
  --blue: #0D43EF;
  --blue-ink: #020715;
  --blue-900: #092579;
  --blue-500: #3867F7;
  --blue-400: #7497FB;
  --blue-300: #A4BCFE;
  --blue-200: #C7D6FF;
  --blue-100: #DCE6FF;
  --blue-50: #E8EDFB;          /* secondary */
  --cream: #F4F3F2;            /* page background */
  --placeholder: #D9D9D9;      /* blank image blocks */

  /* Type */
  --font-head: 'Archivo', sans-serif;
  --font-body: 'Roboto Mono', monospace;

  /* Spacing scale (8px) */
  --s1: 8px;  --s2: 16px; --s3: 24px; --s4: 32px; --s5: 40px;
  --s6: 48px; --s8: 64px; --s9: 72px; --s10: 80px; --s12: 96px; --s24: 192px;

  /* Layout */
  --margin: 32px;
  --margin-merch: 48px;
  --header-h: 80px;
}

@media (max-width: 800px) {
  :root { --margin: 16px; --margin-merch: 24px; }
}

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 14px;                 /* body 2 */
  line-height: normal;
  letter-spacing: -0.05em;
  color: var(--blue);
  background: var(--cream);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; }
img, svg { display: block; max-width: 100%; }
[hidden] { display: none !important; }
a { color: inherit; text-decoration: none; }
button { font: inherit; letter-spacing: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
ul { list-style: none; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 4px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}
.skip {
  position: absolute; left: var(--s2); top: -64px; z-index: 100;
  background: var(--blue); color: #fff; padding: var(--s1) var(--s2);
}
.skip:focus { top: var(--s2); }

/* ---------- Type styles (class names match the Figma text styles) ---------- */
.archivo-display, .archivo-header-1, .archivo-header-2, .archivo-header-3 { font-family: var(--font-head); color: var(--blue); }
.archivo-display { font-weight: 500; font-size: clamp(40px, 6vw, 64px); line-height: 0.98; letter-spacing: -0.04em; }
.archivo-header-1      { font-weight: 400; font-size: clamp(36px, 4.5vw, 54px); line-height: 1.1; letter-spacing: -0.03em; }
.archivo-header-2      { font-weight: 500; font-size: clamp(28px, 3vw, 36px); line-height: 1.1; letter-spacing: -0.03em; }
.archivo-header-3      { font-weight: 500; font-size: 24px; line-height: 1.1; letter-spacing: -0.03em; }
.mono-body-1   { font-size: 20px; line-height: normal; letter-spacing: -0.05em; }
.mono-body-2   { font-size: 14px; line-height: normal; letter-spacing: -0.05em; }
.mono-caption { font-size: 14px; line-height: normal; letter-spacing: -0.04em; text-transform: uppercase; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 20;
  height: var(--header-h);
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  padding: 0 var(--margin);
}
/* Frosted glass that fades out at the bottom (blur, tint and mask all fade together, no hard edge or line) */
.site-header::before {
  content: ""; position: absolute; z-index: -1; pointer-events: none;
  left: 0; right: 0; top: 0; bottom: -32px;
  background: linear-gradient(to bottom, rgba(244, 243, 242, 0.7), rgba(244, 243, 242, 0.35));
  -webkit-backdrop-filter: blur(20px) saturate(1.6);
  backdrop-filter: blur(20px) saturate(1.6);
  -webkit-mask-image: linear-gradient(to bottom, #000 0, #000 45%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 0, #000 45%, transparent 100%);
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .site-header::before { background: linear-gradient(to bottom, var(--cream) 45%, rgba(244, 243, 242, 0)); }
}
.nav { display: flex; gap: var(--s4); }
.nav a, .cart-link { text-transform: uppercase; letter-spacing: -0.04em; }
.cart-link { justify-self: end; }

/* Line animation: a 1px line draws left to right, slowly, under caption links and buttons */
.nav a, .cart-link, .footer-meta a, .btn-label, .menu-toggle, .menu-close {
  background-image: linear-gradient(currentColor, currentColor);
  background-repeat: no-repeat;
  background-position: left bottom;
  background-size: 0 1px;
  padding-bottom: 2px;
  transition: background-size 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}
.nav a:hover, .nav a:focus-visible, .nav a[aria-current="page"],
.menu-toggle:hover, .menu-toggle:focus-visible, .menu-close:hover, .menu-close:focus-visible,
.cart-link:hover, .cart-link:focus-visible, .cart-link[aria-current="page"],
.footer-meta a:hover, .footer-meta a:focus-visible,
.btn:hover .btn-label, .btn:focus-visible .btn-label { background-size: 100% 1px; }

/* Logo: primary logo swaps to the snail on hover */
.logo { position: relative; display: block; width: 80px; height: 28px; }
.logo img {
  position: absolute; left: 50%; top: 50%; height: auto;
  transform: translate(-50%, -50%);
  transition: opacity 0.5s ease;
}
.logo .logo-oval { width: 80px; opacity: 1; transition: opacity 0.3s ease 0.35s; } /* fades back in only after the snail has gone */
.logo .logo-snail { width: 44px; opacity: 0; transform: translate(calc(-50% - 12px), -50%); transition: none; }
/* In from the left, out to the right (classes set in site.js; :hover only as a no-JS fallback) */
.logo.is-hover .logo-oval, html:not(.js) .logo:hover .logo-oval { opacity: 0; transition: opacity 0.3s ease 0s; }
.logo.is-hover .logo-snail, html:not(.js) .logo:hover .logo-snail { opacity: 1; transform: translate(-50%, -50%); transition: opacity 0.5s ease 0.3s, transform 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) 0.3s; } /* snail enters after CHORE has faded */
.logo.is-out .logo-snail { opacity: 0; transform: translate(calc(-50% + 12px), -50%); transition: opacity 0.35s ease 0s, transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) 0s; }
/* Mobile menu */
.menu-toggle { display: none; justify-self: start; text-transform: uppercase; letter-spacing: -0.04em; }
.menu { display: none; }
@media (max-width: 800px) {
  .nav { display: none; }
  .menu-toggle { display: block; }
  .menu {
    display: flex; flex-direction: column; position: fixed; inset: 0; z-index: 50; background: var(--blue-50);
    visibility: hidden; opacity: 0; transition: opacity 0.35s ease, visibility 0s linear 0.35s;
  }
  .menu.is-open { visibility: visible; opacity: 1; transition: opacity 0.35s ease; }
  .menu-bar { display: flex; justify-content: space-between; align-items: center; height: var(--header-h); padding: 0 var(--margin); text-transform: uppercase; letter-spacing: -0.04em; }
  .menu-bar span { padding-bottom: 2px; } /* match the header button box so MENU does not shift */
  .menu-close { text-transform: uppercase; letter-spacing: -0.04em; }
  .menu-links { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--s8); padding-bottom: var(--header-h); }
  .menu-links a { font-size: 64px;
    opacity: 0; transform: translateY(16px);
    transition: opacity 0.6s cubic-bezier(0.2, 0.7, 0.2, 1), transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1);
    transition-delay: calc(var(--i, 0) * 70ms);
  }
  .menu.is-open .menu-links a { opacity: 1; transform: none; transition-delay: calc(0.1s + var(--i, 0) * 70ms); }
}
@media (prefers-reduced-motion: reduce) { .menu, .menu-links a { transition: none !important; } }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  padding: var(--s3) var(--s6);
  border-radius: 999px;
  font-family: var(--font-body);
  font-size: 14px; line-height: 16px;
  text-transform: uppercase; letter-spacing: -0.04em; text-align: center;
  }
.btn-primary { background: var(--blue); color: #fff; }
.btn-light { background: var(--blue-50); color: var(--blue); }
.btn-block { display: block; width: 100%; }
.btn[disabled] { opacity: 0.4; cursor: not-allowed; }
.btn-row { display: flex; gap: var(--s2); justify-content: center; flex-wrap: wrap; }
@media (max-width: 800px) { .btn { padding: var(--s3) var(--s5); } }

/* ---------- Home: stage (hero + marquee over the field) ---------- */
/* The field is allowed to run down behind the merch section; only sideways overflow is clipped. */
.stage { position: relative; overflow-x: clip; overflow-y: visible; padding-bottom: var(--s10); }
.field {
  position: absolute; z-index: 0; pointer-events: none;
  left: 0; top: 56px; width: 100%; max-width: none; height: auto;
  will-change: transform;
}
.hero {
  position: relative; z-index: 1; text-align: center;
  /* Fill the first screen so the snail + marquee land at the fold; copy sits centred, slightly high */
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: min(calc(100vh - var(--header-h) - 46px), 800px);
  min-height: min(calc(100svh - var(--header-h) - 46px), 800px);
  padding: var(--s6) var(--margin) var(--s12);
}
.hero .archivo-display { max-width: 544px; margin: 0 auto; }
.hero-copy { max-width: 560px; margin: var(--s4) auto var(--s10); }
@media (max-width: 800px) {
  .field { width: 900px; left: 0; top: 64px; }
  .hero { padding-top: var(--s6); padding-bottom: var(--s12); }
  .hero-copy { margin-bottom: var(--s6); }
  .stage { padding-bottom: var(--s6); }
}

/* ---------- Marquee ---------- */
.marquee { position: relative; z-index: 2; background: var(--blue); color: #fff; padding: 11px 0; }
.marquee-viewport { overflow: hidden; white-space: nowrap; line-height: 24px; }
.marquee-track { display: flex; width: max-content; animation: marquee 33.4s linear infinite; }
.marquee-track span { padding-right: 36px; }
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .marquee-track { animation: none; } }
.runner { position: absolute; left: 296px; bottom: 100%; width: 144px; height: auto; }
@media (max-width: 800px) { .runner { left: var(--s2); width: 96px; } }

/* ---------- Sections ---------- */
.section { position: relative; z-index: 1; padding: var(--s8) var(--margin-merch) 0; }
.section-head { text-align: center; margin-bottom: var(--s6); }
.section-foot { text-align: center; margin-top: var(--s12); padding-bottom: var(--s24); }
@media (max-width: 800px) { .section-foot { padding-bottom: var(--s12); margin-top: var(--s8); } }

.page-head { padding: var(--s8) var(--margin-merch) var(--s6); text-align: center; }
.page-head .mono-caption { margin-top: var(--s2); }

/* ---------- Product grid + card ---------- */
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s2); }
@media (max-width: 1024px) { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .grid { grid-template-columns: 1fr; } }
.card { display: block; }
.ph { background: var(--placeholder); aspect-ratio: 8 / 9; width: 100%; }
.card .archivo-header-3 { margin-top: var(--s2); }
.card .price { margin-top: var(--s1); }
.card:hover .archivo-header-3 { text-decoration: underline; text-underline-offset: 4px; }
.shop-body { padding: 0 var(--margin-merch) var(--s24); }
@media (max-width: 800px) { .shop-body { padding-bottom: var(--s12); } }

/* ---------- Product page ---------- */
.pdp { display: grid; grid-template-columns: 7fr 5fr; gap: var(--s6); padding: var(--s4) var(--margin-merch) var(--s12); align-items: start; }
.pdp-gallery { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s2); }
.pdp-gallery .ph:first-child { grid-column: 1 / -1; }
.pdp-info { position: sticky; top: calc(var(--header-h) + var(--s4)); display: flex; flex-direction: column; gap: var(--s3); }
.pdp-info .crumb a:hover { text-decoration: underline; text-underline-offset: 4px; }
.field-label { display: block; margin-bottom: var(--s1); }
.chips { display: flex; flex-wrap: wrap; gap: var(--s1); }
.chip { position: relative; }
.chip input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.chip span {
  display: block; padding: var(--s2) var(--s3); line-height: 16px;
  border: 1px solid var(--blue); border-radius: 999px;
  text-transform: uppercase; letter-spacing: -0.04em;
}
.chip input:checked + span { background: var(--blue); color: #fff; }
.chip input:focus-visible + span { outline: 2px solid var(--blue); outline-offset: 4px; }
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--blue); border-radius: 999px; }
.stepper button { width: 48px; height: 48px; font-size: 20px; line-height: 1; }
.stepper button:hover { opacity: 0.6; }
.stepper output { min-width: 32px; text-align: center; }
.status { min-height: 24px; }
.status a { text-decoration: underline; text-underline-offset: 4px; }
.details { border-top: 1px solid var(--blue-200); }
.details details { border-bottom: 1px solid var(--blue-200); padding: var(--s2) 0; }
.details summary { cursor: pointer; list-style: none; display: flex; justify-content: space-between; text-transform: uppercase; letter-spacing: -0.04em; }
.details summary::-webkit-details-marker { display: none; }
.details summary::after { content: '+'; }
.details details[open] summary::after { content: '–'; }
.details details p { margin-top: var(--s2); max-width: 480px; }
.related { padding: 0 var(--margin-merch) var(--s24); }
.related .section-head { margin-bottom: var(--s4); }
@media (max-width: 900px) {
  .pdp { grid-template-columns: 1fr; gap: var(--s4); }
  .pdp-info { position: static; }
  .related { padding-bottom: var(--s12); }
}

/* ---------- Cart ---------- */
.cart { display: grid; grid-template-columns: 1fr 400px; gap: var(--s6); padding: 0 var(--margin-merch) var(--s24); align-items: start; }
.cart-list { border-top: 1px solid var(--blue-200); }
.cart-item { display: grid; grid-template-columns: 96px 1fr auto; gap: var(--s3); padding: var(--s3) 0; border-bottom: 1px solid var(--blue-200); }
.cart-item .ph { aspect-ratio: 8 / 9; }
.cart-item .meta { display: flex; flex-direction: column; gap: var(--s1); align-items: flex-start; }
.cart-item .line { text-align: right; }
.linklike { text-decoration: underline; text-underline-offset: 4px; text-transform: uppercase; letter-spacing: -0.04em; }
.linklike:hover { opacity: 0.6; }
.summary { background: var(--blue-50); padding: var(--s4); display: flex; flex-direction: column; gap: var(--s3); position: sticky; top: calc(var(--header-h) + var(--s4)); }
.summary .row { display: flex; justify-content: space-between; }
.empty { text-align: center; padding: var(--s8) var(--margin-merch) var(--s24); }
.empty p { margin: var(--s2) 0 var(--s4); }
@media (max-width: 900px) {
  .cart { grid-template-columns: 1fr; gap: var(--s4); padding-bottom: var(--s12); }
  .summary { position: static; }
  .empty { padding-bottom: var(--s12); }
}

/* ---------- About ---------- */
/* About hero: fills the first screen (up to a tiny peek of the cards), image blocks sit behind the headline */
.about-hero {
  position: relative; overflow: hidden; text-align: center; margin-top: calc(-1 * var(--header-h));
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: min(calc(100vh - 104px), 1100px); min-height: min(calc(100svh - 104px), 1100px);
  padding: var(--header-h) var(--margin) var(--s6);
}
.about-hero > :not(.blocks) { position: relative; z-index: 1; }
.blocks { position: absolute; inset: 0; z-index: 0; pointer-events: none; --k: 1; }
.blocks .ph { position: absolute; width: calc(var(--w) * var(--k)); aspect-ratio: var(--ar); }
.blocks .b1 { --w: 18.6%; --ar: 372 / 374; left: 11.5%; top: 0; }
.blocks .b2 { --w: 14.9%; --ar: 297 / 361; right: 0; top: 0; }
.blocks .b3 { --w: 10.8%; --ar: 216 / 421; left: 0; top: 44%; }
.blocks .b4 { --w: 22.5%; --ar: 3 / 2; left: 19.3%; bottom: 40px; }
.blocks .b5 { --w: 18.6%; --ar: 373 / 310; left: 65.8%; bottom: 96px; }
.about-hero .archivo-header-1 { max-width: 880px; margin: 0 auto var(--s5); }
.how { padding: var(--s4) var(--margin-merch) var(--s12); }
.how .section-head { margin-bottom: var(--s4); }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s2); }
.step { background: var(--blue-50); padding: var(--s4); min-height: 280px; display: flex; flex-direction: column; justify-content: space-between; gap: var(--s6); }
.step p { max-width: 320px; }
.faq { padding: var(--s12) var(--margin-merch) var(--s4); display: grid; grid-template-columns: 5fr 7fr; gap: var(--s6); }
.faq .details details p { max-width: 560px; }
.past { padding: var(--s8) var(--margin-merch) var(--s24); }
.past .section-head p { margin-top: var(--s2); }
.past .grid { grid-template-columns: repeat(4, 1fr); }
.past .ph { aspect-ratio: 1; }
@media (max-width: 1024px) { .past .grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 900px) {
  .steps { grid-template-columns: 1fr; }
  .how { padding-bottom: var(--s8); }
  .step { min-height: 0; }
  .faq { grid-template-columns: 1fr; gap: var(--s4); padding-top: var(--s8); }
  .past { padding-bottom: var(--s12); }
  .blocks { --k: 1.8; }
  .blocks .b2 { right: 0; }
}

/* ---------- Footer ---------- */
.site-footer { position: relative; overflow: hidden; background: var(--blue-50); padding-top: var(--s4); }
.footer-meta {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s4);
  padding: 0 var(--margin);
}
.footer-meta ul { display: flex; flex-direction: column; gap: var(--s2); }
.footer-split { display: flex; justify-content: space-between; gap: var(--s2); }
/* Wordmark runs edge to edge and just bleeds off the sides and bottom */
.footer-wordmark { display: block; width: calc(100% + 6px); max-width: none; height: auto; margin: max(64px, 15vw) -3px -2px; }
@media (max-width: 800px) {
  .footer-meta { grid-template-columns: 1fr 1fr; row-gap: var(--s3); }
  .footer-split { display: contents; }
  .footer-meta > :last-child { grid-column: 1 / -1; }
}

@media (prefers-reduced-motion: reduce) {
  .nav a, .cart-link, .footer-meta a, .btn-label, .logo img { transition: none; }
}

/* ---------- Word-by-word load reveal (left to right) ---------- */
.js [data-reveal]:not(.is-split) { visibility: hidden; animation: reveal-fallback 0s 1.5s forwards; }
@keyframes reveal-fallback { to { visibility: visible; } }
.word { display: inline-block; opacity: 0; transform: translateY(0.35em); animation: word-in 0.8s cubic-bezier(0.2, 0.7, 0.2, 1) forwards; animation-delay: var(--d, 0ms); }
@keyframes word-in { to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .word { opacity: 1; transform: none; animation: none; } }

/* ---------- Custom cursor (8px rounded square, hotspot at centre) ---------- */
html, body, a, button, summary, .chip input, label { cursor: url("images/cursor.svg") 4 4, auto; }
.btn[disabled] { cursor: url("images/cursor.svg") 4 4, not-allowed; }

/* ---------- Scroll reveal (below the hero) ---------- */
.sr { opacity: 0; transform: translateY(24px); transition: opacity 0.8s cubic-bezier(0.2,0.7,0.2,1), transform 0.8s cubic-bezier(0.2,0.7,0.2,1); transition-delay: var(--sd, 0ms); }
.sr.sr-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .sr { opacity: 1; transform: none; transition: none; } }

/* Weighted cursor follower: the native cursor hides once the dot is active */
.cursor-dot { position: fixed; left: 0; top: 0; width: 8px; height: 8px; z-index: 1000; pointer-events: none; opacity: 0; transition: opacity 0.2s; will-change: transform; }
.cursor-dot.on { opacity: 1; }
html.has-cursor, html.has-cursor * { cursor: none !important; }

.footer-wordmark.sr { transform: translateY(48px); }
.footer-wordmark.sr.sr-in { transform: none; }

/* ---------- Legal pages + footer links ---------- */
.legal { max-width: 720px; margin: 0 auto; padding: var(--s8) var(--margin) var(--s12); }
.legal .mono-caption { margin-bottom: var(--s2); }
.legal .archivo-header-1 { margin-bottom: var(--s6); }
.legal-body h2 { margin-top: var(--s5); margin-bottom: var(--s1); }
.legal-body a { text-decoration: underline; text-underline-offset: 3px; }
.footer-legal { margin-top: var(--s3); }
