/* Shared look, borrowed from the Skimp brand: grid-paper colours, a lime highlighter,
   Archivo (wide cut for headings) and Azeret Mono for every figure.
   Lime (--accent) is a fill only, always with --on-accent text on it. Text links and
   accent text use --accent-ink, which passes contrast on the page. */
@font-face { font-family: "Archivo"; src: url("fonts/archivo.woff2") format("woff2");
             font-weight: 100 900; font-stretch: 62% 125%; font-display: swap; }
@font-face { font-family: "Azeret Mono"; src: url("fonts/azeret-mono.woff2") format("woff2");
             font-weight: 400 700; font-display: swap; }

:root {
  --font: "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Azeret Mono", ui-monospace, Menlo, monospace;
  --bg: #f4f6f1;          /* grid paper */
  --card: #fbfcf9;        /* sheet */
  --ink: #1a1d16;         /* pencil */
  --muted: #586052;       /* note */
  --line: #cdd3c5;        /* borders */
  --grid: #e3e8dd;        /* bar tracks, hover */
  --soft: #eef1e9;        /* quiet panels */
  --accent: #d2f54a;      /* highlighter: fills only */
  --accent-ink: #3d5c00;  /* lime family, dark enough for text and thin lines */
  --accent-soft: #eef7cc;
  --on-accent: #161b05;   /* text, borders and shadows on lime */
  --edge: #161b05;        /* button borders and their offset shadow */
  --input-border: #737b6d;
  --warn: #8a5300;
  --error: #b42318;

  /* Data colours */
  --pos: #3d5c00;         /* good outcome */
  --neg: #b42318;         /* bad outcome */
  --home: #c0392b;        /* home loan: not deductible */
  --inv: #b07a00;         /* investment loan: deductible */
  --shr: #3d5c00;         /* shares */
  --accent2: #1d5fc4;     /* a second series (cash in, path B) */
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121510; --card: #181c15; --ink: #e8ebe2; --muted: #9ea695;
    --line: #30362a; --grid: #232920; --soft: #1d2219;
    --accent: #c6f432; --accent-ink: #c6f432; --accent-soft: #232b12;
    --on-accent: #161b05; --edge: #5d6852; --input-border: #687160;
    --warn: #f0b45a; --error: #ff8a80;
    --pos: #c6f432; --neg: #ff8a80; --home: #ff8a80; --inv: #f0b45a; --shr: #9fd46a; --accent2: #8ab4ff;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.55 var(--font); }
.wrap { max-width: 1000px; margin: 0 auto; padding: 0 16px; }
a { color: var(--accent-ink); }
p { margin: 0 0 12px; }

/* Header: wordmark row with links, then the headline. */
.site-head { padding-top: 28px; }
.brand-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap;
             margin-bottom: 26px; padding-bottom: 12px; border-bottom: 2px solid var(--ink); }
.brand { display: inline-flex; align-items: center; gap: 8px; color: var(--ink); text-decoration: none; }
.brand .mark { width: 34px; height: 34px; flex: none; }
.brand span { font-weight: 850; font-stretch: 118%; font-size: 1.5rem; line-height: 1; letter-spacing: -0.01em; }
.brand-nav { display: flex; gap: 4px; flex-wrap: wrap; }
.brand-nav a { font-family: var(--mono); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em;
               color: var(--muted); text-decoration: none; padding: 4px 8px; border: 1.5px solid transparent; }
.brand-nav a:hover { color: var(--ink); border-color: var(--line); }
.brand-nav a[aria-current="page"] { background: var(--accent); color: var(--on-accent); border-color: var(--on-accent); }
.meta { font-family: var(--mono); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin: 0 0 10px; }
h1 { margin: 0 0 12px; font-size: clamp(2rem, 5.2vw, 3.2rem); font-weight: 850; font-stretch: 112%; line-height: 1.02;
     letter-spacing: -0.015em; text-wrap: balance; max-width: 18ch; }
