/* ================================================================
   Uare.ai Brand Book — styles.css
   Primary: light canvas manifesto. Tokens from design system CSS.
================================================================ */

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: #F9F9F7;
  color: #10100F;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
  letter-spacing: -0.003em;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: inherit; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }

/* ------------------ Legacy direction tokens ------------------
   These aliases back the pre-Bolt-rebuild spreads in Parts 1 & 4.
   All values are now pulled from the canonical palette in
   colors_and_type.css (brand-mode.css, theme-*-mode.css).
-------------------------------------------------------------- */
:root {
  --canvas:      #fafafa;                /* Paper — neutral-50 */
  --ink:         #10100f;                /* Ink — neutral-950 */
  --ink-muted:   #434342;                /* neutral-700 */
  --ink-subtle:  #767774;                /* neutral-500 */
  --rule:        rgba(16,16,15,0.10);    /* opaque-b-10 */
  --rule-strong: rgba(16,16,15,0.20);    /* opaque-b-20 */
  --paper:       #ffffff;                /* raised surface */
  --lime:        #dff693;                /* Uare Green — lime-200 */
  --lime-deep:   #748345;                /* olive — lime-700 (light-mode accent text) */
  --lime-dark:   #545f32;                /* lime-800 */
  --orange:      #ff6b45;                /* orange-500 */
  --pink:        #fe72e4;                /* pink-500 */
  --yellow:      #dfff5e;                /* yellow spark */
  --purple:      #7671fe;                /* purple-500 */
  --blue:        #92e0ff;                /* utility-only blue */
  --dark:        #10100f;                /* ink */
}

body[data-dir="zine"] {
  --canvas: #fafafa;
  --ink: #10100f;
  --paper: #ffffff;
  --rule: rgba(16,16,15,0.10);
  --rule-strong: rgba(16,16,15,0.20);
}

body[data-dir="editorial"] {
  --canvas: #F5F2EA;       /* warmer paper */
  --ink: #1C1A14;
  --ink-muted: #544F45;
  --ink-subtle: #8A8579;
  --rule: rgba(28,26,20,0.14);
  --rule-strong: rgba(28,26,20,0.32);
  --paper: #FBF9F2;
}

/* ============================================================
   DARK MODE — Ink canvas (theme-dark-mode.css)
   Flip body + default .spread to Ink #10100f (neutral-950).
   .spread.dark stays dark. In dark mode the rhythm is uniform;
   accent spreads keep their dark treatment rather than inverting.
============================================================ */
body[data-theme="dark"] {
  --canvas:      #10100f;                /* neutral-950 — Ink */
  --ink:         #f5f5f4;                /* neutral-100 — text on Ink */
  --ink-muted:   #d6d6d6;                /* neutral-300 — text-secondary */
  --ink-subtle:  #a6a6a5;                /* neutral-400 — text-tertiary */
  --rule:        rgba(255,255,255,0.10); /* opaque-w-10 */
  --rule-strong: rgba(255,255,255,0.20); /* opaque-w-20 */
  --paper:       #1f1f1f;                /* neutral-900 — widget */
  background: #10100f;
  color: #f5f5f4;
}
/* Editorial dir in dark mode gets a slightly warmer dark */
body[data-theme="dark"][data-dir="editorial"] {
  --canvas: #1C1A14;
  --paper: #232017;
  --ink: #F5F2EA;
  --ink-muted: #C8C2B0;
  --ink-subtle: #8A8579;
  --rule: rgba(245,242,234,0.10);
  --rule-strong: rgba(245,242,234,0.26);
  background: #1C1A14;
  color: #F5F2EA;
}
/* Default (non-.dark) spreads flip to dark canvas in dark mode */
body[data-theme="dark"] section.spread:not(.dark) {
  background: var(--canvas);
  color: var(--ink);
}
/* In dark mode, .spread.dark stays Ink and gets a subtle elevation via --paper. */
body[data-theme="dark"] section.spread.dark {
  background: #10100f;
  --paper: #1f1f1f;
}
/* Sidebar + app shell follow body */
body[data-theme="dark"] .app { background: var(--canvas); color: var(--ink); }
body[data-theme="dark"] .toc { background: var(--canvas); border-right-color: var(--rule); }

