/* ==========================================================================
   LÖYLY & LIGHT — shared stylesheet
   Semantic colour system: TRADITIONAL = ember amber. INFRARED = infrared red.
   That pairing runs through every comparison on the site.
   ========================================================================== */

:root {
  /* Ground and surfaces — warm near-black, brown-biased */
  --bg:          #16130F;
  --panel:       #201B15;
  --panel-2:     #2B241B;
  --line:        #3B3227;
  --line-soft:   #2C2620;

  /* Text */
  --ink:         #F0E8DA;
  --ink-dim:     #CFC4B0;
  --muted:       #9A8E78;

  /* Semantic modality colours */
  --trad:        #E0913C;   /* traditional / löyly / fire     8.0:1 on --bg */
  --trad-soft:   #33230C;
  --ir:          #DE6E78;   /* infrared / radiant             6.4:1 on --bg */
  --ir-soft:     #351719;

  /* Evidence strength */
  --ev-strong:   #74B08C;
  --ev-mod:      #DDA83E;
  --ev-weak:     #D2756A;
  --ev-none:     #8B8272;

  /* Utility */
  --accent:      var(--trad);
  --link:        #E8A85A;
  --radius:      14px;
  --radius-sm:   8px;
  --shadow:      0 2px 10px rgba(0,0,0,.5);
  --maxw:        1140px;
}

:root[data-theme="light"] {
  --bg:          #FBF8F3;
  --panel:       #FFFFFF;
  --panel-2:     #F2ECE1;
  --line:        #DED5C6;
  --line-soft:   #EBE4D8;
  --ink:         #1B1712;
  --ink-dim:     #3D362C;
  --muted:       #6B6152;
  --trad:        #8A5306;
  --trad-soft:   #FAEDD8;
  --ir:          #A63A46;
  --ir-soft:     #FBE7E9;
  --ev-strong:   #2F6B48;
  --ev-mod:      #7A5C0C;
  --ev-weak:     #9B3B31;
  --ev-none:     #6B6152;
  --link:        #8A5306;
  --shadow:      0 2px 10px rgba(27,23,18,.10);
  color-scheme: light;
}
:root[data-theme="dark"] { color-scheme: dark; }

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 88px; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 18px/1.65 Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ---------- Site header / nav ---------- */
.topbar {
  position: sticky; top: 0; z-index: 60;
  background: var(--bg);                                    /* fallback */
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar-in {
  max-width: var(--maxw); margin: 0 auto; padding: 12px 24px;
  display: flex; align-items: center; gap: 20px; flex-wrap: wrap;
}
.brand { display: flex; align-items: baseline; gap: 10px; text-decoration: none; margin-right: auto; }
.brand b {
  font-family: "Fraunces", Georgia, serif; font-size: 21px; font-weight: 700;
  color: var(--ink); letter-spacing: -.01em;
}
.brand b em { font-style: normal; color: var(--trad); }
.brand span { font-size: 11.5px; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); }

nav.main { display: flex; gap: 2px; flex-wrap: wrap; }
nav.main a {
  color: var(--ink-dim); text-decoration: none; font-size: 14.5px; font-weight: 500;
  padding: 7px 11px; border-radius: 999px; white-space: nowrap;
}
nav.main a:hover { background: var(--panel-2); color: var(--ink); }
nav.main a[aria-current="page"] { color: var(--bg); background: var(--trad); font-weight: 650; }

.tbtn {
  background: var(--panel); color: var(--ink); border: 1px solid var(--line);
  border-radius: 999px; padding: 7px 14px; font: inherit; font-size: 13.5px; font-weight: 600;
  cursor: pointer; white-space: nowrap;
}
.tbtn:hover { border-color: var(--trad); color: var(--trad); }

/* ---------- Layout ---------- */
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 44px 24px 110px; }
.wrap.narrow { max-width: 880px; }
.cols { display: grid; grid-template-columns: 216px minmax(0,1fr); gap: 48px; align-items: start; }
@media (max-width: 940px) { .cols { grid-template-columns: 1fr; gap: 26px; } }

