/* ============================================
   THE MODERN CLASSIC — johnbcowan.com
   Dark Academia meets Modern Minimalism
   Premium non-fiction book aesthetic for the thinking layman
   ============================================ */

:root {
  /* Palette from design concept */
  --bg: #F9F8F6;              /* Soft Parchment / Alabaster */
  --ink: #2C2C2C;             /* Deep Charcoal — primary text */
  --accent-terra: #C05A46;    /* Muted Terracotta */
  --accent-slate: #4A6B7C;    /* Slate Blue */
  --border: #D9D0C3;
  --cream: #F4F1E9;           /* Slightly warmer for boxes */
  --muted: #6B645A;

  /* Typography */
  --serif-heading: "Playfair Display", "EB Garamond", "Crimson Pro", Georgia, serif;
  --serif-body: "Lora", "Merriweather", Georgia, "Iowan Old Style", serif;

  /* Spacing & measure */
  --reading-measure: 68ch;
  --line-height: 1.72;
  --section-y: 5.25rem;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--serif-body);
  font-size: 1.0625rem;
  line-height: var(--line-height);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Generous whitespace foundation */
h1, h2, h3, h4 {
  font-family: var(--serif-heading);
  line-height: 1.25;
  font-weight: 600;
  color: var(--ink);
}

h1 { font-size: 2.85rem; letter-spacing: -0.015em; }
h2 { font-size: 1.95rem; letter-spacing: -0.01em; margin-top: 2.1em; }
h3 { font-size: 1.38rem; letter-spacing: -0.005em; margin-top: 1.85em; }
h4 { font-size: 1.15rem; }

p, ul, ol {
  margin: 0 0 1.35em;
}

a {
  color: var(--accent-terra);
  text-decoration: none;
  transition: color 0.15s ease;
}
a:hover {
  color: var(--accent-slate);
  text-decoration: underline;
}

/* Reading container — 65-75ch sweet spot */
.measure {
  max-width: var(--reading-measure);
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.25rem;
  padding-right: 1.25rem;
}

/* Header — clean, omnipresent, editorial */
.site-header {
  background: #F6F4EF; /* slightly warmer/darker parchment for subtle separation from page bg */
  border-bottom: 1px solid var(--border);
  padding: 1.1rem 0;
  position: sticky;
  top: 0;
  z-index: 50;
}

.header-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 1.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.logo {
  font-family: var(--serif-heading);
  font-size: 1.48rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--ink);
  padding-left: 2px; /* optical alignment tweak for short word */
}

.nav {
  display: flex;
  align-items: center;
  gap: 1.65rem;
  font-size: 0.96rem;
}

.nav a {
  color: var(--ink);
  font-weight: 500;
}
.nav a:hover {
  color: var(--accent-terra);
  text-decoration: none;
}

.nav .separator {
  color: var(--border);
  user-select: none;
}

.nav-cta {
  background: var(--accent-terra);
  color: #fff !important;
  padding: 0.45rem 1.15rem;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  transition: all 0.2s ease;
}
.nav-cta:hover {
  background: #A84B3A;
  color: #fff !important;
  text-decoration: none;
  transform: translateY(-1px);
}

/* Mobile nav */
.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border);
  padding: 0.35rem 0.6rem;
  border-radius: 4px;
  cursor: pointer;
}

@media (max-width: 720px) {
  .nav { display: none; flex-direction: column; gap: 0.9rem; }
  .nav.open { display: flex; }
  .nav-toggle { display: block; }
}

/* HERO — High visual impact, minimalist classical, generous negative space */
.hero {
  min-height: 82vh; /* stronger visual presence */
  display: flex;
  align-items: center;
  padding: 3.8rem 0 5.8rem; /* more breathing room top & bottom */
  border-bottom: 1px solid var(--border);
}

.hero-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 1.75rem;
  display: grid;
  grid-template-columns: 1.15fr 1fr; /* give the larger graphic more room */
  gap: 2.8rem;
  align-items: center;
}

@media (max-width: 860px) {
  .hero-inner {
    grid-template-columns: 1fr;
    gap: 2.25rem;
  }
  .hero-graphic { order: -1; }
}

.hero-graphic {
  display: flex;
  justify-content: center;
  align-items: center;
}

.hero-graphic svg {
  width: 100%;
  max-width: 560px; /* larger, higher visual impact while keeping generous negative space */
  height: auto;
  filter: drop-shadow(0 6px 22px rgba(0,0,0,0.07));
}

.hero-content h1 {
  font-size: 3.35rem;
  line-height: 1.05;
  margin: 0 0 0.65rem;
  font-weight: 700;
}

.hero-content .subtitle {
  font-size: 1.22rem;
  color: var(--muted);
  max-width: 28ch;
  margin-bottom: 1.85rem;
}

