:root {
  --bg-night: #102b25;
  --bg-dusk: #174437;
  --bg-sun: #f0c969;
  --bg-leaf: #79bc6a;
  --bg-pool: #43d1bf;
  --bg-clay: #9f5237;
  --ink: #fff8e6;
  --muted: #d9d7bc;
  --panel: rgba(20, 47, 39, 0.84);
  --panel-strong: rgba(12, 35, 30, 0.91);
  --line: rgba(240, 201, 105, 0.24);
  --glow: 0 22px 60px rgba(7, 24, 21, 0.34);
  --glow-soft: 0 14px 32px rgba(7, 24, 21, 0.25);
  --radius-xl: 18px;
  --radius-lg: 12px;
  --radius-md: 8px;
  --max: 1180px;
  --title: "Palatino Linotype", "Book Antiqua", "URW Palladio L", serif;
  --body: "Trebuchet MS", "Gill Sans", "Segoe UI", sans-serif;
  --mono: "Cascadia Code", "Consolas", monospace;
}

@font-face {
  font-family: "Blaken Script";
  src: url("./fonts/BlakenScript-Regular.otf") format("opentype");
  font-display: swap;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: var(--body);
  line-height: 1.6;
  background:
    repeating-linear-gradient(135deg, rgba(240, 201, 105, 0.08) 0, rgba(240, 201, 105, 0.08) 1px, transparent 1px, transparent 22px),
    linear-gradient(180deg, var(--bg-dusk) 0%, var(--bg-night) 46%, #2b2a1e 100%);
}

body::before,
body::after {
  content: "";
  position: fixed;
  pointer-events: none;
  z-index: -1;
}

body::before {
  top: 0;
  left: 0;
  right: 0;
  height: 42vh;
  background:
    linear-gradient(180deg, rgba(240, 201, 105, 0.16), transparent 75%),
    repeating-linear-gradient(90deg, rgba(255, 248, 230, 0.05) 0, rgba(255, 248, 230, 0.05) 1px, transparent 1px, transparent 96px);
}

body::after {
  right: 0;
  bottom: 0;
  width: 48vw;
  height: 28vh;
  background:
    linear-gradient(135deg, transparent 0 38%, rgba(240, 201, 105, 0.16) 38% 45%, transparent 45%),
    linear-gradient(45deg, transparent 0 58%, rgba(67, 209, 191, 0.14) 58% 66%, transparent 66%);
}

a { color: inherit; }
img { max-width: 100%; display: block; }

.site-shell {
  width: min(calc(100% - 32px), var(--max));
  margin: 0 auto;
}

.site-nav {
  position: sticky;
  top: 0;
  z-index: 30;
  backdrop-filter: blur(14px);
  background: rgba(10, 9, 27, 0.58);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.site-nav .site-shell,
.footer .site-shell,
.section-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
}

.site-nav .site-shell {
  align-items: center;
  padding: 14px 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, rgba(67, 209, 191, 0.24), rgba(240, 201, 105, 0.22)), rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(240, 201, 105, 0.25);
  box-shadow: var(--glow-soft);
  font-family: "Blaken Script", var(--title);
  font-size: 1.2rem;
}

.brand-text { display: flex; flex-direction: column; }
.brand-text strong { font-size: 0.95rem; letter-spacing: 0.08em; text-transform: uppercase; }
.brand-text span { color: var(--muted); font-size: 0.85rem; }

.nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.nav-links a {
  text-decoration: none;
  padding: 9px 13px;
  border-radius: 999px;
  color: var(--muted);
  border: 1px solid transparent;
}

.nav-links a:hover,
.nav-links a[aria-current="page"] {
  color: var(--ink);
  border-color: rgba(124, 244, 255, 0.18);
  background: rgba(255, 255, 255, 0.05);
}

.page-hero { padding: 64px 0 26px; }
.page-hero-compact { padding: 36px 0 18px; }

.hero-panel {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-xl);
  border: 1px solid rgba(255, 255, 255, 0.10);
  background:
    repeating-linear-gradient(90deg, rgba(240, 201, 105, 0.13) 0, rgba(240, 201, 105, 0.13) 2px, transparent 2px, transparent 72px),
    linear-gradient(145deg, rgba(21, 69, 55, 0.94), rgba(135, 69, 45, 0.86));
  box-shadow: var(--glow);
}