/* ---------- Page head ---------- */
.phead { border-bottom: 3px solid var(--trad); padding-bottom: 26px; margin-bottom: 40px; }
.eyebrow {
  font-size: 12px; letter-spacing: .19em; text-transform: uppercase;
  color: var(--trad); font-weight: 700; margin: 0 0 12px;
}
h1 {
  font-family: "Fraunces", Georgia, serif;
  font-size: clamp(34px, 5.2vw, 56px); line-height: 1.08; letter-spacing: -.02em;
  margin: 0 0 18px; font-weight: 700;
}
.standfirst { font-size: clamp(19px, 2.1vw, 23px); line-height: 1.5; color: var(--ink-dim); max-width: 46ch; margin: 0; }
.standfirst.wide { max-width: 62ch; }

/* ---------- Sticky TOC ---------- */
.toc { position: sticky; top: 92px; font-size: 14.5px; }
.toc-h {
  font-size: 11px; letter-spacing: .17em; text-transform: uppercase; color: var(--muted);
  font-weight: 700; margin: 0 0 12px; padding-bottom: 8px; border-bottom: 1px solid var(--line);
}
.toc ol { list-style: none; margin: 0; padding: 0; counter-reset: toc; }
.toc li { counter-increment: toc; margin: 0; }
.toc a {
  display: block; padding: 6px 0 6px 30px; color: var(--muted); text-decoration: none;
  position: relative; line-height: 1.35; border-left: 2px solid transparent; padding-left: 30px;
}
.toc a::before {
  content: counter(toc, decimal-leading-zero);
  position: absolute; left: 8px; font-size: 11px; color: var(--line);
  font-variant-numeric: tabular-nums; top: 9px;
}
.toc a:hover, .toc a.on { color: var(--trad); border-left-color: var(--trad); }
.toc a.on::before { color: var(--trad); }
@media (max-width: 940px) { .toc { position: static; margin-bottom: 8px; } }

/* ---------- Sections ---------- */
section.sec { margin: 0 0 66px; scroll-margin-top: 96px; }
h2 {
  font-family: "Fraunces", Georgia, serif;
  font-size: clamp(26px, 3.2vw, 34px); line-height: 1.18; letter-spacing: -.015em;
  margin: 0 0 6px; font-weight: 700;
}
h2 .kicker {
  display: block; font-family: Inter, sans-serif; font-size: 11.5px; letter-spacing: .18em;
  text-transform: uppercase; color: var(--trad); font-weight: 700; margin-bottom: 9px;
}
h3 { font-size: 21px; line-height: 1.3; margin: 34px 0 10px; font-weight: 650; letter-spacing: -.005em; }
h4 { font-size: 17px; margin: 24px 0 8px; font-weight: 650; color: var(--ink); }
.rule { height: 1px; background: var(--line); border: 0; margin: 14px 0 22px; }

