/* TenFold Ledger
   Two materials: the columnar pad (pale green paper, green column rules,
   red double margin rules, red audit ticks) and the bound ledger cover
   (bottle-green cloth, gold foil). */

:root {
  --paper: #E8EFE0;
  --sheet: #F8FAF4;
  --ink: #1B2A26;
  --ink-2: #4B5D56;
  --ink-3: #5E6E67;
  --rule: #C6DAC0;
  --rule-2: #9DBF97;
  --red: #C0392B;
  --cover: #143A30;
  --cover-deep: #0F2C25;
  --foil: #D2B469;
  --foil-light: #EBDCA8;
  --on-cover: #E4EBDD;
  --on-cover-2: #B9C8B7;

  /* chart series, validated against --sheet (dataviz validator, light mode) */
  --c-tf: #1F8A5F;
  --c-vendor: #8C6BB1;

  --display: "Libre Caslon Display", "Libre Caslon Text", Georgia, "Times New Roman", serif;
  --sans: "Archivo", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --wrap: 1240px;
  --gutter: clamp(16px, 4vw, 48px);
  --header-h: 4.5rem;

  interpolate-size: allow-keywords;
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 1rem);
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.125rem;
  line-height: 1.6;
  font-variation-settings: "wdth" 100;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

::selection { background: #CDE3C4; color: var(--ink); }

h1, h2, h3 { margin: 0; text-wrap: balance; }
h1, h2 { font-family: var(--display); font-weight: 400; letter-spacing: -0.012em; }
p { margin: 0 0 1em; text-wrap: pretty; }
p:last-child { margin-bottom: 0; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
a:hover { text-decoration-style: double; }
img, svg { display: block; }

:focus-visible { outline: 3px solid var(--c-tf); outline-offset: 3px; border-radius: 2px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip {
  position: absolute; left: var(--gutter); top: -4rem; z-index: 100;
  background: var(--ink); color: var(--sheet); padding: 0.6rem 1rem; border-radius: 3px;
}
.skip:focus { top: 0.75rem; }

.wrap { max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }

.num { text-align: right; font-variant-numeric: tabular-nums lining-nums; }

/* ---------- Buttons and links ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 3rem; padding: 0.8rem 1.4rem;
  background: var(--ink); color: var(--sheet);
  font: 600 1rem/1.2 var(--sans);
  text-decoration: none; border: 0; border-radius: 3px; cursor: pointer;
  transition: background-color 0.15s ease;
}
.btn:hover { background: #2B453D; text-decoration: none; }
.btn--small { min-height: 2.5rem; padding: 0.55rem 1rem; font-size: 0.95rem; }

.link-quiet {
  font-weight: 600; text-decoration: underline;
  text-decoration-thickness: 1px; text-underline-offset: 0.3em;
}

/* ---------- Masthead ---------- */

.masthead {
  position: sticky; top: 0; z-index: 50;
  background: rgb(232 239 224 / 0.92);
  backdrop-filter: saturate(1.2) blur(8px);
  -webkit-backdrop-filter: saturate(1.2) blur(8px);
  border-bottom: 1px solid var(--rule-2);
}
.masthead__inner {
  display: flex; align-items: center; justify-content: space-between; gap: 1.5rem;
  height: var(--header-h);
}

.brand {
  display: inline-flex; align-items: center; gap: 0.6rem;
  color: var(--ink); text-decoration: none;
}
.brand:hover { text-decoration: none; }
.brand__mark { width: 30px; height: 30px; flex: none; }
.brand__name { font-family: "Libre Caslon Text", var(--display); font-size: 1.3rem; line-height: 1; letter-spacing: -0.005em; white-space: nowrap; }

.nav { display: flex; align-items: center; gap: 1.75rem; }
.nav a:not(.btn) {
  font-size: 0.975rem; font-weight: 500; text-decoration: none;
  padding-block: 0.4rem; white-space: nowrap;
}
.nav a:not(.btn):hover { text-decoration: underline double; text-underline-offset: 0.35em; }

.nav-toggle {
  display: none;
  font: 600 0.95rem/1 var(--sans); color: var(--ink);
  background: transparent; border: 1.5px solid var(--ink); border-radius: 3px;
  padding: 0.6rem 0.9rem; cursor: pointer;
}

@media (max-width: 980px) {
  .nav-toggle { display: inline-block; }
  .nav {
    display: none;
    position: absolute; left: 0; right: 0; top: var(--header-h);
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--paper); border-bottom: 1px solid var(--rule-2);
    padding: 0.5rem var(--gutter) 1.25rem;
  }
  .nav.is-open { display: flex; }
  .nav a:not(.btn) { padding-block: 0.85rem; border-bottom: 1px solid var(--rule); font-size: 1.05rem; }
  .nav .btn { margin-top: 1rem; }
}

/* ---------- Sections ---------- */

.section { padding-block: clamp(80px, 10vw, 144px); }
.section--sheet { background: var(--sheet); border-block: 1px solid var(--rule); }

.section__head { max-width: 46rem; }
.section__head h2 { font-size: clamp(2.25rem, 4.4vw, 3.75rem); line-height: 1.04; margin-bottom: 0.45em; }
.section__intro { font-size: 1.25rem; line-height: 1.55; color: var(--ink-2); max-width: 40em; }

/* ---------- Hero ---------- */

.hero { padding-block: clamp(48px, 7vw, 104px) clamp(80px, 9vw, 136px); }
.hero__grid { display: grid; column-gap: clamp(48px, 6vw, 96px); row-gap: clamp(36px, 5vw, 56px); align-items: start; }
@media (min-width: 1040px) {
  .hero__grid { grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); }
  .hero__title { grid-column: 1 / -1; }
  .hero__copy { padding-top: 0.5rem; }
}

.hero__title {
  font-size: clamp(2.75rem, 6.6vw, 6rem);
  line-height: 0.98;
  letter-spacing: -0.02em;
}
@media (max-width: 1039px) { .hero__title { margin-bottom: -0.5rem; } }
.hero__title > span { display: block; }
.hero__lede { font-size: 1.25rem; line-height: 1.55; color: var(--ink-2); max-width: 30em; }
.hero__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.75rem; margin-top: 2rem; }
.hero__cred {
  margin-top: 2.75rem; padding-top: 1.1rem; max-width: 32em;
  border-top: 1px solid var(--rule-2);
  font-size: 0.975rem; color: var(--ink-2);
}

