/* =============================================================
   Cyclic BindCraft — Luxury scientific static site
   Pure static, no build step, hand-written CSS.
   Target: Cloudflare Pages.
   Design language: dark navy + gold + warm off-white, Cormorant
   Garamond + Inter + JetBrains Mono.
   ============================================================= */

/* -------------------------------------------------------------
   1. Design tokens (CSS custom properties)
   ------------------------------------------------------------- */

:root {
  /* Dark theme (default) */
  --bg-primary:      #0a0e1a;
  --bg-secondary:    #131829;
  --bg-elevated:     #1a2138;
  --bg-code:         #0d1117;
  --accent-gold:     #c9a961;
  --accent-gold-bright: #e6c878;
  --accent-copper:   #b87333;
  --accent-bronze:   #8c6a3f;
  --text-primary:    #e8e6e1;
  --text-secondary:  #b8b3a8;
  --text-tertiary:   #6b6862;
  --border-subtle:   rgba(201, 169, 97, 0.15);
  --border-strong:   rgba(201, 169, 97, 0.35);
  --success:         #5a8a6e;
  --warning:         #c9a961;
  --error:           #b85450;
  --info:            #6b8aa8;

  /* Typography */
  --font-serif:  'Cormorant Garamond', 'Playfair Display', Georgia, serif;
  --font-sans:   'Inter', -apple-system, system-ui, sans-serif;
  --font-mono:   'JetBrains Mono', 'Fira Code', 'SF Mono', monospace;

  /* Sizing */
  --maxw-prose:   72rem;
  --maxw-code:    64rem;
  --maxw-layout:  1200px;
  --nav-h:        72px;
  --radius:       4px;
  --radius-lg:    6px;

  /* Motion */
  --ease-lux:     cubic-bezier(0.16, 1, 0.3, 1);
  --dur-fast:     0.2s;
  --dur:          0.4s;
  --dur-slow:     0.8s;

  /* Shadow */
  --shadow-card:  0 8px 32px rgba(0,0,0,0.35);
  --shadow-lift:  0 12px 40px rgba(0,0,0,0.45);

  /* Layout padding */
  --section-pad:  clamp(4rem, 8vw, 8rem);
  --card-pad:     clamp(1.75rem, 3vw, 2.75rem);
}

[data-theme="light"] {
  --bg-primary:      #faf8f3;
  --bg-secondary:    #ffffff;
  --bg-elevated:     #f5f1e8;
  --bg-code:         #f7f4ed;
  --accent-gold:     #a8893f;
  --accent-gold-bright: #c9a961;
  --accent-copper:   #8a5a23;
  --accent-bronze:   #6b4f2a;
  --text-primary:    #1a1612;
  --text-secondary:  #4a443c;
  --text-tertiary:   #8a857c;
  --border-subtle:   rgba(168, 137, 63, 0.2);
  --border-strong:   rgba(168, 137, 63, 0.45);
  --shadow-card:  0 8px 32px rgba(60,40,15,0.08);
  --shadow-lift:  0 12px 40px rgba(60,40,15,0.12);
}

/* -------------------------------------------------------------
   2. Reset & base
   ------------------------------------------------------------- */

*, *::before, *::after { box-sizing: border-box; }

html {
  font-size: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 1rem);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.7;
  color: var(--text-primary);
  background: var(--bg-primary);
  font-weight: 300;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color var(--dur) var(--ease-lux),
              color var(--dur) var(--ease-lux);
  overflow-x: hidden;
}

body.site {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

main.site-main { flex: 1 0 auto; }
footer { flex-shrink: 0; }

img, svg { max-width: 100%; height: auto; display: block; }
img { border-style: none; }

a {
  color: var(--accent-gold-bright);
  text-decoration: none;
  transition: color var(--dur-fast) var(--ease-lux);
}
a:hover { color: var(--accent-gold); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:focus-visible { outline: 2px solid var(--accent-gold); outline-offset: 3px; }

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

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-serif);
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.005em;
  margin: 0 0 0.6em;
  color: var(--text-primary);
}

h1 { font-size: clamp(2.5rem, 6vw, 5rem); font-weight: 600; }
h2 { font-size: clamp(2rem, 4vw, 3.25rem); font-weight: 500; }
h3 { font-size: clamp(1.4rem, 2.5vw, 1.85rem); font-weight: 500; }
h4 { font-size: 1.25rem; font-weight: 500; }
h5 { font-size: 1.05rem; font-weight: 600; }

p { margin: 0 0 1.2rem; }

ul, ol { margin: 0 0 1.2rem; padding-left: 1.4rem; }
li { margin-bottom: 0.4rem; }

hr {
  border: none;
  height: 1px;
  background: linear-gradient(to right, transparent, var(--accent-gold) 30%, var(--accent-gold) 70%, transparent);
  opacity: 0.3;
  margin: var(--section-pad) 0;
}

::selection {
  background: rgba(201, 169, 97, 0.3);
  color: var(--text-primary);
}

/* -------------------------------------------------------------
   3. Layout primitives
   ------------------------------------------------------------- */

.container {
  width: 100%;
  max-width: var(--maxw-layout);
  margin-inline: auto;
  padding-inline: clamp(1.25rem, 4vw, 2.5rem);
}
.container-prose { max-width: var(--maxw-prose); }
.container-code  { max-width: var(--maxw-code); }

.section {
  padding: var(--section-pad) 0;
  position: relative;
}
.section--tight { padding: clamp(3rem, 5vw, 5rem) 0; }
.section--dark  { background: var(--bg-secondary); }
.section--elevated { background: var(--bg-elevated); }

.section-divider {
  height: 1px;
  background: linear-gradient(to right, transparent, var(--accent-gold) 50%, transparent);
  opacity: 0.3;
  margin: 0;
  border: none;
}