h2 { margin: 0 0 12px; font-size: 1.45rem; font-weight: 800; font-stretch: 112%; line-height: 1.15; letter-spacing: -0.01em; }
h3 { margin: 22px 0 8px; font-size: 1.05rem; font-weight: 700; font-stretch: 105%; }
mark, .hl { background: linear-gradient(transparent 10%, var(--accent) 10%, var(--accent) 90%, transparent 90%); color: var(--on-accent);
            padding: 0 0.1em; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.lede { color: var(--muted); font-size: 1.05rem; max-width: 640px; }
.muted { color: var(--muted); }
.small { font-size: 0.85rem; }

/* Section label: small wide caps, like a form heading. */
.eyebrow { font-family: var(--mono); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin: 0 0 8px; }

.card { background: var(--card); border: 1px solid var(--line); padding: 20px; margin: 16px 0; }
@media (max-width: 640px) { .card { padding: 16px; } }

/* Figures in one monospace face, so amounts line up and read as data. */
.num, .mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }

input, select, button { font: inherit; color: inherit; border-radius: 0; }
input[type="number"], input[type="text"], select {
  background: var(--bg); border: 1.5px solid var(--input-border); padding: 6px 8px; width: 100%; font-size: 0.95rem; }
input[type="number"] { font-family: var(--mono); }
input[type="range"] { width: 100%; accent-color: var(--accent-ink); height: 26px; }
input[type="checkbox"] { accent-color: var(--accent-ink); }

/* Buttons: rectangles with a 1.5px dark border and a hard offset shadow. Primary ones are lime. */
button { cursor: pointer; background: var(--card); color: var(--ink); border: 1.5px solid var(--edge);
         box-shadow: 3px 3px 0 var(--edge); font-weight: 700; font-stretch: 112%; padding: 8px 16px; font-size: 0.9rem; }
button.primary { background: var(--accent); color: var(--on-accent); border-color: var(--on-accent); }
button:active:not(:disabled) { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--edge); }
button:disabled { opacity: 0.45; cursor: default; box-shadow: none; transform: translate(2px, 2px); }
@media (pointer: coarse) { button, select, input:not([type="checkbox"]):not([type="radio"]):not([type="range"]) { min-height: 44px; } }

/* Tables: a 2px rule on top, thin rules between rows. */
table { width: 100%; border-collapse: collapse; font-size: 0.92rem; border-top: 2px solid var(--ink); }
th, td { text-align: left; padding: 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; white-space: nowrap; font-size: 0.8rem; }

/* Footer: a 2px rule, then small centred text. */
.foot-note { margin-top: 24px; text-align: center; }
.site-footer { display: flex; flex-wrap: wrap; justify-content: center; align-items: baseline; column-gap: 24px; row-gap: 4px;
               text-align: center; margin-top: 24px; padding-top: 12px; padding-bottom: 24px; border-top: 2px solid var(--ink);
               font-size: 0.75rem; color: var(--muted); }
.site-footer p { margin: 0; }
.footer-links { display: flex; flex-wrap: wrap; justify-content: center; list-style: none; margin: 0; padding: 0; }
.footer-links li + li { border-left: 1px solid var(--line); margin-left: 8px; padding-left: 8px; }
.footer-links a { color: var(--ink); text-decoration: none; }
.footer-links a:hover, .footer-links a:focus-visible { text-decoration: underline; }
.footer-links a[aria-current="page"] { color: var(--muted); }

/* Breadcrumb: Skimp > Learn > this page. */
.crumbs { margin: -12px 0 14px; font-size: 0.85rem; }
.crumbs ol { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 0; list-style: none; margin: 0; padding: 0; color: var(--muted); }
.crumbs li { display: inline-flex; align-items: center; }
.crumbs li + li::before { content: "" / ""; width: 6px; height: 6px; margin: 0 10px 0 8px; opacity: 0.6;
                          border-top: 1.5px solid currentColor; border-right: 1.5px solid currentColor; transform: rotate(45deg); }
.crumbs a { color: var(--muted); text-decoration: none; padding: 4px 0; }
.crumbs a:hover, .crumbs a:focus-visible { color: var(--accent-ink); text-decoration: underline; text-underline-offset: 2px; }
.crumbs [aria-current="page"] { color: var(--ink); font-weight: 600; }

/* Course list on /learn/. */
.courses { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.course h2 { margin-bottom: 6px; }
.course h2 a { color: var(--ink); text-decoration: none; }
.course h2 a:hover { text-decoration: underline; }
.course .links { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 0; }