/* The sheet: a page torn from a columnar pad, top corner folded */

.sheet {
  --leg: 2.4rem;
  position: relative;
  margin: 0;
  padding: 1.6rem 1.75rem 1.9rem;
  background: linear-gradient(-135deg, transparent calc(var(--leg) * 0.7071), var(--sheet) 0);
  filter: drop-shadow(0 1px 1px rgb(27 42 38 / 0.10)) drop-shadow(0 22px 28px rgb(27 42 38 / 0.10));
}
.sheet::before {
  content: "";
  position: absolute; top: 0; right: 0;
  width: var(--leg); height: var(--leg);
  background: linear-gradient(to left bottom, transparent 50%, #D3E2CB 0, #E6EEDF);
  border-bottom-left-radius: 4px;
  filter: drop-shadow(-1px 2px 2px rgb(27 42 38 / 0.18));
}

.sheet__cap { display: flex; flex-direction: column; gap: 0.15rem; margin-bottom: 1.1rem; padding-right: 2.5rem; }
.sheet__title { font-weight: 650; font-size: 1.05rem; }
.sheet__note { font-size: 0.875rem; color: var(--ink-3); }

.sheet__table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
  line-height: 1.35;
  font-variant-numeric: tabular-nums lining-nums;
}
.sheet__table th, .sheet__table td { padding: 0.62rem 0.6rem; }
.sheet__table thead th {
  font-size: 0.8rem; font-weight: 600; color: var(--ink-2);
  font-variation-settings: "wdth" 80;
  text-align: left; vertical-align: bottom;
  padding-top: 0; padding-bottom: 0.5rem;
  border-bottom: 3px double var(--red);
}
.sheet__table thead th.num { text-align: right; }
.sheet__table tbody td { border-bottom: 1px solid var(--rule); }
.sheet__table .c-month { width: 3.4rem; text-align: right; padding-right: 0.75rem; border-right: 3px double var(--red); }
.sheet__table .c-part { padding-left: 0.9rem; white-space: nowrap; }
.sheet__table .num { border-left: 1px solid var(--rule); white-space: nowrap; }
.sheet__table .c-tick { width: 1.75rem; padding-inline: 0.35rem 0; color: var(--red); }
.sheet__table .c-tick svg { width: 18px; height: 14px; }
.sheet__table td > span, .sheet__table th > span { display: inline-block; }