/* Eyebrow (small caps label above section heads) */
.eyebrow {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent-gold);
  margin: 0 0 1rem;
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
}
.eyebrow::before {
  content: '';
  display: inline-block;
  width: 24px;
  height: 1px;
  background: var(--accent-gold);
  opacity: 0.6;
}
.eyebrow--plain::before { display: none; }

/* Section number ornament (large gold serif numeral) */
.section-numeral {
  font-family: var(--font-serif);
  font-size: clamp(3.5rem, 8vw, 6rem);
  font-weight: 400;
  color: var(--accent-gold);
  line-height: 1;
  letter-spacing: -0.02em;
  display: block;
  margin-bottom: 0.5rem;
  opacity: 0.85;
}

.lead {
  font-family: var(--font-serif);
  font-size: clamp(1.15rem, 2vw, 1.4rem);
  font-style: italic;
  font-weight: 400;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 2rem;
}

.prose { font-size: 1.05rem; line-height: 1.75; color: var(--text-secondary); }
.prose p { color: var(--text-secondary); }
.prose strong { color: var(--text-primary); font-weight: 600; }

/* -------------------------------------------------------------
   4. Buttons
   ------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.85rem 1.75rem;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  border-radius: var(--radius);
  border: 1px solid transparent;
  text-decoration: none;
  transition: all var(--dur) var(--ease-lux);
  cursor: pointer;
  white-space: nowrap;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:focus-visible { outline: 2px solid var(--accent-gold); outline-offset: 3px; }

.btn--gold {
  background: linear-gradient(135deg, var(--accent-gold-bright) 0%, var(--accent-gold) 60%, var(--accent-bronze) 100%);
  color: #0a0e1a;
  border-color: var(--accent-gold);
  box-shadow: 0 4px 16px rgba(201, 169, 97, 0.18);
}
.btn--gold:hover {
  background: linear-gradient(135deg, #f4d896 0%, var(--accent-gold-bright) 60%, var(--accent-gold) 100%);
  box-shadow: 0 6px 22px rgba(201, 169, 97, 0.28);
}

.btn--ghost {
  background: transparent;
  color: var(--text-primary);
  border-color: var(--border-strong);
}
.btn--ghost:hover {
  border-color: var(--accent-gold);
  background: rgba(201, 169, 97, 0.06);
  color: var(--accent-gold-bright);
}

.btn--small { padding: 0.55rem 1.1rem; font-size: 0.85rem; }
.btn--block { display: flex; width: 100%; justify-content: center; }

.btn-group { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; }

/* -------------------------------------------------------------
   5. Site header / nav
   ------------------------------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10, 14, 26, 0.6);
  backdrop-filter: blur(0);
  border-bottom: 1px solid transparent;
  transition: background var(--dur) var(--ease-lux),
              backdrop-filter var(--dur) var(--ease-lux),
              border-color var(--dur) var(--ease-lux),
              height var(--dur) var(--ease-lux);
  height: var(--nav-h);
}
[data-theme="light"] .site-header { background: rgba(250, 248, 243, 0.6); }

.site-header.scrolled {
  background: rgba(10, 14, 26, 0.85);
  backdrop-filter: blur(16px) saturate(140%);
  border-bottom-color: var(--border-subtle);
  height: 60px;
}
[data-theme="light"] .site-header.scrolled { background: rgba(250, 248, 243, 0.92); }

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  max-width: var(--maxw-layout);
  margin-inline: auto;
  padding-inline: clamp(1.25rem, 4vw, 2.5rem);
  gap: 1rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--text-primary);
  flex-shrink: 0;
}
.brand:hover { text-decoration: none; color: var(--text-primary); }
.brand__logo {
  width: 36px;
  height: 36px;
  display: block;
}
.brand__wordmark {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--text-primary);
  line-height: 1;
}
.brand__tagline {
  display: none;
  font-family: var(--font-sans);
  font-size: 0.62rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--accent-gold);
  margin-top: 4px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav-links a {
  position: relative;
  display: inline-block;
  padding: 0.5rem 0.85rem;
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 400;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color var(--dur-fast) var(--ease-lux);
}
.nav-links a:hover { color: var(--text-primary); text-decoration: none; }
.nav-links a::after {
  content: '';
  position: absolute;
  left: 0.85rem;
  right: 0.85rem;
  bottom: 0.3rem;
  height: 1px;
  background: var(--accent-gold);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform var(--dur) var(--ease-lux);
}
.nav-links a.is-active { color: var(--text-primary); }
.nav-links a.is-active::after,
.nav-links a:hover::after { transform: scaleX(1); }

.nav-tools {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.theme-toggle {
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid var(--border-subtle);
  background: transparent;
  color: var(--text-secondary);
  transition: all var(--dur) var(--ease-lux);
}
.theme-toggle:hover { color: var(--accent-gold-bright); border-color: var(--accent-gold); }
.theme-toggle:focus-visible { outline: 2px solid var(--accent-gold); outline-offset: 2px; }
.theme-toggle__icon { width: 18px; height: 18px; display: block; }
[data-theme="dark"]  .theme-toggle__icon--sun  { display: block; }
[data-theme="dark"]  .theme-toggle__icon--moon { display: none; }
[data-theme="light"] .theme-toggle__icon--sun  { display: none; }
[data-theme="light"] .theme-toggle__icon--moon { display: block; }

.nav-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 1rem;
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  color: var(--text-primary);
  text-decoration: none;
  transition: all var(--dur) var(--ease-lux);
}
.nav-cta:hover {
  border-color: var(--accent-gold);
  background: rgba(201, 169, 97, 0.06);
  color: var(--accent-gold-bright);
  text-decoration: none;
}

/* Hamburger */
.nav-toggle {
  display: none;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--border-subtle);
  background: transparent;
  color: var(--text-primary);
  align-items: center;
  justify-content: center;
}
.nav-toggle__bars, .nav-toggle__bars::before, .nav-toggle__bars::after {
  display: block;
  width: 16px;
  height: 1.5px;
  background: currentColor;
  position: relative;
  transition: all var(--dur) var(--ease-lux);
}
.nav-toggle__bars::before, .nav-toggle__bars::after {
  content: '';
  position: absolute;
  left: 0;
}
.nav-toggle__bars::before { top: -5px; }
.nav-toggle__bars::after  { top:  5px; }
.nav-toggle.is-open .nav-toggle__bars { background: transparent; }
.nav-toggle.is-open .nav-toggle__bars::before { top: 0; transform: rotate(45deg); }
.nav-toggle.is-open .nav-toggle__bars::after  { top: 0; transform: rotate(-45deg); }