/* §03 Life Model cards: keep visual distinction between HLM (Individuals) and HLM for Professionals in both modes */
body[data-theme="dark"] .lm-card.lm-hlm {
  background: #1F1F1E;
  border-color: rgba(255,255,255,0.12);
  color: #F5F5F4;
}
body[data-theme="dark"] .lm-card.lm-hlm .lm-tag { color: var(--accent-text); }
body[data-theme="dark"] .lm-card.lm-hlm .lm-sub,
body[data-theme="dark"] .lm-card.lm-hlm .lm-list .def { color: #AAAAAA; }
body[data-theme="dark"] .lm-card.lm-hlm .lm-list .idx { color: #767774; }
body[data-theme="dark"] .lm-card.lm-hlm .lm-list li { border-color: rgba(255,255,255,0.12); }

/* §12 Imagery: hero Polaroid and collage read well on either canvas. The "Be Yourself"
   Polaroid has a white frame + black thumbnail area; no flip needed. */

/* §07 Logo: the color lockup swatch background is paper — needs a slightly lifted dark bg
   so the logo stays visible in dark mode. The mono-white and u-symbol cards already use
   .logo-dark which stays dark. */
body[data-theme="dark"] .logo-card.logo-light {
  background: #F5F2EA;
  border-color: rgba(28,26,20,0.18);
  color: #1C1A14;
}

/* ------------------ Theme toggle UI ------------------ */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 120ms cubic-bezier(0.22, 1, 0.36, 1), color 120ms cubic-bezier(0.22, 1, 0.36, 1), border-color 120ms cubic-bezier(0.22, 1, 0.36, 1);
  width: 100%;
  justify-content: center;
}
.theme-toggle:hover {
  background: var(--paper);
  border-color: var(--rule-strong);
}
.theme-toggle .material-symbols-rounded {
  font-size: 16px;
  line-height: 1;
}
.theme-toggle .label { display: inline-block; }
/* Show sun icon in dark mode (click to go light), moon in light mode */
body[data-theme="dark"] .theme-toggle .icon-dark { display: none; }
body[data-theme="dark"] .theme-toggle .icon-light { display: inline-flex; }
body[data-theme="dark"] .theme-toggle .label-dark { display: none; }
body[data-theme="dark"] .theme-toggle .label-light { display: inline; }
body:not([data-theme="dark"]) .theme-toggle .icon-light { display: none; }
body:not([data-theme="dark"]) .theme-toggle .icon-dark { display: inline-flex; }
body:not([data-theme="dark"]) .theme-toggle .label-light { display: none; }
body:not([data-theme="dark"]) .theme-toggle .label-dark { display: inline; }
@media print {
  .theme-toggle { display: none !important; }
}

/* ============================================================
   LAYOUT: fixed sidebar TOC + main column
============================================================ */
.app {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
  background: var(--canvas);
  color: var(--ink);
}

.toc {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 32px 28px;
  border-right: 1px solid var(--rule);
  display: flex;
  flex-direction: column;
  gap: 24px;
  background: var(--canvas);
  z-index: 50;
}
.toc .mark {
  display: flex; align-items: center; gap: 10px;
}
.toc .mark svg { width: 22px; height: 22px; }
.toc .mark-text { font-weight: 600; font-size: 13px; letter-spacing: -0.01em; }
.toc .mark-sub { font-size: 11px; color: var(--ink-subtle); letter-spacing: 0.02em; text-transform: uppercase; }

.toc ol {
  list-style: none; padding: 0; margin: 0;
  display: flex; flex-direction: column; gap: 2px;
  font-size: 13px;
  flex: 1;
  overflow-y: auto;
}
.toc ol li a {
  display: flex;
  gap: 10px;
  padding: 6px 8px;
  border-radius: 6px;
  color: var(--ink-muted);
  text-decoration: none;
  align-items: baseline;
  transition: all 140ms var(--ease-out);
}
.toc ol li a:hover { background: rgba(16,16,15,0.06); color: var(--ink); }
.toc ol li a.active {
  background: var(--ink);
  color: var(--canvas);
}
.toc ol li a.active .num { color: var(--accent-text); }
.toc ol li a .num {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--ink-subtle);
  min-width: 22px;
}
.toc ol li a.section-break {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--rule);
  pointer-events: none;
  color: var(--ink-subtle);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.toc .foot {
  font-size: 10px;
  color: var(--ink-subtle);
  line-height: 1.5;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  font-family: var(--font-mono);
}

