/* ═══════════════════════════════════════════════════════════════════
   styles.css — JOYUS STUDIO design system

   This file is the single source of truth for tokens and primitives.
   Every page on the site links it.

   The old DM Serif / DM Sans / warm-gray editorial-wing system was
   retired on 2026-05-20. The legacy class definitions that used to
   live here are GONE — pages that haven't been redesigned will look
   broken (no nav-bar styling, no 4-col footer, no per-hub hero
   gradient). Those pages wear a `<div class="wip-banner">` sticker
   immediately after `<body>` so the breakage reads as intentional.
   Migrate one WIP page at a time to the new primitives.

   See DESIGN-LANGUAGE.md (repo root) for the full audit.
   ═══════════════════════════════════════════════════════════════════ */

/* ── Reset ───────────────────────────────────────────────────────── */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
img { max-width: 100%; height: auto; display: block; }
ul, ol { list-style: none; }

/* ── Tokens ──────────────────────────────────────────────────────── */
:root {
  --bg: #FAF7F2;
  --ink: #2C3544;
  --ink-soft: #54606F;
  --ink-fade: #8892A0;
  --rule: rgba(44, 53, 68, 0.12);
  --pink: #E91E7B;
  --cyan: #4FC4CF;
  --yellow: #F2C94A;
  --white: #FFFFFF;
  --sans: 'Space Grotesk', system-ui, -apple-system, sans-serif;
  --hand: 'Caveat', cursive;
  --x: clamp(1.5rem, 4vw, 3rem);
}

/* ── Per-page accent (set on <body data-accent="…">) ─────────────── */
body[data-accent="pink"]   { --accent: var(--pink); }
body[data-accent="cyan"]   { --accent: var(--cyan); }
body[data-accent="yellow"] { --accent: var(--yellow); }
body:not([data-accent])    { --accent: var(--pink); }

/* ── Body baseline ───────────────────────────────────────────────── */
body {
  font-family: var(--sans);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
a { color: inherit; text-decoration: none; }
a:focus-visible, button:focus-visible, input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Visually hidden — offscreen text that screen readers still read.
   Used for headings or labels that shouldn't appear in the visual design
   but are needed for semantic structure (e.g. the homepage's <h1>). */
.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Skip-to-content (accessibility) */
.skip-to-content {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 999;
  padding: 0.75rem 1.5rem;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  border-radius: 0 0 8px 0;
}
.skip-to-content:focus { left: 0; }

/* ═══════════════════════════════════════════════════════════════════
   PRIMITIVES — namespaced with .j- prefix to avoid colliding with any
   inline `.hero`, `.card`, `.eyebrow`, etc. that modern pages already
   carry in their own <style> blocks. Use these on new work or when
   migrating a WIP page.
   ═══════════════════════════════════════════════════════════════════ */

/* ── .j-hero — unified hero for any non-home modern page ─────────── */
.j-hero {
  position: relative;
  padding: 8rem var(--x) 5rem;
  background: var(--bg);
  overflow: hidden;
}
.j-hero__inner {
  position: relative;
  max-width: 1200px;
  margin: 0 auto;
  z-index: 1;
}
.j-hero__title {
  font: 700 clamp(3rem, 7vw, 8rem) / 0.92 var(--sans);
  letter-spacing: -0.04em;
  color: var(--ink);
  max-width: 16ch;
  margin: 0;
}
.j-hero__title em {
  font-style: italic;
  color: var(--accent);
}
.j-hero__kicker {
  font: 400 clamp(1.15rem, 1.6vw, 1.6rem) / 1.4 var(--hand);
  color: var(--ink-soft);
  margin-top: 1.5rem;
  max-width: 36ch;
}

/* ── .j-progress-thread — fixed 2px gradient scroll indicator ────── */
.j-progress-thread {
  position: fixed;
  top: 0; left: 0;
  height: 2px;
  width: var(--progress, 0%);
  background: linear-gradient(90deg, var(--pink), var(--cyan), var(--yellow));
  z-index: 100;
  transition: width 0.1s linear;
  pointer-events: none;
}

/* ── Eyebrow family — canonical, used across all pages.
   Consolidates .hero-eyebrow / .closing-label / .featured-label /
   .subscribe-label / .section-label / .j-eyebrow (which were duplicated
   inline on every page). Same shape; dot color picks up --accent by
   default. Per-variant overrides below for the section-specific dots. */
.hero-eyebrow,
.closing-label,
.featured-label,
.subscribe-label,
.section-label,
.j-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  font: 500 0.78rem / 1 var(--sans);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin: 0 0 1.5rem;
  position: relative;
  z-index: 2;
}
.hero-eyebrow::before,
.closing-label::before,
.featured-label::before,
.subscribe-label::before,
.section-label::before,
.j-eyebrow::before {
  content: "";
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}
/* Per-variant dot colors (overrides the --accent default) */
.closing-label::before,
.featured-label::before,
.subscribe-label::before { background: var(--yellow); }

/* ── .j-kicker — Caveat hand-note ────────────────────────────────── */
.j-kicker {
  font: 400 clamp(1.1rem, 1.4vw, 1.5rem) / 1.3 var(--hand);
  color: var(--ink-soft);
}

/* ── .j-pill — round-corner inline button/link ───────────────────── */
.j-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 1.1rem;
  border-radius: 999px;
  font: 500 0.95rem / 1 var(--sans);
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--rule);
  text-decoration: none;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
  cursor: pointer;
}
.j-pill:hover { border-color: var(--accent); color: var(--accent); }
.j-pill--solid { background: var(--accent); color: var(--white); border-color: transparent; }
.j-pill--solid:hover { background: var(--ink); color: var(--white); }
.j-pill--active { background: var(--accent); color: var(--white); border-color: transparent; }

