/* ============================================================
   Stacy blog — standalone stylesheet for the server-rendered
   blog pages (no React bundle). Tokens + animation system mirror
   src/styles/tokens.css and src/styles/base.css (amber signature,
   deep-dark default, warm-paper light theme, reveal system gated
   behind html.js with a killswitch) — keep in sync when the
   design system changes.
   ============================================================ */

@font-face {
  font-family: 'Space Grotesk';
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url('/fonts/space-grotesk-var.woff2') format('woff2');
}
@font-face {
  font-family: 'Spline Sans';
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url('/fonts/spline-sans-var.woff2') format('woff2');
}
@font-face {
  font-family: 'Spline Sans Mono';
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url('/fonts/spline-sans-mono-var.woff2') format('woff2');
}

:root {
  --amber: #ffd54a;
  --amber-bright: #ffd54a;
  --amber-deep: #f2a900;
  --amber-ink: #231a00;
  --bg: #07070b;
  --bg-2: #0c0c13;
  --surface: #12121c;
  --surface-2: #181826;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.16);
  --fg: #f4f4f8;
  --fg-dim: #b6b6c6;
  --fg-faint: #7c7c90;
  --purple-soft: #cbb3ff;
  --tint-1: rgba(255, 255, 255, 0.04);
  --tint-2: rgba(255, 255, 255, 0.06);
  --tint-3: rgba(255, 255, 255, 0.09);
  --font-sans: 'Spline Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, Roboto, Helvetica, Arial, sans-serif;
  --font-display: 'Space Grotesk', var(--font-sans);
  --font-mono: 'Spline Sans Mono', ui-monospace, 'SF Mono', SFMono-Regular, Menlo, Consolas, monospace;
  --maxw: 760px;
  --maxw-wide: 1100px;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring: cubic-bezier(0.2, 0.9, 0.3, 1.2);
  --shadow-md: 0 10px 30px rgba(0, 0, 0, 0.32), 0 2px 6px rgba(0, 0, 0, 0.22);
  --shadow-lg: 0 18px 48px rgba(0, 0, 0, 0.45), 0 2px 6px rgba(0, 0, 0, 0.3);
  --glow-amber: 0 20px 60px -10px rgba(242, 169, 0, 0.45);
  --glow-amber-strong: 0 26px 70px -8px rgba(242, 169, 0, 0.6);
  --grad-text: linear-gradient(100deg, var(--fg) 0%, var(--amber) 55%, var(--amber-deep) 100%);
  color-scheme: dark;
}

[data-theme='light'] {
  --amber: #ef9d00;
  --amber-bright: #ffd54a;
  --amber-deep: #e08e00;
  --bg: #f6f4ee;
  --bg-2: #ffffff;
  --surface: #ffffff;
  --surface-2: #f1eee5;
  --line: rgba(34, 26, 10, 0.1);
  --line-strong: rgba(34, 26, 10, 0.17);
  --fg: #1c1812;
  --fg-dim: #54504a;
  --fg-faint: #8a8478;
  --purple-soft: #6a3fd6;
  --tint-1: rgba(28, 22, 10, 0.04);
  --tint-2: rgba(28, 22, 10, 0.06);
  --tint-3: rgba(28, 22, 10, 0.1);
  --shadow-md: 0 6px 18px rgba(34, 26, 10, 0.09), 0 1px 3px rgba(34, 26, 10, 0.06);
  --shadow-lg: 0 14px 36px rgba(34, 26, 10, 0.12), 0 2px 6px rgba(34, 26, 10, 0.07);
  --glow-amber: 0 16px 44px -14px rgba(224, 142, 0, 0.4);
  --glow-amber-strong: 0 22px 56px -12px rgba(224, 142, 0, 0.52);
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

.b-body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

.b-wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 20px;
}
.b-hero-wide {
  max-width: var(--maxw-wide);
}

a {
  color: var(--amber);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}
::selection {
  background: var(--amber);
  color: var(--amber-ink);
}

/* ============================================================
   Reveal / entrance system — vanilla port of base.css. Gated
   behind html.js; .anim-done killswitch + reduced-motion guard
   guarantee content can never strand invisible.
   ============================================================ */