p { margin: 16px 0; }
p.lede { font-size: 20px; line-height: 1.55; color: var(--ink-dim); }
ul, ol { margin: 16px 0; padding-left: 24px; }
li { margin: 8px 0; }
li > ul, li > ol { margin: 8px 0; }
strong, b { font-weight: 650; }
em { font-style: italic; }
a { color: var(--link); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
small { font-size: 14px; color: var(--muted); }
abbr { text-decoration: none; border-bottom: 1px dotted var(--muted); cursor: help; }

/* ---------- Tables ---------- */
.tw { overflow-x: auto; margin: 24px 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
table { width: 100%; border-collapse: collapse; font-size: 15.5px; min-width: 480px; }
caption {
  caption-side: top; text-align: left; font-size: 14px; color: var(--muted);
  padding: 14px 18px 10px; line-height: 1.45;
}
th, td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
thead th {
  font-size: 11.5px; letter-spacing: .11em; text-transform: uppercase; color: var(--muted);
  font-weight: 700; border-bottom: 2px solid var(--line); background: var(--panel-2);
  position: sticky; top: 0;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--panel-2); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
td.n, th.n { white-space: nowrap; }
.rowh { font-weight: 650; }
.rowh small { display: block; font-weight: 400; color: var(--muted); margin-top: 3px; line-height: 1.4; }
col.c-trad, td.t-trad { background: rgba(224,145,60,.06); background: color-mix(in srgb, var(--trad) 5%, transparent); }
col.c-ir,   td.t-ir   { background: rgba(222,110,120,.06); background: color-mix(in srgb, var(--ir) 5%, transparent); }
th.t-trad { color: var(--trad); }
th.t-ir   { color: var(--ir); }

/* ---------- Pills & badges ---------- */
.pill {
  display: inline-block; padding: 2.5px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 700; letter-spacing: .04em; white-space: nowrap;
  border: 1px solid currentColor; line-height: 1.5;
}
.pill.trad { color: var(--trad); background: var(--trad-soft); }
.pill.ir   { color: var(--ir);   background: var(--ir-soft); }
.pill.both { color: var(--ink-dim); background: var(--panel-2); }
.ev {
  display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700;
  letter-spacing: .05em; text-transform: uppercase; white-space: nowrap;
}
.ev::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: currentColor; flex: none; }
.ev.s1 { color: var(--ev-strong); }
.ev.s2 { color: var(--ev-mod); }
.ev.s3 { color: var(--ev-weak); }
.ev.s4 { color: var(--ev-none); }

/* ---------- Callouts ---------- */
.box {
  background: var(--panel); border: 1px solid var(--line); border-left: 4px solid var(--trad);
  border-radius: var(--radius); padding: 22px 26px; margin: 28px 0; box-shadow: var(--shadow);
}
.box > :first-child { margin-top: 0; }
.box > :last-child { margin-bottom: 0; }
.box.ir { border-left-color: var(--ir); }
.box.warn { border-left-color: var(--ev-weak); }
.box.key { border-left-color: var(--ev-mod); }
.box.good { border-left-color: var(--ev-strong); }
.box h4, .box h3 {
  margin-top: 0; font-size: 12.5px; letter-spacing: .15em; text-transform: uppercase;
  color: var(--trad); font-weight: 700;
}
.box.ir h4, .box.ir h3 { color: var(--ir); }
.box.warn h4, .box.warn h3 { color: var(--ev-weak); }
.box.key h4, .box.key h3 { color: var(--ev-mod); }
.box.good h4, .box.good h3 { color: var(--ev-strong); }
.box .big { font-size: 21px; line-height: 1.45; font-weight: 600; color: var(--ink); }

.myth {
  border: 1px solid var(--line); border-radius: var(--radius); margin: 26px 0; overflow: hidden;
  background: var(--panel);
}
.myth-c { padding: 16px 22px; }
.myth-c:first-child { background: rgba(210,117,106,.10); background: color-mix(in srgb, var(--ev-weak) 9%, transparent); border-bottom: 1px solid var(--line); }
.myth-l {
  font-size: 11px; letter-spacing: .16em; text-transform: uppercase; font-weight: 700;
  margin-bottom: 6px; display: block;
}
.myth-c:first-child .myth-l { color: var(--ev-weak); }
.myth-c:last-child .myth-l { color: var(--ev-strong); }
.myth-c p { margin: 0; }

/* ---------- Cards ---------- */
.grid { display: grid; gap: 18px; margin: 26px 0; }
.grid.g2 { grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); }
.grid.g3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.grid.g4 { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px 24px; box-shadow: var(--shadow);
}
.card.t { border-top: 4px solid var(--trad); }
.card.i { border-top: 4px solid var(--ir); }
.card > :first-child { margin-top: 0; }
.card > :last-child { margin-bottom: 0; }
.card h3, .card h4 { margin-top: 0; }
.card .ct { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; font-weight: 700; color: var(--muted); margin-bottom: 8px; }
.card .cn { font-family: "Fraunces", Georgia, serif; font-size: 22px; font-weight: 700; margin-bottom: 10px; line-height: 1.2; }
.card p { font-size: 15.5px; }
.card dl { margin: 0; font-size: 14.5px; }
.card dt { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-top: 12px; }
.card dd { margin: 2px 0 0; font-weight: 600; }