.sheet__table tfoot th, .sheet__table tfoot td { padding-top: 0.75rem; font-weight: 650; }
.sheet__table tfoot .c-total-label { text-align: left; font-weight: 600; color: var(--ink-2); font-size: 0.875rem; }
.sheet__table tfoot td.num:not(:empty) { border-top: 1.5px solid var(--ink); }
.sheet__table .total { position: relative; }
.sheet__table .total::after {
  content: "";
  position: absolute; left: 0.6rem; right: 0.6rem; bottom: 0.05rem;
  height: 5px; border-block: 1.5px solid var(--ink);
}

@media (max-width: 560px) {
  .sheet { padding: 1.25rem 1rem 1.5rem; --leg: 1.9rem; }
  .sheet__table { font-size: 0.875rem; }
  .sheet__table th, .sheet__table td { padding-inline: 0.4rem; }
  /* collapse, don't remove, so the totals label can still span it */
  .sheet__table .c-part { width: 0; padding: 0; font-size: 0; }
  .sheet__table .c-month { width: 2.6rem; padding-right: 0.55rem; }
  .sheet__table tfoot .c-total-label { white-space: nowrap; text-align: right; padding-right: 0.55rem; }
  .sheet__table .c-total-long { display: none; }
}

/* The writing sequence. Only armed when JS is present; JS starts it when the sheet is seen. */
@media (prefers-reduced-motion: no-preference) {
  .js .sheet tbody td > span,
  .js .sheet tfoot :is(th, td) > span {
    clip-path: inset(-0.3em 100% -0.3em 0);
  }
  .js .sheet tbody .c-tick svg { stroke-dasharray: 22; stroke-dashoffset: 22; }
  .js .sheet tfoot td.num:not(:empty) { border-top-color: transparent; transition: border-color 0.3s ease 2.55s; }
  .js .sheet .total::after { transform: scaleX(0); transform-origin: right; }

  .sheet tbody td:nth-child(2) { --c: 1; }
  .sheet tbody td:nth-child(3) { --c: 2; }
  .sheet tbody td:nth-child(4) { --c: 3; }
  .sheet tbody td:nth-child(5) { --c: 4; }

  .js .sheet.is-writing tbody td > span {
    animation: write 0.42s cubic-bezier(0.45, 0.05, 0.25, 1) forwards;
    animation-delay: calc(0.25s + var(--i) * 0.32s + var(--c, 0) * 0.08s);
  }
  .js .sheet.is-writing tbody .c-tick svg {
    animation: draw 0.3s ease-out forwards;
    animation-delay: calc(0.25s + var(--i) * 0.32s + 0.42s);
  }
  .js .sheet.is-writing tfoot td.num:not(:empty) { border-top-color: var(--ink); }
  .js .sheet.is-writing tfoot :is(th, td) > span {
    animation: write 0.5s cubic-bezier(0.45, 0.05, 0.25, 1) forwards;
    animation-delay: 2.65s;
  }
  .js .sheet.is-writing .total::after {
    animation: rule 0.55s cubic-bezier(0.6, 0, 0.2, 1) forwards;
    animation-delay: 3.1s;
  }
}
@keyframes write { to { clip-path: inset(-0.3em 0 -0.3em 0); } }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes rule { to { transform: scaleX(1); } }

/* ---------- Why: the T-account ---------- */

.taccount { margin-top: clamp(2.5rem, 5vw, 4rem); max-width: 68rem; }
.taccount__row { display: grid; grid-template-columns: 1fr 1fr; }
.taccount__row > * {
  margin: 0;
  padding: 1.15rem 2.25rem 1.15rem 0;
  border-bottom: 1px solid var(--rule-2);
  font-size: 1.125rem; line-height: 1.5;
}
.taccount__row > :first-child { color: var(--ink-2); }
.taccount__row > :last-child { padding-left: 2.25rem; padding-right: 0; border-left: 2px solid var(--ink); }
.taccount__row:last-child > * { border-bottom: 0; }
.taccount__row--head > * {
  font-family: var(--display); font-weight: 400;
  font-size: clamp(1.6rem, 2.7vw, 2.3rem); line-height: 1.1;
  padding-top: 0; padding-bottom: 0.85rem;
  border-bottom: 2px solid var(--ink);
}
.taccount__row--head > :first-child { color: var(--ink-2); }
.taccount__row--head > :last-child { border-left: 0; }

