/* ============================================================================
 * Kids of the North — styles  (STUB — structure + TODO anchors only)
 * Consumes the brand variables in tokens.css. Real layout/animation CSS is
 * filled in across the build sequence (BUILD-PLAN-v2.md §7 / ROADMAP milestones).
 * Keep CLS < 0.05: reserve space for hero/media; never inject layout late.
 * ========================================================================== */

/* tokens.css is <link>ed before this file in every HTML <head> (loads in
 * parallel, preloadable). Do NOT @import it here — that would re-request it and
 * add a render-blocking request chain, working against the LCP/CLS budget. */

/* ── Reset / base ─────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
/* Media never overflows its container on small screens */
img, svg { max-width: 100%; height: auto; }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;          /* avoids the iOS URL-bar height jump */
  overflow-x: hidden;          /* belt-and-braces against horizontal scroll */
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: var(--leading-body);
  -webkit-font-smoothing: antialiased;
}

/* Selection highlight */
::selection { background: rgb(var(--blue-rgb) / 0.35); color: var(--ice); }

/* Focus ring (a11y) */
:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
  border-radius: 3px;
}

/* Skip link */
.skip-link {
  position: absolute;
  left: -9999px;
  top: var(--space-sm);
  z-index: 9999;
  padding: var(--space-xs) var(--space-md);
  background: var(--blue);
  color: #fff;
  font-size: var(--step--1);
  border-radius: var(--radius-sm);
  text-decoration: none;
}
.skip-link:focus { left: var(--space-sm); }

/* Screen-reader only */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* ── Self-hosted fonts — A2Z Styra (display + body) ───────────────────────
 * TODO: convert these .otf to .woff2 for ~40% smaller files once tooling is in. */
@font-face {
  font-family: "Styra"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("/assets/fonts/A2Z-Styra-A-Regular.otf") format("opentype");
}
@font-face {
  font-family: "Styra"; font-style: normal; font-weight: 500; font-display: swap;
  src: url("/assets/fonts/A2Z-Styra-A-Medium.otf") format("opentype");
}
@font-face {
  font-family: "Styra"; font-style: normal; font-weight: 700; font-display: swap;
  src: url("/assets/fonts/A2Z-Styra-A-Bold.otf") format("opentype");
}
@font-face {
  font-family: "Styra"; font-style: normal; font-weight: 900; font-display: swap;
  src: url("/assets/fonts/A2Z-Styra-A-Black.otf") format("opentype");
}

/* ── Layout primitives ────────────────────────────────────────────────────
 * TODO(M1): .container (max --container, inline padding), .stack, .eyebrow
 * (mono label, --tracking-label), .section (vertical rhythm --space-2xl). */

/* ── Aurora canvas layer ──────────────────────────────────────────────────
 * #aurora is set by js/aurora.js (WebGL). The body::before gradient below
 * acts as a static fallback when WebGL hasn't loaded yet.
 * TODO(M1, §5.2): full WebGL aurora in js/aurora.js. */
#aurora {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: var(--z-aurora);
  pointer-events: none;
}

/* Background — snow (assets/img/snow.jpg), shown clean/full-bleed as cover.
 * Served at 1600px from a git-ignored 7776px master. */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-color: var(--bg);
  background-image: url("/assets/img/snow.jpg");
  background-size: cover;
  background-position: center;
  pointer-events: none;
  z-index: var(--z-aurora);
}

/* Aurora/vignette overlay removed for a clean snow backdrop.
 * (Re-add a tint here once the owner sets the colour direction.) */

/* ── Intro / preloader overlay ────────────────────────────────────────────
 * TODO(M1, §5.1): #intro fixed, z:--z-intro, holds the North-Star SVG; fades
 * out when reveal is gated on model.loaded. Skipped on repeat visit + reduced-motion. */
#intro {
  position: fixed;
  inset: 0;
  z-index: var(--z-intro);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  /* Hidden by default until js/intro.js activates it */
  opacity: 0;
}

/* ── Site header ──────────────────────────────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: var(--z-nav);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-md) var(--space-lg);
  /* clean: no banner bar — wordmark sits directly on the background */
}

.brand {
  color: var(--text);
  text-decoration: none;
  font-family: var(--font-display);
  font-size: var(--step-0);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
}
.brand:hover { color: var(--ice); }

/* Wordmark (graffiti throw-up, assets/img/wordmark.png — white on transparent) */
.brand { display: inline-flex; align-items: center; }
.brand-mark {
  height: clamp(42px, 5vw, 66px);   /* ~3x larger header wordmark */
  width: auto;
  display: block;
  opacity: 0.95;
  transition: opacity var(--dur-fast) var(--ease-emerge);
}
.brand:hover .brand-mark { opacity: 1; }