.toc .dir-toggle {
  display: flex;
  border: 1px solid var(--rule-strong);
  border-radius: 999px;
  padding: 3px;
  gap: 2px;
  background: var(--paper);
}
.toc .dir-toggle button {
  flex: 1;
  padding: 6px 10px;
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-radius: 999px;
  color: var(--ink-muted);
  font-weight: 600;
}
.toc .dir-toggle button.on {
  background: var(--ink);
  color: var(--canvas);
}

/* ============================================================
   MAIN
============================================================ */
.main { min-width: 0; }

section.spread {
  /* Spreads size to content (no forced 100vh dead space). Cover keeps its own height
     via #cover.spread further down. */
  min-height: auto;
  padding: 96px 96px 96px;
  border-bottom: 1px solid var(--rule);
  position: relative;
  overflow: hidden;
}
#cover.spread { min-height: 100vh; }
/* Always-dark spread — regardless of body theme. Overrides the
   legacy --ink/--rule tokens so existing markup reads correctly. */
section.spread.dark {
  background: #10100f;                      /* neutral-950 Ink */
  color: #f5f5f4;                           /* neutral-100 */
  --ink:         #f5f5f4;                   /* text-primary (flipped) */
  --ink-muted:   #d6d6d6;                   /* neutral-300 — text-secondary */
  --ink-subtle:  #a6a6a5;                   /* neutral-400 — text-tertiary */
  --rule:        rgba(255,255,255,0.10);    /* opaque-w-10 */
  --rule-strong: rgba(255,255,255,0.20);
  --paper:       #1f1f1f;                   /* neutral-900 widget */
  /* Lime inside always-dark spread is the pale hero, not olive */
  --lime-deep:   #dff693;                   /* lime-200 — accent text */
  --accent-text: #dff693;
}
section.spread.dark.lime-canvas {
  background: #dff693;                      /* Uare Green */
  color: #10100f;
  --ink:         #10100f;
  --ink-muted:   #434342;
  --ink-subtle:  #575756;
  --rule:        rgba(16,16,15,0.15);
  --paper:       #fafafa;
  --lime-deep:   #545f32;                   /* lime-800 for contrast on lime bg */
  --accent-text: #545f32;
}

.spread-meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-subtle);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding-bottom: 18px;
  margin-bottom: 36px;
  border-bottom: 1px solid var(--rule);
}
.spread-meta .num {
  font-weight: 500;
  color: var(--ink-muted);
}
.spread-meta .chapter { color: var(--lime-dark); }
section.spread.dark .spread-meta .chapter { color: var(--accent-text); }

.kicker {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-subtle);
  margin-bottom: 18px;
  display: flex; align-items: center; gap: 12px;
}
.kicker::before {
  content: "";
  display: inline-block;
  width: 8px; height: 8px;
  background: var(--lime-deep);
  border-radius: 999px;
}
section.spread.dark .kicker::before { background: var(--lime); }

.display-xl {
  font-weight: 700;
  font-size: clamp(72px, 10vw, 168px);
  line-height: 0.92;
  letter-spacing: -0.045em;
  margin: 0;
}
.display-lg {
  font-weight: 700;
  font-size: clamp(56px, 7vw, 104px);
  line-height: 0.95;
  letter-spacing: -0.04em;
  margin: 0;
}
.display-md {
  font-weight: 600;
  font-size: clamp(40px, 5vw, 72px);
  line-height: 1.02;
  letter-spacing: -0.03em;
  margin: 0;
}
.display-sm {
  font-weight: 600;
  font-size: clamp(28px, 3.2vw, 44px);
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin: 0;
}
.body-lg {
  font-size: 20px;
  line-height: 1.45;
  letter-spacing: -0.005em;
  max-width: 62ch;
}
.body-md {
  font-size: 16px;
  line-height: 1.55;
  max-width: 64ch;
}