@media (max-width: 720px) {
  .taccount__row { grid-template-columns: 1fr; padding-block: 1rem; border-bottom: 1px solid var(--rule-2); }
  .taccount__row:last-child { border-bottom: 0; }
  .taccount__row--head { display: none; }
  .taccount__row > * { border-bottom: 0; padding: 0.35rem 0; }
  .taccount__row > :last-child { padding-left: 1rem; margin-top: 0.4rem; }
  .taccount__row > *::before {
    content: attr(data-side);
    display: block; font-size: 0.85rem; font-weight: 600; color: var(--ink-3);
  }
}

/* ---------- Glide path: phases ---------- */

.phases {
  list-style: none; margin: clamp(2.75rem, 5vw, 4rem) 0 0; padding: 0;
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 2px solid var(--ink);
}
.phase { position: relative; display: flex; flex-direction: column; padding: 1.6rem 2rem 0 0; }
.phase::before {
  content: ""; position: absolute; top: -7px; left: 0;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--sheet); border: 2px solid var(--ink);
}
.phase:last-child::before { background: var(--c-tf); border-color: var(--c-tf); }
.phase__when { margin: 0 0 0.3rem; font-size: 0.875rem; font-weight: 600; color: var(--ink-3); font-variation-settings: "wdth" 85; }
.phase__name { font-family: var(--display); font-weight: 400; font-size: 1.85rem; line-height: 1.1; margin-bottom: 0.55rem; }
.phase p { font-size: 1rem; color: var(--ink-2); }
.phase .phase__fee {
  margin-top: auto; padding-top: 0.7rem;
  border-top: 1px solid var(--rule);
  font-size: 0.925rem; font-weight: 600; color: var(--ink);
}
.phase > p:nth-last-child(2) { margin-bottom: 1.1rem; }

@media (max-width: 960px) {
  .phases { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 2.5rem; border-top: 0; }
  .phase { border-top: 2px solid var(--ink); }
}
@media (max-width: 560px) {
  .phases { grid-template-columns: 1fr; row-gap: 0; border-top: 0; border-left: 2px solid var(--ink); margin-left: 6px; }
  .phase { border-top: 0; padding: 0 0 2rem 1.5rem; }
  .phase:last-child { padding-bottom: 0; }
  .phase::before { top: 0.2rem; left: -8px; }
}

/* ---------- Glide path: the calculator ---------- */

.calc {
  margin-top: clamp(3.5rem, 7vw, 5.5rem);
  padding-top: clamp(2rem, 4vw, 2.75rem);
  border-top: 3px double var(--red);
}
.calc__head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 1.5rem 3rem; }
.calc__title { font-family: var(--display); font-weight: 400; font-size: clamp(1.6rem, 2.6vw, 2.1rem); line-height: 1.1; max-width: 14em; }
.calc__controls { display: flex; flex-wrap: wrap; gap: 1.25rem 2.5rem; align-items: flex-end; }

.field { display: flex; flex-direction: column; gap: 0.4rem; min-width: 0; }
.field label, .field legend { font-size: 0.925rem; font-weight: 600; }
.range-row { display: flex; align-items: center; gap: 0.9rem; min-height: 2.75rem; }
.range-row output { min-width: 3.2em; font-weight: 650; font-variant-numeric: tabular-nums; text-align: right; }

.calc input[type="number"] {
  width: 9rem; height: 2.75rem; padding: 0 0.75rem;
  font: 600 1rem/1.2 var(--sans); font-variant-numeric: tabular-nums;
  color: var(--ink); background: #fff;
  border: 1px solid var(--rule-2); border-radius: 3px;
}
.calc input[type="number"]:focus-visible { outline-offset: 1px; }

