/* tldrTLS. One stylesheet; the only script is public/theme.js.
   Flat colour, ink outlines, hard offset shadows. The palette is the block
   of variables below; change it there and nowhere else. */

@font-face {
  font-family: "Bricolage Grotesque";
  src: url("/fonts/bricolage-grotesque-latin.woff2") format("woff2");
  font-weight: 200 800;
  font-display: swap;
}

/* Each colour is light-dark(light, dark). Which one applies follows
   color-scheme: the OS setting by default, or the header's theme switch. */
:root {
  --paper: light-dark(#e0f7f4, #0c0e1b);   /* pale aqua / deep navy */
  --surface: light-dark(#ffffff, #161a2d);
  --sunk: light-dark(#cdeee9, #222741);
  --ink: light-dark(#0b0d1a, #f1f3ff);
  --ink-2: light-dark(#3a3f55, #c8cde4);
  --muted: light-dark(#5a6178, #9198b6);
  --rule: light-dark(#bfe3dd, #2b3150);
  --hl: light-dark(#2ee6d6, #25b5aa);   /* highlighter: electric aqua, calmer at night */
  --brand: light-dark(#2a3cff, #98a3ff);   /* cobalt */
  --border: light-dark(#0b0d1a, #565e88);
  --shadow: light-dark(#0b0d1a, #000);
  --code-bg: light-dark(#0b0d1a, #070812);
  --code-ink: #e8ebff;

  /* Rating fills. Text on them is always --fill-ink. */
  --now: light-dark(#ff5964, #e8656e);
  --quarter: light-dark(#ffcc33, #dcae3c);
  --plan: light-dark(#a594ff, #9488e6);
  --notyet: light-dark(#cfd4e2, #9aa1b8);
  --fill-ink: #0b0d1a;

  --display: "Bricolage Grotesque", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;
  color-scheme: light dark;
}

/* Theme switch. The radios work on their own; public/theme.js remembers the
   choice and sets data-theme on <html> before the page is drawn. */
:root[data-theme="light"], :root:has(#theme-light:checked) { color-scheme: light; }
:root[data-theme="dark"], :root:has(#theme-dark:checked) { color-scheme: dark; }

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 1.0625rem/1.6 var(--sans); -webkit-font-smoothing: antialiased; }
/* Links are the text colour with a solid underline, so they never depend on
   telling blue from the background. Hover inverts them. */
a { color: inherit; text-decoration-thickness: 2px; text-decoration-color: currentColor; text-underline-offset: .2em; }
a:hover { background: var(--ink); color: var(--paper); text-decoration-color: transparent; }
/* Links that leave the site get an arrow. */
.prose a[href^="http"]::after, .refs a::after { content: ""; display: inline-block; width: .62em; height: .62em; margin-left: .25em; background: currentColor; -webkit-mask: url("/out.svg") no-repeat center / contain; mask: url("/out.svg") no-repeat center / contain; }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 3px; border-radius: 4px; }
h1, h2, h3 { font-family: var(--display); font-weight: 800; line-height: 1.08; letter-spacing: -.025em; margin: 0; text-wrap: balance; }
p { margin: 0 0 1em; }
code, pre { font-family: var(--mono); }
.wrap { max-width: 66rem; margin: 0 auto; padding: 0 1.25rem; }

/* The box shape everything is built from. */
.tile, .verdict, .scale, .timeline, pre, .button {
  border: 2px solid var(--border);
  border-radius: 14px;
  box-shadow: 4px 4px 0 var(--shadow);
}

/* ---------- Header ---------- */
.top { padding: 1.1rem 0; }
.top .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .6rem 1.5rem; }
/* The logo: "tldr", then TLS inside an address-bar padlock pill. */
.brand { display: inline-flex; align-items: center; gap: .32rem; text-decoration: none; font: 800 1.5rem/1 var(--display); letter-spacing: -.04em; }
.brand:hover { background: none; color: inherit; }
.brand span { display: inline-flex; align-items: center; gap: .32rem; padding: .2em .6em .24em .5em; background: var(--hl); color: var(--fill-ink); border: 2px solid var(--border); border-radius: 999px; box-shadow: 2px 2px 0 var(--shadow); font-size: .8em; letter-spacing: .03em; transition: transform .12s, box-shadow .12s; }
.brand:hover span { transform: translate(-1px, -1px); box-shadow: 3px 3px 0 var(--shadow); }
.top nav { display: flex; flex-wrap: wrap; gap: .2rem 1.3rem; font-weight: 600; font-size: .98rem; }
.top nav a { text-decoration: none; padding: .1rem 0; }
.top nav a:hover { background: none; color: inherit; }
.top nav a:hover, .top nav a[aria-current="page"] { box-shadow: inset 0 -.2em 0 var(--hl); }

/* Theme switch: three radios drawn as one pill of buttons. */
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.theme { display: inline-flex; margin: 0; padding: 0; border: 2px solid var(--border); border-radius: 999px; box-shadow: 2px 2px 0 var(--shadow); background: var(--surface); overflow: hidden; }
.theme input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
.theme label { padding: .22rem .7rem; font: 700 .85rem/1.2 var(--display); cursor: pointer; }
.theme label + input + label { border-left: 2px solid var(--border); }
.theme label:hover { background: var(--sunk); }
.theme input:checked + label { background: var(--hl); color: var(--fill-ink); }
.theme input:focus-visible + label { outline: 3px solid var(--brand); outline-offset: -5px; border-radius: 999px; }

/* ---------- Badges ---------- */
.lv-now { --fill: var(--now); }
.lv-quarter { --fill: var(--quarter); }
.lv-plan { --fill: var(--plan); }
.lv-notyet { --fill: var(--notyet); }

.badge { display: inline-flex; align-items: center; gap: .5rem; padding: .22rem .7rem .22rem .55rem; background: var(--fill); color: var(--fill-ink); border: 2px solid var(--fill-ink); border-radius: 999px; font: 800 .9rem/1.2 var(--display); letter-spacing: 0; white-space: nowrap; }
.pips { display: inline-flex; gap: 3px; }
.pips i { width: 9px; height: 9px; border: 2px solid var(--fill-ink); border-radius: 3px; }
.pips i.on { background: var(--fill-ink); }

/* ---------- Buttons ---------- */
.button { display: inline-block; padding: .6rem 1.15rem; background: var(--hl); color: var(--fill-ink); font: 800 1.02rem/1.2 var(--display); text-decoration: none; transition: transform .12s, box-shadow .12s; }
.button.quiet { background: var(--surface); color: var(--ink); }
.button:hover { background: var(--hl); color: var(--fill-ink); transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--shadow); }
.button:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--shadow); }

/* ---------- Home: hero ---------- */
.hero { text-align: center; padding: 3.2rem 0 3.4rem; }
.hero h1 { font-size: clamp(2.7rem, 8.2vw, 5.4rem); letter-spacing: -.045em; line-height: 1.05; }
.hero mark { display: inline-block; padding: 0 .14em .06em; background: var(--hl); color: var(--fill-ink); border: 3px solid var(--border); border-radius: .2em; transform: rotate(-2deg); box-shadow: 5px 5px 0 var(--shadow); }
.lede { font-size: 1.22rem; line-height: 1.5; color: var(--ink-2); max-width: 36rem; }
.hero .lede { margin: 1.7rem auto 1.7rem; }
.cta { display: flex; flex-wrap: wrap; justify-content: center; gap: .9rem; margin: 0; }

/* ---------- Home: this week's notice ---------- */
/* Large colour blocks are solid by day. At night they become a dark tint with a
   coloured edge, so they don't glare against the navy. */
.notice { --fill: var(--quarter); margin: 0 0 2.8rem; padding: 1.1rem 1.25rem; background: light-dark(var(--fill), color-mix(in srgb, var(--fill) 16%, var(--surface))); color: light-dark(var(--fill-ink), var(--ink)); border: 2px solid light-dark(var(--border), var(--fill)); border-radius: 14px; box-shadow: 4px 4px 0 var(--shadow); }
.notice .eyebrow { color: inherit; margin-bottom: .35rem; }
.notice p { margin: 0 0 .5rem; max-width: 52rem; }
.notice p:last-child { margin: 0; font-weight: 700; }
.notice a { text-decoration-color: currentColor; }
.notice a:hover { background: light-dark(var(--fill-ink), var(--ink)); color: light-dark(var(--quarter), var(--paper)); }

/* ---------- Home: groups and tiles ---------- */
.group { margin: 0 0 2.8rem; }
.group > h2 { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .9rem; margin: 0 0 1rem; }
.group > h2 > span:last-child { font: 500 1rem/1.4 var(--sans); letter-spacing: 0; color: var(--ink-2); }
.group > h2 .badge { font-size: 1.05rem; padding: .32rem .9rem .32rem .7rem; }
.group > h2 .plain { font-size: 1.6rem; }

.tiles { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(22rem, 100%), 1fr)); gap: 1.15rem; }
.tiles li { display: flex; }
.tile { --fill: var(--brand); position: relative; display: flex; flex-direction: column; gap: .4rem; width: 100%; padding: 1.5rem 1.15rem 1.15rem; background: var(--surface); text-decoration: none; overflow: hidden; transition: transform .12s, box-shadow .12s; }
.tile::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 10px; background: var(--fill); border-bottom: 2px solid var(--border); }
.tile:hover { background: var(--surface); color: inherit; transform: translate(-2px, -2px); box-shadow: 7px 7px 0 var(--shadow); }
.tile .topic { font: 500 .74rem/1.3 var(--mono); letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.tile strong { font: 800 1.24rem/1.16 var(--display); letter-spacing: -.02em; }
.tile .act { font-size: .95rem; line-height: 1.45; color: var(--ink-2); }
.lv-now .tile { --fill: var(--now); }
.lv-quarter .tile { --fill: var(--quarter); }
.lv-plan .tile { --fill: var(--plan); }
.lv-notyet .tile { --fill: var(--notyet); }

/* ---------- Home: timeline ---------- */
.timeline { list-style: none; margin: 0; padding: .3rem 1.15rem; background: var(--surface); }
.timeline li { display: grid; grid-template-columns: 9.5rem 1fr; gap: 1rem; padding: .7rem 0; border-top: 1px solid var(--rule); }
.timeline li:first-child { border-top: 0; }
.timeline time { align-self: start; justify-self: start; padding: .15rem .6rem; background: var(--quarter); color: var(--fill-ink); border: 2px solid var(--fill-ink); border-radius: 999px; font: 800 .9rem/1.3 var(--display); white-space: nowrap; }
.coming > h2 .plain { font-size: 2rem; }
.timeline { border-width: 3px; box-shadow: 6px 6px 0 var(--shadow); }
.timeline li { font-size: 1.05rem; font-weight: 600; }
.timeline a { text-decoration: none; }
.timeline a:hover { text-decoration: underline; }
.more { margin: 0 0 1rem; }

/* ---------- Inner pages ---------- */
.sheet { max-width: 46rem; margin: 0 auto; padding: 1.6rem 0 1rem; }
.eyebrow { font: 500 .8rem/1.3 var(--mono); letter-spacing: .05em; text-transform: uppercase; color: var(--muted); margin: 0 0 .7rem; }
.sheet h1 { font-size: clamp(2.1rem, 5.4vw, 3.3rem); letter-spacing: -.04em; margin-bottom: 1.3rem; }
.sheet > .lede { max-width: none; margin-bottom: 1rem; }
.verdict { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1rem; padding: .9rem 1.1rem; background: light-dark(var(--fill), color-mix(in srgb, var(--fill) 16%, var(--surface))); color: light-dark(var(--fill-ink), var(--ink)); border-color: light-dark(var(--border), var(--fill)); margin: 0 0 1.1rem; }
.verdict .badge { background: light-dark(var(--fill-ink), var(--fill)); color: light-dark(var(--fill), var(--fill-ink)); }
.verdict .pips i { border-color: light-dark(var(--fill), var(--fill-ink)); }
.verdict .pips i.on { background: light-dark(var(--fill), var(--fill-ink)); }
.verdict p { margin: 0; flex: 1 1 16rem; font: 700 1.12rem/1.35 var(--display); }
.stamp { display: flex; flex-wrap: wrap; gap: .5rem; margin: 0 0 1.2rem; font: 600 .9rem/1.3 var(--sans); color: var(--ink); }
.stamp span { padding: .25rem .7rem; background: var(--surface); border: 2px solid var(--border); border-radius: 999px; }
.stamp .upd { background: var(--hl); color: var(--fill-ink); }
.stamp time { font-weight: 800; }

.sheet h2 { font-size: 1.65rem; margin: 2.6rem 0 .9rem; }
.sheet h2::before { content: ""; display: inline-block; width: .55em; height: .55em; margin-right: .45em; background: var(--hl); border: 2px solid var(--border); border-radius: 4px; transform: rotate(-8deg); }
.sheet h3 { font-size: 1.2rem; margin: 1.9rem 0 .6rem; letter-spacing: -.015em; }
.prose ul, .prose ol, .refs { padding-left: 1.4rem; margin: 0 0 1em; }
.prose li, .refs li { margin: .35rem 0; }
.prose li::marker, .refs li::marker { font-weight: 700; }
.fetched { font: 500 .78rem/1.4 var(--mono); color: var(--ink-2); white-space: nowrap; margin-left: .3rem; }
.prose strong { font-weight: 700; }

:not(pre) > code { font-size: .86em; background: var(--sunk); padding: .12em .38em; border-radius: 5px; overflow-wrap: anywhere; }
pre { tab-size: 4; margin: 0 0 1.3rem; padding: .95rem 1.1rem; background: var(--code-bg); color: var(--code-ink); overflow-x: auto; font-size: .86rem; line-height: 1.6; }

table { width: 100%; border-collapse: collapse; margin: 0 0 1.4rem; font-size: .95rem; }
th { text-align: left; font: 500 .74rem/1.3 var(--mono); letter-spacing: .05em; text-transform: uppercase; color: var(--muted); padding: .5rem .8rem .5rem 0; border-bottom: 2px solid var(--border); }
td { padding: .65rem .8rem .65rem 0; border-bottom: 1px solid var(--rule); vertical-align: top; }

.scale { list-style: none; margin: 0 0 1rem; padding: .2rem 1.1rem; background: var(--surface); }
.scale li { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; padding: .75rem 0; border-top: 1px solid var(--rule); }
.scale li:first-child { border-top: 0; }
.scale .badge { min-width: 10.5rem; }
.scale p { margin: 0; }

.log { list-style: none; padding: 0; margin: 0; }
.log li { display: grid; grid-template-columns: 7.5rem 1fr; gap: 1rem; padding: .35rem 0; }
.log time { font: 500 .84rem/1.9 var(--mono); color: var(--muted); }

/* ---------- Config picker ---------- */
.picker { display: grid; gap: .7rem; margin: 0 0 1.4rem; padding: 1rem 1.1rem; background: var(--surface); border: 2px solid var(--border); border-radius: 14px; box-shadow: 4px 4px 0 var(--shadow); }
.pick { display: grid; grid-template-columns: 12.5rem 1fr; align-items: center; gap: .4rem 1rem; }
.pick p { margin: 0; font: 800 .98rem/1.3 var(--display); }
.pick ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .45rem; }
.pick a, .pick .off { display: inline-flex; align-items: center; gap: .4rem; padding: .3rem .8rem; border: 2px solid var(--border); border-radius: 999px; font: 700 .92rem/1.3 var(--sans); text-decoration: none; background: var(--paper); }
.pick a:hover { background: var(--ink); color: var(--paper); }
.pick a[aria-current] { background: var(--hl); color: var(--fill-ink); border-color: var(--fill-ink); box-shadow: 2px 2px 0 var(--shadow); }
.pick .off { border-style: dashed; color: var(--muted); }
.pick small { font: 500 .68rem/1 var(--mono); text-transform: uppercase; letter-spacing: .04em; opacity: .85; }
.tested { margin: 0 0 1.4rem; padding: .7rem 1rem; border: 2px solid var(--border); border-radius: 12px; border-left-width: 10px; }
.tested.yes { border-left-color: var(--hl); }
.tested.no { border-left-color: var(--quarter); }
.eyebrow a { text-decoration-thickness: 1px; }

/* ---------- Site map on inner pages ---------- */
.sitemap { max-width: 46rem; margin: 2.5rem auto 0; padding-top: 1.4rem; border-top: 2px solid var(--border); display: grid; grid-template-columns: 2fr 1fr; gap: 1rem 2rem; font-size: .95rem; }
.sitemap h2 { font-size: 1.05rem; margin: 0 0 .5rem; }
.sitemap ul { list-style: none; margin: 0; padding: 0; columns: 2; column-gap: 1.5rem; }
.sitemap div:last-child ul { columns: 1; }
.sitemap li { margin: 0 0 .3rem; break-inside: avoid; }

/* ---------- Footer ---------- */
footer { margin-top: 3.5rem; padding: 1.6rem 0 2.5rem; border-top: 2px solid var(--border); font-size: .9rem; color: var(--ink-2); }
footer p { margin: 0 0 .3rem; }
footer .credit { margin-top: .9rem; font-weight: 700; color: var(--ink); }
.heart { color: var(--now); }

/* ---------- Small screens ---------- */
@media (max-width: 40rem) {
  .hero { padding: 1.8rem 0 2.4rem; }
  .timeline li, .log li { grid-template-columns: 1fr; gap: .3rem; }
  .sitemap { grid-template-columns: 1fr; }
  .pick { grid-template-columns: 1fr; }
  table { display: block; overflow-x: auto; }
  .scale .badge { min-width: 0; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .button, .tile, .brand span { transition: none; }
  .button:hover, .tile:hover, .button:active { transform: none; }
}