/* Mobile nav overlay */
.nav-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg-primary);
  z-index: 95;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  padding: 2rem;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-100%);
  transition: opacity var(--dur) var(--ease-lux), transform var(--dur) var(--ease-lux);
}
.nav-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}
.nav-overlay a {
  font-family: var(--font-serif);
  font-size: 2rem;
  font-weight: 500;
  color: var(--text-primary);
  text-decoration: none;
}
.nav-overlay a:hover { color: var(--accent-gold-bright); }
.nav-overlay .nav-overlay__tagline {
  font-family: var(--font-sans);
  font-size: 0.7rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--accent-gold);
  margin-bottom: 1rem;
}

/* -------------------------------------------------------------
   6. Hero
   ------------------------------------------------------------- */

.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  overflow: hidden;
  isolation: isolate;
  padding-top: var(--nav-h);
}
.hero--compact { min-height: 56vh; padding-top: calc(var(--nav-h) + 3rem); }

.hero__bg {
  position: absolute;
  inset: 0;
  z-index: -2;
  background-image: url('../img/hero.png');
  background-size: cover;
  background-position: center right;
  animation: hero-ken-burns 30s ease-in-out infinite alternate;
}
.hero--compact .hero__bg { background-position: center; animation: none; }

@keyframes hero-ken-burns {
  0%   { transform: scale(1.02) translate(0, 0); }
  100% { transform: scale(1.10) translate(-1%, -1%); }
}

.hero__overlay {
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(to right,
    rgba(10, 14, 26, 0.82) 0%,
    rgba(10, 14, 26, 0.68) 30%,
    rgba(10, 14, 26, 0.35) 60%,
    rgba(10, 14, 26, 0.05) 100%),
    linear-gradient(to bottom,
    rgba(10, 14, 26, 0.55) 0%,
    rgba(10, 14, 26, 0.10) 35%,
    rgba(10, 14, 26, 0.10) 65%,
    rgba(10, 14, 26, 0.55) 100%);
}
.hero--compact .hero__overlay {
  background: linear-gradient(to right,
    rgba(10, 14, 26, 0.78) 0%,
    rgba(10, 14, 26, 0.55) 50%,
    rgba(10, 14, 26, 0.45) 100%);
}

/* grain texture overlay (CSS-only noise) */
.hero__grain {
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: 0.04;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' /%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
}

.hero__content {
  position: relative;
  z-index: 1;
  max-width: 64rem;
  padding-top: 2rem;
  padding-bottom: 4rem;
}
.hero__eyebrow {
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--accent-gold);
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.85rem;
}
.hero__eyebrow::before {
  content: '';
  display: inline-block;
  width: 36px;
  height: 1px;
  background: var(--accent-gold);
  opacity: 0.7;
}
.hero__title {
  font-family: var(--font-serif);
  font-size: clamp(2.75rem, 7vw, 5.5rem);
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.015em;
  margin: 0 0 1.5rem;
  background: linear-gradient(135deg, #f4d896 0%, #c9a961 50%, #b87333 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero--compact .hero__title { font-size: clamp(2.25rem, 5vw, 3.75rem); -webkit-text-fill-color: var(--text-primary); background: none; }

.hero__subhead {
  font-family: var(--font-serif);
  font-size: clamp(1.1rem, 2vw, 1.45rem);
  font-style: italic;
  font-weight: 400;
  line-height: 1.5;
  color: var(--text-secondary);
  margin: 0 0 2.5rem;
  max-width: 48rem;
}
.hero--compact .hero__subhead { font-size: clamp(1rem, 1.6vw, 1.2rem); margin-bottom: 1.5rem; }

.hero__cta { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; margin-bottom: 2.5rem; }

.hero__caption {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-tertiary);
  letter-spacing: 0.04em;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.hero__caption::before {
  content: '';
  display: inline-block;
  width: 8px;
  height: 8px;
  border: 1px solid var(--accent-gold);
  border-radius: 50%;
}

/* Decorative corner marks on hero card frame */
.hero__frame {
  position: absolute;
  inset: 4rem;
  border: 1px solid var(--border-subtle);
  pointer-events: none;
  z-index: 0;
  opacity: 0.5;
}
.hero__frame::before, .hero__frame::after,
.hero__frame > span::before, .hero__frame > span::after {
  content: '';
  position: absolute;
  width: 24px;
  height: 24px;
  border: 1px solid var(--accent-gold);
  opacity: 0.7;
}
.hero__frame::before { top: -1px; left: -1px; border-right: none; border-bottom: none; }
.hero__frame::after  { top: -1px; right: -1px; border-left: none; border-bottom: none; }
.hero__frame > span::before { content: ''; position: absolute; bottom: -1px; left: -1px; width: 24px; height: 24px; border: 1px solid var(--accent-gold); border-right: none; border-top: none; opacity: 0.7; }
.hero__frame > span::after  { content: ''; position: absolute; bottom: -1px; right: -1px; width: 24px; height: 24px; border: 1px solid var(--accent-gold); border-left: none; border-top: none; opacity: 0.7; }

/* Rotating gold particle ring (decorative) */
.hero__ring {
  position: absolute;
  right: -8rem;
  top: 50%;
  transform: translateY(-50%);
  width: 38rem;
  height: 38rem;
  z-index: -1;
  opacity: 0.5;
  pointer-events: none;
  animation: slow-rotate 80s linear infinite;
}
@keyframes slow-rotate { from { transform: translateY(-50%) rotate(0deg); } to { transform: translateY(-50%) rotate(360deg); } }
.hero__ring svg { width: 100%; height: 100%; }

@media (max-width: 1024px) { .hero__ring { display: none; } .hero__frame { inset: 2rem; } }

/* -------------------------------------------------------------
   7. Cards
   ------------------------------------------------------------- */

.card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  padding: var(--card-pad);
  transition: transform var(--dur) var(--ease-lux),
              border-color var(--dur) var(--ease-lux),
              box-shadow var(--dur) var(--ease-lux);
  position: relative;
  display: flex;
  flex-direction: column;
}
.card:hover {
  transform: translateY(-2px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-lift);
}
.card--elevated { background: var(--bg-elevated); }
.card--plain { background: transparent; border: none; }
.card--hover-none:hover { transform: none; box-shadow: none; border-color: var(--border-subtle); }

.card__icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-gold);
  margin-bottom: 1.25rem;
  border: 1px solid var(--border-subtle);
  border-radius: 50%;
}
.card__icon svg { width: 22px; height: 22px; }