input[type="range"] {
  --p: 30%;
  -webkit-appearance: none; appearance: none;
  width: 15rem; max-width: 100%; height: 28px; margin: 0;
  background: transparent; cursor: pointer;
}
input[type="range"]::-webkit-slider-runnable-track {
  height: 4px; border-radius: 2px;
  background: linear-gradient(to right, var(--ink) var(--p), var(--rule-2) var(--p));
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 22px; height: 22px; margin-top: -9px; border-radius: 50%;
  background: var(--sheet); border: 2px solid var(--ink);
}
input[type="range"]::-moz-range-track { height: 4px; border-radius: 2px; background: var(--rule-2); }
input[type="range"]::-moz-range-progress { height: 4px; border-radius: 2px; background: var(--ink); }
input[type="range"]::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: var(--sheet); border: 2px solid var(--ink); }

.legend { list-style: none; margin: 2rem 0 0.5rem; padding: 0; display: flex; flex-wrap: wrap; gap: 0.5rem 2rem; font-size: 0.925rem; color: var(--ink-2); }
.legend li { display: inline-flex; align-items: center; gap: 0.6rem; }
.legend__key { width: 28px; height: 8px; flex: none; }

.chart { position: relative; height: 360px; margin-top: 0.75rem; }
.chart svg { width: 100%; height: 100%; overflow: visible; touch-action: pan-y; }
.chart svg:focus-visible { outline-offset: 6px; }
.chart__nojs { color: var(--ink-2); padding-top: 2rem; }
.chart .grid line { stroke: var(--rule); stroke-width: 1; }
.chart .axis text, .chart .band-label { fill: var(--ink-3); font: 500 12px/1 var(--sans); font-variant-numeric: tabular-nums; }
.chart .band-label { font-size: 12.5px; fill: var(--ink-2); }
.chart .baseline { stroke: var(--ink-2); stroke-width: 1; }
.chart .divider { stroke: var(--ink-3); stroke-width: 1; }
.chart .gap-fill { fill: var(--c-tf); fill-opacity: 0.1; }
.chart .line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .line--tf { stroke: var(--c-tf); }
.chart .line--vendor { stroke: var(--c-vendor); stroke-dasharray: 6 4; }
.chart .end-label { font: 500 12.5px/1 var(--sans); fill: var(--ink-2); }
.chart .end-value { font: 650 14px/1 var(--sans); fill: var(--ink); font-variant-numeric: tabular-nums; }
.chart .cross { stroke: var(--ink); stroke-width: 1; }
.chart .dot { stroke: var(--sheet); stroke-width: 2; }