.js .reveal {
  opacity: 0;
  transform: translateY(34px);
  transition: opacity 0.8s var(--ease-out), transform 0.8s var(--ease-out);
}
.js .reveal.in {
  opacity: 1;
  transform: none;
}
.js .reveal.d1 { transition-delay: 0.08s; }
.js .reveal.d2 { transition-delay: 0.16s; }
.js .reveal.d3 { transition-delay: 0.24s; }
.js .reveal.d4 { transition-delay: 0.32s; }
.js .zoom {
  opacity: 0;
  transform: scale(0.92);
  transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-spring);
}
.js .zoom.in {
  opacity: 1;
  transform: none;
}
/* transform-only rise (opacity stays 1 → never strands hidden) */
.js .h-rise {
  transform: translateY(26px);
  transition: transform 0.7s var(--ease-out);
}
.js .h-rise.in {
  transform: none;
}
.js .h-rise + .h-rise { transition-delay: 0.08s; }
.js .h-rise + .h-rise + .h-rise { transition-delay: 0.16s; }
.js .h-rise + .h-rise + .h-rise + .h-rise { transition-delay: 0.24s; }

.js.anim-done .reveal,
.js.anim-done .zoom,
.js.anim-done .h-rise {
  opacity: 1 !important;
  transform: none !important;
  transition: none !important;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
  .js .reveal, .js .zoom, .js .h-rise {
    opacity: 1 !important;
    transform: none !important;
  }
}

/* ---- Reading progress (amber hairline, like the SPA) ---- */
.b-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 100%;
  transform: scaleX(0);
  transform-origin: left;
  background: linear-gradient(90deg, var(--amber-bright), var(--amber-deep));
  z-index: 200;
}

/* ---- Chrome ---- */
.b-nav {
  position: sticky;
  top: 0;
  z-index: 150;
  background: rgba(7, 7, 11, 0.72);
  backdrop-filter: blur(14px) saturate(160%);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  border-bottom: 1px solid var(--line);
}
[data-theme='light'] .b-nav {
  background: rgba(246, 244, 238, 0.8);
}
.b-nav-in {
  display: flex;
  align-items: center;
  gap: 22px;
  height: 64px;
  max-width: var(--maxw-wide);
}
.b-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 19px;
  color: var(--fg);
}
.b-brand:hover {
  text-decoration: none;
}
.b-brand img {
  transition: transform 0.4s var(--ease-spring);
}
.b-brand:hover img {
  transform: rotate(-10deg) scale(1.08);
}
.b-nav-links {
  display: flex;
  gap: 26px;
  margin-left: auto;
}
.b-nav-links a {
  color: var(--fg-dim);
  font-weight: 500;
  font-size: 15px;
  position: relative;
  transition: color 0.15s;
}
.b-nav-links a::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -5px;
  width: 100%;
  height: 2px;
  background: var(--amber);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s var(--ease-out);
}
.b-nav-links a:hover {
  color: var(--fg);
  text-decoration: none;
}
.b-nav-links a:hover::after {
  transform: scaleX(1);
}

/* Amber pill CTA with the signature sheen sweep. */
.b-cta {
  position: relative;
  overflow: hidden;
  display: inline-block;
  background: linear-gradient(180deg, var(--amber-bright) 0%, var(--amber-deep) 100%);
  color: var(--amber-ink);
  font-weight: 600;
  font-size: 14px;
  padding: 9px 18px;
  border-radius: 999px;
  white-space: nowrap;
  box-shadow: var(--glow-amber);
  transition: box-shadow 0.25s, transform 0.25s var(--ease-out);
}
.b-cta:hover {
  text-decoration: none;
  box-shadow: var(--glow-amber-strong);
  transform: translateY(-2px);
}
.b-cta::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(120deg, transparent 30%, rgba(255, 255, 255, 0.35) 50%, transparent 70%);
  transform: translateX(-120%);
}
.b-cta:hover::after {
  animation: sheen 0.8s var(--ease-out);
}
@keyframes sheen {
  to {
    transform: translateX(120%);
  }
}
.b-cta-lg {
  padding: 13px 26px;
  font-size: 16px;
}
.b-cta-ghost {
  display: inline-block;
  border: 1px solid var(--line-strong);
  background: var(--tint-1);
  color: var(--fg);
  font-weight: 600;
  font-size: 15px;
  padding: 12px 24px;
  border-radius: 999px;
  transition: background 0.15s, transform 0.25s var(--ease-out);
}
.b-cta-ghost:hover {
  background: var(--tint-3);
  transform: translateY(-2px);
  text-decoration: none;
}