.hero-panel::after {
  content: "";
  position: absolute;
  inset: auto -60px -80px auto;
  width: 260px;
  height: 260px;
  background:
    linear-gradient(135deg, transparent 0 36%, rgba(240, 201, 105, 0.20) 36% 43%, transparent 43%),
    linear-gradient(45deg, transparent 0 54%, rgba(67, 209, 191, 0.16) 54% 62%, transparent 62%);
}

.hero-grid,
.split-layout,
.card-grid,
.stats-strip,
.story-grid {
  display: grid;
  gap: 18px;
}

.hero-grid,
.split-layout {
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
}

.hero-grid { padding: 38px; gap: 28px; }
.card-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stats-strip { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: 22px; gap: 14px; }
.story-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.eyebrow,
.small-caps,
.kicker {
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.eyebrow { margin: 0 0 12px; color: #f0c969; font-weight: 700; }
.small-caps { color: #f0c969; }
.kicker { display: inline-block; margin-bottom: 10px; color: #43d1bf; }

.hero-title,
.section-title,
.hero-card h2,
.content-card h2,
.content-card h3,
.mini-card h3,
.story-card h3,
.timeline-card h3,
.quote-card blockquote {
  margin-top: 0;
  font-family: var(--title);
}

.hero-title {
  margin: 0;
  font-size: 5rem;
  line-height: 1.02;
  max-width: 8.5ch;
}

body.page-stories .hero-panel {
  background:
    repeating-linear-gradient(90deg, rgba(240, 201, 105, 0.10) 0, rgba(240, 201, 105, 0.10) 2px, transparent 2px, transparent 80px),
    linear-gradient(145deg, rgba(20, 59, 49, 0.92), rgba(104, 62, 43, 0.86));
}

body.page-stories .hero-grid {
  grid-template-columns: minmax(0, 1.3fr) minmax(240px, 0.7fr);
  padding: 28px 32px;
  gap: 22px;
}

body.page-stories .hero-title {
  max-width: 12ch;
  font-size: 3.2rem;
  line-height: 1.06;
}

body.page-stories .hero-copy {
  max-width: 56ch;
  font-size: 1rem;
}

.section-title {
  margin: 0;
  font-size: 2.8rem;
  line-height: 1.05;
}

.hero-copy,
.section-note,
.page-intro,
.hero-card p,
.content-card p,
.mini-card p,
.story-card p,
.timeline-card p,
.quote-card p,
li {
  color: var(--muted);
}

.hero-copy { max-width: 62ch; font-size: 1.05rem; margin: 18px 0 0; }
.page-intro { max-width: 76ch; margin-bottom: 18px; }

.hero-actions,
.pill-row,
.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.hero-actions,
.pill-row { margin-top: 22px; }
.tag-list { margin-top: 16px; gap: 10px; }

.button,
.ghost-button,
.tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  border-radius: 999px;
}

.button,
.ghost-button {
  gap: 10px;
  padding: 12px 18px;
  font-weight: 700;
}

.button {
  color: #171127;
  background: linear-gradient(135deg, #43d1bf, #f0c969);
  box-shadow: 0 10px 30px rgba(67, 209, 191, 0.20);
}

.ghost-button {
  color: var(--ink);
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.04);
}

.hero-card,
.content-card,
.mini-card,
.quote-card,
.timeline-card,
.story-card,
.page-panel,
.script-frame,
.stat,
.callout {
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--glow-soft);
  backdrop-filter: blur(14px);
}

.hero-card,
.content-card,
.story-card,
.quote-card,
.timeline-card,
.mini-card,
.page-panel { padding: 24px; }

.section { padding: 18px 0 54px; }
.section-head { align-items: end; margin-bottom: 20px; }
.stack { display: grid; gap: 18px; }

.script-sample {
  font-family: "Blaken Script", var(--title);
  font-size: 3.2rem;
  line-height: 1.1;
  color: #f5d783;
}

.quote-card { position: relative; overflow: hidden; }
.quote-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 6px;
  background: linear-gradient(180deg, #43d1bf, #f0c969);
}

.quote-card blockquote { margin: 0; font-size: 1.45rem; line-height: 1.35; }
.quote-card footer { margin-top: 12px; color: #f0c969; }

.stat { padding: 18px; background: rgba(255, 255, 255, 0.05); border-color: rgba(255, 255, 255, 0.08); }
.stat strong { display: block; font-size: 1.7rem; font-family: var(--title); }
.stat span { color: var(--muted); font-size: 0.94rem; }

.bullet-list,
.clean-list {
  padding-left: 18px;
  margin: 0;
}

.bullet-list li + li,
.clean-list li + li { margin-top: 8px; }

.tag {
  gap: 8px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #d8f7cb;
  font-size: 0.92rem;
}

.script-frame { overflow: hidden; background: linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.02)); }
.script-frame img { width: 100%; height: 100%; object-fit: cover; }

.callout {
  padding: 18px 20px;
  border-radius: var(--radius-md);
  background: rgba(149, 242, 126, 0.08);
  border-color: rgba(149, 242, 126, 0.20);
}

.prose {
  max-width: 78ch;
}

.stories-panel {
  max-width: none;
}

.story-archive-block {
  display: grid;
  gap: 22px;
  margin-top: 2.2rem;
}

.story-archive-head {
  display: grid;
  gap: 10px;
  padding: 24px 26px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(124, 244, 255, 0.12);
  background: linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.02));
}

