/* ─── THE1IGHT BRAND TOKENS ────────────────────────── */
/* Source: _CORE/BRAND_DESIGN.md                       */
:root {
  /* Surfaces */
  --color-bg-primary:   #15333B;
  --color-surface:      #1d4049;
  --color-bg-secondary: #2a5662;
  --color-border:       #3E5E63;
  --color-card-light:   #EDF2F4;

  /* Text */
  --color-heading: #FDF5DA;
  --color-body:    #F0F0F0;
  --color-muted:   #8ba5ab;

  /* Brand / CTA */
  --color-brand:     #FFD94C;
  --color-cta-hover: #EAB308;
  --color-accent:    #4E8770;

  /* Semantic */
  --color-error: #a04545;

  /* Fonts */
  --font-display: 'Fraunces', Georgia, serif;
  --font-body:    'Be Vietnam Pro', system-ui, sans-serif;

  /* Reader */
  --reader-size: 19px;

  /* Shadows */
  --shadow: 0 20px 60px rgba(0,0,0,0.35);
}

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

body {
  margin: 0;
  background: var(--color-bg-primary);
  color: var(--color-body);
  font-family: var(--font-body);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

/* ─── PROGRESS BAR ───────────────────────────────── */
.read-progress {
  position: fixed;
  top: 0; left: 0;
  z-index: 20;
  width: 100%; height: 3px;
  background: transparent;
}
.read-progress span {
  display: block;
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--color-brand), var(--color-accent));
  transition: width .1s linear;
}

/* ─── HEADER ─────────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0; z-index: 15;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 16px clamp(18px, 4vw, 52px);
  background: color-mix(in srgb, var(--color-bg-primary) 90%, transparent);
  border-bottom: 1px solid var(--color-border);
  backdrop-filter: blur(20px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}
.brand-mark {
  display: grid;
  width: 36px; height: 36px;
  place-items: center;
  background: var(--color-brand);
  color: var(--color-bg-primary);
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
}
.brand strong {
  display: block;
  font-size: 14px;
  font-weight: 700;
  color: var(--color-heading);
}
.brand small {
  display: block;
  color: var(--color-muted);
  font-size: 11px;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.top-nav {
  display: flex;
  gap: 24px;
  color: var(--color-muted);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .02em;
}
.top-nav a { text-decoration: none; transition: color .15s; }
.top-nav a:hover { color: var(--color-brand); }

/* ─── TYPOGRAPHY ─────────────────────────────────── */
h1, h2, h3 {
  margin: 0;
  color: var(--color-heading);
  line-height: 1.05;
  letter-spacing: -.01em;
}

h1 {
  font-family: var(--font-display);
  font-size: clamp(52px, 8.5vw, 124px);
  font-weight: 700;
}
h2 {
  font-family: var(--font-display);
  font-size: clamp(30px, 4.5vw, 58px);
}
h3 {
  font-size: 17px;
  font-weight: 700;
  color: var(--color-heading);
}

.eyebrow, .story-kicker, .sidebar-label {
  margin: 0 0 10px;
  color: var(--color-brand);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.lede {
  max-width: 600px;
  margin: 18px 0 0;
  color: var(--color-muted);
  font-size: clamp(17px, 2.2vw, 24px);
  line-height: 1.5;
}

/* ─── BUTTONS ────────────────────────────────────── */
.primary-button, .secondary-button, .reader-toolbar button {
  min-height: 44px;
  border: 1px solid;
  border-radius: 2px;
  padding: 10px 22px;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  text-decoration: none;
  transition: background .15s, color .15s, border-color .15s;
  display: inline-flex;
  align-items: center;
}
.primary-button {
  background: var(--color-brand);
  border-color: var(--color-brand);
  color: var(--color-bg-primary);
}
.primary-button:hover {
  background: var(--color-cta-hover);
  border-color: var(--color-cta-hover);
}
.secondary-button {
  background: transparent;
  border-color: var(--color-border);
  color: var(--color-muted);
}
.secondary-button:hover {
  border-color: var(--color-brand);
  color: var(--color-brand);
}

/* ─── HERO ───────────────────────────────────────── */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(260px, .85fr);
  gap: clamp(36px, 6vw, 80px);
  align-items: center;
  min-height: calc(100svh - 68px);
  padding: clamp(40px, 7vw, 88px) clamp(18px, 5vw, 72px);
  position: relative;
}
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 55% 55% at 80% 50%, rgba(255,217,76,.05), transparent),
    radial-gradient(ellipse 40% 60% at 10% 90%, rgba(78,135,112,.04), transparent);
  pointer-events: none;
}
.hero-copy { max-width: 740px; position: relative; }

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
}