.card__title {
  font-family: var(--font-serif);
  font-size: 1.4rem;
  font-weight: 500;
  color: var(--text-primary);
  margin: 0 0 0.65rem;
}
.card__body {
  font-family: var(--font-sans);
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--text-secondary);
  margin: 0;
}

.card-grid { display: grid; gap: 1.5rem; }
.card-grid--2 { grid-template-columns: repeat(2, 1fr); }
.card-grid--3 { grid-template-columns: repeat(3, 1fr); }
.card-grid--4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 1024px) {
  .card-grid--4 { grid-template-columns: repeat(2, 1fr); }
  .card-grid--3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .card-grid--2, .card-grid--3, .card-grid--4 { grid-template-columns: 1fr; }
}

/* -------------------------------------------------------------
   8. Tables
   ------------------------------------------------------------- */

.table-wrap { overflow-x: auto; margin: 0 0 2rem; }

table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-sans);
  font-size: 0.92rem;
}
table th {
  font-family: var(--font-sans);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent-gold);
  text-align: left;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border-strong);
  background: transparent;
  white-space: nowrap;
}
table td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  vertical-align: top;
}
table tr:last-child td { border-bottom: none; }
table tr:hover td { background: rgba(201, 169, 97, 0.03); }
table td strong { color: var(--text-primary); font-weight: 600; }
table td code, table th code { font-family: var(--font-mono); font-size: 0.85em; color: var(--accent-gold-bright); background: rgba(201, 169, 97, 0.08); padding: 0.1em 0.4em; border-radius: 3px; }

/* Highlighted cells (cyclic advantage) */
.td-highlight { color: var(--accent-gold-bright); font-weight: 500; }
.td-highlight strong { color: var(--accent-gold-bright); }

/* -------------------------------------------------------------
   9. Code blocks & inline code
   ------------------------------------------------------------- */

code, kbd, samp {
  font-family: var(--font-mono);
  font-size: 0.92em;
}
:not(pre) > code {
  background: rgba(201, 169, 97, 0.08);
  color: var(--accent-gold-bright);
  padding: 0.15em 0.4em;
  border-radius: 3px;
  border: 1px solid var(--border-subtle);
  font-size: 0.85em;
}

pre {
  position: relative;
  background: var(--bg-code);
  border: 1px solid var(--border-subtle);
  border-left: 2px solid var(--accent-gold);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  overflow-x: auto;
  margin: 0 0 1.5rem;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.65;
  color: #d4d2cd;
  tab-size: 4;
}
pre code {
  background: transparent;
  color: inherit;
  padding: 0;
  border: none;
  font-size: inherit;
}

