/* Thoufedu. Layout idea: quiet editorial pages; the one bold object is the yellow price tag (live calculator). */
:root {
  --bg: #f1f5f4;
  --surface: #ffffff;
  --ink: #0e1e2a;
  --text: #25384a;
  --muted: #566a78;
  --line: #d3dedf;
  --accent: #0b7a75;
  --accent-ink: #065652;
  --on-accent: #ffffff;
  --tag: #ffc72c;
  --tag-ink: #2b2100;
  --sel: #dcf0ed;
  --good: #1b7f3b;
  --bad: #b8341c;
  --bar1: #0e1e2a;
  --bar2: #3b5568;
  --bar3: #6d8798;
  --bar4: #9db3c0;
  --bar5: #c3d2db;
  --bar6: #8f6bd1;
  --font-display: "Bricolage Grotesque", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --font-body: "Literata", Georgia, "Times New Roman", serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b161d; --surface: #122029; --ink: #eaf3f2; --text: #c5d5d8; --muted: #8fa5ad; --line: #223540;
    --accent: #4fd1c5; --accent-ink: #7fe3d9; --on-accent: #06211f; --sel: #12383a; --good: #5fd68a; --bad: #ff8d77;
    --bar1: #eaf3f2; --bar2: #9fb8c2; --bar3: #6d8a96; --bar4: #44606c; --bar5: #2d4450; --bar6: #b79af0;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0b161d; --surface: #122029; --ink: #eaf3f2; --text: #c5d5d8; --muted: #8fa5ad; --line: #223540;
  --accent: #4fd1c5; --accent-ink: #7fe3d9; --on-accent: #06211f; --sel: #12383a; --good: #5fd68a; --bad: #ff8d77;
  --bar1: #eaf3f2; --bar2: #9fb8c2; --bar3: #6d8a96; --bar4: #44606c; --bar5: #2d4450; --bar6: #b79af0;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--text); font: 400 1.0625rem/1.7 var(--font-body); -webkit-font-smoothing: antialiased; }
img, svg { max-width: 100%; }
a { color: var(--accent-ink); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3 { font-family: var(--font-display); color: var(--ink); line-height: 1.15; text-wrap: balance; margin: 0; font-weight: 700; letter-spacing: -0.01em; }
h1 { font-size: clamp(2rem, 5vw, 3.1rem); }
h2 { font-size: clamp(1.4rem, 3vw, 1.85rem); margin-top: 2.6rem; }
h3 { font-size: 1.2rem; margin-top: 1.8rem; }
p, ul, ol { margin: 0 0 1.1rem; }
ul, ol { padding-left: 1.3rem; }
li { margin-bottom: .4rem; }
.wrap { width: min(1080px, 100% - 32px); margin-inline: auto; }
.narrow { width: min(720px, 100% - 32px); margin-inline: auto; }
.skip { position: absolute; left: -999px; top: 0; background: var(--ink); color: var(--bg); padding: .6rem 1rem; z-index: 10; }
.skip:focus { left: 8px; top: 8px; }

/* header */
.site-head { border-bottom: 1px solid var(--line); background: var(--bg); }
.site-head .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .6rem 1.5rem; padding-block: .9rem; }
.brand { display: inline-flex; align-items: center; gap: .55rem; font: 800 1.45rem/1 var(--font-display); color: var(--ink); text-decoration: none; letter-spacing: -0.02em; }
.brand-tag { width: 22px; height: 26px; background: var(--tag); border-radius: 3px 3px 3px 12px; position: relative; flex: none; }
.brand-tag::after { content: ""; position: absolute; top: 5px; left: 50%; width: 6px; height: 6px; margin-left: -3px; border-radius: 50%; background: var(--bg); }
.nav { display: flex; flex-wrap: wrap; gap: .2rem 1.4rem; font: 500 .98rem var(--font-display); }
.nav a { color: var(--text); text-decoration: none; padding: .3rem 0; border-bottom: 2px solid transparent; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--tag); }