/* big number stat */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px,1fr)); gap: 16px; margin: 26px 0; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.stat .v { font-family: "Fraunces", Georgia, serif; font-size: 34px; font-weight: 700; line-height: 1; color: var(--trad); letter-spacing: -.02em; }
.stat.i .v { color: var(--ir); }
.stat .k { font-size: 13.5px; color: var(--ink-dim); margin-top: 9px; line-height: 1.4; }
.stat .src { font-size: 11.5px; color: var(--muted); margin-top: 8px; }

/* ---------- Citations ---------- */
.cites { font-size: 14.5px; margin: 22px 0 0; padding: 0; list-style: none; }
.cites li {
  padding: 11px 0 11px 26px; border-bottom: 1px solid var(--line-soft); position: relative;
  color: var(--ink-dim); line-height: 1.5;
}
.cites li:last-child { border-bottom: none; }
.cites li::before { content: "▸"; position: absolute; left: 4px; color: var(--trad); font-size: 12px; top: 13px; }
.cites .j { color: var(--muted); font-style: italic; }
.cites .n { color: var(--muted); }
.srcnote { font-size: 14px; color: var(--muted); border-top: 1px solid var(--line); padding-top: 14px; margin-top: 26px; }

/* ---------- Spectrum bar (mechanism page) ---------- */
.spectrum { margin: 28px 0; }
.spec-bar {
  height: 44px; border-radius: var(--radius-sm); overflow: hidden; display: flex;
  border: 1px solid var(--line); font-size: 12px; font-weight: 700;
}
.spec-bar div { display: flex; align-items: center; justify-content: center; color: #16130F; text-align: center; padding: 0 4px; }
.spec-scale { display: flex; font-size: 11.5px; color: var(--muted); margin-top: 7px; font-variant-numeric: tabular-nums; }
.spec-scale span { flex: 1; }
.spec-scale span:last-child { text-align: right; flex: none; }

/* ---------- Verdict block ---------- */
.verdict {
  background: linear-gradient(135deg, var(--panel) 0%, var(--panel-2) 100%);
  border: 1px solid var(--line); border-radius: var(--radius); padding: 30px 32px; margin: 30px 0;
}
.verdict .vl { font-size: 11.5px; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); font-weight: 700; margin-bottom: 14px; }
.verdict p { font-size: 20px; line-height: 1.55; }
.verdict p:first-of-type { margin-top: 0; }
.verdict p:last-child { margin-bottom: 0; }

/* ---------- Home hero ---------- */
.hero { padding: 56px 0 40px; border-bottom: 1px solid var(--line); margin-bottom: 48px; }
.hero h1 { font-size: clamp(40px, 7vw, 78px); margin-bottom: 24px; }
.hero h1 em { font-style: normal; color: var(--trad); }
.hero h1 i { font-style: normal; color: var(--ir); }
.hero .standfirst { font-size: clamp(20px, 2.4vw, 26px); max-width: 54ch; }
.herometa { display: flex; gap: 12px 34px; flex-wrap: wrap; margin-top: 30px; font-size: 14.5px; color: var(--muted); }
.herometa b { color: var(--ink); font-weight: 650; }

