/* Flowlyte blog theme. Tokens from DESIGN.md "Dark mode" (Quantitative
 * Editorial), with the app's "Flowlyte Light" palette (src/lib/themes.ts) as
 * the light theme. Raw colour values appear only in the token blocks below;
 * everything else uses var(). */

@font-face { font-family: "Geist"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/geist-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Geist"; font-style: normal; font-weight: 500; font-display: swap; src: url("../fonts/geist-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Geist"; font-style: normal; font-weight: 600; font-display: swap; src: url("../fonts/geist-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Geist Mono"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/geist-mono-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Geist Mono"; font-style: normal; font-weight: 500; font-display: swap; src: url("../fonts/geist-mono-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Instrument Serif"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/instrument-serif-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Instrument Serif"; font-style: italic; font-weight: 400; font-display: swap; src: url("../fonts/instrument-serif-latin-400-italic.woff2") format("woff2"); }

:root {
    --bg: #0B0F19;
    --surface: #121826;
    --surface-highlight: #1E2536;
    --text: #F1EDE6;
    --text-muted: #9AA3B2;
    --text-dim: #6B7280;
    --primary: #F97316;
    --link: #8AB4F8;
    --hair: rgba(241, 237, 230, .07);
    --hair-2: rgba(241, 237, 230, .14);
    --primary-text: var(--primary);
    --on-primary: #0B0F19;
    --card-shadow: none;
    color-scheme: dark;
    --serif: "Instrument Serif", Georgia, serif;
    --sans: "Geist", system-ui, sans-serif;
    --mono: "Geist Mono", ui-monospace, monospace;
    --radius: 8px;
}

/* Light theme (slice 10). Values from src/lib/themes.ts "Flowlyte Light"
 * and DESIGN.md "Depth hierarchy": cream page, brighter elevated surfaces.
 * Small orange text turns ink (#EA580C is 3.27:1 on cream, under AA for small
 * text) and text on the orange button stays ink (5.38:1); orange stays on
 * borders, rules, the drop cap and the focus ring (3:1 rule). Light dim text
 * takes the palette's secondary grey, since #94A3B8 is 2.36:1 on cream.
 * Decision D80, 2026-11-16. Keep this block and the media block identical. */
:root[data-theme="light"] {
    --bg: #F8F5EF;
    --surface: #FFFFFF;
    --surface-highlight: #F1EDE6;
    --text: #0B0F19;
    --text-muted: #475569;
    --text-dim: #475569;
    --primary: #EA580C;
    --link: #1D4ED8;
    --hair: rgba(11, 15, 25, .07);
    --hair-2: rgba(11, 15, 25, .14);
    --primary-text: var(--text);
    --on-primary: #0B0F19;
    --card-shadow: 0 2px 12px rgba(0,0,0,0.08), 0 1px 4px rgba(0,0,0,0.04);
    color-scheme: light;
}

/* No stored choice and no JS: follow the system's light preference. */
@media (prefers-color-scheme: light) {
    :root:not([data-theme="dark"]) {
    --bg: #F8F5EF;
    --surface: #FFFFFF;
    --surface-highlight: #F1EDE6;
    --text: #0B0F19;
    --text-muted: #475569;
    --text-dim: #475569;
    --primary: #EA580C;
    --link: #1D4ED8;
    --hair: rgba(11, 15, 25, .07);
    --hair-2: rgba(11, 15, 25, .14);
    --primary-text: var(--text);
    --on-primary: #0B0F19;
    --card-shadow: 0 2px 12px rgba(0,0,0,0.08), 0 1px 4px rgba(0,0,0,0.04);
    color-scheme: light;
    }
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--sans);
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--link); }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; }
code, pre, kbd { font-family: var(--mono); font-variant-numeric: tabular-nums; }
table { font-variant-numeric: tabular-nums; }

/* Site header and footer */
.site-head, .site-foot {
    max-width: 1100px;
    margin: 0 auto;
    padding: 20px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}