/* Prism overrides for luxury feel */
pre[class*="language-"] {
  background: var(--bg-code);
  padding: 1.25rem 1.5rem;
  margin: 0 0 1.5rem;
  border-radius: var(--radius);
  border: 1px solid var(--border-subtle);
  border-left: 2px solid var(--accent-gold);
}
code[class*="language-"] { font-family: var(--font-mono); font-size: 13px; line-height: 1.65; }
.token.comment, .token.prolog, .token.doctype, .token.cdata { color: #6b6862; font-style: italic; }
.token.punctuation { color: #b8b3a8; }
.token.property, .token.tag, .token.boolean, .token.number, .token.constant, .token.symbol { color: var(--accent-gold-bright); }
.token.selector, .token.attr-name, .token.string, .token.char, .token.builtin, .token.inserted { color: #5a8a6e; }
.token.operator, .token.entity, .token.url, .language-css .token.string, .style .token.string { color: #b8b3a8; }
.token.atrule, .token.attr-value, .token.keyword { color: var(--accent-gold); font-weight: 500; }
.token.function, .token.class-name { color: #e6c878; }
.token.regex, .token.important, .token.variable { color: #b87333; }
.token.deleted { color: var(--error); }

/* Copy button */
.copy-btn {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.7rem;
  font-family: var(--font-sans);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  background: rgba(10, 14, 26, 0.6);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  transition: all var(--dur-fast) var(--ease-lux);
  opacity: 0;
  z-index: 2;
}
pre:hover .copy-btn,
pre.copyable:focus-within .copy-btn { opacity: 1; }
.copy-btn:hover { color: var(--accent-gold-bright); border-color: var(--accent-gold); background: rgba(10, 14, 26, 0.85); }
.copy-btn.is-copied { color: var(--success); border-color: var(--success); }
.copy-btn svg { width: 12px; height: 12px; }

/* Code block header (filename label) */
.code-block {
  margin: 0 0 1.5rem;
  position: relative;
}
.code-block__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.55rem 1rem;
  background: rgba(13, 17, 23, 0.8);
  border: 1px solid var(--border-subtle);
  border-bottom: none;
  border-radius: var(--radius) var(--radius) 0 0;
  border-left: 2px solid var(--accent-gold);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-tertiary);
}
.code-block__header + pre {
  margin-top: 0;
  border-top-left-radius: 0;
  border-top-right-radius: 0;
  border-top: none;
  border-left: 2px solid var(--accent-gold);
}
.code-block__filename { display: flex; align-items: center; gap: 0.5rem; }
.code-block__filename::before {
  content: '';
  width: 8px;
  height: 8px;
  background: var(--accent-gold);
  border-radius: 50%;
  opacity: 0.7;
}

/* ASCII diagram block (pre without prism) */
.ascii {
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.45;
  color: var(--text-secondary);
  background: var(--bg-code);
  border: 1px solid var(--border-subtle);
  border-left: 2px solid var(--accent-copper);
  padding: 1.25rem 1.5rem;
  overflow-x: auto;
  white-space: pre;
  border-radius: var(--radius);
  margin: 0 0 1.5rem;
}

/* -------------------------------------------------------------
   10. Callouts
   ------------------------------------------------------------- */

.callout {
  display: flex;
  gap: 1rem;
  padding: 1.1rem 1.4rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  margin: 0 0 1.5rem;
  font-size: 0.95rem;
  line-height: 1.65;
  color: var(--text-secondary);
}
.callout--tip     { border-left: 3px solid var(--accent-gold); }
.callout--warning { border-left: 3px solid var(--accent-copper); }
.callout--info    { border-left: 3px solid var(--text-tertiary); }
.callout--error   { border-left: 3px solid var(--error); }
.callout__icon { flex-shrink: 0; width: 22px; height: 22px; color: var(--accent-gold); margin-top: 0.2rem; }
.callout--warning .callout__icon { color: var(--accent-copper); }
.callout--info    .callout__icon { color: var(--text-tertiary); }
.callout__title {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--text-primary);
  margin: 0 0 0.3rem;
}
.callout__body { margin: 0; }
.callout__body p:last-child { margin-bottom: 0; }
.callout__body code { font-size: 0.85em; }

/* -------------------------------------------------------------
   11. Stats band
   ------------------------------------------------------------- */

.stats-band {
  background: var(--bg-code);
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
  padding: clamp(3rem, 6vw, 5rem) 0;
}
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2rem;
  text-align: center;
}
@media (max-width: 768px) { .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 2.5rem 1.5rem; } }

.stat__numeral {
  font-family: var(--font-serif);
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 500;
  line-height: 1;
  color: var(--accent-gold);
  letter-spacing: -0.01em;
  margin-bottom: 0.5rem;
  display: block;
}
.stat__label {
  font-family: var(--font-sans);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-tertiary);
}

/* -------------------------------------------------------------
   12. Pipeline diagram block (SVG)
   ------------------------------------------------------------- */

.pipeline-svg {
  display: block;
  width: 100%;
  height: auto;
  max-width: 100%;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  background: var(--bg-code);
  margin: 0 0 2rem;
}

/* -------------------------------------------------------------
   13. Footer
   ------------------------------------------------------------- */

.site-footer {
  background: var(--bg-code);
  border-top: 1px solid var(--border-subtle);
  padding: clamp(3rem, 6vw, 4.5rem) 0 1.5rem;
  margin-top: 4rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 2.5rem;
  margin-bottom: 2.5rem;
}
@media (max-width: 768px) { .footer-grid { grid-template-columns: 1fr 1fr; gap: 2rem; } }
@media (max-width: 480px) { .footer-grid { grid-template-columns: 1fr; } }

.footer-brand { max-width: 28rem; }
.footer-brand__logo { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 1rem; }
.footer-brand__logo img { width: 36px; height: 36px; }
.footer-brand__name {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
}
.footer-brand__tag {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin: 0;
}

.footer-col__title {
  font-family: var(--font-sans);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent-gold);
  margin: 0 0 1rem;
}
.footer-col ul { list-style: none; padding: 0; margin: 0; }
.footer-col li { margin-bottom: 0.55rem; }
.footer-col a {
  font-family: var(--font-sans);
  font-size: 0.9rem;
  color: var(--text-secondary);
  text-decoration: none;
}
.footer-col a:hover { color: var(--accent-gold-bright); text-decoration: none; }

.footer-bottom {
  border-top: 1px solid var(--border-subtle);
  padding-top: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}
.footer-bottom__copy {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-tertiary);
  letter-spacing: 0.02em;
}
.footer-bottom__seal {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent-gold);
}
.footer-bottom__seal::before {
  content: '';
  display: inline-block;
  width: 12px;
  height: 12px;
  border: 1px solid var(--accent-gold);
  border-radius: 50%;
}

/* -------------------------------------------------------------
   14. CTA section
   ------------------------------------------------------------- */

.cta-section {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
  padding: var(--section-pad) 0;
  text-align: center;
}
.cta-section__title {
  font-family: var(--font-serif);
  font-size: clamp(2rem, 4vw, 3.25rem);
  font-weight: 500;
  color: var(--text-primary);
  margin: 0 0 1rem;
}
.cta-section__sub {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.2rem;
  color: var(--text-secondary);
  margin: 0 0 2.5rem;
}

/* -------------------------------------------------------------
   15. Tutorial / step cards
   ------------------------------------------------------------- */