/* ── .j-card — base + variants ───────────────────────────────────── */
.j-card {
  --card-bg: var(--white);
  --card-fg: var(--ink);
  position: relative;
  background: var(--card-bg);
  color: var(--card-fg);
  border-radius: 12px;
  padding: 1.5rem;
  overflow: hidden;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.j-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 0 -8px var(--accent);
}
.j-card[style*="--tilt"] { transform: rotate(var(--tilt, 0)); }
.j-card[style*="--tilt"]:hover { transform: rotate(var(--tilt, 0)) translateY(-6px); }

/* .j-card--photo — full-bleed image, bottom gradient, white label */
.j-card--photo {
  padding: 0;
  aspect-ratio: 3 / 4;
  background: var(--ink);
}
.j-card--photo .j-card__img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
}
.j-card--photo::after {
  content: '';
  position: absolute; left: 0; right: 0; bottom: 0;
  height: 50%;
  background: linear-gradient(180deg, transparent, rgba(0,0,0,0.7));
  pointer-events: none;
}
.j-card--photo .j-card__label {
  position: absolute; left: 1.25rem; right: 1.25rem; bottom: 1.25rem;
  font: 600 1.45rem / 1.15 var(--sans);
  color: var(--white);
  z-index: 1;
}

/* .j-card--solid — filled accent card */
.j-card--solid {
  --card-bg: var(--accent);
  --card-fg: var(--white);
}
.j-card--solid.j-card--ink   { --card-bg: var(--ink);   --card-fg: var(--white); }
.j-card--solid.j-card--paper { --card-bg: var(--white); --card-fg: var(--ink);   }
.j-card--solid .j-card__dot {
  position: absolute;
  width: 120px; height: 120px;
  border-radius: 50%;
  top: -60px; right: -60px;
  background: var(--card-dot, var(--yellow));
  opacity: 0.9;
}

/* .j-card--quote — white, accent left bar, Caveat quote-mark watermark */
.j-card--quote {
  --card-bg: var(--white);
  --card-fg: var(--ink);
  border-left: 3px solid var(--accent);
  padding-left: 2rem;
}
.j-card--quote::before {
  content: '"';
  position: absolute;
  top: 0.25rem; right: 1rem;
  font: 400 6rem / 1 var(--hand);
  color: var(--accent);
  opacity: 0.18;
  pointer-events: none;
}

/* .j-card--stat — solid accent, huge white number */
.j-card--stat {
  --card-bg: var(--accent);
  --card-fg: var(--white);
  display: flex; flex-direction: column; justify-content: space-between;
  min-height: 200px;
}
.j-card--stat .j-card__number {
  font: 700 clamp(4rem, 7vw, 7rem) / 0.9 var(--sans);
  letter-spacing: -0.03em;
}
.j-card--stat .j-card__label {
  font: 500 0.95rem / 1.3 var(--sans);
  opacity: 0.85;
}

/* ── .j-dots — decorative ornament ───────────────────────────────── */
.j-dots {
  position: absolute; inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}
.j-dots .j-dot {
  position: absolute;
  border-radius: 50%;
  background: var(--accent);
}
.j-dots .j-dot--pink   { background: var(--pink); }
.j-dots .j-dot--cyan   { background: var(--cyan); }
.j-dots .j-dot--yellow { background: var(--yellow); }
.j-dots .j-dot--ink    { background: var(--ink); }
.j-dots .j-dot--ring   { background: transparent; border: 2px solid currentColor; }

/* ── .closing — canonical end-of-page block (the "your move" moment).
   Consolidates the .closing family that was previously duplicated inline
   on every page. Connected to .foot below as one design moment.        */
.closing {
  padding: clamp(4rem, 10vh, 7rem) var(--x) clamp(3rem, 6vh, 5rem);
  position: relative;
  overflow: hidden;
  border-top: 2px solid var(--ink);
}
.closing h3, .closing h2 {
  font-weight: 600;
  font-size: clamp(1.75rem, 4vw, 2.75rem);
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin-bottom: 0.75rem;
  max-width: 720px;
  position: relative;
  z-index: 2;
}
.closing h3, .closing h2 em { font-style: normal; color: var(--pink); }
.closing h3, .closing h2 a {
  border-bottom: 3px solid var(--pink);
  padding-bottom: 2px;
  color: var(--pink);
}
.closing h3, .closing h2 a:hover { color: var(--ink); border-bottom-color: var(--ink); }
.closing .hint {
  display: block;
  font-size: 0.9rem;
  color: var(--ink-fade);
  position: relative;
  z-index: 2;
}
/* Closing flows directly into the foot — kill the foot's top gap so they
   read as one moment. */