/* Hero wordmark headline (replaces the H1 text on the landing page) */
.hero-wordmark {
  margin: 0 auto var(--space-md);
  line-height: 0;
}
.hero-wordmark img {
  display: block;
  width: min(740px, 86vw);
  height: auto;
  margin-inline: auto;
  /* soft glow to echo the spray bloom (§5.1) */
  filter: drop-shadow(0 0 24px rgb(var(--cyan-rgb) / 0.22));
}

/* ── Hub: hero + email capture ─────────────────────────────────────────────
 * TODO(M2, §7.2): graffiti wordmark artwork + mascot GLB in front of aurora. */

.hero {
  text-align: center;
  padding: var(--space-2xl) var(--space-lg) var(--space-md);
  max-width: var(--measure);
  margin-inline: auto;
  position: relative;
  z-index: var(--z-content);
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: var(--step--1);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--cyan);
  margin: 0 0 var(--space-sm);
}

h1 {
  font-family: var(--font-display);
  font-size: var(--step-3);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-display);
  color: var(--ice);
  margin: 0 0 var(--space-md);
  overflow-wrap: break-word;
}

.hero-sub {
  color: var(--muted);
  font-size: var(--step-0);
  margin: 0;
}

/* ── Waitlist / email capture ─────────────────────────────────────────────── */
.waitlist {
  text-align: center;
  padding: var(--space-lg) var(--space-lg) var(--space-2xl);
  max-width: 540px;
  margin-inline: auto;
  position: relative;
  z-index: var(--z-content);
}

.waitlist-label {
  font-size: var(--step-0);
  color: var(--muted);
  margin: 0 0 var(--space-lg);
}

.waitlist-row {
  display: flex;
  gap: var(--space-xs);
  justify-content: center;
}

.waitlist-row input[type="email"] {
  flex: 1;
  min-width: 0;
  padding: 0.72em 1em;
  background: var(--bg-2);                 /* solid — was faded/translucent */
  border: 1px solid rgb(var(--ice-rgb) / 0.18);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--step-0);
  transition: border-color var(--dur-fast) var(--ease-emerge),
              background var(--dur-fast) var(--ease-emerge);
}
.waitlist-row input[type="email"]:focus {
  outline: none;
  border-color: rgb(var(--cyan-rgb) / 0.45);
  background: rgb(var(--ice-rgb) / 0.08);
}
.waitlist-row input[type="email"]::placeholder { color: var(--muted); }

/* ── CTA button (shared) ────────────────────────────────────────────────── */
.cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.72em 1.4em;
  background: var(--blue);
  color: #fff;
  font-family: var(--font-body);
  font-size: var(--step-0);
  font-weight: 600;
  text-decoration: none;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--dur-fast) var(--ease-emerge),
              color var(--dur-fast) var(--ease-emerge),
              transform var(--dur-fast) var(--ease-emerge);
}
.cta:hover { background: var(--cyan); color: var(--bg); }
.cta:active { transform: scale(0.97); }
.cta:disabled { opacity: 0.5; cursor: not-allowed; }

.waitlist-error {
  margin-top: var(--space-sm);
  color: var(--accent-pink);
  font-size: var(--step--1);
}

.waitlist-success {
  color: var(--cyan);
  font-size: var(--step-0);
  padding: var(--space-md) 0;
}

/* ── 3-CTA grid (landing hub) ─────────────────────────────────────────────── */
.cta-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-md);
  max-width: var(--container);
  margin: var(--space-lg) auto var(--space-2xl);
  padding-inline: var(--space-lg);
  position: relative;
  z-index: var(--z-content);
}

.cta-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  min-height: 220px;
  padding: var(--space-lg);
  background: var(--bg-2);                 /* solid surface — no longer faded/translucent */
  border: 1px solid rgb(var(--ice-rgb) / 0.18);
  border-radius: var(--radius);
  box-shadow: 0 14px 36px rgb(var(--bg-rgb) / 0.40);   /* lift off the snow */
  color: var(--text);
  text-decoration: none;
  overflow: hidden;
  transition: border-color var(--dur-fast) var(--ease-emerge),
              background var(--dur-fast) var(--ease-emerge),
              transform var(--dur-med) var(--ease-emerge);
}
.cta-card:hover {
  border-color: rgb(var(--cyan-rgb) / 0.55);
  background: #131c27;
  transform: translateY(-4px);
}

.cta-card__eyebrow {
  font-family: var(--font-mono);
  font-size: var(--step--1);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--cyan);
}
.cta-card__title {
  font-family: var(--font-display);
  font-size: var(--step-2);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-display);
  color: var(--ice);
}
.cta-card__action {
  margin-top: auto;
  color: var(--text);
  font-weight: 600;
}
.cta-card__action span { transition: margin-left var(--dur-fast) var(--ease-emerge); }
.cta-card:hover .cta-card__action span { margin-left: 0.35em; }

