/* ============================================================
   FT WEEKEND × EDITORIAL BOOK
   ============================================================ */

:root {
  --paper:        #fbe3d6;
  --paper-deep:   #f4d4c1;
  --paper-edge:   #ead0bb;
  --ink:          #1a1612;
  --ink-soft:     #4a3c30;
  --ink-mute:     #8a7a6c;
  --rule:         #d4b59c;
  --accent:       #c8102e;
  --accent-soft:  #e8716a;
  --money:        #0f4d2a;
  --noise-alpha:  0.04;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper:        #0e0907;
    --paper-deep:   #16100b;
    --paper-edge:   #1d150f;
    --ink:          #f0e6d6;
    --ink-soft:     #c4b8a4;
    --ink-mute:     #7e7164;
    --rule:         #3a2e22;
    --accent:       #ff6b5e;
    --accent-soft:  #f8a384;
    --money:        #7ad99c;
    --noise-alpha:  0.06;
  }
}

* { box-sizing: border-box; }
::selection { background: var(--accent); color: var(--paper); }

html { background: var(--paper); }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "PT Serif", Georgia, "Times New Roman", serif;
  font-size: 18px;
  line-height: 1.7;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "kern" 1, "liga" 1, "onum" 1;
  position: relative;
}
body::before {
  content: "";
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: var(--noise-alpha);
  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.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 1 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  mix-blend-mode: multiply;
}

.layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  min-height: 100vh;
  position: relative;
  z-index: 2;
}

aside.toc {
  background: var(--paper-deep);
  border-right: 1px solid var(--rule);
  padding: 40px 30px 80px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--rule) transparent;
}
aside.toc::-webkit-scrollbar { width: 6px; }
aside.toc::-webkit-scrollbar-thumb { background: var(--rule); border-radius: 3px; }

.brand { display: block; text-decoration: none; color: var(--ink); margin-bottom: 32px; }
.brand .mark {
  font-family: "Oswald", "PT Sans Narrow", sans-serif;
  font-weight: 500;
  font-size: 10px;
  letter-spacing: 0.32em;
  color: var(--accent);
  display: block;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--ink);
  margin-bottom: 14px;
}
.brand .name {
  font-family: "Playfair Display", "Times New Roman", serif;
  font-weight: 900;
  font-style: italic;
  font-size: 26px;
  line-height: 1.0;
  letter-spacing: -0.015em;
  color: var(--ink);
  display: block;
}
.brand .sub {
  font-family: "PT Serif", serif;
  font-style: italic;
  font-size: 13px;
  color: var(--ink-soft);
  margin-top: 8px;
  display: block;
  line-height: 1.4;
}

aside.toc .section {
  font-family: "Oswald", sans-serif;
  font-weight: 500;
  font-size: 10px;
  letter-spacing: 0.3em;
  color: var(--ink-mute);
  margin: 28px 0 0;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--rule);
}

aside.toc ol { list-style: none; padding: 0; margin: 4px 0 0; counter-reset: ch; }
aside.toc li { counter-increment: ch; }
aside.toc a {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px dotted var(--rule);
  font-family: "PT Serif", serif;
  font-size: 14px;
  line-height: 1.3;
  color: var(--ink-soft);
  text-decoration: none;
  transition: color 0.15s, padding-left 0.15s;
}
aside.toc a::before {
  content: counter(ch, decimal-leading-zero);
  font-family: "Oswald", sans-serif;
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--ink-mute);
  padding-top: 4px;
}
aside.toc a:hover { color: var(--ink); padding-left: 4px; }
aside.toc a.active { color: var(--accent); font-style: italic; font-weight: 700; }
aside.toc a.active::before { color: var(--accent); }

main {
  padding: 72px 88px 120px;
  max-width: 900px;
}

article.chapter { position: relative; }

.eyebrow {
  font-family: "Oswald", sans-serif;
  font-weight: 500;
  font-size: 13px;
  letter-spacing: 0.4em;
  color: var(--accent);
  margin: 0 0 22px;
  display: flex;
  align-items: center;
  gap: 18px;
}
.eyebrow::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--accent);
  opacity: 0.5;
}