/* ─── STORY META ─────────────────────────────────── */
.story-meta {
  display: grid;
  grid-template-columns: repeat(4, minmax(0,1fr));
  gap: 10px;
  max-width: 680px;
  margin: 36px 0 0;
}
.story-meta div {
  border-top: 1px solid var(--color-border);
  padding-top: 12px;
}
.story-meta dt {
  color: var(--color-muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.story-meta dd {
  margin: 4px 0 0;
  font-weight: 600;
  font-size: 14px;
  color: var(--color-heading);
}

/* ─── COVER ILLUSTRATION ─────────────────────────── */
.cover-art { margin: 0; }
.cover-frame {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow);
}
.cover-frame svg { display: block; width: 100%; height: auto; }

/* ─── READER ─────────────────────────────────────── */
.reader-shell {
  display: grid;
  grid-template-columns: 240px minmax(0, 800px);
  gap: 40px;
  justify-content: center;
  padding: 52px clamp(18px, 5vw, 72px) 80px;
}
.reader-sidebar {
  position: sticky;
  top: 84px;
  align-self: start;
}
.sidebar-block {
  border-left: 2px solid var(--color-brand);
  padding-left: 16px;
}
.chapter-nav { display: grid; gap: 6px; }
.chapter-nav a {
  display: block;
  color: var(--color-muted);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: color .15s;
}
.chapter-nav a:hover { color: var(--color-brand); }

.story-panel {
  min-width: 0;
  padding: clamp(24px, 5vw, 60px);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow);
}
.reader-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
  margin-bottom: 32px;
}
.reader-toolbar button {
  min-height: 34px;
  padding: 6px 12px;
  border-color: var(--color-border);
  color: var(--color-muted);
  font-size: 12px;
  background: transparent;
}
.reader-toolbar button:hover {
  color: var(--color-brand);
  border-color: var(--color-brand);
}

.story-content {
  font-family: var(--font-display);
  font-size: var(--reader-size);
  line-height: 1.9;
  color: var(--color-body);
}
.chapter { scroll-margin-top: 90px; }
.chapter + .chapter {
  margin-top: 60px;
  padding-top: 48px;
  border-top: 1px solid var(--color-border);
}
.chapter-number {
  margin-bottom: 8px;
  color: var(--color-brand);
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.chapter h2 {
  margin-bottom: 24px;
  font-size: clamp(26px, 3.5vw, 42px);
}
.chapter p { margin: 0 0 1.2em; }
.chapter blockquote {
  margin: 2rem 0;
  padding: 0 0 0 20px;
  border-left: 2px solid var(--color-brand);
  color: var(--color-muted);
  font-style: italic;
}

/* ─── BEHIND SECTION ─────────────────────────────── */
.behind-section {
  display: grid;
  grid-template-columns: minmax(0,.85fr) minmax(0,1.15fr);
  gap: 52px;
  padding: 80px clamp(18px, 5vw, 72px);
  background: var(--color-bg-secondary);
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
}
.behind-left { display: flex; flex-direction: column; gap: 28px; }
.behind-illustration { margin-top: auto; }
.behind-illustration svg {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--color-border);
}

.behind-grid { display: grid; gap: 12px; align-content: start; }
.behind-card {
  border: 1px solid var(--color-border);
  padding: 20px;
  background: rgba(255,255,255,.03);
  transition: border-color .2s;
}
.behind-card:hover { border-color: var(--color-brand); }
.behind-card h3 { font-size: 15px; margin-bottom: 8px; }
.behind-card p {
  margin: 0;
  color: var(--color-muted);
  font-size: 14px;
  line-height: 1.65;
}

/* ─── CHAPTER CARDS ──────────────────────────────── */
.chapters-section { padding: 80px clamp(18px, 5vw, 72px); }
.chapter-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap: 12px;
  margin-top: 28px;
}
.chapter-card {
  min-height: 180px;
  border: 1px solid var(--color-border);
  padding: 22px;
  background: var(--color-surface);
  text-decoration: none;
  transition: border-color .2s, background .2s;
}
.chapter-card:hover { border-color: var(--color-brand); }
.chapter-card span {
  color: var(--color-brand);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.chapter-card h3 {
  margin: 10px 0 0;
  font-family: var(--font-display);
  font-size: 22px;
}
.chapter-card p {
  margin: 10px 0 0;
  color: var(--color-muted);
  font-size: 13px;
  line-height: 1.55;
}

/* ─── FOOTER ─────────────────────────────────────── */
.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 24px clamp(18px, 5vw, 72px);
  color: var(--color-muted);
  border-top: 1px solid var(--color-border);
  font-size: 13px;
}
.site-footer p { margin: 0; }
.site-footer a {
  font-weight: 700;
  color: var(--color-brand);
  text-decoration: none;
}
.site-footer a:hover { color: var(--color-cta-hover); }

/* ─── RESPONSIVE ─────────────────────────────────── */
@media (max-width: 980px) {
  .hero, .reader-shell, .behind-section { grid-template-columns: 1fr; }
  .hero { min-height: auto; }
  .reader-sidebar { position: static; }
  .story-meta { grid-template-columns: repeat(2, 1fr); }
  .chapter-cards { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .chapter-cards { grid-template-columns: 1fr; }
  .top-nav { display: none; }
}