/* ── Drop pages (helmets / buckles / customs) ─────────────────────────────── */
.drop { padding-bottom: var(--space-xl); }

/* Stacked form fields (Customs uses email + textarea) */
.field {
  width: 100%;
  padding: 0.72em 1em;
  background: var(--bg-2);                 /* solid — was faded/translucent */
  border: 1px solid rgb(var(--ice-rgb) / 0.18);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--step-0);
  transition: border-color var(--dur-fast) var(--ease-emerge),
              background var(--dur-fast) var(--ease-emerge);
}
.field:focus {
  outline: none;
  border-color: rgb(var(--cyan-rgb) / 0.45);
  background: rgb(var(--ice-rgb) / 0.08);
}
.field::placeholder { color: var(--muted); }
textarea.field { resize: vertical; min-height: 6em; }

.waitlist-form--customs {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  text-align: left;
}
.cta--block {
  width: 100%;
  background: var(--ice);          /* light blue (was bright --blue) */
  color: var(--bg);
}
.cta--block:hover { background: var(--cyan); color: var(--bg); }

.customs-direct {
  margin-top: var(--space-lg);
  color: var(--muted);
  font-size: var(--step--1);
  overflow-wrap: anywhere;   /* let the long email wrap on narrow screens */
}

/* Back link (drop pages) + footer contact email */
.back-link { margin-top: var(--space-xl); font-size: var(--step--1); }
.back-link a,
.customs-direct a,
.footer-contact a {
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color var(--dur-fast) var(--ease-emerge);
}
.back-link a { color: var(--ice); }
.customs-direct a,
.footer-contact a { color: var(--blue-deep); }   /* dark blue email (reads on snow) */
.back-link a:hover,
.customs-direct a:hover,
.footer-contact a:hover { color: var(--blue); }
.footer-contact { margin: 0 0 var(--space-xs); }

/* ── Site footer ──────────────────────────────────────────────────────────── */
.site-footer {
  padding: var(--space-lg);
  text-align: center;
  color: var(--muted);
  font-size: var(--step--1);
  position: relative;
  z-index: var(--z-content);
}

/* ── Responsive / mobile — adaptive to screen ──────────────────────────────
 * Type already scales fluidly (clamp() tokens). These rules adapt the layout:
 * collapse the grid, tighten vertical rhythm, stack inline controls, and scale
 * the fur for small viewports. */

/* Tablet */
@media (max-width: 900px) {
  .cta-grid { gap: var(--space-sm); }
}

/* Phones — single column, tighter rhythm, more visible fur texture */
@media (max-width: 720px) {
  /* Lander must fit one screen — compact the vertical rhythm so the footer
     email is visible without scrolling. */
  .site-header { padding: var(--space-sm) var(--space-md); }
  .hero { padding: var(--space-md) var(--space-md) var(--space-xs); }
  .cta-grid {
    grid-template-columns: 1fr;
    gap: var(--space-xs);
    margin: var(--space-xs) auto var(--space-sm);
    padding-inline: var(--space-md);
  }
  .cta-card { min-height: 0; padding: var(--space-md); gap: 2px; }
  .cta-card__action { margin-top: var(--space-sm); }
  .site-footer { padding: var(--space-md); }
  .waitlist { padding: var(--space-md) var(--space-md) var(--space-xl); }
  .drop { padding-bottom: var(--space-lg); }

  /* Stack the email + button to full-width, tappable controls */
  .waitlist-row { flex-direction: column; }
  .waitlist-row input[type="email"] { flex: none; width: 100%; }  /* don't grow vertically */
  .waitlist-row .cta { width: 100%; }
}

/* ── Product page shell (product-01 / buckle / product-03) ────────────────
 * TODO(M3, §7.8): shared shell — media column + story/price/CTA column. */

/* ── Product page shell (product-01 / buckle / product-03) ────────────────
 * TODO(M3, §7.8): shared shell — media column + story/price/CTA column.
 * Stripe Payment Element + Express Checkout mount points themed to brand. */

/* ── Micro-interactions ───────────────────────────────────────────────────
 * TODO(M4, §5.7): custom north-star cursor, magnetic buttons, graffiti-spray
 * underline on links, snow-camo card-hover fill. */

/* ── Accessibility / reduced motion ───────────────────────────────────────
 * TODO(M5, §4.4): prefers-reduced-motion freezes aurora to static gradient,
 * kills parallax/auto-rotate; visible focus states; sufficient contrast. */
@media (prefers-reduced-motion: reduce) {
  /* TODO: disable transitions/animations; pin aurora to still gradient. */
}
