/* ==========================================================================
   Generative Practice — Dr. Keith Morneau theme
   Adapted from the Aldric personal-site design system (keithmorneau.com).
   Palette: parchment / ink / gold. Type: Cormorant Garamond, Lora, JetBrains Mono.
   ========================================================================== */

:root {
  --paper:        #f3ead6;
  --paper-2:      #ece1c6;
  --paper-3:      #e2d4b2;
  --ink:          #1a140d;
  --ink-soft:     #3a2e22;
  --ink-mute:     #6a5a45;
  --gold:         #b8893a;
  --gold-deep:    #8a5f1f;
  --gold-soft:    #d9b35e;
  --rule:         rgba(26, 20, 13, 0.18);
  --rule-soft:    rgba(26, 20, 13, 0.10);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: 'Lora', Georgia, serif;
  font-size: 17px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: geometryPrecision;
  background-image:
    radial-gradient(ellipse 1200px 800px at 20% 0%, rgba(184, 137, 58, 0.08), transparent 60%),
    radial-gradient(ellipse 900px 700px at 100% 100%, rgba(184, 137, 58, 0.06), transparent 60%);
}

/* subtle paper grain */
body::before {
  content: "";
  position: fixed; inset: 0;
  pointer-events: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.10  0 0 0 0 0.08  0 0 0 0 0.05  0 0 0 0.10 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  opacity: 0.55;
  mix-blend-mode: multiply;
  z-index: 1;
}

.frame { position: relative; z-index: 2; }

a { color: inherit; }

/* ================= TOP BAR ================= */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px 56px;
  border-bottom: 1px solid var(--rule);
  font-family: 'Cormorant Garamond', serif;
}
.mark {
  display: flex; align-items: center; gap: 14px;
  font-size: 20px; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--ink);
  text-decoration: none;
}
.mark .seal {
  width: 38px; height: 38px; border-radius: 50%;
  border: 1.5px solid var(--ink);
  display: grid; place-items: center;
  font-family: 'Cormorant Garamond', serif;
  font-style: italic; font-weight: 600; font-size: 22px;
  background: var(--paper-2);
  color: var(--ink);
}
nav.primary { display: flex; gap: 36px; flex-wrap: wrap; }
nav.primary a {
  color: var(--ink-soft); text-decoration: none;
  font-size: 15px; letter-spacing: 0.16em; text-transform: uppercase;
  font-family: 'Cormorant Garamond', serif; font-weight: 500;
  position: relative; padding-bottom: 4px;
  transition: color 0.2s;
}
nav.primary a:hover, nav.primary a.active { color: var(--gold-deep); }
nav.primary a:hover::after, nav.primary a.active::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0;
  border-bottom: 1px solid var(--gold-deep);
}

/* ================= GENERIC BUTTONS ================= */
.btn {
  font-family: 'Cormorant Garamond', serif;
  font-size: 16px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 16px 28px;
  border-radius: 2px;
  transition: all 0.2s ease;
  display: inline-flex; align-items: center; gap: 10px;
  font-weight: 500;
}
.btn.primary {
  background: var(--ink);
  color: var(--paper);
  border: 1px solid var(--ink);
}
.btn.primary:hover { background: var(--gold-deep); border-color: var(--gold-deep); }
.btn.ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--ink);
}
.btn.ghost:hover { background: var(--ink); color: var(--paper); }
.btn .arr { font-style: italic; font-family: 'Cormorant Garamond', serif; font-size: 20px; letter-spacing: 0;}

/* ================= BOOK COVER ================= */
.cover-img {
  display: block; width: 100%; height: auto;
  border-radius: 2px 6px 6px 2px;
  box-shadow: -2px 0 0 rgba(0, 0, 0, 0.18) inset, 0 30px 60px -20px rgba(26, 20, 13, 0.55), 0 12px 24px -10px rgba(26, 20, 13, 0.4);
}

/* ================= SECTION HEAD ================= */
section.spread {
  padding: 96px 72px;
  border-bottom: 1px solid var(--rule);
  position: relative;
}
.section-head {
  display: flex; align-items: baseline; gap: 18px;
  margin-bottom: 56px;
}
.section-head .num {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 18px;
  color: var(--gold-deep);
  letter-spacing: 0.2em;
}
.section-head .label {
  font-family: 'Cormorant Garamond', serif;
  font-size: 14px; letter-spacing: 0.32em; text-transform: uppercase;
  color: var(--ink-mute);
}
.section-head .rule { flex: 1; height: 1px; background: var(--rule); }

.section-head-illus {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 40px;
  margin-bottom: 56px;
}
.section-head-illus .section-head { margin-bottom: 0; flex: 1; }
.section-head-illus img {
  width: 150px;
  height: auto;
  flex-shrink: 0;
  filter: drop-shadow(0 8px 20px rgba(26, 20, 13, 0.15));
}
@media (max-width: 760px) {
  .section-head-illus { flex-direction: column; align-items: flex-start; gap: 20px; }
  .section-head-illus img { width: 110px; }
}

