/* ═══════════════════════════════════════════════════════
   preintakeproblem.com — editorial design system
   Single-essay publication. Paper feel. Serif everywhere.
   ═══════════════════════════════════════════════════════ */

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

:root {
  /* Paper palette */
  --paper:        #F4F0E8;
  --paper-deep:   #ECE5D5;
  --paper-warm:   #FAF6EC;
  --paper-faint:  rgba(244,240,232,0.6);

  /* Ink palette */
  --ink:          #0F0F0F;
  --ink-soft:     #2A2A2A;
  --ink-mid:      #555555;
  --ink-faint:    #888888;
  --ink-line:     #C8C0B0;
  --ink-rule:     rgba(15,15,15,0.12);

  /* Single accent */
  --orange:       #C0552E;
  --orange-deep:  #9A4424;
  --orange-soft:  rgba(192,85,46,0.08);
  --orange-mid:   rgba(192,85,46,0.2);

  /* Layout */
  --col:          720px;
  --col-narrow:   620px;
  --col-wide:     960px;
}

html { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; scroll-behavior: smooth; background: var(--paper); }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: 'Source Serif Pro', 'Source Serif 4', Georgia, 'Times New Roman', serif;
  font-size: 20px;
  line-height: 1.78;
  font-weight: 400;
  overflow-x: hidden;
  min-height: 100vh;
}

a { color: var(--orange); text-decoration: none; border-bottom: 1px solid var(--orange-mid); transition: border 0.15s ease, color 0.15s ease; }
a:hover { color: var(--orange-deep); border-bottom-color: var(--orange-deep); }

::selection { background: var(--orange); color: var(--paper); }

/* ───── Reading progress bar ───── */
.read-progress {
  position: fixed;
  top: 0; left: 0;
  height: 3px;
  background: var(--orange);
  width: 0%;
  z-index: 200;
  transition: width 0.05s linear;
}

/* ───── NAV (minimal masthead) ───── */
nav {
  border-bottom: 1px solid var(--ink-rule);
  background: var(--paper);
}
.nav-inner {
  max-width: var(--col-wide);
  margin: 0 auto;
  padding: 18px 32px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}
.nameplate {
  font-family: 'Playfair Display', 'Source Serif Pro', Georgia, serif;
  font-weight: 700;
  font-style: normal;
  font-size: 22px;
  color: var(--ink);
  letter-spacing: -0.3px;
  border-bottom: none;
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
}
.nameplate em { font-style: italic; color: var(--orange); }
.nav-links { display: flex; gap: 24px; }
.nav-links a {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-mid);
  letter-spacing: 0.02em;
  border-bottom: none;
}
.nav-links a:hover { color: var(--orange); }
.nav-links a.active { color: var(--ink); border-bottom: 1px solid var(--ink); padding-bottom: 2px; }

/* ───── MASTHEAD (essay header) ───── */
.masthead {
  max-width: var(--col);
  margin: 0 auto;
  padding: 64px 32px 32px;
}
.masthead .kicker {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--orange);
  font-weight: 600;
  margin-bottom: 28px;
}
.masthead h1 {
  font-family: 'Playfair Display', 'Source Serif Pro', Georgia, serif;
  font-weight: 700;
  font-size: clamp(48px, 7vw, 88px);
  line-height: 1.02;
  letter-spacing: -1.5px;
  color: var(--ink);
  margin-bottom: 28px;
}
.masthead h1 em { font-style: italic; color: var(--orange); font-weight: 700; }
.masthead .deck {
  font-family: 'Source Serif Pro', Georgia, serif;
  font-style: italic;
  font-size: 24px;
  line-height: 1.45;
  color: var(--ink-soft);
  margin-bottom: 36px;
  max-width: 620px;
}
.masthead .byline-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  padding: 18px 0;
  border-top: 1px solid var(--ink-rule);
  border-bottom: 1px solid var(--ink-rule);
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 13px;
  color: var(--ink-mid);
  letter-spacing: 0.01em;
}
.masthead .byline-row strong { color: var(--ink); font-weight: 600; }
.masthead .byline-row .sep { color: var(--ink-faint); margin: 0 2px; }
.masthead .byline-row .read-time::before { content: '· '; color: var(--ink-faint); margin-right: 4px; }

/* ───── ESSAY BODY ───── */
.essay {
  max-width: var(--col);
  margin: 0 auto;
  padding: 0 32px 96px;
}
.essay h2 {
  font-family: 'Playfair Display', 'Source Serif Pro', Georgia, serif;
  font-weight: 700;
  font-size: 36px;
  line-height: 1.15;
  letter-spacing: -0.5px;
  color: var(--ink);
  margin-top: 80px;
  margin-bottom: 8px;
}
.essay h2 .numeral {
  display: block;
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-weight: 400;
  font-size: 22px;
  color: var(--orange);
  margin-bottom: 12px;
  letter-spacing: 0;
}
.essay h3 {
  font-family: 'Playfair Display', serif;
  font-weight: 700;
  font-size: 24px;
  line-height: 1.2;
  color: var(--ink);
  margin-top: 40px;
  margin-bottom: 10px;
}
.essay p {
  font-size: 20px;
  line-height: 1.78;
  color: var(--ink);
  margin-bottom: 26px;
  font-weight: 400;
}
.essay p strong { font-weight: 700; color: var(--ink); }
.essay p em { font-style: italic; color: var(--ink); }