.chart__tip {
  position: absolute; top: 0; left: 0; z-index: 2; pointer-events: none;
  min-width: 11rem; padding: 0.6rem 0.75rem;
  background: var(--ink); color: var(--sheet); border-radius: 4px;
  font-size: 0.85rem; line-height: 1.35;
  box-shadow: 0 6px 18px rgb(27 42 38 / 0.18);
  opacity: 0; transition: opacity 0.12s ease;
}
.chart__tip.is-on { opacity: 1; }
.chart__tip-title { color: #BFCDC4; margin-bottom: 0.35rem; font-weight: 500; }
.chart__tip-row { display: grid; grid-template-columns: 16px auto; column-gap: 0.5rem; align-items: center; }
.chart__tip-row + .chart__tip-row { margin-top: 0.3rem; }
.chart__tip-row svg { width: 16px; height: 6px; grid-row: span 2; }
.chart__tip-row strong { font-size: 1rem; font-variant-numeric: tabular-nums; }
.chart__tip-row span { color: #BFCDC4; grid-column: 2; font-size: 0.8rem; }

.calc__foot { display: grid; gap: 2rem 4rem; margin-top: 2.25rem; align-items: start; }
@media (min-width: 900px) { .calc__foot { grid-template-columns: minmax(0, 26rem) minmax(0, 1fr); } }

.tally { width: 100%; border-collapse: collapse; font-size: 1.05rem; }
.tally th { text-align: left; font-weight: 400; color: var(--ink-2); padding: 0.55rem 1.5rem 0.55rem 0; }
.tally td { padding: 0.55rem 0; font-weight: 600; white-space: nowrap; }
.tally tr:not(.tally__total) :is(th, td) { border-bottom: 1px solid var(--rule); }
.tally__total th { font-weight: 650; color: var(--ink); }
.tally__total td { border-top: 1.5px solid var(--ink); }
.tally__total td span {
  display: inline-block; padding-bottom: 0.1rem;
  border-bottom: 4.5px double var(--ink);
  font-size: 1.35rem; font-weight: 700;
}

.fineprint { font-size: 0.875rem; line-height: 1.55; color: var(--ink-3); max-width: 42em; }

.data-table { margin-top: 1.75rem; }
.data-table summary {
  cursor: pointer; font-weight: 600; font-size: 0.95rem;
  text-decoration: underline; text-underline-offset: 0.3em; text-decoration-thickness: 1px;
  width: fit-content;
}
.data-table__scroll { max-height: 22rem; overflow: auto; margin-top: 1rem; max-width: 34rem; border-top: 3px double var(--red); }
.data-table table { width: 100%; border-collapse: collapse; font-size: 0.95rem; font-variant-numeric: tabular-nums; }
.data-table th, .data-table td { padding: 0.4rem 0.75rem; border-bottom: 1px solid var(--rule); text-align: left; }
.data-table th.num, .data-table td.num { text-align: right; }
.data-table thead th { position: sticky; top: 0; background: var(--sheet); font-size: 0.85rem; font-weight: 600; color: var(--ink-2); }

/* ---------- Services: the ledger ---------- */

.ledger {
  width: 100%; margin-top: clamp(2.5rem, 5vw, 4rem);
  border-collapse: collapse;
}
.ledger thead th {
  text-align: left; vertical-align: bottom;
  font-size: 0.875rem; font-weight: 600; color: var(--ink-2);
  font-variation-settings: "wdth" 85;
  padding: 0 1.75rem 0.7rem;
  border-bottom: 3px double var(--red);
}
.ledger thead th:first-child { padding-left: 0; border-right: 3px double var(--red); }
.ledger tbody th {
  width: 24%;
  text-align: left; vertical-align: top;
  font-family: var(--display); font-weight: 400;
  font-size: clamp(1.35rem, 2vw, 1.65rem); line-height: 1.15;
  padding: 1.5rem 1.75rem 1.5rem 0;
  border-right: 3px double var(--red);
}
.ledger td {
  vertical-align: top;
  padding: 1.5rem 1.75rem;
  font-size: 1.025rem; line-height: 1.55;
}
.ledger td:first-of-type { color: var(--ink-2); }
.ledger td + td { border-left: 1px solid var(--rule-2); background: rgb(248 250 244 / 0.55); }
.ledger tbody tr { border-bottom: 1px solid var(--rule-2); }

@media (max-width: 860px) {
  .ledger, .ledger tbody, .ledger tr, .ledger th, .ledger td { display: block; width: auto; }
  .ledger thead { display: none; }
  .ledger { border-top: 3px double var(--red); }
  .ledger tbody tr { padding: 1.5rem 0; }
  .ledger tbody th { width: auto; border-right: 0; padding: 0 0 0.75rem; }
  .ledger td { padding: 0.6rem 0; }
  .ledger td + td { border-left: 0; background: none; border-top: 1px solid var(--rule); padding-top: 0.75rem; margin-top: 0.25rem; }
  .ledger td::before {
    content: attr(data-label);
    display: block; margin-bottom: 0.2rem;
    font-size: 0.85rem; font-weight: 600; color: var(--ink-3);
  }
}

/* ---------- Markets ---------- */

.markets {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2.5rem 3rem;
  margin-top: clamp(2.5rem, 5vw, 4rem);
}
.market h3, .split__title {
  font-family: var(--display); font-weight: 400;
  font-size: 1.75rem; line-height: 1.1;
  padding-bottom: 0.7rem; margin-bottom: 0.2rem;
  border-bottom: 2px solid var(--ink);
}
.market ul, .stack { list-style: none; margin: 0; padding: 0; }
.market li { padding: 0.6rem 0; border-bottom: 1px solid var(--rule); font-size: 1.025rem; }

.split {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 2.5rem 4rem;
  margin-top: clamp(3.5rem, 7vw, 5.5rem);
}
.split__title { margin-bottom: 1.1rem; }
.split p { font-size: 1.05rem; color: var(--ink-2); }
.split strong { color: var(--ink); font-weight: 650; }
.split__note { margin-bottom: 0.75rem; }
.stack { columns: 2; column-gap: 2rem; }
.stack li { break-inside: avoid; padding: 0.5rem 0; border-bottom: 1px solid var(--rule); font-size: 1rem; }

@media (max-width: 860px) {
  .markets { grid-template-columns: 1fr; }
  .split { grid-template-columns: 1fr; }
}

/* ---------- Partners ---------- */

.partners {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 3rem clamp(2rem, 4vw, 3.5rem);
  margin-top: clamp(2.5rem, 5vw, 4rem);
}
.partner { border-top: 2px solid var(--ink); padding-top: 1.5rem; }
.partner__mono {
  display: grid; place-items: center;
  width: 4.25rem; height: 4.25rem; margin-bottom: 1.25rem;
  background: var(--cover); color: var(--foil);
  font-family: var(--display); font-size: 1.75rem; letter-spacing: 0.04em;
  border-radius: 2px;
  box-shadow: inset 0 0 0 3px var(--cover), inset 0 0 0 4px rgb(210 180 105 / 0.55);
}
.partner__name { font-family: var(--display); font-weight: 400; font-size: 1.85rem; line-height: 1.1; }
.partner__role { margin: 0.35rem 0 0.15rem; font-weight: 650; font-size: 1rem; }
.partner__cred { font-size: 0.925rem; color: var(--ink-3); margin-bottom: 1rem; }
.partner p:last-child { font-size: 1rem; line-height: 1.6; color: var(--ink-2); }

@media (max-width: 960px) { .partners { grid-template-columns: 1fr; max-width: 40rem; } }

/* ---------- FAQ ---------- */

.faq { display: grid; gap: 2rem 4rem; }
@media (min-width: 960px) { .faq { grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); align-items: start; } }

.faq__list { border-top: 2px solid var(--ink); }
.faq__list details { border-bottom: 1px solid var(--rule-2); }
.faq__list summary {
  position: relative; list-style: none; cursor: pointer;
  padding: 1.25rem 3rem 1.25rem 0;
  font-size: 1.2rem; font-weight: 600; line-height: 1.35;
}
.faq__list summary::-webkit-details-marker { display: none; }
.faq__list summary::before, .faq__list summary::after {
  content: ""; position: absolute; right: 0.4rem; top: 50%;
  width: 16px; height: 2px; margin-top: -1px; background: var(--ink);
  transition: transform 0.25s ease;
}
.faq__list summary::after { transform: rotate(90deg); }
.faq__list details[open] summary::after { transform: rotate(0deg); }
.faq__body { padding: 0 3rem 1.5rem 0; color: var(--ink-2); font-size: 1.05rem; max-width: 40em; }

.faq__list details::details-content {
  block-size: 0; overflow: clip;
  transition: block-size 0.3s ease, content-visibility 0.3s allow-discrete;
}
.faq__list details[open]::details-content { block-size: auto; }

/* ---------- Contact: the ledger cover ---------- */

.cover {
  position: relative;
  color-scheme: dark;
  color: var(--on-cover);
  background-color: var(--cover);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .55 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.35'/%3E%3C/svg%3E");
  padding-block: clamp(96px, 11vw, 168px);
}
.cover::before {
  content: ""; position: absolute; pointer-events: none;
  inset: clamp(10px, 1.6vw, 22px);
  border: 4px double rgb(210 180 105 / 0.42);
}
.cover__grid { position: relative; display: grid; gap: 3.5rem clamp(3rem, 6vw, 6rem); }
@media (min-width: 1000px) { .cover__grid { grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr); align-items: start; } }

