/* ============================================================
   The Path Is The Proof — Book Website
   thepathisproof.com
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=EB+Garamond:ital,wght@0,400;0,500;0,600;0,700;1,400;1,500&family=Source+Code+Pro:wght@400;500&display=swap');

/* ── Custom properties ── */
:root {
  --bg:          #0d0d0f;
  --bg-card:     #141418;
  --bg-card-alt: #18181e;
  --amber:       #D4780A;
  --amber-light: #E8901A;
  --blue:        #3A6B9F;
  --blue-light:  #4D82B8;
  --cream:       #F5F0E8;
  --cream-dim:   #C8C0B4;
  --border:      #2a2a32;

  --font-serif:  'EB Garamond', 'Georgia', serif;
  --font-mono:   'Source Code Pro', 'Courier New', monospace;

  --max-w: 1100px;
  --radius: 4px;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--cream);
  font-family: var(--font-serif);
  font-size: 1.1rem;
  line-height: 1.7;
}

/* ── Container ── */
.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ── Navigation ── */
nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(13, 13, 15, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  padding: 0.9rem 1.5rem;
}

nav .nav-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.nav-logo {
  font-family: var(--font-serif);
  font-size: 1rem;
  font-weight: 600;
  color: var(--amber);
  text-decoration: none;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.nav-logo:hover { color: var(--amber-light); }

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.4rem;
  list-style: none;
  flex-wrap: wrap;
}

.nav-links a {
  color: var(--cream-dim);
  text-decoration: none;
  font-size: 0.95rem;
  transition: color 0.15s;
}

.nav-links a:hover { color: var(--cream); }

/* ── Buttons ── */
.cta-primary {
  display: inline-block;
  background: var(--amber);
  color: #0d0d0f;
  font-family: var(--font-serif);
  font-size: 1rem;
  font-weight: 600;
  padding: 0.65rem 1.4rem;
  border-radius: var(--radius);
  text-decoration: none;
  border: 2px solid var(--amber);
  transition: background 0.15s, border-color 0.15s;
  cursor: pointer;
}

.cta-primary:hover {
  background: var(--amber-light);
  border-color: var(--amber-light);
}

.cta-secondary {
  display: inline-block;
  background: transparent;
  color: var(--blue-light);
  font-family: var(--font-serif);
  font-size: 1rem;
  font-weight: 500;
  padding: 0.65rem 1.4rem;
  border-radius: var(--radius);
  text-decoration: none;
  border: 2px solid var(--blue);
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  cursor: pointer;
}

.cta-secondary:hover {
  background: rgba(58, 107, 159, 0.15);
  border-color: var(--blue-light);
  color: var(--cream);
}

.cta-ebook {
  display: inline-block;
  background: transparent;
  color: #7ec8a4;
  font-family: var(--font-serif);
  font-size: 1rem;
  font-weight: 500;
  padding: 0.65rem 1.4rem;
  border-radius: var(--radius);
  text-decoration: none;
  border: 2px solid #4a9970;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  cursor: pointer;
}

.cta-ebook:hover {
  background: rgba(74, 153, 112, 0.15);
  border-color: #7ec8a4;
  color: var(--cream);
}

/* ── Hero ── */
.hero {
  padding: 5rem 1.5rem 4rem;
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 4rem;
  max-width: var(--max-w);
  margin: 0 auto;
  align-items: center;
}

.hero-cover {
  position: relative;
}

.hero-cover img {
  width: 100%;
  border-radius: 6px;
  box-shadow: 0 16px 64px rgba(0,0,0,0.7), 0 0 0 1px var(--border);
  display: block;
}

.hero-text h1 {
  font-size: 2.3rem;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 0.5rem;
  color: var(--cream);
}

.hero-text .book-subtitle {
  font-size: 1.1rem;
  font-style: italic;
  color: var(--cream-dim);
  margin-bottom: 1.4rem;
  line-height: 1.4;
}

.hero-tagline {
  font-size: 1.15rem;
  font-style: italic;
  color: var(--cream);
  border-left: 3px solid var(--amber);
  padding-left: 1rem;
  margin-bottom: 2rem;
  line-height: 1.5;
}

.hero-ctas {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

/* ── Section generic ── */
section {
  padding: 4rem 1.5rem;
  border-top: 1px solid var(--border);
}

section:first-of-type { border-top: none; }

.section-inner {
  max-width: var(--max-w);
  margin: 0 auto;
}

.section-title {
  font-size: 1.6rem;
  font-weight: 600;
  color: var(--cream);
  margin-bottom: 1.5rem;
}

.section-title span.amber { color: var(--amber); }

/* ── Pitch section ── */
.pitch p {
  font-size: 1.15rem;
  max-width: 72ch;
  color: var(--cream-dim);
  margin-bottom: 1rem;
}

.pitch p strong { color: var(--cream); font-weight: 600; }

/* ── Acrostic teaser ── */
.acrostic-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 0.4rem 1.5rem;
  margin-top: 0.5rem;
}

.acrostic-entry {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  padding: 0.35rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 1rem;
}

.acrostic-letter {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--amber);
  min-width: 1.1rem;
  text-align: center;
  flex-shrink: 0;
}

.acrostic-rest {
  color: var(--cream-dim);
  font-style: italic;
}