/* ================= QUOTE BANNER ================= */
.quote-banner {
  background: var(--ink);
  color: var(--paper);
  padding: 64px 72px;
  text-align: center;
  position: relative;
}
.quote-banner .quote {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: clamp(28px, 3.4vw, 44px);
  line-height: 1.25;
  margin: 0 auto;
  max-width: 32ch;
  color: var(--paper);
}
.quote-banner .quote .accent { color: var(--gold-soft); font-style: normal; }
.quote-banner .attrib {
  margin-top: 22px;
  font-family: 'Cormorant Garamond', serif;
  font-size: 13px; letter-spacing: 0.32em; text-transform: uppercase;
  color: var(--gold-soft);
}
.quote-banner::before, .quote-banner::after {
  content: "\2766";
  color: var(--gold-soft);
  font-size: 20px;
  position: absolute; left: 50%; transform: translateX(-50%);
}
.quote-banner::before { top: 22px; }
.quote-banner::after  { bottom: 22px; }

/* ================= ESSAYS GRID ================= */
.essays-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  border-top: 1px solid var(--rule);
  border-left: 1px solid var(--rule);
}
.essay {
  padding: 40px 36px 44px 36px;
  border-right: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  transition: background 0.25s;
  display: flex; flex-direction: column;
  min-height: 300px;
  text-decoration: none;
  color: inherit;
}
.essay:hover { background: var(--paper-2); }
.essay .meta {
  font-family: 'Cormorant Garamond', serif;
  font-size: 12px; letter-spacing: 0.3em; text-transform: uppercase;
  color: var(--ink-mute);
  display: flex; justify-content: space-between;
  margin-bottom: 24px;
}
.essay .meta .cat { color: var(--gold-deep); }
.essay h3 {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 500;
  font-size: 27px;
  line-height: 1.15;
  margin: 0 0 14px 0;
}
.essay h3 em { font-style: italic; color: var(--gold-deep); }
.essay p {
  font-size: 15.5px;
  line-height: 1.65;
  color: var(--ink-soft);
  margin: 0;
  flex: 1;
}
.essay .read {
  margin-top: 24px;
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 16px;
  color: var(--ink);
  border-top: 1px solid var(--rule-soft);
  padding-top: 14px;
  display: flex; justify-content: space-between; align-items: center;
}
.essay .read .arr { color: var(--gold-deep); }

/* ================= FOOTER ================= */
footer.colophon {
  padding: 56px 72px 40px;
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: 48px;
  background: var(--ink);
  color: var(--paper);
}
footer.colophon h4 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 13px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--gold-soft);
  margin: 0 0 18px 0;
  font-weight: 500;
}
footer .signature {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 26px;
  line-height: 1.3;
  color: var(--paper);
  margin: 0 0 18px 0;
}
footer .signature em { color: var(--gold-soft); }
footer .imprint {
  font-size: 14px;
  line-height: 1.7;
  color: rgba(243, 234, 214, 0.7);
  max-width: 36ch;
}
footer ul { list-style: none; padding: 0; margin: 0; }
footer ul li { padding: 6px 0; font-size: 15px; }
footer ul li a { color: var(--paper); text-decoration: none; opacity: 0.8;
  font-family: 'Cormorant Garamond', serif; font-size: 17px; }
footer ul li a:hover { color: var(--gold-soft); opacity: 1; }
.footer-bottom {
  grid-column: 1 / -1;
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid rgba(217, 179, 94, 0.25);
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase;
  color: rgba(243, 234, 214, 0.5);
}

/* ================= READING LAYOUT (essay pages) ================= */
.reading-hero {
  padding: 80px 72px 56px;
  border-bottom: 1px solid var(--rule);
  max-width: 900px;
}
.reading-hero .breadcrumb {
  font-family: 'Cormorant Garamond', serif;
  font-size: 14px; letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--ink-mute);
  text-decoration: none;
  display: inline-flex; align-items: center; gap: 8px;
  margin-bottom: 28px;
}
.reading-hero .breadcrumb:hover { color: var(--gold-deep); }
.reading-hero .kicker {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 18px;
  color: var(--gold-deep);
  letter-spacing: 0.05em;
  margin-bottom: 18px;
}
.reading-hero h1 {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 500;
  font-size: clamp(36px, 5vw, 60px);
  line-height: 1.05;
  letter-spacing: -0.01em;
  margin: 0 0 22px 0;
  color: var(--ink);
}
.reading-hero h1 em { font-style: italic; color: var(--gold-deep); }
.reading-hero .dek {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 21px;
  line-height: 1.5;
  color: var(--ink-mute);
  max-width: 62ch;
  margin: 0;
}
.reading-hero .byline {
  margin-top: 28px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--ink-mute);
}