.layout-with-sidebar {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 3rem;
  align-items: start;
}
@media (max-width: 1024px) { .layout-with-sidebar { grid-template-columns: 1fr; gap: 2rem; } }

.toc {
  position: sticky;
  top: calc(var(--nav-h) + 1.5rem);
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  padding: 1.5rem 1.25rem;
}
@media (max-width: 1024px) { .toc { position: static; } }

.toc__title {
  font-family: var(--font-sans);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent-gold);
  margin: 0 0 1rem;
}
.toc ol { list-style: none; padding: 0; margin: 0; counter-reset: toc; }
.toc li { margin-bottom: 0.45rem; counter-increment: toc; }
.toc a {
  display: flex;
  align-items: baseline;
  gap: 0.65rem;
  font-family: var(--font-sans);
  font-size: 0.85rem;
  color: var(--text-secondary);
  text-decoration: none;
  padding: 0.3rem 0;
  transition: color var(--dur-fast) var(--ease-lux);
  border-bottom: 1px solid transparent;
}
.toc a::before {
  content: counter(toc, decimal-leading-zero);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--accent-gold);
  opacity: 0.7;
}
.toc a:hover { color: var(--accent-gold-bright); text-decoration: none; }

.step {
  position: relative;
  padding: clamp(1.75rem, 3vw, 2.5rem);
  margin-bottom: 2rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  scroll-margin-top: calc(var(--nav-h) + 1.5rem);
}
.step__head { display: flex; align-items: baseline; gap: 1.5rem; margin-bottom: 1.25rem; flex-wrap: wrap; }
.step__numeral {
  font-family: var(--font-serif);
  font-size: clamp(2.5rem, 5vw, 3.75rem);
  font-weight: 500;
  color: var(--accent-gold);
  line-height: 1;
  flex-shrink: 0;
}
.step__title {
  font-family: var(--font-serif);
  font-size: clamp(1.4rem, 2.5vw, 1.85rem);
  font-weight: 500;
  color: var(--text-primary);
  margin: 0;
  flex: 1;
}
.step__body { font-size: 1rem; color: var(--text-secondary); line-height: 1.75; }
.step__body p { margin-bottom: 1rem; }
.step__body h4 {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 500;
  color: var(--text-primary);
  margin: 1.5rem 0 0.5rem;
}

/* -------------------------------------------------------------
   16. Mermaid diagram
   ------------------------------------------------------------- */

.mermaid {
  display: flex;
  justify-content: center;
  background: var(--bg-code);
  border: 1px solid var(--border-subtle);
  border-left: 2px solid var(--accent-gold);
  border-radius: var(--radius);
  padding: 2rem 1.5rem;
  margin: 0 0 1.5rem;
  overflow-x: auto;
  text-align: center;
}
.mermaid svg { max-width: 100%; height: auto; }

/* -------------------------------------------------------------
   17. FAQ accordion
   ------------------------------------------------------------- */

.filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0 0 2.5rem;
}
.chip {
  padding: 0.45rem 1rem;
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  background: transparent;
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  cursor: pointer;
  transition: all var(--dur-fast) var(--ease-lux);
}
.chip:hover { color: var(--accent-gold-bright); border-color: var(--accent-gold); }
.chip.is-active {
  background: var(--accent-gold);
  color: var(--bg-primary);
  border-color: var(--accent-gold);
}

.accordion { border-top: 1px solid var(--border-subtle); }
.accordion__item {
  border-bottom: 1px solid var(--border-subtle);
}
.accordion__item.is-hidden { display: none; }
.accordion__q {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1.4rem 0.5rem;
  background: transparent;
  border: none;
  text-align: left;
  cursor: pointer;
  font-family: var(--font-serif);
  font-size: clamp(1.1rem, 2vw, 1.35rem);
  font-weight: 500;
  color: var(--text-primary);
  transition: color var(--dur-fast) var(--ease-lux);
}
.accordion__q:hover { color: var(--accent-gold-bright); }
.accordion__q:focus-visible { outline: 2px solid var(--accent-gold); outline-offset: 3px; }
.accordion__q-num {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--accent-gold);
  letter-spacing: 0.05em;
  margin-right: 0.85rem;
  opacity: 0.8;
}
.accordion__q-text { flex: 1; }
.accordion__q-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: var(--accent-gold);
  transition: transform var(--dur) var(--ease-lux);
}
.accordion__item.is-open .accordion__q-icon { transform: rotate(45deg); }
.accordion__a {
  max-height: 0;
  overflow: hidden;
  transition: max-height var(--dur) var(--ease-lux);
  padding-left: 3.25rem;
  padding-right: 1.5rem;
}
.accordion__item.is-open .accordion__a { max-height: 1400px; }
.accordion__a-inner {
  padding: 0 0 1.5rem;
  font-size: 0.97rem;
  color: var(--text-secondary);
  line-height: 1.75;
}
.accordion__a-inner p:last-child { margin-bottom: 0; }
.accordion__a-inner ul, .accordion__a-inner ol { padding-left: 1.4rem; }
.accordion__a-inner code { font-size: 0.85em; }
.accordion__a-inner pre { margin: 1rem 0; }

@media (max-width: 640px) {
  .accordion__q { padding: 1.1rem 0.25rem; font-size: 1rem; gap: 0.75rem; }
  .accordion__a { padding-left: 0.5rem; padding-right: 0.5rem; }
}

/* -------------------------------------------------------------
   18. API reference
   ------------------------------------------------------------- */

