@import url('fonts.css');

/* Exit Cost
   The page is a statement of account: ruled money columns, right-aligned
   figures, a rule only above a total, debits in red and credits in green.
   Colour never carries a verdict on its own — the word is always there too. */

:root {
  color-scheme: light dark;

  --paper:        #edeef0;
  --paper-raised: #f7f8f9;
  --ink:          #000000;
  --muted:        #565c66;
  --rule:         #c0c4cb;
  --rule-strong:  #8b919b;
  --debit:        #a81e27;
  --credit:       #0b5137;
  --mark:         #ffe89b;

  --measure: 36rem;
  --wide:    46rem;

  --serif: 'Newsreader', Georgia, 'Times New Roman', serif;
  --mono:  'DM Mono', ui-monospace, 'SF Mono', Menlo, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper:        #14161a;
    --paper-raised: #1c1f25;
    --ink:          #e9eaec;
    --muted:        #969ca6;
    --rule:         #333840;
    --rule-strong:  #565c66;
    --debit:        #e8737a;
    --credit:       #57c295;
    --mark:         #453d17;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.0625rem;
  line-height: 1.62;
  font-optical-sizing: auto;
  text-rendering: optimizeLegibility;
}

.wrap { max-width: var(--wide); margin: 0 auto; padding: 0 1.5rem; }
.measure { max-width: var(--measure); }

/* ---------------------------------------------------------------- masthead */

.masthead {
  border-bottom: 1px solid var(--rule-strong);
  padding: 1.15rem 0 .85rem;
  display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; align-items: baseline;
}
.masthead a.wordmark { font-weight: 600; font-size: 1.0625rem; letter-spacing: -.011em; text-decoration: none; color: var(--ink); }
.masthead nav { margin-left: auto; display: flex; gap: 1.1rem; }
.masthead nav a { color: var(--muted); text-decoration: none; font-size: .9375rem; }
.masthead nav a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: .2em; }

/* ------------------------------------------------------------- typography */

h1, h2, h3 { font-weight: 500; letter-spacing: -.018em; line-height: 1.18; margin: 0; }
h1 { font-size: clamp(1.7rem, 1.2rem + 2.1vw, 2.5rem); }
h2 { font-size: 1.35rem; margin: 2.75rem 0 .6rem; }
h3 { font-size: 1.0625rem; font-weight: 600; margin: 1.5rem 0 .35rem; }

/* Section headings speak in the statement's own voice rather than as
   tracked-out labels sitting above the content. */
/* Semantically an h2 so the page can be navigated by section; visually the same
   quiet rule it always was. Level and weight are different things. */
h2.section-head {
  font-style: italic; font-size: 1.0625rem; font-weight: 400; letter-spacing: 0;
  line-height: 1.5; color: var(--muted);
  margin: 2.25rem 0 .5rem; border-bottom: 1px solid var(--rule); padding-bottom: .3rem;
}

p { margin: 0 0 1rem; }
a { color: var(--ink); text-underline-offset: .18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
small, .small { font-size: .875rem; }
.muted { color: var(--muted); }
.dek { font-size: 1.125rem; color: var(--muted); margin-top: .6rem; }

/* ---------------------------------------------------------------- verdict */

.standfirst { margin: 2.25rem 0 0; }
h1.route { font-size: .9375rem; font-weight: 400; letter-spacing: 0; line-height: 1.5; color: var(--muted); margin: 0 0 1.1rem; }
.route b { font-weight: 500; color: var(--ink); }

.verdict-line {
  font-size: clamp(1.35rem, 1.05rem + 1.3vw, 1.8rem);
  line-height: 1.3; margin: 0 0 .35rem; max-width: 30ch;
}
.verdict-word { font-weight: 600; }
.v-switch   .verdict-word { color: var(--credit); }
.v-stay     .verdict-word { color: var(--debit); }
.v-marginal .verdict-word { color: var(--muted); }

/* The one loud thing on the page. Everything else stays quiet. */
.crossover {
  font-family: var(--mono); font-weight: 500;
  font-size: clamp(3.1rem, 1.6rem + 6.5vw, 5.5rem);
  line-height: .96; letter-spacing: -.045em;
  font-feature-settings: 'tnum' 1;
  margin: .35rem 0 .1rem; display: block;
}
.crossover .per { font-size: .28em; letter-spacing: 0; color: var(--muted); margin-left: .12em; }
.crossover-note { color: var(--muted); font-size: .9375rem; margin-bottom: 1.75rem; }

/* ------------------------------------------------------------------- rate */

.rate { border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); padding: 1.1rem 0 1.25rem; margin: 1.75rem 0; }
.rate-top { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; }
.rate label { font-style: italic; color: var(--muted); }
.rate output { font-family: var(--mono); font-size: 1.25rem; font-feature-settings: 'tnum' 1; }
.rate input[type=range] { width: 100%; margin: .85rem 0 .3rem; accent-color: var(--ink); height: 1.5rem; }
.rate input[type=range]:focus-visible { outline: 2px solid var(--ink); outline-offset: 4px; }
.threshold {
  margin: -.6rem 0 1.6rem;
  font-size: 1.0625rem;
  color: var(--muted);
}
.threshold b { color: var(--ink); font-weight: 500; }
.threshold:empty { display: none; }

.rate-scale { display: flex; justify-content: space-between; font-family: var(--mono); font-size: .75rem; color: var(--muted); }

/* ------------------------------------------------------------------ chart */