.cta-primary {
  display: inline-block;
  background: var(--accent-terra);
  color: #fff;
  font-family: var(--serif-heading);
  font-size: 1.05rem;
  font-weight: 600;
  padding: 0.85rem 2.1rem;
  border-radius: 3px;
  letter-spacing: 0.01em;
  box-shadow: 0 2px 0 rgba(0,0,0,0.08);
  transition: all 0.2s ease;
}
.cta-primary:hover {
  background: #A84B3A;
  color: #fff;
  text-decoration: none;
  transform: translateY(-2px);
  box-shadow: 0 6px 14px rgba(192, 90, 70, 0.25);
}

/* Sections */
.section {
  padding: var(--section-y) 0;
}

.section-title {
  font-size: 1.65rem;
  margin-bottom: 1.65rem;
  position: relative;
  display: inline-block;
}
.section-title::after {
  content: "";
  position: absolute;
  bottom: -6px;
  left: 0;
  width: 42%;
  height: 2px;
  background: linear-gradient(to right, var(--accent-terra), transparent);
}

/* Visual Roadmap (mini on home, full on series hub) */
.roadmap {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(148px, 1fr));
  gap: 1.15rem;
  margin: 1.75rem 0;
}

.roadmap-node {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1.1rem 1rem 1.25rem;
  text-align: center;
  transition: all 0.2s ease;
  position: relative;
}

.roadmap-node.active {
  border-color: var(--accent-terra);
  background: linear-gradient(to bottom, #fff, #FBF9F5);
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.roadmap-node.locked {
  opacity: 0.72;
  background: #F7F5F0;
}

.roadmap-node .icon {
  width: 46px;
  height: 46px;
  margin: 0 auto 0.6rem;
  color: var(--accent-slate);
}

.roadmap-node.active .icon {
  color: var(--accent-terra);
}

.roadmap-node h4 {
  font-size: 0.95rem;
  margin: 0 0 0.35rem;
  font-weight: 600;
}

.roadmap-node .meta {
  font-size: 0.78rem;
  color: var(--muted);
  letter-spacing: 0.02em;
}

/* Epoch cards on homepage (rhythmic, motif thumbnails) */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.6rem;
  margin-top: 1.4rem;
}

.essay-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 5px;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: flex;
  flex-direction: column;
}

.essay-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 24px rgba(0,0,0,0.07);
}

.card-motif {
  height: 108px;
  background: #F4F1E9;
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid var(--border);
}

.card-motif svg {
  width: 72px;
  height: 72px;
  color: var(--accent-slate);
  opacity: 0.85;
}

.essay-card .content {
  padding: 1.15rem 1.25rem 1.35rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.essay-card h3 {
  font-size: 1.12rem;
  margin: 0 0 0.55rem;
  line-height: 1.3;
}

.essay-card .excerpt {
  font-size: 0.94rem;
  color: var(--muted);
  line-height: 1.55;
  flex: 1;
}

.essay-card .meta {
  font-size: 0.8rem;
  color: var(--accent-terra);
  margin-top: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.03em;
}

/* The Core Idea — prominent distillation box */
.core-idea {
  background: var(--cream);
  border-left: 5px solid var(--accent-terra);
  padding: 1.45rem 1.7rem 1.55rem;
  margin: 1.15rem 0 2.15rem;
  font-size: 1.03rem;
  line-height: 1.68;
  border-radius: 0 4px 4px 0;
}

.core-idea .label {
  display: block;
  font-family: var(--serif-heading);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-terra);
  margin-bottom: 0.45rem;
}

/* Essay reading experience */
.article-header {
  padding: 2.1rem 0 1.35rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.85rem;
}

.article-title {
  font-size: 2.35rem;
  line-height: 1.1;
  margin: 0 0 0.4rem;
}

/* Progress bar (subtle, fixed) */
#reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: var(--accent-terra);
  z-index: 100;
  transition: width 0.05s linear;
  box-shadow: 0 1px 3px rgba(192, 90, 70, 0.3);
}

/* Distraction-free essay body */
.article-body {
  font-size: 1.075rem;
  line-height: 1.78;
}

.article-body h3 {
  margin-top: 2.4em;
  margin-bottom: 0.85em;
  font-weight: 600;
}

/* Pull quotes — elegant, no heavy boxing (per refined direction) */
.pullquote {
  margin: 1.85em 0;
  padding-left: 1.4rem;
  border-left: 3px solid var(--accent-slate);
  font-style: italic;
  color: #3F3A33;
  font-size: 1.08rem;
  line-height: 1.65;
}

.pullquote cite {
  display: block;
  margin-top: 0.5em;
  font-style: normal;
  font-size: 0.9rem;
  color: var(--muted);
}

/* Callouts — styled emphasis for author prose, breathing room */
.callout {
  background: #FBF9F5;
  border: 1px solid var(--border);
  padding: 1.15rem 1.45rem;
  margin: 1.65rem 0;
  font-size: 1.08rem;
  line-height: 1.7;
  border-radius: 4px;
  position: relative;
}

.callout::before {
  content: "—";
  position: absolute;
  left: 1.45rem;
  top: -0.55rem;
  background: var(--bg);
  padding: 0 0.35rem;
  color: var(--accent-terra);
  font-size: 1.4rem;
  line-height: 1;
}

