:root {
  --navy-950: #0a1428;
  --navy-900: #0f1d38;
  --navy-800: #16274a;
  --navy-700: #1f345c;
  --gold-400: #d4af7a;
  --gold-500: #c9a05c;
  --gold-600: #b8860b;
  --cream-100: #faf7f0;
  --cream-200: #f2ecdd;
  --ink-900: #201c14;
  --ink-700: #3a3426;
  --ink-500: #6b6353;
  --serif-display: 'Cormorant Garamond', 'EB Garamond', serif;
  --serif-body: 'EB Garamond', Georgia, serif;
  --caps: 'Cinzel', serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--cream-100);
  color: var(--ink-900);
  font-family: var(--serif-body);
}

.hidden { display: none !important; }

/* ============ LANDING ============ */
.landing {
  min-height: 100vh;
  background:
    radial-gradient(ellipse at 30% 0%, var(--navy-800) 0%, var(--navy-950) 60%),
    linear-gradient(180deg, var(--navy-900), var(--navy-950));
  color: var(--cream-200);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 64px 24px 32px;
  position: relative;
  overflow: hidden;
}

.landing::before {
  content: "";
  position: absolute;
  inset: 18px;
  border: 1px solid rgba(212, 175, 122, 0.25);
  pointer-events: none;
}