em.serif, .serif {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
}

.lime-highlight {
  background: var(--lime);
  color: #10100F;
  padding: 0 0.08em;
  border-radius: 4px;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

/* ============================================================
   COVER — animated intro
============================================================ */
#cover.spread {
  min-height: 100vh;
  padding: 0;
  background: var(--canvas);
  color: var(--ink);
  display: grid;
  place-items: center;
  overflow: hidden;
}
.cover-stage {
  position: relative;
  width: 100%;
  height: 100vh;
  display: grid;
  place-items: center;
}
.cover-wedge {
  position: relative;
  z-index: 4;
  text-align: center;
  mix-blend-mode: multiply;
}
.cover-wedge .sup {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-muted);
  opacity: 0;
  animation: fadeUp 600ms var(--ease-out) 1500ms forwards;
  margin-bottom: 24px;
}
.cover-wedge h1 {
  font-weight: 700;
  font-size: clamp(80px, 13vw, 220px);
  line-height: 0.88;
  letter-spacing: -0.05em;
  margin: 0;
}
.cover-wedge h1 .word {
  display: inline-block;
  opacity: 0;
  transform: translateY(40px);
  animation: wordIn 800ms var(--ease-out) forwards;
}
.cover-wedge h1 .word.italic {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  color: var(--accent-text);
  letter-spacing: -0.03em;
}
body[data-dir="editorial"] .cover-wedge h1 .word.italic { color: #8A6A2C; }
.cover-wedge h1 .word:nth-child(1) { animation-delay: 300ms; }
.cover-wedge h1 .word:nth-child(2) { animation-delay: 500ms; }
.cover-wedge h1 .word:nth-child(3) { animation-delay: 700ms; }
.cover-wedge h1 .word:nth-child(4) { animation-delay: 900ms; }
.cover-wedge h1 .word:nth-child(5) { animation-delay: 1100ms; }

.cover-wedge .sub {
  font-size: 18px;
  color: var(--ink-muted);
  margin-top: 32px;
  opacity: 0;
  animation: fadeUp 600ms var(--ease-out) 1800ms forwards;
}
.cover-wedge .period {
  color: var(--accent-text);
}

.cover-burst {
  position: absolute;
  color: var(--accent-text);
}
.cover-burst svg { width: 100%; height: 100%; display: block; }
.cover-burst.b1 { top: -200px; left: -200px; width: 720px; height: 720px; transform: rotate(-20deg); opacity: 0; animation: burstIn 1200ms var(--ease-out) 0ms forwards; }
.cover-burst.b2 { bottom: -260px; right: -240px; width: 820px; height: 820px; transform: rotate(30deg); opacity: 0; animation: burstIn 1200ms var(--ease-out) 200ms forwards; }
.cover-burst.b3 { top: 30%; right: 8%; width: 180px; height: 180px; color: var(--orange); transform: rotate(10deg); opacity: 0; animation: burstIn 1200ms var(--ease-out) 600ms forwards; }
.cover-burst.b4 { bottom: 22%; left: 10%; width: 140px; height: 140px; color: var(--yellow); opacity: 0; animation: burstIn 1200ms var(--ease-out) 800ms forwards; }
.cover-burst.b5 { top: 14%; left: 42%; width: 90px; height: 90px; color: var(--pink); opacity: 0; animation: burstIn 1200ms var(--ease-out) 1000ms forwards; }

.cover-chrome {
  position: absolute;
  display: flex;
  justify-content: space-between;
  inset: 40px 40px auto 40px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-muted);
  z-index: 5;
}
.cover-foot {
  position: absolute;
  display: flex;
  justify-content: space-between;
  inset: auto 40px 40px 40px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-muted);
  z-index: 5;
}