.api-index {
  position: sticky;
  top: calc(var(--nav-h) + 1.5rem);
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  padding: 1.5rem 1.25rem;
  max-height: calc(100vh - var(--nav-h) - 3rem);
  overflow-y: auto;
}
@media (max-width: 1024px) { .api-index { position: static; max-height: none; } }
.api-index__title {
  font-family: var(--font-sans);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent-gold);
  margin: 0 0 1rem;
}
.api-index ul { list-style: none; padding: 0; margin: 0; }
.api-index li { margin-bottom: 0.4rem; }
.api-index a {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-secondary);
  text-decoration: none;
  display: block;
  padding: 0.25rem 0;
  border-bottom: 1px dashed transparent;
}
.api-index a:hover { color: var(--accent-gold-bright); border-bottom-color: var(--border-subtle); }

.func-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  padding: clamp(1.5rem, 3vw, 2.5rem);
  margin-bottom: 2rem;
  scroll-margin-top: calc(var(--nav-h) + 1.5rem);
}
.func-card__sig {
  background: rgba(201, 169, 97, 0.05);
  border: 1px solid var(--border-subtle);
  border-left: 2px solid var(--accent-gold);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-primary);
  overflow-x: auto;
  margin: 0 0 1.25rem;
  line-height: 1.5;
}
.func-card__sig .fn-name { color: var(--accent-gold-bright); font-weight: 600; }
.func-card__sig .fn-kw   { color: var(--accent-copper); }
.func-card__sig .fn-type { color: var(--success); font-style: italic; }

.func-card__h {
  font-family: var(--font-sans);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent-gold);
  margin: 1.5rem 0 0.5rem;
}

.func-card__desc { color: var(--text-secondary); font-size: 0.97rem; line-height: 1.7; margin-bottom: 0.5rem; }
.func-card__returns { color: var(--text-secondary); font-size: 0.95rem; }

/* -------------------------------------------------------------
   19. Tabs (for code.html)
   ------------------------------------------------------------- */

.tabs { margin-bottom: 2rem; }
.tabs__list {
  display: flex;
  gap: 0.25rem;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}
.tabs__tab {
  padding: 0.65rem 1.1rem;
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: all var(--dur-fast) var(--ease-lux);
  margin-bottom: -1px;
}
.tabs__tab:hover { color: var(--text-primary); }
.tabs__tab.is-active {
  color: var(--accent-gold-bright);
  border-bottom-color: var(--accent-gold);
}
.tabs__panel { display: none; }
.tabs__panel.is-active { display: block; animation: fade-in 0.3s var(--ease-lux); }

@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

/* -------------------------------------------------------------
   20. File tree (for code.html)
   ------------------------------------------------------------- */

.file-tree {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.7;
  color: var(--text-secondary);
  background: var(--bg-code);
  border: 1px solid var(--border-subtle);
  border-left: 2px solid var(--accent-gold);
  border-radius: var(--radius);
  padding: 1.5rem 1.75rem;
  overflow-x: auto;
  margin: 0 0 1.5rem;
}
.file-tree .ft-dir { color: var(--accent-gold-bright); font-weight: 600; }
.file-tree .ft-file { color: var(--text-secondary); }
.file-tree .ft-new  { color: var(--success); }
.file-tree .ft-mod  { color: var(--accent-copper); }
.file-tree .ft-comment { color: var(--text-tertiary); font-style: italic; }

/* -------------------------------------------------------------
   21. Citation blocks
   ------------------------------------------------------------- */

.cite-block {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-left: 3px solid var(--accent-gold);
  border-radius: var(--radius);
  padding: 1.5rem 1.75rem;
  margin-bottom: 1.5rem;
}
.cite-block__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}
.cite-block__title {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 500;
  color: var(--text-primary);
  margin: 0;
}
.cite-block__authors {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}
.cite-block__meta {
  font-family: var(--font-sans);
  font-size: 0.85rem;
  color: var(--text-tertiary);
  margin-bottom: 1rem;
}

/* -------------------------------------------------------------
   22. Reveal animations (scroll-reveal)
   ------------------------------------------------------------- */

.reveal {
  /* Content visible by default; JS adds .js class to <html> to enable the
     fade-up animation. This is progressive enhancement — without JS, content
     is always visible (good for SEO, accessibility, crawlers, screenshots). */
  opacity: 1;
  transform: none;
  transition: opacity var(--dur-slow) var(--ease-lux),
              transform var(--dur-slow) var(--ease-lux);
  will-change: opacity, transform;
}
.js .reveal {
  opacity: 0;
  transform: translateY(20px);
}
.reveal.in-view {
  opacity: 1;
  transform: translateY(0);
}
.reveal[data-delay="1"].in-view { transition-delay: 0.08s; }
.reveal[data-delay="2"].in-view { transition-delay: 0.16s; }
.reveal[data-delay="3"].in-view { transition-delay: 0.24s; }
.reveal[data-delay="4"].in-view { transition-delay: 0.32s; }
.reveal[data-delay="5"].in-view { transition-delay: 0.40s; }
.reveal[data-delay="6"].in-view { transition-delay: 0.48s; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .reveal { opacity: 1; transform: none; }
  .hero__bg { animation: none; }
  .hero__ring { animation: none; }
}

/* -------------------------------------------------------------
   23. Page hero (interior pages)
   ------------------------------------------------------------- */

.page-hero {
  position: relative;
  padding: calc(var(--nav-h) + 4rem) 0 4rem;
  border-bottom: 1px solid var(--border-subtle);
  overflow: hidden;
}
.page-hero__eyebrow {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--accent-gold);
  margin: 0 0 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.page-hero__eyebrow::before {
  content: '';
  display: inline-block;
  width: 36px;
  height: 1px;
  background: var(--accent-gold);
}
.page-hero__title {
  font-family: var(--font-serif);
  font-size: clamp(2.25rem, 5vw, 4rem);
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.1;
  margin: 0 0 1.25rem;
  max-width: 36rem;
}
.page-hero__sub {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: clamp(1.05rem, 1.6vw, 1.3rem);
  color: var(--text-secondary);
  line-height: 1.5;
  margin: 0;
  max-width: 44rem;
}