article.chapter h1 {
  font-family: "Playfair Display", serif;
  font-weight: 900;
  font-style: italic;
  font-size: clamp(40px, 5.5vw, 68px);
  line-height: 0.98;
  letter-spacing: -0.022em;
  margin: 0 0 40px;
  color: var(--ink);
  text-wrap: balance;
}

article.chapter h2 {
  font-family: "Playfair Display", serif;
  font-weight: 700;
  font-size: 30px;
  line-height: 1.18;
  margin: 64px 0 20px;
  letter-spacing: -0.012em;
}
article.chapter h2::before {
  content: "";
  display: block;
  width: 44px;
  height: 2px;
  background: var(--accent);
  margin-bottom: 14px;
}

article.chapter h3 {
  font-family: "Playfair Display", serif;
  font-weight: 600;
  font-style: italic;
  font-size: 22px;
  line-height: 1.3;
  margin: 40px 0 14px;
  color: var(--ink);
}

article.chapter h4, article.chapter h5, article.chapter h6 {
  font-family: "Oswald", sans-serif;
  font-weight: 500;
  font-size: 13px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 32px 0 12px;
}

article.chapter p { margin: 0 0 22px; hyphens: auto; -webkit-hyphens: auto; }

article.chapter > p:first-of-type::first-letter {
  font-family: "Playfair Display", serif;
  font-weight: 900;
  font-style: italic;
  font-size: 5.6em;
  line-height: 0.82;
  float: left;
  margin: 8px 14px -4px -2px;
  color: var(--accent);
}

article.chapter a {
  color: var(--ink);
  text-decoration: none;
  background-image: linear-gradient(to top, var(--accent) 1.5px, transparent 1.5px);
  background-position: 0 100%;
  background-repeat: repeat-x;
  background-size: 100% 2px;
  transition: color 0.15s, background-size 0.2s;
  padding-bottom: 1px;
}
article.chapter a:hover { color: var(--accent); background-size: 100% 22px; }

article.chapter hr {
  border: none;
  margin: 56px 0;
  text-align: center;
  line-height: 1;
  height: 12px;
}
article.chapter hr::before {
  content: "✦ ✦ ✦";
  font-size: 14px;
  color: var(--accent);
  letter-spacing: 0.8em;
}

article.chapter blockquote {
  margin: 36px 0;
  padding: 8px 0 8px 32px;
  border-left: 3px solid var(--accent);
  font-family: "Playfair Display", serif;
  font-style: italic;
  font-weight: 400;
  font-size: 24px;
  line-height: 1.38;
  color: var(--ink);
  text-wrap: balance;
}
article.chapter blockquote p { margin: 0 0 8px; }
article.chapter blockquote p:last-child { margin-bottom: 0; }
article.chapter blockquote em { font-style: normal; font-weight: 600; }
article.chapter blockquote strong { font-style: normal; }

article.chapter table {
  border-collapse: collapse;
  width: 100%;
  margin: 36px 0;
  font-size: 15px;
  border-top: 2px solid var(--ink);
  border-bottom: 2px solid var(--ink);
}
article.chapter th {
  font-family: "Oswald", sans-serif;
  font-weight: 500;
  letter-spacing: 0.2em;
  font-size: 11px;
  color: var(--accent);
  text-align: left;
  padding: 14px 18px 14px 0;
  border-bottom: 1px solid var(--ink);
  text-transform: uppercase;
}
article.chapter td {
  padding: 12px 18px 12px 0;
  border-bottom: 1px solid var(--rule);
  font-family: "PT Serif", serif;
  vertical-align: top;
  font-feature-settings: "tnum" 1, "lnum" 1;
}
article.chapter tr:last-child td { border-bottom: none; }
article.chapter td:last-child {
  font-family: "JetBrains Mono", "SF Mono", monospace;
  font-size: 14px;
  color: var(--money);
  font-weight: 600;
  text-align: right;
  white-space: nowrap;
}
article.chapter table th:last-child { text-align: right; }

article.chapter strong { font-weight: 700; }
article.chapter em { font-style: italic; }

article.chapter code {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.86em;
  background: var(--paper-deep);
  padding: 2px 7px;
  border-radius: 2px;
  border: 1px solid var(--rule);
}