/* ============================================================
   Cover — logo + taped Polaroid collage
============================================================ */
.cover-logo {
  z-index: 6;
  mix-blend-mode: normal;
  display: grid;
  place-items: center;
  padding: 64px 80px;
  background: rgba(249, 249, 247, 0.82);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border-radius: 32px;
  box-shadow: 0 24px 60px rgba(25, 25, 24, 0.08);
}
.cover-logo-img {
  width: clamp(360px, 42vw, 640px);
  height: auto;
  display: block;
  opacity: 0;
  animation: fadeUp 800ms var(--ease-out) 400ms forwards;
}
.cover-subtitle {
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: clamp(15px, 1.4vw, 19px);
  line-height: 1;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent-text);  /* olive light, pale lime dark — visible both modes */
  margin-top: 28px;
  text-align: center;
  opacity: 0;
  animation: fadeUp 800ms var(--ease-out) 900ms forwards;
}
.cover-subtitle em {
  font-style: italic;
  font-weight: 500;
}

.cover-polaroids {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  overflow: hidden;
}
.cover-polaroids .pola {
  position: absolute;
  width: clamp(160px, 14vw, 220px);
  height: auto;
  padding: 10px 10px 44px 10px;
  background: #FFFFFF;
  box-shadow:
    0 16px 28px rgba(25, 25, 24, 0.18),
    0 4px 8px rgba(25, 25, 24, 0.10);
  opacity: 0;
  transform: rotate(var(--r, 0deg)) translateY(20px);
  animation: polaIn 900ms var(--ease-out) forwards;
}
/* Cellophane tape strip on each Polaroid */
.cover-polaroids .pola::before {
  content: "";
  position: absolute;
  top: -14px;
  left: 50%;
  transform: translateX(-50%) rotate(var(--tape-r, -6deg));
  width: 80px;
  height: 28px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.65) 0%, rgba(255, 255, 255, 0.35) 50%, rgba(255, 255, 255, 0.55) 100%);
  border-left: 1px dashed rgba(0, 0, 0, 0.06);
  border-right: 1px dashed rgba(0, 0, 0, 0.06);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
  filter: blur(0.2px);
  pointer-events: none;
}
/* Hero Polaroid — centered, developing animation
   Override .pola padding/background since Photo-4.png already includes
   the full polaroid frame (white border + black square + caption). */
.cover-polaroids .pola-anchor {
  width: clamp(180px, 21vw, 280px);
  top: 50%;
  left: 50%;
  padding: 0;
  background: transparent;
  --r: -2deg;
  --tape-r: 4deg;
  animation-delay: 320ms;
  margin: 0;
}
/* Hero polaroid uses 4-corner tape (defined via .tape spans), not the top-center strip. */
.cover-polaroids .pola-anchor::before { display: none; }
.cover-polaroids .pola-anchor .tape {
  position: absolute;
  width: 56px;
  height: 22px;
  background: linear-gradient(180deg, rgba(255,255,255,0.65) 0%, rgba(255,255,255,0.35) 50%, rgba(255,255,255,0.55) 100%);
  border-left: 1px dashed rgba(0,0,0,0.06);
  border-right: 1px dashed rgba(0,0,0,0.06);
  box-shadow: 0 2px 4px rgba(0,0,0,0.08);
  filter: blur(0.2px);
  pointer-events: none;
  z-index: 5;
}
/* Each corner: tape juts out diagonally past the polaroid edge.
   Rotation aims along the corner diagonal so the strip "tapes down" toward center. */
.cover-polaroids .pola-anchor .tape-tl {
  top: -10px;  left: -18px;  transform: rotate(-42deg); transform-origin: center;
}
.cover-polaroids .pola-anchor .tape-tr {
  top: -10px;  right: -18px; transform: rotate(42deg);  transform-origin: center;
}
.cover-polaroids .pola-anchor .tape-bl {
  bottom: -10px; left: -18px;  transform: rotate(42deg);  transform-origin: center;
}
.cover-polaroids .pola-anchor .tape-br {
  bottom: -10px; right: -18px; transform: rotate(-42deg); transform-origin: center;
}
@keyframes polaInCenter {
  0%   { opacity: 0; transform: translate(-50%, -50%) rotate(var(--r, 0deg)) scale(0.96); }
  100% { opacity: 1; transform: translate(-50%, -50%) rotate(var(--r, 0deg)) scale(1); }
}
.cover-polaroids .pola-anchor {
  animation-name: polaInCenter;
}
.cover-polaroids .pola-anchor img {
  display: block;
  width: 100%;
  height: auto;
}