/* Series navigation (large, clear) */
.series-nav {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin: 3.5rem 0 1.25rem;
  padding-top: 1.75rem;
  border-top: 1px solid var(--border);
}

.series-nav a {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--serif-heading);
  font-size: 1.05rem;
  font-weight: 600;
  padding: 0.7rem 1.35rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: #fff;
  transition: all 0.2s ease;
}
.series-nav a:hover {
  border-color: var(--accent-terra);
  color: var(--accent-terra);
  text-decoration: none;
  background: #FBF9F5;
}

/* Newsletter CTA (non-intrusive, at essay end) */
.newsletter-cta {
  background: var(--cream);
  padding: 1.85rem 1.9rem;
  border-radius: 6px;
  margin: 2.75rem 0 1rem;
  text-align: center;
}

.newsletter-cta p {
  margin: 0 0 0.9rem;
  font-size: 1.01rem;
}

.newsletter-cta form {
  display: flex;
  gap: 0.5rem;
  max-width: 380px;
  margin: 0 auto;
}
.newsletter-cta input {
  flex: 1;
  padding: 0.6rem 0.95rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-family: inherit;
  font-size: 0.95rem;
}
.newsletter-cta button {
  background: var(--accent-slate);
  color: #fff;
  border: none;
  padding: 0 1.3rem;
  border-radius: 4px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}
.newsletter-cta button:hover {
  background: #3A5463;
}

/* About page drop-cap */
.drop-cap {
  font-size: 1.0625rem;
  line-height: var(--line-height);
}
.drop-cap::first-letter {
  float: left;
  font-family: var(--serif-heading);
  font-size: 4.35rem;
  line-height: 0.68;
  margin: 0.05em 0.18em 0 0;
  color: var(--accent-terra);
  font-weight: 700;
}

/* Glossary */
.glossary-term {
  margin-bottom: 1.35rem;
  padding-bottom: 1.35rem;
  border-bottom: 1px solid var(--border);
}
.glossary-term:last-child { border-bottom: none; }
.glossary-term dt {
  font-family: var(--serif-heading);
  font-size: 1.08rem;
  font-weight: 600;
  color: var(--accent-slate);
}
.glossary-term dd {
  margin: 0.25rem 0 0;
  color: var(--muted);
}

/* Elegant term tooltips (progressive enhancement) */
.term {
  border-bottom: 1px dotted var(--accent-slate);
  cursor: help;
  position: relative;
}
.term:hover::after {
  content: attr(data-tip);
  position: absolute;
  bottom: 140%;
  left: 50%;
  transform: translateX(-50%);
  background: #2C2C2C;
  color: #F9F8F6;
  font-size: 0.82rem;
  line-height: 1.4;
  padding: 0.55rem 0.85rem;
  border-radius: 4px;
  white-space: normal;
  max-width: 240px;
  z-index: 80;
  box-shadow: 0 4px 14px rgba(0,0,0,0.18);
  pointer-events: none;
}
.term:hover::before {
  content: "";
  position: absolute;
  bottom: 115%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: #2C2C2C;
}

/* Timeline on Series Hub — full curriculum */
.timeline {
  margin: 2rem 0;
}
.timeline-epoch {
  margin-bottom: 2.35rem;
  background: #F8F6F1;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.1rem 1.35rem 1.25rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.03);
}
.timeline-epoch-header {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 0.85rem;
}
.timeline-epoch-header h3 {
  margin: 0;
  font-size: 1.42rem;
}
.timeline-epoch-header .period {
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 500;
}
.timeline-epoch.active {
  background: #FBF9F3;
  border-color: #D4C9B8;
  box-shadow: 0 2px 8px rgba(192, 90, 70, 0.08);
}

.timeline-epoch:not(.active) {
  opacity: 0.88;
}
.timeline-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.timeline-list li {
  padding: 0.55rem 0 0.55rem 2.1rem;
  position: relative;
  border-left: 2px solid var(--border);
}
.timeline-list li:last-child { border-left-color: transparent; }
.timeline-list li::before {
  content: "";
  position: absolute;
  left: -5px;
  top: 0.95rem;
  width: 9px;
  height: 9px;
  background: var(--accent-slate);
  border-radius: 50%;
}
.timeline-list li a {
  font-weight: 600;
}
.timeline-list li.locked {
  color: var(--muted);
  pointer-events: none;
}
.timeline-transition {
  margin: 1.85rem 0 1.5rem;
  padding-left: 1.1rem;
  border-left: 3px dashed var(--accent-terra);
  font-style: italic;
  color: var(--muted);
  font-size: 0.98rem;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 2.4rem 0 2rem;
  font-size: 0.9rem;
  color: var(--muted);
  text-align: center;
}

/* Utility */
.text-muted { color: var(--muted); }
.text-center { text-align: center; }
.mt-2 { margin-top: 2rem; }

/* Print niceties */
@media print {
  .site-header, .series-nav, .newsletter-cta, #reading-progress { display: none; }
  .article-body { font-size: 11pt; line-height: 1.55; }
}