.chart { margin: 1.5rem 0 .5rem; }
.chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart .grid  { stroke: var(--rule); stroke-width: 1; }
.chart .axis  { stroke: var(--rule-strong); stroke-width: 1; }
.chart .l-inc { fill: none; stroke: var(--debit);  stroke-width: 2; }
.chart .l-alt { fill: none; stroke: var(--credit); stroke-width: 2; stroke-dasharray: 5 3; }
.chart text   { font-family: var(--mono); font-size: 10px; fill: var(--muted); }
.chart .cross circle { fill: var(--paper); stroke: var(--ink); stroke-width: 1.5; }
.chart .cross[hidden] { display: none; }
.chart .cross text   { fill: var(--ink); font-size: 10px; paint-order: stroke fill; stroke: var(--paper); stroke-width: 3px; stroke-linejoin: round; }
.chart-key { display: flex; gap: 1.5rem; font-size: .875rem; color: var(--muted); margin-top: .4rem; flex-wrap: wrap; }
.chart-key i { display: inline-block; width: 1.6rem; height: 0; border-top-width: 2px; border-top-style: solid; vertical-align: .28em; margin-right: .4rem; }
.chart-key .k-inc i { border-color: var(--debit); }
.chart-key .k-alt i { border-color: var(--credit); border-top-style: dashed; }

/* -------------------------------------------------------------- statement */

.statement { width: 100%; border-collapse: collapse; margin: .25rem 0 1.25rem; }
.statement th, .statement td { padding: .34rem 0; vertical-align: baseline; text-align: left; font-weight: 400; }
.statement td.amt, .statement th.amt { text-align: right; font-family: var(--mono); font-feature-settings: 'tnum' 1; white-space: nowrap; padding-left: 1rem; }
.statement .note { color: var(--muted); font-size: .875rem; }
.statement tr.total td { border-top: 1px solid var(--rule-strong); padding-top: .45rem; font-weight: 500; }
.statement tr.grand td { border-top: 3px double var(--rule-strong); padding-top: .5rem; }
.statement td.amt.neg { color: var(--debit); }
.statement td.amt.pos { color: var(--credit); }
.statement caption { text-align: left; font-style: italic; color: var(--muted); padding-bottom: .3rem; }

/* ---------------------------------------------------------------- columns */

.elsewhere { list-style: none; margin: 0 0 1.6rem; padding: 0; display: grid; gap: .1rem; }
.elsewhere li { display: grid; grid-template-columns: 8rem auto 1fr; gap: .1rem .9rem; align-items: baseline;
                padding: .3rem 0; border-bottom: 1px solid var(--rule); font-size: .9375rem; }
.elsewhere li:last-child { border-bottom: 0; }
.elsewhere .amt-inline { font-family: var(--mono); font-feature-settings: 'tnum' 1; }
.elsewhere .note { color: var(--muted); font-size: .8125rem; }
@media (max-width: 30rem) { .elsewhere li { grid-template-columns: 1fr auto; } .elsewhere .note { grid-column: 1 / -1; } }

.two-col { display: grid; gap: 1.5rem 2.5rem; grid-template-columns: 1fr; margin: .5rem 0 1rem; }
@media (min-width: 42rem) { .two-col { grid-template-columns: 1fr 1fr; } }
.two-col ul { margin: .2rem 0; padding-left: 1.05rem; }
.two-col li { margin-bottom: .45rem; }
.two-col h3 { margin-top: 0; }
.lose h3 { color: var(--debit); }
.gain h3 { color: var(--credit); }
.caveats { margin: .3rem 0 1rem; padding-left: 1.05rem; }
.caveats li { margin-bottom: .6rem; }

/* ------------------------------------------------------------------ index */

.index-list { list-style: none; margin: 1rem 0 0; padding: 0; }
.index-list li { border-bottom: 1px solid var(--rule); }
.index-list a { display: grid; grid-template-columns: 1fr auto; gap: .2rem 1rem; align-items: baseline; padding: .85rem 0; text-decoration: none; color: inherit; }
.index-list a:hover .idx-title { text-decoration: underline; text-underline-offset: .18em; }
.idx-title { font-size: 1.0625rem; }
.idx-sub { grid-column: 1; color: var(--muted); font-size: .875rem; }
.idx-num { grid-row: 1 / span 2; grid-column: 2; text-align: right; font-family: var(--mono); font-feature-settings: 'tnum' 1; font-size: 1.0625rem; white-space: nowrap; }
.idx-num .idx-verdict { display: block; font-family: var(--serif); font-size: .8125rem; }
.managed-flip { color: var(--credit); font-weight: 500; }
.v-switch-t { color: var(--credit); }
.v-stay-t   { color: var(--debit); }
.v-marginal-t { color: var(--muted); }

/* ------------------------------------------------------------- provenance */

.provenance { border-top: 1px solid var(--rule); margin-top: 2.5rem; padding-top: 1rem; font-size: .875rem; color: var(--muted); }
.provenance table { width: 100%; border-collapse: collapse; }
.provenance td { padding: .22rem 0; vertical-align: baseline; }
.provenance td:last-child { text-align: right; font-family: var(--mono); font-size: .8125rem; white-space: nowrap; padding-left: 1rem; }
.provenance a { color: var(--muted); }
.aff { font-size: .75rem; color: var(--muted); border: 1px solid var(--rule); padding: .05em .35em; border-radius: 2px; white-space: nowrap; }

.flag { background: var(--mark); color: var(--ink); padding: .7rem .85rem; margin: 1.25rem 0; border-left: 3px solid var(--rule-strong); font-size: .9375rem; }

footer.site { border-top: 1px solid var(--rule-strong); margin-top: 3.5rem; padding: 1.25rem 0 3rem; font-size: .875rem; color: var(--muted); }
footer.site p { margin: 0 0 .5rem; max-width: var(--measure); }
footer.site a { color: var(--muted); }

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