.closing + .foot { padding-top: 0.5rem; }

/* ═══════════════════════════════════════════════════════════════════
   .foot — shared with `_partials/foot.html` (not prefixed because the
   partial already uses the bare class name and is the canonical
   footer markup site-wide).
   ═══════════════════════════════════════════════════════════════════ */

.foot {
  position: relative;
  z-index: 20;
  background: var(--bg);
  padding: 1.5rem var(--x) 2rem;
  padding-bottom: max(2rem, calc(env(safe-area-inset-bottom) + 1.5rem));
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  font-family: var(--sans);
  font-size: 0.78rem;
  color: var(--ink-fade);
  letter-spacing: 0.05em;
}
.foot a { color: var(--ink-fade); text-decoration: none; transition: color 0.2s; }
.foot a:hover { color: var(--accent); }
.j-closing + .foot { padding-top: 0.5rem; border-top: 0; }
@media (max-width: 480px) { .foot { justify-content: flex-start; } }

/* ═══════════════════════════════════════════════════════════════════
   .wip-banner — sticker for pages not yet redesigned in the new
   system. Sits immediately after <body>, before everything else.
   ═══════════════════════════════════════════════════════════════════ */

.wip-banner {
  position: relative;
  z-index: 200;
  display: block;
  padding: 0.5rem 1rem;
  background: var(--yellow);
  color: var(--ink);
  text-align: center;
  font-family: var(--sans);
  font-size: 0.85rem;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--rule);
}
.wip-banner::before {
  content: '✱ ';
  color: var(--pink);
  font-weight: 700;
}
.wip-banner__note {
  font-family: var(--hand);
  font-size: 1.05rem;
  text-transform: none;
  letter-spacing: 0;
  color: var(--ink-soft);
  margin-left: 0.5rem;
}

/* ═══════════════════════════════════════════════════════════════════
   ANIMATIONS (used by primitives, exposed for opt-in elsewhere)
   ═══════════════════════════════════════════════════════════════════ */

.fade-in { opacity: 0; transform: translateY(20px); transition: opacity 0.6s ease, transform 0.6s ease; }
.fade-in.visible { opacity: 1; transform: translateY(0); }

/* Gentle vertical bob (transform) + size pulse (scale). Kept on separate
   properties so the two animations layer instead of overriding. */
@keyframes float-y {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-12px); }
}
@keyframes breathe {
  0%, 100% { scale: 1; }
  50%      { scale: 1.08; }
}

/* EVERY decorative dot bobs AND breathes, site-wide. The two animations
   target different properties (transform vs scale) so they compose. */
.dot,
.j-dots .j-dot {
  animation: float-y 7s ease-in-out infinite, breathe 5.5s ease-in-out infinite;
}

/* De-sync: give each dot in a cluster its own pair of durations + negative
   delays (one value per animation: float-y, breathe) so nothing moves in
   lockstep. nth-of-type cycles these across however many dots a page has. */
.dot:nth-of-type(7n+1), .j-dots .j-dot:nth-child(7n+1) { animation-duration: 7s,   5.5s; animation-delay: -0.4s, -2.1s; }
.dot:nth-of-type(7n+2), .j-dots .j-dot:nth-child(7n+2) { animation-duration: 8.6s, 6.4s; animation-delay: -2.7s, -0.8s; }
.dot:nth-of-type(7n+3), .j-dots .j-dot:nth-child(7n+3) { animation-duration: 6.1s, 4.7s; animation-delay: -1.3s, -3.4s; }
.dot:nth-of-type(7n+4), .j-dots .j-dot:nth-child(7n+4) { animation-duration: 9.4s, 7.2s; animation-delay: -3.8s, -1.6s; }
.dot:nth-of-type(7n+5), .j-dots .j-dot:nth-child(7n+5) { animation-duration: 7.7s, 5.1s; animation-delay: -0.9s, -4.0s; }
.dot:nth-of-type(7n+6), .j-dots .j-dot:nth-child(7n+6) { animation-duration: 6.6s, 6.0s; animation-delay: -4.5s, -2.6s; }
.dot:nth-of-type(7n),   .j-dots .j-dot:nth-child(7n)   { animation-duration: 8.1s, 4.4s; animation-delay: -2.0s, -3.9s; }

/* The legacy .drift / .drift-slow / .drift-fast classes are now inert —
   the base .dot rule above already bobs + breathes, and the nth-of-type
   buckets handle de-syncing every dot (including drifted ones). Leaving
   the classes in markup is harmless. */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