.site-head { border-bottom: 1px solid var(--hair); }
.site-head__brand { font-family: var(--serif); font-size: 24px; color: var(--text); text-decoration: none; }
.site-head__home { margin-left: auto; }
.site-head__home, .site-foot a { font-family: var(--mono); font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--text-muted); text-decoration: none; }
.site-foot { border-top: 1px solid var(--hair); font-family: var(--mono); font-size: 12px; color: var(--text-dim); }

/* Light/dark switch (slice 10): 44px target, sun in dark, moon in light. */
.theme-toggle { min-width: 44px; min-height: 44px; padding: 0; display: inline-flex; align-items: center; justify-content: center; background: none; color: var(--text-muted); border: 1px solid var(--hair-2); border-radius: var(--radius); cursor: pointer; }
.theme-toggle[hidden] { display: none; }
.theme-toggle:hover { color: var(--text); border-color: var(--text-muted); }
.theme-toggle:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.theme-toggle__moon { display: none; }
:root[data-theme="light"] .theme-toggle__sun { display: none; }
:root[data-theme="light"] .theme-toggle__moon { display: block; }

/* Masthead (variant B) */
.mast {
    max-width: 1100px;
    margin: 0 auto;
    padding: 56px 16px 24px;
    display: grid;
    gap: 12px;
    border-bottom: 1px solid var(--hair-2);
}
.eyebrow { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--primary-text); font-weight: 600; }
.eyebrow a { color: inherit; text-decoration: none; }
.eyebrow span { color: var(--text-muted); margin-left: 14px; }
.mast h1 {
    font-family: var(--serif);
    font-weight: 400;
    font-size: clamp(40px, 7vw, 72px);
    line-height: .95;
    letter-spacing: -.028em;
    margin: 6px 0;
    max-width: 16ch;
}
.mast--list h1 { font-size: clamp(36px, 5vw, 48px); max-width: none; }
.stand { font-family: var(--serif); font-style: italic; font-size: 24px; color: var(--text-muted); max-width: 40ch; line-height: 1.3; margin: 0; }
.asof { display: flex; flex-wrap: wrap; gap: 18px; font-family: var(--mono); font-size: 12px; color: var(--text-muted); padding-top: 14px; }
.asof b { color: var(--text); font-weight: 500; }

/* Tracker badge and verdict (names live in partials/tracker-tags.hbs) */
.tracker { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; font-family: var(--mono); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; }
.tracker__badge { color: var(--primary-text); border: 1px solid var(--primary); border-radius: 4px; padding: 3px 8px; }
.verdict--worth-a-look { color: var(--primary-text); }
.verdict--wait { color: var(--text); }
.verdict--pass { color: var(--text-muted); }
.verdict--quiet-week { color: var(--text-dim); }

/* Post body: step rail plus article. --col-left is the article column's
 * offset from the start of the centred .body box, so full-width cards can
 * break out to the viewport edge (see .kg-width-full). */
.body {
    --rail: 200px;
    --gap: 56px;
    --pad: 16px;
    --max: 1100px;
    --col-left: calc(var(--pad) + var(--rail) + var(--gap));
    max-width: var(--max);
    margin: 0 auto;
    padding: 0 var(--pad);
    display: grid;
    grid-template-columns: var(--rail) minmax(0, 680px);
    gap: var(--gap);
}
.body--page { grid-template-columns: minmax(0, 680px); --col-left: var(--pad); }
.toc { position: sticky; top: 20px; align-self: start; padding-top: 40px; font-size: 13px; }
.toc[hidden] { display: none; }
.toc ol { list-style: none; padding: 0; margin: 0; }
.toc li { padding: 6px 0; border-bottom: 1px solid var(--hair); }
.toc a { color: var(--text-muted); text-decoration: none; }
.toc a:hover { color: var(--text); }
.toc li span { font-family: var(--mono); color: var(--primary-text); margin-right: 8px; }
.body > article { grid-column: -2 / -1; padding-top: 40px; font-size: 17px; line-height: 1.65; min-width: 0; }