.foil {
  font-size: clamp(2.9rem, 6vw, 5.2rem); line-height: 1; letter-spacing: -0.015em;
  margin-bottom: 0.5em;
  color: var(--foil);
  background: linear-gradient(100deg, #B8964A 0%, #EBD9A0 34%, #C7A458 52%, #F2E4B4 68%, #B18C42 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
@media (forced-colors: active) { .foil { -webkit-text-fill-color: currentColor; background: none; } }
.cover__copy p:not(.cover__direct) { margin-bottom: 2rem; }
.cover__copy p { font-size: 1.2rem; line-height: 1.55; color: var(--on-cover); max-width: 28em; }
.cover__copy .cover__direct { margin-top: 0.75rem; font-size: 1rem; color: var(--on-cover-2); }
.cover a { color: var(--foil-light); }
.cover :focus-visible { outline-color: var(--foil); }

.enquiry { display: grid; gap: 1.25rem; }
.enquiry__row { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
@media (max-width: 600px) { .enquiry__row { grid-template-columns: 1fr; } }
.enquiry .field label, .enquiry .field legend { color: var(--on-cover); }
.enquiry .optional { font-weight: 400; color: var(--on-cover-2); margin-left: 0.35rem; }
.enquiry input:not([type="checkbox"]), .enquiry select, .enquiry textarea {
  width: 100%;
  padding: 0.75rem 0.85rem;
  font: 1rem/1.4 var(--sans); color: #F4F7F0;
  background: rgb(255 255 255 / 0.06);
  border: 1px solid rgb(210 180 105 / 0.45);
  border-radius: 3px;
}
.enquiry select option { color: var(--ink); background: var(--sheet); }
.enquiry input:not([type="checkbox"]), .enquiry select { height: 3rem; }
.enquiry textarea { resize: vertical; min-height: 6rem; }
.enquiry input:focus-visible, .enquiry select:focus-visible, .enquiry textarea:focus-visible { outline: 2px solid var(--foil); outline-offset: 1px; border-color: var(--foil); }
.enquiry [aria-invalid="true"] { border-color: #F0A79E; }

.enquiry fieldset { border: 0; margin: 0; padding: 0; }
.enquiry legend { padding: 0; margin-bottom: 0.55rem; font-weight: 600; font-size: 0.925rem; }
.chips { display: flex; flex-wrap: wrap; gap: 0.55rem; }
.chips label { position: relative; cursor: pointer; }
.chips input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.chips span {
  display: inline-block; padding: 0.45rem 0.85rem;
  font-size: 0.925rem; font-weight: 500;
  border: 1px solid rgb(210 180 105 / 0.5); border-radius: 999px;
  transition: background-color 0.15s ease, color 0.15s ease;
}
.chips input:checked + span { background: var(--foil); border-color: var(--foil); color: var(--cover); font-weight: 600; }
.chips input:focus-visible + span { outline: 2px solid var(--foil); outline-offset: 2px; }

.enquiry__error { margin: 0; padding: 0.6rem 0.8rem; border-left: 3px solid #F0A79E; background: rgb(240 167 158 / 0.1); color: #FBE3DF; font-size: 0.95rem; }
.enquiry__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1.5rem; margin-top: 0.5rem; }
.enquiry__note { margin: 0; font-size: 0.9rem; color: var(--on-cover-2); max-width: 22em; }

.btn--foil { background: var(--foil); color: var(--cover); }
.btn--foil:hover { background: var(--foil-light); }

/* ---------- Footer ---------- */

.footer { background: var(--cover-deep); color: var(--on-cover-2); padding-block: 3.5rem 2.5rem; font-size: 0.95rem; }
.footer__grid { display: grid; gap: 2rem 3rem; grid-template-columns: 1.4fr 1fr 1fr; }
.footer__brand p { margin-top: 0.85rem; max-width: 22em; }
.footer a { color: var(--on-cover); }
.footer__label { margin-bottom: 0.35rem; font-weight: 600; color: var(--on-cover); }
.footer__legal { grid-column: 1 / -1; margin: 1rem 0 0; padding-top: 1.5rem; border-top: 1px solid rgb(210 180 105 / 0.25); font-size: 0.85rem; }
.footer .brand--foil { color: var(--foil); --mark-page: var(--cover-deep); --mark-rule: var(--foil-light); }
@media (max-width: 760px) { .footer__grid { grid-template-columns: 1fr; } }

/* ---------- 404 ---------- */

.lost { min-height: calc(100vh - var(--header-h)); display: grid; align-content: center; padding-block: 4rem; }
.lost h1 { font-size: clamp(2.6rem, 6vw, 4.5rem); line-height: 1.02; margin-bottom: 0.5em; max-width: 12em; }
.lost p { font-size: 1.2rem; color: var(--ink-2); max-width: 30em; margin-bottom: 2rem; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.01ms !important; }
}
