/* The Fold — Alimony Cost. A typographic ledger, not a header-and-card template. */
:root {
  --mist: #e6e3db;
  --sheet: #f4f2ec;
  --leaf: #fbfaf6;
  --ink: #1b1a17;
  --quiet: #4a4740;
  --faint: #6f6b63;
  --rule: #bdb6aa;
  --spine: #241f1c;
  --berry: #6e2432;
  --berry-soft: #ead6d8;
  --copper: #7a5524;
  --lamp: #d7c085;
  --focus: #6e2432;
  --display: "Gloock", "Iowan Old Style", "Palatino Linotype", serif;
  --grotesk: "Bricolage Grotesk", "Segoe UI", sans-serif;
  --serif: "Source Serif 4", "Georgia", serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { margin: 0; min-height: 100%; }
body {
  background: var(--mist);
  color: var(--ink);
  font-family: var(--grotesk);
  font-size: 1.05rem;
  line-height: 1.6;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--berry); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { color: var(--ink); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }

.skip {
  position: absolute;
  left: 1rem;
  top: -3rem;
  background: var(--spine);
  color: #fff;
  padding: 0.5rem 0.8rem;
  z-index: 20;
}
.skip:focus { top: 0.75rem; }

/* Left typographic spine — not a top bar */
.spine {
  position: sticky;
  top: 0;
  align-self: start;
  min-height: 100vh;
  padding: 1.4rem 1rem 6rem;
  background: var(--spine);
  color: #efece6;
  display: flex;
  flex-direction: column;
  gap: 2rem;
  width: 9.5rem;
}
.mark {
  color: #fff;
  text-decoration: none;
  font-family: var(--display);
  font-size: 1.35rem;
  line-height: 0.95;
  letter-spacing: -0.02em;
}
.mark span { display: block; color: var(--lamp); font-size: 0.72rem; font-family: var(--grotesk); letter-spacing: 0.14em; text-transform: uppercase; margin-top: 0.45rem; }
.spine ol { list-style: none; margin: 0; padding: 0; }
.spine li { margin: 0 0 0.85rem; }
.spine a.nav {
  color: #d9d3c8;
  text-decoration: none;
  display: block;
  font-size: 0.86rem;
  border-bottom: 1px solid transparent;
  padding-bottom: 0.2rem;
  background-image: linear-gradient(var(--lamp), var(--lamp));
  background-repeat: no-repeat;
  background-position: 0 100%;
  background-size: 0 1px;
  transition: background-size 0.35s ease, color 0.2s ease;
}
.spine a.nav:hover, .spine a.nav[aria-current="page"] {
  color: #fff;
  background-size: 100% 1px;
}
.spine .num { display: block; font-family: var(--display); color: var(--lamp); font-size: 1rem; }
.colophon {
  margin-top: auto;
  font-size: 0.72rem;
  color: #b9b2a6;
  line-height: 1.45;
}

/* Bottom dock — mobile, and a quiet companion on desktop tools */
.dock {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  display: none;
  background: var(--spine);
  color: #fff;
  z-index: 12;
  border-top: 1px solid #3a332e;
}
.dock ul {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  list-style: none;
  margin: 0;
  padding: 0;
}
.dock a {
  color: #d9d3c8;
  text-decoration: none;
  text-align: center;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.7rem 0.2rem 0.8rem;
  display: block;
}
.dock a[aria-current="page"], .dock a:hover { color: var(--lamp); }

/* Folded spread */
.spread {
  display: grid;
  grid-template-columns: 9.5rem 1fr;
  min-height: 100vh;
}
.stage { min-width: 0; }

.fold {
  display: grid;
  grid-template-columns: minmax(18rem, 1fr) minmax(22rem, 1.05fr);
  min-height: 100vh;
  position: relative;
}
.fold::after {
  content: "";
  position: absolute;
  top: 0; bottom: 0;
  left: 50%;
  width: 1px;
  background: var(--rule);
  box-shadow: 10px 0 30px rgba(27, 26, 23, 0.06);
  pointer-events: none;
}
.leaf {
  padding: 2.4rem 2.2rem 5.5rem;
}
.leaf-essay { background: var(--sheet); }
.leaf-ledger { background: var(--leaf); }
.mast {
  font-family: var(--display);
  font-size: clamp(3rem, 7vw, 5.6rem);
  line-height: 0.9;
  margin: 0 0 1rem;
  letter-spacing: -0.03em;
  font-weight: 400;
}
.standfirst {
  font-family: var(--serif);
  font-size: 1.2rem;
  color: var(--quiet);
  margin: 0 0 1.4rem;
  max-width: 36rem;
}
.folio-label {
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--copper);
  margin: 0 0 0.8rem;
}