/* Drop cap on first paragraph after each H2 */
.essay h2 + p::first-letter,
.essay h2 + .lead::first-letter {
  font-family: 'Playfair Display', serif;
  font-weight: 700;
  font-size: 76px;
  line-height: 0.85;
  float: left;
  padding: 8px 12px 0 0;
  color: var(--orange);
  font-style: normal;
}

/* Section spacing rule */
.essay h2:not(:first-child) {
  position: relative;
}
.essay h2:not(:first-child)::before {
  content: '';
  display: block;
  width: 48px;
  height: 1px;
  background: var(--ink-line);
  margin-bottom: 56px;
}

/* Body lists inside essay */
.essay ul, .essay ol {
  margin: 26px 0;
  padding-left: 28px;
}
.essay ul li, .essay ol li {
  font-size: 20px;
  line-height: 1.7;
  margin-bottom: 14px;
  color: var(--ink);
}
.essay ul { list-style: none; padding-left: 0; }
.essay ul li {
  padding-left: 28px;
  position: relative;
}
.essay ul li::before {
  content: '·';
  color: var(--orange);
  position: absolute;
  left: 8px;
  font-size: 32px;
  line-height: 1;
  top: 2px;
}
.essay ol {
  counter-reset: olcount;
  list-style: none;
  padding-left: 0;
}
.essay ol li {
  counter-increment: olcount;
  padding-left: 42px;
  position: relative;
}
.essay ol li::before {
  content: counter(olcount) ".";
  font-family: 'Playfair Display', serif;
  font-style: italic;
  color: var(--orange);
  position: absolute;
  left: 8px;
  top: 0;
  font-size: 22px;
}

/* ───── PULL QUOTE ───── */
.pullquote {
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-weight: 400;
  font-size: 30px;
  line-height: 1.35;
  color: var(--ink-soft);
  margin: 48px 0;
  padding: 32px 0 32px 36px;
  border-left: 3px solid var(--orange);
  letter-spacing: -0.3px;
}
.pullquote cite {
  display: block;
  margin-top: 18px;
  font-family: 'Inter', sans-serif;
  font-style: normal;
  font-size: 12px;
  color: var(--ink-mid);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* ───── FOOTNOTES (inline) ───── */
.fn {
  font-size: 0.7em;
  vertical-align: super;
  color: var(--orange);
  font-weight: 600;
  cursor: help;
  text-decoration: none;
  border-bottom: none;
  margin-left: 1px;
}
.fn:hover { color: var(--orange-deep); }

.footnotes {
  max-width: var(--col);
  margin: 64px auto 0;
  padding: 32px 32px 0;
  border-top: 1px solid var(--ink-rule);
}
.footnotes h4 {
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-mid);
  margin-bottom: 20px;
}
.footnotes ol {
  font-size: 16px;
  line-height: 1.65;
  color: var(--ink-soft);
  padding-left: 0;
  list-style: none;
  counter-reset: fn;
}
.footnotes ol li {
  counter-increment: fn;
  padding-left: 32px;
  position: relative;
  margin-bottom: 14px;
}
.footnotes ol li::before {
  content: counter(fn);
  position: absolute;
  left: 0;
  top: 2px;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: 11px;
  color: var(--orange);
  letter-spacing: 0.04em;
}

/* ───── CALLOUT (sparingly used) ───── */
.callout {
  background: var(--paper-deep);
  padding: 28px 32px;
  margin: 40px 0;
  border-left: 3px solid var(--ink);
  font-style: italic;
  font-size: 19px;
  line-height: 1.55;
  color: var(--ink);
}

/* ───── AUTHOR BIO ───── */
.author-bio {
  max-width: var(--col);
  margin: 64px auto 0;
  padding: 40px 32px;
  border-top: 1px solid var(--ink-rule);
  border-bottom: 1px solid var(--ink-rule);
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 24px;
  align-items: start;
}
.author-bio .avatar {
  width: 64px; height: 64px;
  background: var(--ink);
  color: var(--paper);
  font-family: 'Playfair Display', serif;
  font-weight: 700;
  font-size: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  letter-spacing: -1px;
}
.author-bio .label {
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-mid);
  margin-bottom: 6px;
  font-weight: 600;
}
.author-bio .name {
  font-family: 'Playfair Display', serif;
  font-weight: 700;
  font-size: 22px;
  color: var(--ink);
  margin-bottom: 8px;
}
.author-bio p {
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink-soft);
  margin-bottom: 8px;
}