.story-archive-head h2 {
  margin: 0;
}

.story-archive-head p {
  margin: 0;
}

.story-archive-count {
  color: #f5d783;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.story-archive-grid {
  align-items: stretch;
}

.grammar-grid {
  margin-top: 18px;
}

.grammar-card {
  display: grid;
  gap: 14px;
  align-content: start;
}

.grammar-card h2,
.grammar-card p {
  margin: 0;
}

.story-teaser-card {
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 16px;
  padding: 26px;
}

.story-teaser-title {
  margin: 0;
  font-family: "Blaken Script", var(--title);
  font-size: 2.2rem;
  line-height: 1.04;
  color: #f5d783;
  letter-spacing: 0;
}

.story-teaser-card p {
  margin: 0;
}

.story-teaser-actions {
  display: flex;
  justify-content: flex-start;
}

.prose h1,
.prose h2,
.prose h3 {
  font-family: var(--title);
  line-height: 1.08;
}

.prose h2,
.prose h3 {
  margin-top: 1.8em;
}

.prose p,
.prose li,
.prose blockquote {
  color: var(--muted);
}

.prose blockquote {
  margin: 1.4rem 0;
  padding-left: 1rem;
  border-left: 4px solid rgba(124, 244, 255, 0.4);
  font-family: var(--title);
  font-size: 1.2rem;
}

.prose a {
  color: #43d1bf;
}

.prose img {
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.1);
  margin: 1.2rem 0;
}

.table-scroll {
  overflow-x: auto;
  margin: 1.2rem 0;
  border: 1px solid rgba(240, 201, 105, 0.20);
  border-radius: var(--radius-md);
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 620px;
  background: rgba(255, 255, 255, 0.03);
}

th,
td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(240, 201, 105, 0.14);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--ink);
  background: rgba(240, 201, 105, 0.08);
}

td {
  color: var(--muted);
}

.footer {
  padding: 18px 0 38px;
  color: var(--muted);
}

.footer .site-shell {
  border-top: 1px solid rgba(255, 255, 255, 0.10);
  padding-top: 18px;
  flex-wrap: wrap;
}

code { font-family: var(--mono); }

@media (max-width: 960px) {
  .hero-grid,
  .split-layout,
  .card-grid,
  .stats-strip,
  .story-grid {
    grid-template-columns: 1fr;
  }

  body.page-stories .hero-grid {
    grid-template-columns: 1fr;
  }

  .section-head,
  .footer .site-shell,
  .site-nav .site-shell {
    align-items: start;
  }
}

@media (max-width: 700px) {
  .site-shell { width: min(calc(100% - 24px), var(--max)); }
  .page-hero { padding-top: 34px; }
  .site-nav .site-shell { flex-direction: column; }
  .brand { width: 100%; }
  .nav-links {
    width: 100%;
    flex-wrap: wrap;
    overflow-x: visible;
    padding-bottom: 0;
  }
  .nav-links a { white-space: nowrap; }
  .hero-grid,
  .hero-card,
  .content-card,
  .story-card,
  .quote-card,
  .timeline-card,
  .mini-card { padding: 20px; }
  .nav-links { gap: 6px; }
  .nav-links a { padding: 8px 10px; font-size: 0.88rem; }
  .hero-title { font-size: 2.6rem; max-width: none; }
  .section-title { font-size: 2rem; }
  .script-sample { font-size: 2.3rem; }

  body.page-stories .hero-grid {
    padding: 22px;
  }

  body.page-stories .hero-title {
    font-size: 2.2rem;
  }

  .story-archive-head,
  .story-teaser-card {
    padding: 20px;
  }

  .story-teaser-title {
    font-size: 1.8rem;
  }
}