/* hero */
.hero { padding-block: clamp(2rem, 6vw, 4rem) clamp(2rem, 5vw, 3.5rem); }
.hero .wrap { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: clamp(1.5rem, 5vw, 4rem); align-items: center; }
.hero h1 { margin-bottom: 1.1rem; }
.hero .lede { font-size: 1.2rem; max-width: 34rem; color: var(--text); }
.hero-links { display: flex; flex-wrap: wrap; gap: .7rem; margin-top: 1.4rem; }
.btn { display: inline-block; font: 600 1rem var(--font-display); padding: .7rem 1.2rem; border-radius: 8px; text-decoration: none; border: 2px solid var(--ink); color: var(--ink); background: transparent; cursor: pointer; }
.btn:hover { background: var(--ink); color: var(--bg); }
.btn.solid { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn.solid:hover { background: var(--accent-ink); border-color: var(--accent-ink); color: var(--on-accent); }
.btn.small { padding: .4rem .8rem; font-size: .9rem; border-width: 1.5px; }

/* the yellow price tag */
.pricetag { position: relative; background: var(--tag); color: var(--tag-ink); border-radius: 14px 14px 14px 40px; padding: 2.2rem 1.4rem 1.4rem; box-shadow: 0 1px 0 rgba(0,0,0,.08), 0 14px 28px -18px rgba(0,0,0,.35); }
.pricetag::before { content: ""; position: absolute; top: 12px; left: 50%; width: 14px; height: 14px; margin-left: -7px; border-radius: 50%; background: var(--bg); box-shadow: inset 0 1px 2px rgba(0,0,0,.3); }
.pricetag h2 { margin: 0 0 .2rem; font-size: 1.35rem; color: var(--tag-ink); }
.pricetag p.sub { margin: 0 0 1rem; font-size: .95rem; }
.pricetag label { color: var(--tag-ink); }
.pricetag .result { border-top: 2px dashed rgba(43,33,0,.45); margin-top: 1rem; padding-top: .8rem; }
.pricetag .big { color: var(--tag-ink); }
.pricetag a { color: var(--tag-ink); font-weight: 600; }
.pricetag input { background: #fffbe9; border-color: rgba(43,33,0,.35); color: #1c1500; }

/* form controls and calculators */
.fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .7rem .9rem; }
.field { display: flex; flex-direction: column; gap: .25rem; min-width: 0; }
.field.full { grid-column: 1 / -1; }
label, .lbl { font: 600 .86rem var(--font-display); color: var(--ink); }
.hint { font: 400 .8rem/1.35 var(--font-body); color: var(--muted); }
.pricetag .hint { color: rgba(43,33,0,.75); }
input[type="number"], input[type="text"], select { width: 100%; min-width: 0; font: 500 1rem var(--font-mono); padding: .55rem .65rem; border: 1.5px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); }
input[type="number"] { font-variant-numeric: tabular-nums; }
.check { display: flex; gap: .55rem; align-items: flex-start; font: 500 .92rem/1.4 var(--font-display); }
.check input { margin-top: .25rem; width: 1.05rem; height: 1.05rem; accent-color: var(--accent); flex: none; }
.tool { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: clamp(1rem, 3vw, 1.6rem); margin: 1.6rem 0; }
.tool > h3 { margin: 0 0 .3rem; }
.tool > .sub { color: var(--muted); font-size: .95rem; margin-bottom: 1rem; }
.result { margin-top: 1.2rem; }
.big { font: 800 clamp(2rem, 6vw, 2.8rem)/1 var(--font-display); color: var(--ink); font-variant-numeric: tabular-nums; }
.big.neg { color: var(--bad); }
.pricetag .big.neg { color: #8a1c05; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .9rem; margin-top: 1rem; }
.stat { border-left: 3px solid var(--tag); padding-left: .7rem; }
.stat b { display: block; font: 700 1.25rem var(--font-display); color: var(--ink); font-variant-numeric: tabular-nums; }
.stat span { font-size: .85rem; color: var(--muted); }
.note { font-size: .95rem; color: var(--muted); }
.msg-bad { color: var(--bad); font-weight: 600; }

/* breakdown bar */
.bar { display: flex; height: 2.2rem; border-radius: 8px; overflow: hidden; border: 1px solid var(--line); background: var(--surface); }
.bar i { display: block; height: 100%; min-width: 0; }
.legend { display: flex; flex-wrap: wrap; gap: .3rem 1rem; margin: .6rem 0 0; padding: 0; list-style: none; font: 500 .85rem var(--font-display); }
.legend li { display: flex; align-items: center; gap: .4rem; margin: 0; }
.legend s { width: .8rem; height: .8rem; border-radius: 2px; display: inline-block; text-decoration: none; }
.c1 { background: var(--bar1); } .c2 { background: var(--bar2); } .c3 { background: var(--bar3); } .c4 { background: var(--bar4); } .c5 { background: var(--bar5); } .c6 { background: var(--bar6); }
.cp { background: var(--tag); } .cn { background: var(--bad); }

/* sections on home */
.tracks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.2rem; padding-block: 1rem 2.5rem; }
.track { display: block; background: var(--ink); color: var(--bg); border-radius: 16px; padding: 1.6rem; text-decoration: none; }
.track h2 { color: var(--bg); margin: 0 0 .5rem; font-size: 1.6rem; }
.track p { margin: 0 0 1rem; color: color-mix(in srgb, var(--bg) 85%, transparent); }
.track .go { font: 700 1rem var(--font-display); border-bottom: 2px solid var(--tag); padding-bottom: 2px; }
.track:hover { outline: 3px solid var(--tag); outline-offset: 2px; }
:root[data-theme="dark"] .track, :root:not([data-theme="light"]) .track { }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .track { background: var(--surface); border: 1px solid var(--line); color: var(--ink); } :root:not([data-theme="light"]) .track h2 { color: var(--ink); } :root:not([data-theme="light"]) .track p { color: var(--text); } }
:root[data-theme="dark"] .track { background: var(--surface); border: 1px solid var(--line); color: var(--ink); }
:root[data-theme="dark"] .track h2 { color: var(--ink); }
:root[data-theme="dark"] .track p { color: var(--text); }
.section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin: 0 0 1.1rem; }
.section-title h2 { margin: 0; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 1.2rem; padding-bottom: 3rem; }
.card { position: relative; display: flex; flex-direction: column; gap: .6rem; background: var(--surface); border: 1px solid var(--line); border-radius: 6px 18px 6px 18px; padding: 2rem 1.3rem 1.3rem; text-decoration: none; color: var(--text); }
.card::before { content: ""; position: absolute; top: 12px; left: 16px; width: 11px; height: 11px; border-radius: 50%; background: var(--bg); border: 1.5px solid var(--line); }
.card:hover { border-color: var(--accent); }
.card h3 { margin: 0; font-size: 1.2rem; }
.card p { margin: 0; font-size: .96rem; color: var(--muted); }
.card .meta { margin-top: auto; padding-top: .4rem; }
.chips { display: flex; flex-wrap: wrap; gap: .4rem; margin: 0; padding: 0; list-style: none; }
.chips li { margin: 0; font: 600 .76rem var(--font-display); background: var(--sel); color: var(--accent-ink); padding: .22rem .55rem; border-radius: 999px; }
.chips li.t { background: var(--tag); color: var(--tag-ink); }