/* Ring motif behind page hero */
.page-hero__ring {
  position: absolute;
  right: -10rem;
  top: 50%;
  transform: translateY(-50%);
  width: 32rem;
  height: 32rem;
  border: 1px solid var(--border-subtle);
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
  opacity: 0.6;
}
.page-hero__ring::before {
  content: '';
  position: absolute;
  inset: 2rem;
  border: 1px solid var(--border-subtle);
  border-radius: 50%;
  opacity: 0.6;
}
.page-hero__ring::after {
  content: '';
  position: absolute;
  inset: 5rem;
  border: 1px solid var(--border-subtle);
  border-radius: 50%;
  opacity: 0.5;
}
.page-hero > .container { position: relative; z-index: 1; }
@media (max-width: 1024px) { .page-hero__ring { display: none; } }

/* -------------------------------------------------------------
   24. Comparison layouts
   ------------------------------------------------------------- */

.comparison-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin: 0 0 2rem;
}
@media (max-width: 768px) { .comparison-grid { grid-template-columns: 1fr; } }

.comparison-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  padding: 2rem;
}
.comparison-card--highlight {
  border-color: var(--accent-gold);
  background: linear-gradient(180deg, rgba(201,169,97,0.04), var(--bg-secondary));
  position: relative;
}
.comparison-card--highlight::before {
  content: 'RECOMMENDED';
  position: absolute;
  top: 1rem;
  right: 1rem;
  font-family: var(--font-sans);
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  color: var(--bg-primary);
  background: var(--accent-gold);
  padding: 0.25rem 0.65rem;
  border-radius: 2px;
}
.comparison-card__title {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 500;
  color: var(--text-primary);
  margin: 0 0 0.25rem;
}
.comparison-card__sub {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--accent-gold);
  margin: 0 0 1rem;
  letter-spacing: 0.04em;
}

/* -------------------------------------------------------------
   25. Page meta / breadcrumbs / source-link
   ------------------------------------------------------------- */

.source-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-tertiary);
  border: 1px solid var(--border-subtle);
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius);
  transition: all var(--dur-fast) var(--ease-lux);
}
.source-link:hover {
  color: var(--accent-gold-bright);
  border-color: var(--accent-gold);
  text-decoration: none;
}
.source-link svg { width: 14px; height: 14px; }

/* -------------------------------------------------------------
   26. Numbered list (luxury)
   ------------------------------------------------------------- */

ol.lux-list {
  list-style: none;
  counter-reset: lux;
  padding-left: 0;
}
ol.lux-list > li {
  counter-increment: lux;
  position: relative;
  padding-left: 3.25rem;
  margin-bottom: 1.5rem;
}
ol.lux-list > li::before {
  content: counter(lux, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 0.05em;
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 500;
  color: var(--accent-gold);
  line-height: 1;
}

/* -------------------------------------------------------------
   27. Misc helpers
   ------------------------------------------------------------- */

.text-center { text-align: center; }
.text-mono   { font-family: var(--font-mono); }
.text-gold   { color: var(--accent-gold); }
.text-bright { color: var(--accent-gold-bright); }
.text-muted  { color: var(--text-tertiary); }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.justify-between { justify-content: space-between; }
.items-center { align-items: center; }
.hidden { display: none !important; }

/* Visually hidden but accessible */
.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;
}

/* Skip-link */
.skip-link {
  position: absolute;
  top: -100px;
  left: 1rem;
  z-index: 1000;
  padding: 0.6rem 1rem;
  background: var(--bg-elevated);
  color: var(--accent-gold-bright);
  border: 1px solid var(--accent-gold);
  border-radius: var(--radius);
  font-family: var(--font-sans);
  font-size: 0.85rem;
}
.skip-link:focus { top: 1rem; }

/* -------------------------------------------------------------
   28. 404 page
   ------------------------------------------------------------- */

.error-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 4rem 1.5rem;
  position: relative;
  overflow: hidden;
}
.error-page__ring {
  position: absolute;
  width: 50rem;
  height: 50rem;
  border: 1px solid var(--border-subtle);
  border-radius: 50%;
  z-index: -1;
  opacity: 0.5;
  animation: slow-rotate 120s linear infinite;
}
.error-page__ring::before, .error-page__ring::after {
  content: '';
  position: absolute;
  border: 1px solid var(--border-subtle);
  border-radius: 50%;
}
.error-page__ring::before { inset: 3rem; opacity: 0.7; }
.error-page__ring::after  { inset: 8rem; opacity: 0.5; }
.error-page__code {
  font-family: var(--font-serif);
  font-size: clamp(6rem, 14vw, 12rem);
  font-weight: 600;
  line-height: 1;
  background: linear-gradient(135deg, #f4d896 0%, #c9a961 50%, #8c6a3f 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin: 0;
}
.error-page__title {
  font-family: var(--font-serif);
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  font-weight: 500;
  color: var(--text-primary);
  margin: 1rem 0 0.5rem;
}
.error-page__sub {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.15rem;
  color: var(--text-secondary);
  margin: 0 0 2.5rem;
  max-width: 32rem;
}

/* -------------------------------------------------------------
   29. Print (basic)
   ------------------------------------------------------------- */

@media print {
  .site-header, .site-footer, .nav-toggle, .copy-btn, .hero__ring, .page-hero__ring { display: none !important; }
  body { color: #000; background: #fff; }
  .card, .step, .func-card { border: 1px solid #ccc; box-shadow: none; break-inside: avoid; }
  pre { white-space: pre-wrap; word-wrap: break-word; }
}

/* -------------------------------------------------------------
   30. Responsive nav (mobile)
   ------------------------------------------------------------- */

@media (max-width: 1100px) {
  .nav-links { display: none; }
  .nav-cta { display: none; }
  .nav-toggle { display: inline-flex; }
}