.reading-body {
  padding: 64px 72px 120px;
  display: flex;
  justify-content: center;
}
.reading-body article {
  max-width: 680px;
  width: 100%;
}
.reading-body p {
  font-family: 'Lora', Georgia, serif;
  font-size: 18px;
  line-height: 1.8;
  color: var(--ink-soft);
  margin: 0 0 26px 0;
}
.reading-body article > p:first-of-type::first-letter {
  font-family: 'Cormorant Garamond', serif;
  font-size: 72px;
  float: left;
  line-height: 0.82;
  margin: 8px 10px 0 -2px;
  color: var(--gold-deep);
  font-weight: 500;
}
.reading-body h2 {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 500;
  font-size: 34px;
  line-height: 1.15;
  margin: 56px 0 22px;
  color: var(--ink);
}
.reading-body h3 {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 500;
  font-size: 24px;
  line-height: 1.2;
  margin: 40px 0 16px;
  color: var(--ink);
}
.reading-body h4 {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-weight: 500;
  font-size: 20px;
  margin: 32px 0 14px;
  color: var(--ink-soft);
}
.reading-body em, .reading-body i { font-style: italic; }
.reading-body strong, .reading-body b { color: var(--ink); font-weight: 600; }
.reading-body a { color: var(--gold-deep); text-decoration: underline; text-underline-offset: 3px; }
.reading-body blockquote.pull {
  border-left: 2px solid var(--gold-deep);
  padding: 4px 0 4px 24px;
  margin: 36px 0;
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 23px;
  color: var(--ink);
  line-height: 1.4;
}
.reading-body hr {
  border: none;
  text-align: center;
  margin: 48px 0;
  height: 1px;
}
.reading-body hr.asterism {
  height: auto;
  border: none;
  display: block;
}
.reading-body hr.asterism::before {
  content: "\2766";
  display: block;
  text-align: center;
  color: var(--gold-deep);
  font-size: 20px;
  letter-spacing: 0.5em;
}
.reading-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 32px 0;
  font-size: 15.5px;
}
.reading-body table caption {
  text-align: left;
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  color: var(--ink-mute);
  margin-bottom: 10px;
}
.reading-body th, .reading-body td {
  text-align: left;
  padding: 12px 16px;
  border-bottom: 1px solid var(--rule);
  vertical-align: top;
  line-height: 1.5;
  color: var(--ink-soft);
}
.reading-body th {
  font-family: 'Cormorant Garamond', serif;
  font-size: 13px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--gold-deep);
  font-weight: 600;
}
.reading-body table strong { color: var(--ink); }

.reading-footer {
  max-width: 680px;
  margin: 0 auto;
  padding: 0 72px 64px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 16px;
  color: var(--ink-mute);
}
.reading-footer a {
  text-decoration: none;
  color: var(--ink);
  border-bottom: 1px solid var(--ink);
  padding-bottom: 2px;
  font-style: normal;
  letter-spacing: 0.08em;
  transition: color 0.2s, border-color 0.2s;
}
.reading-footer a:hover { color: var(--gold-deep); border-color: var(--gold-deep); }

/* ================= FIGURE WRAPPER PAGES ================= */
.figure-frame {
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}
.figure-nav {
  display: flex; justify-content: space-between; align-items: center;
  padding: 20px 72px;
  font-family: 'Cormorant Garamond', serif;
  font-size: 14px; letter-spacing: 0.16em; text-transform: uppercase;
  border-bottom: 1px solid var(--rule);
}
.figure-nav a { text-decoration: none; color: var(--ink-soft); }
.figure-nav a:hover { color: var(--gold-deep); }

/* ================= RESPONSIVE ================= */
@media (max-width: 1100px) {
  section.spread, .reading-hero, .reading-body, .figure-nav { padding-left: 32px; padding-right: 32px; }
  .essays-grid, .book-spread, .about-spread { grid-template-columns: 1fr !important; }
  .topbar { padding: 18px 32px; flex-direction: column; gap: 16px; }
  nav.primary { gap: 20px; justify-content: center; }
  footer.colophon { grid-template-columns: 1fr; gap: 32px; padding-left: 32px; padding-right: 32px; }
  .hero { grid-template-columns: 1fr !important; }
  .hero-text { border-right: 0 !important; border-bottom: 1px solid var(--rule) !important; padding: 64px 32px !important; }
  .hero-portrait { padding: 48px 32px !important; }
  .about-portrait { position: static !important; }
  .about-spread, .book-spread { gap: 48px !important; }
}
@media (max-width: 600px) {
  nav.primary { gap: 8px 18px; }
  nav.primary a { font-size: 13px; letter-spacing: 0.12em; }
  section.spread, .reading-hero, .reading-body { padding-top: 56px; padding-bottom: 56px; }
  .quote-banner { padding: 48px 24px; }
  .hero-text, .hero-portrait { padding: 40px 20px !important; }
}