/* guide pages */
.crumbs { font: 500 .88rem var(--font-display); color: var(--muted); padding-top: 1.4rem; }
.crumbs a { color: var(--muted); }
.guide-head { padding-block: 1rem 1.2rem; }
.guide-head h1 { margin-bottom: .9rem; }
.guide-head .dek { font-size: 1.2rem; color: var(--text); margin-bottom: 1rem; }
.byline { font: 500 .9rem var(--font-display); color: var(--muted); margin-bottom: .8rem; }
.prose { padding-bottom: 3rem; }
.prose h2:first-child { margin-top: 1rem; }
.callout { border-left: 4px solid var(--tag); background: var(--surface); padding: .9rem 1.1rem; border-radius: 0 10px 10px 0; margin: 1.4rem 0; }
.callout p:last-child { margin-bottom: 0; }
.callout b.h { font-family: var(--font-display); color: var(--ink); }
.tablewrap { overflow-x: auto; margin: 1.4rem 0; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
table { border-collapse: collapse; width: 100%; font-size: .95rem; min-width: 560px; }
th, td { text-align: left; vertical-align: top; padding: .65rem .8rem; border-bottom: 1px solid var(--line); }
th { font: 700 .9rem var(--font-display); color: var(--ink); background: var(--sel); }
tr:last-child td { border-bottom: 0; }
.sources { font-size: .92rem; color: var(--muted); border-top: 1px solid var(--line); margin-top: 2.5rem; padding-top: 1rem; }
.sources h2 { font-size: 1.05rem; margin: 0 0 .5rem; }

/* flow diagram */
.flow { list-style: none; padding: 0; margin: 1.6rem 0; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 0; counter-reset: step; }
.flow li { position: relative; margin: 0; padding: 1rem .8rem .9rem; background: var(--surface); border: 1px solid var(--line); border-right: 0; font: 600 .95rem/1.3 var(--font-display); color: var(--ink); counter-increment: step; }
.flow li:first-child { border-radius: 12px 0 0 12px; }
.flow li:last-child { border-right: 1px solid var(--line); border-radius: 0 12px 12px 0; }
.flow li::before { content: counter(step); display: grid; place-items: center; width: 1.6rem; height: 1.6rem; margin-bottom: .5rem; border-radius: 50%; background: var(--tag); color: var(--tag-ink); font-size: .85rem; }
.flow li span { display: block; margin-top: .3rem; font: 400 .85rem/1.4 var(--font-body); color: var(--muted); }
.flow li:not(:last-child)::after { content: ""; position: absolute; right: -9px; top: 50%; width: 16px; height: 16px; margin-top: -8px; background: var(--surface); border-top: 1px solid var(--line); border-right: 1px solid var(--line); transform: rotate(45deg); z-index: 1; }

/* copy scripts */
.script { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; margin: 1rem 0; overflow: hidden; }
.script header { display: flex; align-items: center; justify-content: space-between; gap: .6rem; padding: .55rem .8rem; background: var(--sel); font: 700 .92rem var(--font-display); color: var(--ink); }
.script pre { margin: 0; padding: .9rem 1rem; white-space: pre-wrap; word-wrap: break-word; font: 400 .95rem/1.6 var(--font-body); color: var(--text); }

/* checklist */
.checklist { list-style: none; padding: 0; margin: 1rem 0; }
.checklist li { margin: 0; border-bottom: 1px solid var(--line); }
.checklist label { display: flex; gap: .7rem; align-items: flex-start; padding: .7rem .2rem; font: 400 1rem/1.5 var(--font-body); color: var(--text); cursor: pointer; }
.checklist input { margin-top: .3rem; width: 1.1rem; height: 1.1rem; accent-color: var(--accent); flex: none; }
.checklist input:checked + span { text-decoration: line-through; color: var(--muted); }
.checklist h4 { margin: 1.2rem 0 .3rem; font: 700 1rem var(--font-display); color: var(--ink); }
.toolbar { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: .8rem; }

/* quiz */
.quiz fieldset { border: 0; padding: 0; margin: 0 0 1.2rem; min-width: 0; }
.quiz legend { font: 700 1.02rem/1.35 var(--font-display); color: var(--ink); padding: 0; margin-bottom: .5rem; }
.quiz .opt { display: flex; gap: .6rem; align-items: flex-start; padding: .5rem .7rem; border: 1.5px solid var(--line); border-radius: 9px; margin-bottom: .45rem; cursor: pointer; font: 500 .96rem/1.4 var(--font-display); color: var(--text); background: var(--bg); }
.quiz .opt:has(input:checked) { border-color: var(--accent); background: var(--sel); color: var(--ink); }
.quiz .opt input { margin-top: .2rem; accent-color: var(--accent); }
.quiz-result { border: 2px solid var(--accent); border-radius: 12px; padding: 1.1rem 1.2rem; margin-top: 1rem; background: var(--sel); }
.quiz-result h3 { margin-top: 0; }
.quiz-score { display: flex; gap: .5rem; flex-wrap: wrap; margin: .6rem 0; padding: 0; list-style: none; font: 600 .88rem var(--font-display); }
.quiz-score li { margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: .2rem .7rem; }
[hidden] { display: none !important; }

/* footer */
.site-foot { border-top: 1px solid var(--line); padding-block: 2rem 2.5rem; margin-top: 2rem; font-size: .93rem; color: var(--muted); }
.site-foot .wrap { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 1.5rem; }
.site-foot a { color: var(--muted); }
.foot-links { display: flex; flex-wrap: wrap; gap: .3rem 1.1rem; font-family: var(--font-display); font-weight: 500; }

/* simple pages */
.page { padding-block: 2.2rem 3rem; }
.page h1 { margin-bottom: 1.2rem; }

@media (max-width: 800px) {
  .hero .wrap, .tracks, .site-foot .wrap { grid-template-columns: minmax(0, 1fr); }
  .flow { grid-auto-flow: row; }
  .flow li { border-right: 1px solid var(--line); border-bottom: 0; }
  .flow li:first-child { border-radius: 12px 12px 0 0; }
  .flow li:last-child { border-bottom: 1px solid var(--line); border-radius: 0 0 12px 12px; }
  .flow li:not(:last-child)::after { right: auto; left: 1.4rem; top: auto; bottom: -9px; margin-top: 0; transform: rotate(135deg); }
}
@media (max-width: 460px) { .fields { grid-template-columns: minmax(0, 1fr); } }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
@media print {
  body { background: #fff; color: #000; font-size: 11pt; }
  .site-head, .site-foot, .toolbar, .hero-links, .no-print { display: none !important; }
  .tool, .script, .callout { break-inside: avoid; border-color: #999; }
  a { color: #000; }
}

/* The yellow tag stays yellow in dark mode, so its text must stay dark */
.pricetag .lbl, .pricetag .note, .pricetag p.sub { color: var(--tag-ink); }
.pricetag .note { opacity: .85; }