/* Ledger (home calculator) — accounting rows, not a boxed widget */
.ledger {
  border-top: 2px solid var(--ink);
  border-bottom: 2px solid var(--ink);
  padding: 1rem 0 1.2rem;
}
.ledger h2 {
  font-family: var(--display);
  font-weight: 400;
  font-size: 2rem;
  margin: 0 0 0.4rem;
}
.row {
  display: grid;
  grid-template-columns: 11rem 1fr;
  gap: 0.8rem;
  align-items: start;
  padding: 0.7rem 0;
  border-bottom: 1px dotted var(--rule);
}
.row label, .row .caption {
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--quiet);
  padding-top: 0.45rem;
}
.row .hint { font-size: 0.8rem; color: var(--faint); margin: 0.25rem 0 0; text-transform: none; letter-spacing: 0; }
select, input[type="text"], input[type="number"], input[type="email"], input[type="date"], textarea {
  width: 100%;
  font: inherit;
  color: var(--ink);
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--ink);
  border-radius: 0;
  padding: 0.35rem 0;
}
textarea { min-height: 7rem; border: 1px solid var(--rule); padding: 0.6rem; }
.choices { display: flex; flex-direction: column; gap: 0.25rem; }
.choices label { text-transform: none; letter-spacing: 0; font-size: 1rem; color: var(--ink); display: flex; gap: 0.5rem; align-items: flex-start; }
.ink-btn {
  font: inherit;
  font-weight: 600;
  background: var(--ink);
  color: var(--sheet);
  border: 0;
  padding: 0.7rem 1.1rem;
  cursor: pointer;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 0.82rem;
  text-decoration: none;
  display: inline-block;
}
.ink-btn:hover { background: var(--berry); color: #fff; }
.ghost-btn {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--ink);
  padding: 0.6rem 1rem;
  font: inherit;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 0.82rem;
  cursor: pointer;
}

/* Tear sheet results */
.tear {
  margin-top: 1.5rem;
  background: var(--sheet);
  padding: 1.3rem 1.1rem 1.2rem;
  position: relative;
}
.tear::before {
  content: "";
  position: absolute;
  top: -7px; left: 0; right: 0;
  height: 14px;
  background: radial-gradient(circle, var(--leaf) 5px, transparent 6px);
  background-size: 18px 14px;
  background-repeat: repeat-x;
}
.tear h3 { font-family: var(--display); font-weight: 400; font-size: 1.6rem; margin: 0 0 0.3rem; }
.big-range {
  font-family: var(--display);
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  color: var(--berry);
  margin: 0.2rem 0 0.7rem;
}
.accounts { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.accounts th, .accounts td { text-align: left; padding: 0.4rem 0; border-bottom: 1px dotted var(--rule); vertical-align: top; }
.accounts td:last-child { text-align: right; white-space: nowrap; }
.fine { font-size: 0.88rem; color: var(--quiet); }
.caution {
  border-left: 2px solid var(--berry);
  padding: 0.2rem 0 0.2rem 0.8rem;
  margin: 1rem 0;
  font-family: var(--serif);
}

/* Essay layout — editorial, drop cap, margin notes */
.essay-shell { background: var(--sheet); min-height: 100vh; }
.essay {
  display: grid;
  grid-template-columns: 8rem minmax(0, 38rem) 12rem;
  gap: 1.5rem;
  padding: 2.5rem 2rem 6rem;
  max-width: 68rem;
}
.margin-note {
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--copper);
  padding-top: 0.4rem;
}
article.reading { font-family: var(--serif); font-size: 1.14rem; }
article.reading h1 {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(2.4rem, 6vw, 4.2rem);
  line-height: 0.95;
  margin: 0 0 1rem;
}
article.reading .lede { font-size: 1.25rem; color: var(--quiet); }
article.reading h2 { font-family: var(--display); font-weight: 400; font-size: 1.8rem; margin: 2rem 0 0.6rem; }
article.reading p:first-of-type::first-letter {
  font-family: var(--display);
  float: left;
  font-size: 4.6rem;
  line-height: 0.8;
  padding: 0.12rem 0.4rem 0 0;
  color: var(--berry);
}
.aside {
  font-family: var(--serif);
  font-style: italic;
  color: var(--quiet);
  border-top: 1px solid var(--ink);
  padding-top: 0.8rem;
  margin-top: 2.5rem;
  font-size: 1.05rem;
}
.poster {
  margin: 3rem 0 0;
  padding: 2rem 0 0;
  border-top: 2px solid var(--ink);
}
.poster a {
  font-family: var(--display);
  font-size: 2rem;
  text-decoration: none;
  color: var(--ink);
  line-height: 1.1;
}
.poster a:hover { color: var(--berry); }