.gh-content > p:first-of-type::first-letter { font-family: var(--serif); font-size: 64px; float: left; line-height: .8; padding: 6px 8px 0 0; color: var(--primary); }
.gh-content > .k { font-family: var(--mono); font-size: 12px; color: var(--primary-text); letter-spacing: .1em; border-top: 1px solid var(--hair-2); margin-top: 44px; padding-top: 20px; }
.gh-content > h2 { font-family: var(--serif); font-weight: 400; font-size: 34px; line-height: 1.05; margin: 6px 0 16px; }
.gh-content > h3 { font-family: var(--serif); font-weight: 400; font-size: 24px; line-height: 1.2; margin: 32px 0 12px; }
.gh-content blockquote { font-family: var(--serif); font-size: 30px; line-height: 1.15; border-left: 2px solid var(--primary); padding-left: 20px; margin: 32px 0; color: var(--text); }
.gh-content hr { border: 0; border-top: 1px solid var(--hair-2); margin: 40px 0; }

/* Images and captions */
figure { margin: 24px 0; }
figure img { display: block; border-radius: var(--radius); }
figcaption { font-size: 12px; color: var(--text-dim); font-family: var(--mono); margin-top: 8px; }
.kg-width-wide { margin-left: -40px; margin-right: -40px; }
.kg-width-wide figcaption { padding: 0 40px; }
/* Viewport-wide: the column is not centred in the viewport (the rail sits to
 * its left), so the left margin comes from the column's real offset, not 50%.
 * Painted above the sticky rail while it scrolls past. */
.kg-width-full {
    width: 100vw;
    max-width: none;
    margin-left: calc((min(100vw, var(--max)) - 100vw) / 2 - var(--col-left));
    margin-right: 0;
    position: relative;
    z-index: 1;
}
.kg-width-full img { border-radius: 0; width: 100%; }
.kg-width-full figcaption { padding: 0 16px; }

/* Tables: the framed tabular-number box */
.kg-html-card table, .gh-content table {
    display: block;
    overflow-x: auto;
    width: 100%;
    border-collapse: collapse;
    background: var(--surface);
    border: 1px solid var(--hair);
    border-radius: var(--radius);
    margin: 24px 0;
    font-size: 14px;
    font-variant-numeric: tabular-nums;
}
.kg-html-card th, .gh-content th { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--text-muted); font-weight: 500; text-align: left; }
.kg-html-card th, .kg-html-card td, .gh-content th, .gh-content td { padding: 8px 12px; border-bottom: 1px solid var(--hair); }

/* The tracker header card: styled only, never read by script */
.tracker-head { background: var(--surface); box-shadow: var(--card-shadow); border: 1px solid var(--hair-2); border-radius: var(--radius); padding: 16px 18px; margin: 0 0 32px; font-family: var(--mono); font-size: 13px; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.tracker-head b, .tracker-head strong { color: var(--text); font-weight: 500; }

/* Disclaimer */
.disc { display: block; border: 1px solid var(--hair-2); border-radius: var(--radius); padding: 16px 18px; font-size: 13px; color: var(--text-muted); line-height: 1.55; margin: 40px 0; }
.disc b { display: block; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--text); margin-bottom: 6px; }

/* End-of-post CTA */
.cta { max-width: 1100px; margin: 56px auto 80px; padding: 0 16px; }
.cta .in { display: grid; grid-template-columns: 1fr auto; gap: 24px; align-items: center; border-top: 2px solid var(--primary); border-bottom: 1px solid var(--hair-2); padding: 28px 0; }
.cta h3 { font-family: var(--serif); font-weight: 400; font-size: 36px; margin: 0; }
.cta p { color: var(--text-muted); margin: 6px 0 0; }
.cta__button { background: var(--primary); color: var(--on-primary); font-weight: 600; padding: 14px 26px; border-radius: var(--radius); text-decoration: none; }
.cta__button:hover { text-decoration: none; opacity: .9; }

/* Share row (slice 09): plain links plus Copy link and Share, which blog.js
 * shows only where the browser supports them. 44px touch targets; wraps at
 * any width. */