.b-footer {
  border-top: 1px solid var(--line);
  margin-top: 80px;
  padding: 30px 0 44px;
  color: var(--fg-faint);
  font-size: 14px;
}
.b-footer-in {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
  justify-content: space-between;
  max-width: var(--maxw-wide);
}
.b-footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
}
.b-footer-links a {
  color: var(--fg-dim);
}
.b-footer-links a:hover {
  color: var(--fg);
  text-decoration: none;
}

/* ---- Hub hero (glow orb + gradient headline, like the landing) ---- */
.b-main {
  padding: 0 0 20px;
}
.b-hero {
  position: relative;
  overflow: hidden;
  padding: 72px 0 30px;
}
.b-hero-glow {
  position: absolute;
  left: 50%;
  top: -40%;
  width: 80vw;
  height: 60vw;
  max-width: 1100px;
  max-height: 820px;
  transform: translateX(-50%);
  background: radial-gradient(circle, rgba(242, 169, 0, 0.16), transparent 60%);
  filter: blur(40px);
  pointer-events: none;
  animation: heroGlow 9s ease-in-out infinite;
}
@keyframes heroGlow {
  50% {
    opacity: 0.65;
  }
}
.b-hero .b-wrap {
  position: relative;
  z-index: 2;
}
.b-grad {
  background: var(--grad-text);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.b-crumbs {
  font-size: 13px;
  color: var(--fg-faint);
  margin: 34px 0 22px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.b-hero .b-crumbs {
  margin-top: 0;
}
.b-crumbs a {
  color: var(--fg-dim);
}
h1 {
  font-family: var(--font-display);
  font-size: clamp(34px, 6vw, 58px);
  line-height: 1.06;
  letter-spacing: -0.02em;
  margin: 0 0 16px;
}
.b-lead {
  color: var(--fg-dim);
  font-size: 19px;
  max-width: 640px;
  margin: 0 0 10px;
}
.b-eyebrow {
  color: var(--amber);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 12px;
  font-weight: 600;
  margin: 0 0 14px;
}
.b-byline {
  color: var(--fg-faint);
  font-size: 14px;
  margin: 4px 0 0;
}

/* ---- Hub groups + cards ---- */
.b-group {
  margin-top: 56px;
}
.b-group h2 {
  font-family: var(--font-display);
  font-size: 26px;
  letter-spacing: -0.01em;
  margin: 0 0 6px;
}
.b-group-desc {
  color: var(--fg-dim);
  margin: 0 0 20px;
}
.b-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 18px;
}
.b-card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  color: var(--fg);
  transition: border-color 0.25s, transform 0.35s var(--ease-out), box-shadow 0.35s;
}
.b-card:hover {
  text-decoration: none;
  border-color: rgba(242, 169, 0, 0.4);
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}
.b-card-art {
  display: block;
  aspect-ratio: 40 / 19;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
}
.b-card-art svg {
  display: block;
  width: 100%;
  height: 100%;
  transition: transform 0.6s var(--ease-out);
}
.b-card:hover .b-card-art svg {
  transform: scale(1.045);
}
.b-card-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 18px;
}
.b-card-tags {
  color: var(--amber);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 11px;
  font-weight: 600;
}
.b-card h3 {
  font-family: var(--font-display);
  font-size: 18px;
  line-height: 1.3;
  margin: 0;
}
.b-card p {
  color: var(--fg-dim);
  font-size: 14px;
  line-height: 1.55;
  margin: 0;
}
.b-card-meta {
  color: var(--fg-faint);
  font-size: 13px;
  margin-top: 4px;
}

/* ---- Article ---- */
.b-article {
  padding-bottom: 24px;
}
.b-article-head {
  margin-bottom: 28px;
}
.b-cover {
  margin: 0 0 30px;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow-md);
}
.b-cover svg {
  display: block;
  width: 100%;
  height: auto;
}
.b-tldr {
  background: var(--tint-2);
  border: 1px solid var(--line);
  border-left: 3px solid var(--amber);
  border-radius: 10px;
  padding: 15px 18px;
  color: var(--fg-dim);
  margin: 0 0 28px;
}
.b-tldr strong {
  color: var(--fg);
}
.b-toc {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px 22px;
  margin: 0 0 32px;
  font-size: 15px;
}
.b-toc h2 {
  font-family: var(--font-display);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--fg-faint);
  margin: 0 0 8px;
}
.b-toc ol {
  margin: 0;
  padding-left: 20px;
}
.b-toc a {
  color: var(--fg-dim);
  transition: color 0.15s;
}
.b-toc a:hover {
  color: var(--amber);
  text-decoration: none;
}