.acrostic-note {
  margin-top: 1.2rem;
  font-size: 0.95rem;
  color: var(--cream-dim);
  max-width: 60ch;
}

.acrostic-chapters-link {
  color: var(--amber);
  text-decoration: none;
}

.acrostic-chapters-link:hover { text-decoration: underline; }

/* ── Dialogue excerpt ── */
.dialogue-excerpt {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--amber);
  border-radius: var(--radius);
  padding: 2rem 2.2rem;
  max-width: 70ch;
  font-size: 1.05rem;
}

.dialogue-excerpt .setting {
  font-style: italic;
  color: var(--cream-dim);
  font-size: 0.95rem;
  margin-bottom: 1.2rem;
}

.dialogue-line { margin-bottom: 0.9rem; }
.dialogue-line:last-child { margin-bottom: 0; }

.speaker {
  font-weight: 700;
  color: var(--cream);
}

.speaker-achilles { color: var(--amber-light); }
.speaker-tortoise { color: var(--blue-light); }
.speaker-crab     { color: #9b8fcc; }

/* ── Three mathematicians ── */
.mathematicians {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-top: 0.5rem;
}

.mathematician-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.8rem;
}

.mathematician-card h3 {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--cream);
  margin-bottom: 0.3rem;
}

.mathematician-card .years {
  font-size: 0.85rem;
  color: var(--cream-dim);
  font-family: var(--font-mono);
  margin-bottom: 0.8rem;
}

.mathematician-card p {
  font-size: 0.98rem;
  color: var(--cream-dim);
  line-height: 1.6;
}

.mathematician-card .role-tag {
  display: inline-block;
  margin-top: 0.8rem;
  font-size: 0.82rem;
  font-style: italic;
  color: var(--amber);
  opacity: 0.8;
}

/* ── Agda strip ── */
.agda-strip {
  background: var(--bg-card-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.6rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  flex-wrap: wrap;
}

.agda-strip p {
  font-size: 1rem;
  color: var(--cream-dim);
  max-width: 60ch;
}

.agda-strip p strong { color: var(--cream); }

.agda-strip a.cta-secondary { white-space: nowrap; }

/* ── Footer ── */
footer {
  border-top: 1px solid var(--border);
  padding: 2.5rem 1.5rem;
  font-size: 0.9rem;
  color: var(--cream-dim);
}

.footer-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 2rem;
  flex-wrap: wrap;
}

.footer-left { max-width: 40ch; line-height: 1.6; }
.footer-left strong { color: var(--cream); }

.footer-right {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  text-align: right;
}

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

/* ── Chapters page ── */
.page-header {
  padding: 4rem 1.5rem 2.5rem;
  max-width: var(--max-w);
  margin: 0 auto;
}

.page-header h1 {
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--cream);
  margin-bottom: 0.5rem;
}

.page-header p {
  font-size: 1.05rem;
  color: var(--cream-dim);
  max-width: 62ch;
  font-style: italic;
}

.chapter-table-wrap {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1.5rem 4rem;
  overflow-x: auto;
}

.chapter-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 1rem;
}

.chapter-table thead tr {
  border-bottom: 2px solid var(--amber);
}

.chapter-table thead th {
  text-align: left;
  padding: 0.7rem 1rem;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--cream-dim);
  font-family: var(--font-mono);
  font-weight: 400;
}

.chapter-table tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background 0.1s;
}

.chapter-table tbody tr:hover {
  background: var(--bg-card);
}

.chapter-table tbody tr.prelude,
.chapter-table tbody tr.finale {
  opacity: 0.6;
}

.chapter-table td {
  padding: 0.65rem 1rem;
  vertical-align: top;
}

.td-hlevel {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--blue-light);
  white-space: nowrap;
  width: 5rem;
}

.td-acrostic {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--amber);
  width: 2.5rem;
  text-align: center;
}

.td-acrostic.none {
  color: var(--border);
  font-size: 1rem;
}

.td-title {
  font-style: italic;
  color: var(--cream);
}

.td-desc {
  font-size: 0.93rem;
  color: var(--cream-dim);
  max-width: 38ch;
}

.hlevel-note {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1.5rem 4rem;
}

.hlevel-note .note-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--blue);
  border-radius: var(--radius);
  padding: 1.6rem 2rem;
  max-width: 70ch;
}

.hlevel-note h2 {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--cream);
  margin-bottom: 0.7rem;
}

.hlevel-note p {
  font-size: 0.98rem;
  color: var(--cream-dim);
  line-height: 1.65;
  margin-bottom: 0.6rem;
}

.hlevel-note p:last-child { margin-bottom: 0; }

/* ── Responsive ── */
@media (max-width: 768px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 2rem;
    padding: 3rem 1.5rem;
  }

  .hero-cover {
    max-width: 280px;
    margin: 0 auto;
  }

  .hero-text h1 { font-size: 1.8rem; }

  .chapter-table thead th:nth-child(4),
  .chapter-table td:nth-child(4) {
    display: none;
  }

  .agda-strip {
    flex-direction: column;
    align-items: flex-start;
  }

  .footer-inner { flex-direction: column; }
  .footer-right { text-align: left; }

  .nav-links .hide-mobile { display: none; }
}