.share { max-width: 1100px; margin: 40px auto 0; padding: 20px 16px 0; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; border-top: 1px solid var(--hair); }
.share__label { font-family: var(--mono); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--text-dim); margin-right: 4px; }
.share__link, .social__link { min-height: 44px; min-width: 44px; padding: 0 12px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; font-family: var(--mono); font-size: 12px; letter-spacing: .06em; color: var(--text-muted); text-decoration: none; background: none; border: 1px solid var(--hair-2); border-radius: var(--radius); cursor: pointer; }
.share__link[hidden] { display: none; }
.share__link:hover, .share__link:focus-visible, .social__link:hover, .social__link:focus-visible { color: var(--primary-text); border-color: var(--primary); text-decoration: none; }
.share__link:focus-visible, .social__link:focus-visible, .site-foot a:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.share__link svg, .social__link svg { width: 18px; height: 18px; flex: none; }
.share__status { font-family: var(--mono); font-size: 12px; color: var(--text-muted); }

/* Footer (slice 09): Ghost's secondary menu, Privacy Policy, RSS and socials. */
.site-foot { flex-wrap: wrap; }
/* One row: the nav and both lists inside it (Ghost's menu, then Privacy
 * Policy and RSS) share one flex rule and one gap, so they wrap as one line. */
.site-foot__nav, .site-foot .nav { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 20px; list-style: none; margin: 0; padding: 0; }
.site-foot .nav a { display: inline-flex; align-items: center; min-height: 44px; }
.site-foot a:hover { color: var(--primary-text); }
.social { display: flex; flex-wrap: wrap; gap: 8px; }
/* Hides the block when no account is set: social.hbs keeps no whitespace
 * between its {{#if}} blocks, so the div is truly empty (test t24). */
.social:empty { display: none; }
.site-foot .social__link { padding: 0; border-color: transparent; }
.site-foot .social__link--text { padding: 0 8px; }

/* Post lists: index, tag and read more */
.cards { max-width: 1100px; margin: 0 auto; padding: 0 16px; }
.card { padding: 28px 0; border-bottom: 1px solid var(--hair); display: grid; gap: 8px; }
.card__title { font-family: var(--serif); font-weight: 400; font-size: 30px; line-height: 1.1; margin: 0; }
.card__title a { color: var(--text); text-decoration: none; }
.card__title a:hover { color: var(--primary-text); text-decoration: underline; text-decoration-color: var(--primary); }
.card__excerpt { color: var(--text-muted); margin: 0; max-width: 680px; }
.read-more { max-width: 1100px; margin: 0 auto 80px; padding: 0 16px; }
.read-more h4 { font-family: var(--mono); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--text-muted); font-weight: 500; }
.read-more .cards { padding: 0; }
.cards--grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 24px; }
.cards--grid .card { background: var(--surface); box-shadow: var(--card-shadow); border: 1px solid var(--hair); border-radius: var(--radius); padding: 18px; }
.cards--grid .card__title { font-size: 22px; }

.pagination { max-width: 1100px; margin: 32px auto 80px; padding: 0 16px; display: flex; gap: 24px; align-items: center; font-family: var(--mono); font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--text-dim); }
.pagination a { color: var(--text-muted); text-decoration: none; }
.pagination a:hover { color: var(--text); }

/* Consent banner (copy matches the app's CookieConsent) */
.consent { position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 50; max-width: 1100px; margin: 0 auto; display: flex; flex-wrap: wrap; gap: 16px; align-items: center; justify-content: space-between; background: var(--surface); box-shadow: var(--card-shadow); border: 1px solid var(--hair-2); border-radius: var(--radius); padding: 16px 18px; }
.consent[hidden] { display: none; }
.consent h3 { font-size: 14px; font-weight: 600; margin: 0 0 4px; }
.consent p { font-size: 13px; color: var(--text-muted); margin: 0; max-width: 680px; }
.consent__actions { display: flex; gap: 8px; }
.consent button { font: inherit; font-size: 13px; font-weight: 600; padding: 8px 16px; border-radius: var(--radius); cursor: pointer; }
.consent__decline { background: transparent; color: var(--text-muted); border: 1px solid var(--hair-2); }
.consent__accept { background: var(--primary); color: var(--on-primary); border: 1px solid var(--primary); }

@media (max-width: 860px) {
    .body { grid-template-columns: 1fr; --col-left: var(--pad); }
    .toc { display: none; }
    .kg-width-wide { margin-left: 0; margin-right: 0; }
    .kg-width-wide figcaption { padding: 0; }
    .cta .in { grid-template-columns: 1fr; }
}