.navcards { display: grid; grid-template-columns: repeat(auto-fit, minmax(255px,1fr)); gap: 16px; margin: 30px 0; }
.navcard {
  display: block; text-decoration: none; color: inherit; background: var(--panel);
  border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; transition: border-color .15s;
}
.navcard:hover { border-color: var(--trad); }
.navcard .nn { font-size: 11.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.navcard .nt { font-family: "Fraunces", Georgia, serif; font-size: 23px; font-weight: 700; margin: 9px 0 8px; line-height: 1.2; color: var(--ink); }
.navcard p { font-size: 15px; margin: 0; color: var(--ink-dim); }

/* ---------- Footer ---------- */
footer.site {
  border-top: 1px solid var(--line); background: var(--panel);
  padding: 40px 24px; font-size: 14.5px; color: var(--muted);
}
footer.site .fin { max-width: var(--maxw); margin: 0 auto; }
footer.site nav { display: flex; gap: 8px 22px; flex-wrap: wrap; margin-bottom: 22px; }
footer.site nav a { color: var(--ink-dim); text-decoration: none; }
footer.site nav a:hover { color: var(--trad); }
footer.site p { max-width: 80ch; }

/* ---------- Buttons ---------- */
.pdfbtn {
  position: fixed; bottom: 22px; right: 22px; z-index: 55;
  background: var(--trad); color: #16130F; border: none; border-radius: 999px;
  padding: 13px 24px; font: inherit; font-size: 14.5px; font-weight: 700; cursor: pointer;
  box-shadow: 0 4px 18px rgba(0,0,0,.45);
}
.pdfbtn:hover { filter: brightness(1.08); }
:root[data-theme="light"] .pdfbtn { color: #FBF8F3; }

.pagenav { display: flex; justify-content: space-between; gap: 18px; flex-wrap: wrap; border-top: 1px solid var(--line); padding-top: 26px; margin-top: 56px; }
.pagenav a { text-decoration: none; font-size: 15px; }
.pagenav .pl { display: block; font-size: 11px; letter-spacing: .15em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
.pagenav strong { color: var(--ink); }

/* ---------- Print ---------- */
@page { size: letter portrait; margin: 0.5in; }
@media print {
  :root {
    --bg:#fff; --panel:#fff; --panel-2:#F5F2EC; --line:#C7BFB1; --line-soft:#DDD6C9;
    --ink:#000; --ink-dim:#1B1712; --muted:#4A4437;
    --trad:#7A4703; --ir:#8E2F39; --link:#000;
    --ev-strong:#265739; --ev-mod:#68500A; --ev-weak:#84302A; --shadow:none;
  }
  body { background:#fff; color:#000; font-size: 9.5pt; line-height: 1.42; }
  .topbar, .pdfbtn, .toc, .pagenav, .navcards, .noprint { display: none !important; }
  .wrap { max-width: none; padding: 0; }
  .cols { display: block; }
  .phead, .hero { margin-bottom: 16px; padding-bottom: 12px; border-bottom-width: 2.5px; }
  h1 { font-size: 21pt; } .hero h1 { font-size: 24pt; }
  h2 { font-size: 14pt; } h3 { font-size: 11.5pt; margin: 13px 0 5px; } h4 { font-size: 10pt; }
  .standfirst { font-size: 11pt; max-width: none; }
  section.sec { margin-bottom: 18px; break-inside: avoid; }
  p, li { margin: 6px 0; } p.lede { font-size: 10.5pt; }
  table { font-size: 8.2pt; min-width: 0; }
  th, td { padding: 5px 7px; }
  thead th { font-size: 7.2pt; position: static; background: #EFEBE3; }
  .tw { border-radius: 0; break-inside: avoid; }
  caption { padding: 0 0 6px; font-size: 8pt; }
  .box, .card, .stat, .verdict, .myth { padding: 11px 14px; margin: 12px 0; break-inside: avoid; box-shadow: none; }
  .verdict p { font-size: 10.5pt; }
  .stat .v { font-size: 18pt; } .card .cn { font-size: 12pt; }
  .pill { padding: 1px 6px; font-size: 7.4pt; }
  .ev { font-size: 7.4pt; }
  .cites { font-size: 7.6pt; } .cites li { padding: 5px 0 5px 16px; }
  .cites li::before { top: 7px; }
  a { text-decoration: none; }
  footer.site { padding: 14px 0; font-size: 7.6pt; }
  footer.site nav { display: none; }
  .spec-bar { height: 26px; font-size: 7.5pt; }
}