.landing-inner {
  display: flex;
  align-items: center;
  gap: 72px;
  max-width: 1100px;
  width: 100%;
  animation: fadeUp 0.9s ease both;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

.landing-cover img {
  width: 300px;
  max-width: 38vw;
  border-radius: 3px;
  box-shadow: 0 30px 70px rgba(0,0,0,0.55), 0 0 0 1px rgba(212,175,122,0.2);
}

.landing-info { flex: 1; min-width: 280px; }

.kicker {
  font-family: var(--caps);
  letter-spacing: 0.28em;
  font-size: 0.72rem;
  color: var(--gold-400);
  text-transform: uppercase;
  margin: 0 0 14px;
}

.landing-info h1 {
  font-family: var(--serif-display);
  font-weight: 600;
  font-size: 2.8rem;
  line-height: 1.12;
  margin: 0 0 10px;
  color: var(--cream-100);
}

.subtitle {
  font-family: var(--serif-display);
  font-style: italic;
  font-size: 1.25rem;
  color: var(--gold-400);
  margin: 0 0 22px;
}

.divider {
  color: var(--gold-500);
  font-size: 1.1rem;
  margin: 18px 0;
  opacity: 0.8;
}

.author-line {
  font-family: var(--caps);
  font-size: 1.05rem;
  letter-spacing: 0.05em;
  margin: 0 0 4px;
  color: var(--cream-100);
}

.author-cred {
  font-style: italic;
  color: var(--gold-400);
  margin: 0 0 10px;
  font-size: 0.95rem;
}

.author-role {
  font-size: 0.92rem;
  line-height: 1.55;
  color: rgba(250, 247, 240, 0.75);
  margin: 0 0 16px;
}

.foreword-credit {
  font-style: italic;
  font-size: 0.9rem;
  color: rgba(212, 175, 122, 0.85);
  margin: 0 0 20px;
}

.meta-row {
  font-size: 0.82rem;
  color: rgba(250,247,240,0.55);
  margin-bottom: 6px;
}
.meta-row .dot { margin: 0 8px; color: var(--gold-500); }

.publisher {
  font-size: 0.78rem;
  color: rgba(250,247,240,0.45);
  margin: 0 0 30px;
}

.btn-primary, .btn-secondary {
  font-family: var(--caps);
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  padding: 13px 30px;
  border-radius: 2px;
  cursor: pointer;
  margin-right: 14px;
  margin-bottom: 10px;
  transition: all 0.25s ease;
}

.btn-primary {
  background: linear-gradient(135deg, var(--gold-400), var(--gold-600));
  color: var(--navy-950);
  border: none;
  box-shadow: 0 8px 24px rgba(184, 134, 11, 0.3);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(184,134,11,0.4); }

.btn-secondary {
  background: transparent;
  color: var(--gold-400);
  border: 1px solid rgba(212,175,122,0.5);
}
.btn-secondary:hover { background: rgba(212,175,122,0.1); }

.landing-timeline {
  margin-top: 56px;
  display: flex;
  gap: 40px;
  flex-wrap: wrap;
  justify-content: center;
  font-family: var(--caps);
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  color: rgba(212,175,122,0.55);
  text-transform: uppercase;
  max-width: 900px;
}

@media (max-width: 760px) {
  .landing-inner { flex-direction: column; text-align: center; gap: 28px; }
  .landing-cover img { width: 220px; max-width: 55vw; }
  .landing-info h1 { font-size: 2.1rem; }
  .author-role { text-align: center; }
}

/* ============ READER ============ */
.reader {
  display: flex;
  min-height: 100vh;
  background: var(--cream-100);
}

.sidebar-toggle {
  display: none;
  position: fixed;
  top: 14px;
  left: 14px;
  z-index: 50;
  background: var(--navy-900);
  color: var(--gold-400);
  border: none;
  width: 42px;
  height: 42px;
  border-radius: 4px;
  font-size: 1.1rem;
  cursor: pointer;
}

.sidebar {
  width: 300px;
  flex-shrink: 0;
  background: var(--navy-950);
  color: var(--cream-200);
  padding: 30px 0 40px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.sidebar-header {
  padding: 0 26px 20px;
  border-bottom: 1px solid rgba(212,175,122,0.18);
  margin-bottom: 10px;
}

.sidebar-title {
  font-family: var(--serif-display);
  font-weight: 600;
  font-size: 1.15rem;
  color: var(--cream-100);
  text-decoration: none;
  line-height: 1.25;
  display: block;
}

.sidebar-author {
  font-family: var(--caps);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  color: var(--gold-400);
  margin: 8px 0 0;
  text-transform: uppercase;
}

.nav-list {
  list-style: none;
  margin: 0;
  padding: 8px 0;
}

.nav-list li {
  padding: 9px 26px;
  font-size: 0.86rem;
  cursor: pointer;
  color: rgba(250,247,240,0.7);
  border-left: 3px solid transparent;
  transition: all 0.15s ease;
  line-height: 1.4;
}

.nav-list li:hover {
  background: rgba(212,175,122,0.07);
  color: var(--cream-100);
}

.nav-list li.active {
  border-left-color: var(--gold-500);
  background: rgba(212,175,122,0.1);
  color: var(--gold-400);
  font-weight: 600;
}

.nav-list li.section-divider {
  margin-top: 10px;
  padding-top: 14px;
  border-top: 1px solid rgba(212,175,122,0.12);
  font-family: var(--caps);
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(212,175,122,0.5);
  cursor: default;
}
.nav-list li.section-divider:hover { background: none; color: rgba(212,175,122,0.5); }

.content {
  flex: 1;
  max-width: 860px;
  margin: 0 auto;
  padding: 40px 60px 100px;
}

.content-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 20px;
  margin-bottom: 30px;
  border-bottom: 1px solid rgba(184,134,11,0.2);
  position: sticky;
  top: 0;
  background: var(--cream-100);
  z-index: 10;
  padding-top: 10px;
}

.toolbar-center { display: flex; align-items: center; gap: 16px; }

.nav-arrow {
  font-family: var(--caps);
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  background: none;
  border: 1px solid rgba(184,134,11,0.35);
  color: var(--ink-700);
  padding: 8px 14px;
  border-radius: 3px;
  cursor: pointer;
}
.nav-arrow:hover { background: rgba(184,134,11,0.08); }
.nav-arrow:disabled { opacity: 0.3; cursor: default; }

.tts-btn {
  font-family: var(--serif-body);
  font-size: 0.85rem;
  background: var(--navy-900);
  color: var(--gold-400);
  border: none;
  padding: 8px 16px;
  border-radius: 3px;
  cursor: pointer;
}
.tts-btn:hover { background: var(--navy-800); }
.tts-btn.playing { background: var(--gold-600); color: var(--navy-950); }

.font-controls button {
  background: none;
  border: 1px solid rgba(184,134,11,0.35);
  color: var(--ink-700);
  width: 34px;
  height: 34px;
  border-radius: 3px;
  cursor: pointer;
  font-size: 0.8rem;
}
.font-controls button:hover { background: rgba(184,134,11,0.08); }

.speed-controls {
  display: flex;
  align-items: center;
  gap: 4px;
}

.speed-btn {
  font-family: var(--caps);
  font-size: 0.68rem;
  letter-spacing: 0.02em;
  background: none;
  border: 1px solid rgba(184,134,11,0.35);
  color: var(--ink-700);
  padding: 8px 9px;
  border-radius: 3px;
  cursor: pointer;
}
.speed-btn:hover { background: rgba(184,134,11,0.08); }
.speed-btn.active {
  background: var(--gold-600);
  border-color: var(--gold-600);
  color: var(--navy-950);
  font-weight: 600;
}

.article-body {
  font-size: 1.12rem;
  line-height: 1.85;
  color: var(--ink-900);
}

.article-body h1.section-title {
  font-family: var(--serif-display);
  font-weight: 600;
  font-size: 2.1rem;
  color: var(--navy-900);
  margin: 0 0 6px;
  line-height: 1.2;
}

.article-body h2.section-subtitle {
  font-family: var(--serif-display);
  font-style: italic;
  font-weight: 500;
  font-size: 1.25rem;
  color: var(--gold-600);
  margin: 0 0 34px;
}

.article-body p {
  margin: 0 0 20px;
}

.article-body p.bullet {
  margin: 0 0 10px;
  padding-left: 22px;
  position: relative;
}

.article-body p.bullet::before {
  content: "—";
  position: absolute;
  left: 0;
  color: var(--gold-600);
}

.article-body p.small-caps-label {
  font-family: var(--caps);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  color: var(--gold-600);
  text-transform: uppercase;
  margin: 32px 0 10px;
}

.foreword-portrait {
  float: right;
  margin: 0 0 20px 28px;
  text-align: center;
  max-width: 170px;
}

.foreword-portrait img {
  width: 100%;
  display: block;
  border: 1px solid rgba(184,134,11,0.35);
  box-shadow: 0 10px 26px rgba(10,20,40,0.18);
}

.foreword-portrait p {
  font-family: var(--caps);
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  color: var(--ink-500);
  margin: 10px 0 0;
  line-height: 1.5;
}

@media (max-width: 640px) {
  .foreword-portrait { float: none; margin: 0 auto 24px; }
}

.content-footer-nav {
  display: flex;
  justify-content: space-between;
  margin-top: 60px;
  padding-top: 24px;
  border-top: 1px solid rgba(184,134,11,0.2);
}

.signature-block {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: -6px 0 26px;
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(184,134,11,0.2);
}

.signature-img {
  height: 44px;
  width: auto;
  display: block;
}

.signature-date-img {
  height: 26px;
  width: auto;
  display: block;
}

.signature-date-text {
  font-family: var(--serif-display);
  font-style: italic;
  font-size: 0.92rem;
  color: var(--ink-500);
}

.nav-arrow-wide {
  font-family: var(--caps);
  font-size: 0.78rem;
  letter-spacing: 0.05em;
  background: var(--navy-950);
  color: var(--gold-400);
  border: none;
  padding: 12px 22px;
  border-radius: 3px;
  cursor: pointer;
}
.nav-arrow-wide:hover { background: var(--navy-800); }
.nav-arrow-wide:disabled { opacity: 0.25; cursor: default; }

@media (max-width: 900px) {
  .sidebar-toggle { display: block; }
  .sidebar {
    position: fixed;
    left: -320px;
    top: 0;
    z-index: 40;
    transition: left 0.25s ease;
    box-shadow: 10px 0 40px rgba(0,0,0,0.3);
  }
  .sidebar.open { left: 0; }
  .content { padding: 80px 22px 80px; }
  .content-toolbar { flex-wrap: wrap; gap: 10px; }
}

/* ============ VIDEO EMBEDS & LINKS ============ */
.video-embed {
  position: relative;
  width: 100%;
  padding-top: 56.25%; /* 16:9 */
  margin: 8px 0 26px;
  background: var(--navy-950);
  border: 1px solid rgba(184,134,11,0.25);
  border-radius: 4px;
  overflow: hidden;
  box-shadow: 0 12px 30px rgba(10,20,40,0.15);
}
.video-embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.article-body p.external-link {
  word-break: break-all;
}
.article-body p.external-link a {
  color: var(--gold-600);
  text-decoration: underline;
}
.article-body p.external-link a:hover {
  color: var(--navy-800);
}

/* Text-to-speech: sentence highlighting while reading aloud */
.tts-sentence { transition: background-color 0.2s ease; border-radius: 2px; }
.tts-sentence.tts-highlight {
  background-color: rgba(212, 175, 122, 0.35); /* gold-400 tint */
  box-shadow: 0 0 0 2px rgba(212, 175, 122, 0.35);
}