/* ───── SECTION ANCHOR NAV (desktop sidebar) ───── */
.toc {
  position: fixed;
  top: 50%;
  right: 28px;
  transform: translateY(-50%);
  z-index: 50;
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  letter-spacing: 0.05em;
  color: var(--ink-mid);
  max-width: 180px;
}
.toc h5 {
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 10px;
  font-weight: 600;
}
.toc ol { list-style: none; }
.toc ol li {
  margin-bottom: 6px;
  line-height: 1.35;
}
.toc ol li a {
  color: var(--ink-mid);
  border-bottom: none;
  display: block;
  padding: 2px 0;
  font-size: 11px;
}
.toc ol li a::before { content: counter(toccount) " · "; color: var(--ink-faint); }
.toc ol { counter-reset: toccount; }
.toc ol li { counter-increment: toccount; }
.toc ol li a:hover { color: var(--orange); }
.toc ol li a.current { color: var(--ink); font-weight: 600; }

@media (max-width: 1180px) { .toc { display: none; } }

/* ───── PAGE-LEVEL HEADER (for subpages) ───── */
.page-hero {
  max-width: var(--col);
  margin: 0 auto;
  padding: 56px 32px 32px;
}
.page-hero .crumbs {
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  color: var(--ink-mid);
  letter-spacing: 0.04em;
  margin-bottom: 24px;
}
.page-hero .crumbs a { border-bottom: none; }
.page-hero h1 {
  font-family: 'Playfair Display', serif;
  font-weight: 700;
  font-size: clamp(36px, 5vw, 56px);
  line-height: 1.08;
  letter-spacing: -0.5px;
  color: var(--ink);
  margin-bottom: 16px;
}
.page-hero .deck {
  font-size: 21px;
  font-style: italic;
  color: var(--ink-mid);
  line-height: 1.5;
}

/* ───── FOOTER ───── */
footer {
  border-top: 1px solid var(--ink-rule);
  background: var(--paper-warm);
  margin-top: 80px;
}
.footer-inner {
  max-width: var(--col-wide);
  margin: 0 auto;
  padding: 48px 32px 28px;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 48px;
}
.footer-pub {
  font-family: 'Playfair Display', serif;
  font-weight: 700;
  font-size: 20px;
  color: var(--ink);
  margin-bottom: 14px;
}
.footer-pub em { font-style: italic; color: var(--orange); }
.footer-brand p {
  font-size: 14px;
  color: var(--ink-mid);
  line-height: 1.6;
  max-width: 380px;
}
.footer-col h5 {
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-mid);
  margin-bottom: 14px;
}
.footer-col a {
  display: block;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  color: var(--ink-soft);
  padding: 4px 0;
  border-bottom: none;
}
.footer-col a:hover { color: var(--orange); }
.footer-bottom {
  max-width: var(--col-wide);
  margin: 0 auto;
  padding: 24px 32px;
  border-top: 1px solid var(--ink-rule);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  color: var(--ink-mid);
}
.footer-bottom .legal { display: flex; gap: 18px; }
.footer-bottom .legal a { color: var(--ink-mid); border-bottom: none; }
.footer-bottom .legal a:hover { color: var(--orange); }

/* ───── PROSE (for non-essay subpages) ───── */
.prose {
  max-width: var(--col);
  margin: 0 auto;
  padding: 0 32px 80px;
}
.prose h2 {
  font-family: 'Playfair Display', serif;
  font-weight: 700;
  font-size: 30px;
  line-height: 1.15;
  margin: 48px 0 14px;
  color: var(--ink);
}
.prose p {
  font-size: 19px;
  line-height: 1.7;
  color: var(--ink);
  margin-bottom: 22px;
}
.prose ul, .prose ol {
  margin: 22px 0;
  padding-left: 28px;
}
.prose ul li, .prose ol li {
  font-size: 18px;
  line-height: 1.65;
  margin-bottom: 12px;
}

/* ───── RESPONSIVE ───── */
@media (max-width: 768px) {
  body { font-size: 19px; }
  .nav-inner { padding: 14px 20px; }
  .nameplate { font-size: 18px; }
  .nav-links { gap: 16px; }
  .nav-links a { font-size: 12px; }
  .masthead { padding: 40px 20px 24px; }
  .masthead .deck { font-size: 21px; }
  .essay { padding: 0 20px 64px; }
  .essay h2 { font-size: 28px; margin-top: 56px; }
  .essay h2::before { margin-bottom: 36px !important; }
  .essay p { font-size: 19px; }
  .essay h2 + p::first-letter, .essay h2 + .lead::first-letter { font-size: 60px; }
  .pullquote { font-size: 22px; padding-left: 22px; }
  .footnotes { padding: 28px 20px 0; }
  .author-bio { padding: 32px 20px; grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr; gap: 32px; padding: 36px 20px 24px; }
  .footer-bottom { flex-direction: column; gap: 12px; align-items: flex-start; padding: 20px; }
  .page-hero { padding: 40px 20px 24px; }
  .prose { padding: 0 20px 64px; }
}