article.chapter pre {
  font-family: "JetBrains Mono", monospace;
  background: var(--paper-deep);
  border-left: 3px solid var(--accent);
  padding: 18px 22px;
  overflow-x: auto;
  font-size: 14px;
  line-height: 1.55;
  margin: 28px 0;
}
article.chapter pre code { background: none; padding: 0; border: none; }

article.chapter ul, article.chapter ol { padding-left: 26px; margin: 0 0 22px; }
article.chapter li { margin: 8px 0; padding-left: 6px; }
article.chapter ul li::marker { color: var(--accent); content: "▸ "; }
article.chapter ol li::marker { color: var(--accent); font-weight: 700; }

article.chapter img { max-width: 100%; height: auto; margin: 28px 0; border: 1px solid var(--rule); }

.nav-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  margin-top: 96px;
  padding-top: 36px;
  border-top: 2px solid var(--ink);
}
.nav-buttons a {
  display: block;
  text-decoration: none;
  color: var(--ink);
  background: none;
  padding: 0;
  transition: color 0.15s;
}
.nav-buttons a .label {
  font-family: "Oswald", sans-serif;
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.3em;
  color: var(--accent);
  display: block;
  margin-bottom: 6px;
}
.nav-buttons a .name {
  font-family: "Playfair Display", serif;
  font-style: italic;
  font-size: 19px;
  line-height: 1.3;
  display: block;
}
.nav-buttons a:hover .name { color: var(--accent); }
.nav-buttons .next { text-align: right; }
.nav-buttons .placeholder { visibility: hidden; }

.footer-note {
  font-style: italic;
  font-size: 13px;
  color: var(--ink-mute);
  margin: 48px 0 0;
  padding-top: 24px;
  border-top: 1px solid var(--rule);
  max-width: 640px;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}
article.chapter > .eyebrow { animation: fadeUp 0.55s ease-out 0.05s backwards; }
article.chapter > h1       { animation: fadeUp 0.65s ease-out 0.16s backwards; }
article.chapter > p:nth-of-type(1) { animation: fadeUp 0.7s ease-out 0.32s backwards; }
article.chapter > p:nth-of-type(2) { animation: fadeUp 0.7s ease-out 0.42s backwards; }
@media (prefers-reduced-motion: reduce) {
  article.chapter > * { animation: none !important; }
}

/* ---------- Cover (index.html) ---------- */
.cover { padding: 88px 88px 128px; position: relative; }
.cover .indicia {
  font-family: "Oswald", sans-serif;
  font-weight: 500;
  font-size: 12px;
  letter-spacing: 0.4em;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: 18px;
  margin: 0 0 36px;
}
.cover .indicia::before, .cover .indicia::after {
  content: "";
  flex: 0 0 56px;
  height: 1px;
  background: var(--accent);
}
.cover .indicia::after { flex: 1; }
.cover h1.title {
  font-family: "Playfair Display", serif;
  font-weight: 900;
  font-style: italic;
  font-size: clamp(58px, 9.5vw, 124px);
  line-height: 0.9;
  letter-spacing: -0.028em;
  margin: 0 0 28px;
  text-wrap: balance;
  color: var(--ink);
}
.cover .deck {
  font-family: "Playfair Display", serif;
  font-weight: 400;
  font-style: italic;
  font-size: clamp(20px, 2.4vw, 30px);
  line-height: 1.28;
  color: var(--ink-soft);
  margin: 0 0 56px;
  max-width: 720px;
  text-wrap: balance;
}
.cover .lede { font-family: "PT Serif", serif; font-size: 19px; line-height: 1.7; max-width: 660px; }
.cover .lede > p:first-of-type::first-letter {
  font-family: "Playfair Display", serif;
  font-weight: 900;
  font-style: italic;
  font-size: 5em;
  line-height: 0.82;
  float: left;
  margin: 6px 12px -2px -2px;
  color: var(--accent);
}
.cover .stats {
  margin: 64px 0 0;
  border-top: 2px solid var(--ink);
  border-bottom: 2px solid var(--ink);
  padding: 28px 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
}
.cover .stat { padding: 0 22px; border-right: 1px solid var(--rule); }
.cover .stat:first-child { padding-left: 0; }
.cover .stat:last-child { padding-right: 0; border-right: none; }
.cover .stat .v {
  font-family: "Playfair Display", serif;
  font-weight: 900;
  font-style: italic;
  font-size: clamp(34px, 4vw, 48px);
  line-height: 1;
  color: var(--accent);
  letter-spacing: -0.02em;
}
.cover .stat .k {
  font-family: "Oswald", sans-serif;
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.22em;
  color: var(--ink-mute);
  margin-top: 10px;
  text-transform: uppercase;
}
.cover .cta {
  display: inline-block;
  margin-top: 56px;
  padding: 18px 44px;
  background: var(--ink);
  color: var(--paper);
  font-family: "Oswald", sans-serif;
  font-weight: 500;
  font-size: 13px;
  letter-spacing: 0.3em;
  text-decoration: none;
  border: 2px solid var(--ink);
  transition: transform 0.12s, box-shadow 0.12s;
  box-shadow: 6px 6px 0 var(--accent);
}
.cover .cta:hover { transform: translate(-2px, -2px); box-shadow: 8px 8px 0 var(--accent); }
.cover .cta:active { transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--accent); }