/* Developing-film noise overlay — covers the black square exactly.
   Photo-4.png is 1207×1661. Black square: y 58→1188, x 73→1132.
   So as % of image: top 3.5%, left 6%, right 6%, bottom 28.5%.
   Now that .pola-anchor has no padding, figure ≡ image, percentages
   map directly. */
.pola-developing { position: relative; }
.pola-developing .develop-noise {
  position: absolute;
  top: 3.5%;
  left: 6%;
  right: 6%;
  bottom: 28.5%;
  background-image:
    url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.95' numOctaves='3' stitchTiles='stitch' seed='4'/%3E%3CfeColorMatrix values='0 0 0 0 0.92  0 0 0 0 0.96  0 0 0 0 0.58  0 0 0 0.7 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 240px 240px;
  mix-blend-mode: screen;
  opacity: 0.42;
  pointer-events: none;
  animation: developFilm 3.6s ease-in-out infinite;
}
@keyframes developFilm {
  0%, 100% { opacity: 0.42; background-position: 0 0; }
  33%      { opacity: 0.18; background-position: 4px -3px; }
  66%      { opacity: 0.30; background-position: -3px 5px; }
}

@keyframes polaIn {
  0%   { opacity: 0; transform: rotate(var(--r, 0deg)) translateY(20px); }
  100% { opacity: 1; transform: rotate(var(--r, 0deg)) translateY(0); }
}

@keyframes burstIn {
  0% { opacity: 0; transform: rotate(var(--r, 0deg)) scale(0.6); }
  100% { opacity: 1; transform: rotate(var(--r, 0deg)) scale(1); }
}
@keyframes wordIn {
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes spin { from { transform: rotate(0); } to { transform: rotate(360deg); } }

/* ============================================================
   Reusable chunks
============================================================ */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 64px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }

.rule { height: 1px; background: var(--rule); border: none; margin: 32px 0; }

.card {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 24px;
  padding: 32px;
}
section.spread.dark .card { background: #1F1F1E; }

.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--canvas);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.pill.lime { background: var(--lime); color: #10100F; }
.pill.outline { background: transparent; border: 1px solid var(--rule-strong); color: var(--ink-muted); }

/* SWATCH */
.swatch {
  border-radius: 16px;
  border: 1px solid var(--rule);
  overflow: hidden;
  transition: transform 200ms var(--ease-out);
  cursor: pointer;
}
.swatch:hover { transform: translateY(-2px); }
.swatch .chip {
  height: 180px;
  display: flex; align-items: flex-end;
  padding: 16px;
}
.swatch .chip-label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(255,255,255,0.9);
  color: #10100F;
}
.swatch .meta {
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  background: var(--paper);
  font-size: 13px;
}
.swatch .meta .name { font-weight: 600; }
.swatch .meta .code { font-family: var(--font-mono); color: var(--ink-subtle); font-size: 11px; }

/* TOAST */
.toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translate(-50%, 20px);
  background: var(--dark);
  color: var(--accent-text);
  padding: 12px 20px;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  opacity: 0;
  pointer-events: none;
  z-index: 100;
  transition: all 240ms var(--ease-out);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* PRINT */
@media print {
  .toc, .floating-chip, .toast, #cover .cover-chrome, #cover .cover-foot { display: none !important; }
  .app { display: block; }
  section.spread {
    width: 1920px;
    height: 1080px;
    min-height: 0;
    page-break-after: always;
    overflow: hidden;
    padding: 72px 96px;
    border: none;
  }
  @page { size: 1920px 1080px; margin: 0; }
  html, body { background: var(--canvas); }
}