.b-prose h2 {
  font-family: var(--font-display);
  font-size: 27px;
  letter-spacing: -0.01em;
  line-height: 1.2;
  margin: 46px 0 14px;
  position: relative;
}
.b-prose h3 {
  font-family: var(--font-display);
  font-size: 20px;
  margin: 34px 0 10px;
}
.b-prose p,
.b-prose li {
  color: var(--fg-dim);
}
.b-prose strong {
  color: var(--fg);
}
.b-prose ul,
.b-prose ol {
  padding-left: 24px;
}
.b-prose li {
  margin: 6px 0;
}
.b-prose li::marker {
  color: var(--amber);
}
.b-prose blockquote {
  border-left: 3px solid var(--amber);
  margin: 20px 0;
  padding: 4px 0 4px 18px;
  color: var(--fg-dim);
  font-style: italic;
}
.b-prose code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: var(--tint-2);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 1px 6px;
}
.b-prose pre {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
  overflow-x: auto;
}
.b-prose pre code {
  background: none;
  border: 0;
  padding: 0;
}
.b-prose table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
  margin: 20px 0;
}
.b-prose th,
.b-prose td {
  border: 1px solid var(--line);
  padding: 9px 12px;
  text-align: left;
}
.b-prose th {
  background: var(--tint-1);
  color: var(--fg);
  font-weight: 600;
}
.b-prose img {
  max-width: 100%;
  border-radius: 12px;
}
.b-prose hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 38px 0;
}
.b-prose a {
  border-bottom: 1px solid rgba(242, 169, 0, 0.35);
  transition: border-color 0.15s;
}
.b-prose a:hover {
  border-bottom-color: var(--amber);
  text-decoration: none;
}

/* ---- FAQ ---- */
.b-faq {
  margin-top: 50px;
}
.b-faq h2 {
  font-family: var(--font-display);
  font-size: 27px;
  margin: 0 0 16px;
}
.b-faq details {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 15px 20px;
  margin-bottom: 10px;
  color: var(--fg-dim);
  transition: border-color 0.2s;
}
.b-faq details:hover {
  border-color: var(--line-strong);
}
.b-faq details[open] {
  border-color: rgba(242, 169, 0, 0.4);
}
.b-faq summary {
  cursor: pointer;
  color: var(--fg);
  font-weight: 600;
  font-size: 16px;
  list-style: none;
  position: relative;
  padding-right: 28px;
}
.b-faq summary::-webkit-details-marker {
  display: none;
}
.b-faq summary::after {
  content: '+';
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  color: var(--amber);
  font-family: var(--font-display);
  font-size: 20px;
  transition: transform 0.25s var(--ease-out);
}
.b-faq details[open] summary::after {
  transform: translateY(-50%) rotate(45deg);
}
.b-faq details p {
  margin: 10px 0 2px;
}

/* ---- CTA box + related ---- */
.b-cta-box {
  position: relative;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid rgba(242, 169, 0, 0.35);
  border-radius: 20px;
  box-shadow: var(--shadow-md);
  padding: 34px 28px;
  margin-top: 56px;
  text-align: center;
}
.b-cta-glow {
  position: absolute;
  left: 50%;
  top: -60%;
  width: 480px;
  height: 320px;
  transform: translateX(-50%);
  background: radial-gradient(circle, rgba(242, 169, 0, 0.18), transparent 60%);
  filter: blur(30px);
  pointer-events: none;
}
.b-cta-box h2 {
  position: relative;
  font-family: var(--font-display);
  font-size: 24px;
  margin: 0 0 10px;
}
.b-cta-box p {
  position: relative;
  color: var(--fg-dim);
  margin: 0 0 6px;
}
.b-cta-actions {
  position: relative;
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 18px;
}
.b-related {
  margin-top: 56px;
}
.b-related h2 {
  font-family: var(--font-display);
  font-size: 26px;
  margin: 0 0 18px;
}

@media (max-width: 560px) {
  .b-nav-links {
    display: none;
  }
  .b-nav-in {
    justify-content: space-between;
  }
  .b-hero {
    padding-top: 48px;
  }
}