.cover > .indicia { animation: fadeUp 0.55s ease-out 0.05s backwards; }
.cover > h1.title { animation: fadeUp 0.7s ease-out 0.18s backwards; }
.cover > .deck    { animation: fadeUp 0.7s ease-out 0.34s backwards; }
.cover > .lede    { animation: fadeUp 0.7s ease-out 0.48s backwards; }
.cover > .stats   { animation: fadeUp 0.7s ease-out 0.6s backwards; }
.cover > .cta     { animation: fadeUp 0.7s ease-out 0.72s backwards; }

/* ---------- Mobile ---------- */
.mobile-toggle { display: none; }
@media (max-width: 920px) {
  body { font-size: 17px; }
  .layout { grid-template-columns: 1fr; }
  aside.toc {
    position: fixed;
    left: -340px;
    top: 0;
    width: 320px;
    height: 100vh;
    z-index: 50;
    transition: left 0.28s cubic-bezier(.2,.7,.3,1);
    box-shadow: 8px 0 32px rgba(20, 10, 5, 0.18);
  }
  aside.toc.open { left: 0; }
  main { padding: 32px 22px 80px; }
  .cover { padding: 28px 22px 80px; }
  article.chapter h1 { font-size: clamp(34px, 9vw, 48px); margin-bottom: 28px; }
  article.chapter h2 { font-size: 24px; margin-top: 44px; }
  article.chapter > p:first-of-type::first-letter { font-size: 4.4em; margin: 6px 10px -2px -1px; }
  article.chapter blockquote { font-size: 20px; padding-left: 22px; margin: 28px 0; }
  .cover .stats { grid-template-columns: repeat(2, 1fr); border: none; padding: 0; }
  .cover .stat { border: 1px solid var(--rule); padding: 18px 16px; margin: -1px -1px 0 0; }
  .cover .cta { width: 100%; text-align: center; }
  .nav-buttons { gap: 16px; }
  .nav-buttons a .name { font-size: 16px; }

  .mobile-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    position: fixed;
    top: 14px;
    right: 14px;
    z-index: 60;
    background: var(--paper);
    color: var(--ink);
    border: 1.5px solid var(--ink);
    border-radius: 0;
    padding: 8px 14px;
    font-family: "Oswald", sans-serif;
    font-weight: 500;
    font-size: 12px;
    letter-spacing: 0.25em;
    cursor: pointer;
    box-shadow: 3px 3px 0 var(--accent);
    transition: transform 0.1s, box-shadow 0.1s;
  }
  .mobile-toggle:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--accent); }
  .mobile-toggle:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--accent); }
}

@media print {
  aside.toc, .mobile-toggle, .nav-buttons { display: none; }
  body::before { display: none; }
  main { padding: 0; max-width: 100%; }
  article.chapter h1 { page-break-after: avoid; }
  article.chapter blockquote { page-break-inside: avoid; }
}