/* Worktable */
.bench {
  background:
    linear-gradient(180deg, transparent 39px, #ece7dc 39px, #ece7dc 40px, transparent 40px),
    var(--leaf);
  background-size: 100% 40px;
  min-height: 100vh;
  padding: 2rem 2.2rem 6.5rem;
}
.stamp {
  font-family: var(--display);
  font-size: clamp(2.2rem, 5vw, 3.6rem);
  margin: 0 0 0.4rem;
  line-height: 0.95;
}
.bench .intro { max-width: 40rem; font-family: var(--serif); color: var(--quiet); }
.work { max-width: 46rem; margin-top: 1.4rem; }

/* Letter (about, legal, contact) */
.letter {
  background: var(--sheet);
  min-height: 100vh;
  padding: 3.5rem 1.5rem 6rem;
}
.letterhead {
  max-width: 36rem;
  margin: 0 auto;
  font-family: var(--serif);
}
.letterhead .who {
  font-family: var(--display);
  font-size: 1.1rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--ink);
  padding-bottom: 0.6rem;
  margin-bottom: 2rem;
}
.letterhead h1 { font-family: var(--display); font-weight: 400; font-size: 2.8rem; line-height: 0.95; margin: 0 0 1rem; }
.letterhead h2 { font-family: var(--display); font-weight: 400; font-size: 1.5rem; }

/* Broadsheet index */
.broadsheet {
  background: var(--sheet);
  min-height: 100vh;
  padding: 2.2rem 2rem 6rem;
}
.broadsheet h1 {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(3rem, 8vw, 6rem);
  line-height: 0.85;
  margin: 0 0 1.5rem;
  border-bottom: 3px double var(--ink);
  padding-bottom: 0.4rem;
}
.columns {
  columns: 2 18rem;
  column-gap: 2.5rem;
}
.entry {
  break-inside: avoid;
  margin: 0 0 1.1rem;
  padding-bottom: 0.7rem;
  border-bottom: 1px solid var(--rule);
}
.entry a {
  font-family: var(--display);
  font-size: 1.55rem;
  text-decoration: none;
  color: var(--ink);
  line-height: 1.1;
}
.entry a:hover { color: var(--berry); }
.entry p { margin: 0.35rem 0 0; color: var(--quiet); }

/* Quiet 404 */
.quiet {
  background: var(--mist);
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 2rem 1.5rem 6rem;
  text-align: center;
}
.quiet h1 { font-family: var(--display); font-weight: 400; font-size: 3rem; margin: 0.6rem 0; }
.art { margin: 0 auto 1rem; width: min(22rem, 90vw); }

.tiny {
  font-size: 0.8rem;
  color: var(--faint);
  max-width: 46rem;
  margin: 2rem 0 0;
}
.base {
  padding: 1.2rem 2rem 5.5rem;
  font-size: 0.8rem;
  color: var(--faint);
  background: var(--sheet);
  border-top: 1px solid var(--rule);
}

.faq details {
  border-top: 1px solid var(--rule);
  padding: 0.7rem 0;
}
.faq summary { cursor: pointer; font-weight: 600; }
.checklist label { display: flex; gap: 0.55rem; padding: 0.35rem 0; border-bottom: 1px dotted var(--rule); }
.output {
  white-space: pre-wrap;
  font-family: var(--serif);
  border-top: 2px solid var(--ink);
  margin-top: 1rem;
  padding-top: 0.8rem;
}

@media (max-width: 960px) {
  .spread { grid-template-columns: 1fr; }
  .spine { display: none; }
  .dock { display: block; }
  .fold { grid-template-columns: 1fr; }
  .fold::after { display: none; }
  .essay { grid-template-columns: 1fr; }
  .margin-note { padding-top: 0; }
  .row { grid-template-columns: 1fr; }
  .leaf { padding: 1.6rem 1.2rem 5.5rem; }
}
@media (min-width: 961px) {
  .dock { display: none; }
  .bench .dock-note { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .spine a.nav { transition: none; }
}

@media print {
  .spine, .dock, .ink-btn, .ghost-btn, .skip { display: none !important; }
  .spread { display: block; }
  body { background: #fff; }
}
