/* ============================================================
   raw.css — the RAW POWER design system (spec 053).

   THE system going forward: new components are styled HERE, and each
   redesign pass MOVES an area's rules out of the legacy style.css into
   this file, deleting them there — style.css shrinks until it is gone.
   Loaded after style.css so this sheet always wins.
   ============================================================ */

body {
    background: var(--bg);
    background-image: repeating-linear-gradient(0deg, rgba(255,255,255,0.022) 0 1px, transparent 1px 3px);
    color: var(--ink);
}

h1, h2, .section-head h2 {
    /* Sentence case, lighter weight — the owner's own adjustment
       (2026-09-03): headings read, they do not shout. Cards and mono
       labels keep their uppercase; it is theirs alone now. */
    font-family: var(--font-display);
    text-transform: none;
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 0.95;
}
.section-head h2 { font-size: 28px; }

/* --- Nav --- */
.nav { background: var(--bg); border-bottom: 2px solid var(--border-strong); box-shadow: none; }
.nav-inner { max-width: var(--max); }
.brand-mark {
    background: var(--ink); color: var(--bg); border-radius: 0;
    font-family: var(--font-display); font-weight: 900;
}
.brand-text {
    font-family: var(--font-display); font-weight: 800; text-transform: uppercase;
    letter-spacing: 0.06em; color: var(--ink);
}
.brand-text .accent, .brand-text .tld { color: var(--ink); }
.nav-link {
    font-family: var(--font-mono); font-size: 11.5px; font-weight: 700;
    letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted);
}
.nav-link:hover { color: var(--ink); }
.nav-cta {
    font-family: var(--font-display); font-size: 15px; font-weight: 700;
    letter-spacing: 0; text-transform: none;
    color: var(--bg); background: var(--ink); border-radius: 0; padding: 11px 18px;
}
.nav-cta:hover { background: var(--teal); color: var(--bg); }
/* THE MENU BUTTON WAS INVISIBLE ON THE LIGHT THEME. style.css gives it
   `color: #fff` from the era when the bar was always dark navy; this file
   then made the bar `var(--bg)`, which is #f2f2f2 on rawwhite — a white
   glyph on a white bar, so mobile had no way into the menu at all
   (owner, 2026-09-08). A colour that only works in one theme is a token
   that was never used. */
.nav-toggle { color: var(--ink); }

.nav-search { border: 1px solid var(--border); border-radius: var(--radius-lg); background: transparent; }
.nav-search-input {
    font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.14em;
    text-transform: uppercase; color: var(--ink); background: transparent;
}

/* --- Buttons --- */
.btn-primary, a.btn-primary {
    /* Sentence case, moderate weight — the owner's rule for ALL buttons
       (2026-09-03): consistent with the headings, no shouting. */
    font-family: var(--font-display); font-weight: 700; text-transform: none;
    letter-spacing: 0; font-size: 19px;
    color: var(--bg); background: var(--ink);
    border-radius: 0; box-shadow: none;
}
.btn-primary:hover, a.btn-primary:hover { background: var(--teal); color: var(--bg); filter: none; }
.btn-secondary, a.btn-secondary {
    border-radius: var(--radius-lg); border: 1px solid var(--border);
    background: transparent; color: var(--ink);
}

/* --- Hero --- */
.hero { border-bottom: 1px solid var(--border); background-image: none; }
.hero h1 { font-size: clamp(36px, 4.6vw, 68px); line-height: 1.0; }
.hero h1 .accent { color: var(--teal); }
.hero-note a { color: var(--teal-glow); }

/* --- Section heads: mono eyebrow + red tick --- */
.section-head { border-bottom: 1px solid var(--border); padding-bottom: 14px; }
.section-sub { color: var(--muted); }
.section-link {
    font-family: var(--font-mono); font-size: 11.5px; font-weight: 700;
    letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink);
    border-bottom: 2px solid var(--teal); padding-bottom: 2px;
}
.live-dot { background: var(--teal); border-radius: 0; box-shadow: none; }

/* --- Cards: flat, bordered, offset hover --- */
.video-card, .art-card, .ideas-card, .admin-card, .idea-card, .product-stat {
    border-radius: var(--radius-lg); border: 1px solid var(--border);
    background: var(--bg); box-shadow: none;
}
.video-card { transition: transform .14s, box-shadow .14s; }
.video-card:hover { transform: translate(-3px, -3px); box-shadow: 6px 6px 0 var(--teal); }

/* --- Footer --- */
.footer { background: var(--bg); border-top: 2px solid var(--border-strong); }
.footer-section h3 {
    font-family: var(--font-mono); font-size: 10.5px; font-weight: 700;
    letter-spacing: 0.22em; text-transform: uppercase; color: var(--teal);
}
.footer-brand { font-family: var(--font-display); font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; }

/* --- Product Row Wide, RAW POWER edition (self-sufficient; the legacy
   glow-card block is DELETED from style.css) --- */
.prw {
    position: relative; display: grid;
    grid-template-columns: 100px minmax(200px, 1fr) minmax(200px, 1.3fr) minmax(200px, 280px);
    align-items: stretch; border: 1px solid var(--border); border-radius: var(--radius-lg);
    background: var(--bg); color: var(--ink); text-decoration: none;
    font-family: 'Instrument Sans', system-ui, sans-serif;
    transition: transform .14s, box-shadow .14s;
}
.prw:hover { transform: translate(-3px, -3px); box-shadow: 6px 6px 0 var(--teal); color: var(--ink); text-decoration: none; }
.prw-glyph { position: relative; display: flex; border-right: 1px solid var(--border); }
.prw-glyph > span {
    flex: 1; min-height: 96px; display: flex; align-items: center; justify-content: center;
    background: var(--ink);
    background-image: repeating-linear-gradient(135deg, transparent 0 12px, rgba(10,10,10,0.07) 12px 13px);
    color: var(--bg); font-family: var(--font-display); font-size: 56px;
    font-weight: 900; letter-spacing: -0.06em;
}
.prw-identity {
    padding: 12px 18px; border-right: 1px solid var(--border);
    display: flex; flex-direction: column; justify-content: center; gap: 4px; min-width: 0;
}
.prw-badges { display: flex; align-items: center; gap: 8px; min-width: 0; }
.prw-brand {
    display: inline-flex; align-items: center; gap: 5px; flex: none;
    color: var(--ink); font-family: var(--font-display); font-weight: 800;
    font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase;
}
.prw-brand-mark {
    width: 14px; height: 14px; display: flex; align-items: center; justify-content: center;
    background: var(--ink); color: var(--bg); font-weight: 900; font-size: 8px;
}
.prw-category {
    font-family: var(--font-mono); font-size: 9px; font-weight: 700;
    letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.prw-name {
    margin: 0; font-family: var(--font-display); font-size: 26px; font-weight: 900;
    letter-spacing: -0.02em; line-height: 1.1; text-transform: uppercase;
    color: var(--ink);
    /* Two lines, clamped at a line — never "Software Archit…". */
    display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden;
}
.prw-tagline {
    font-family: var(--font-mono); font-size: 9.5px; font-weight: 700;
    letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.prw-desc {
    padding: 12px 18px; border-right: 1px solid var(--border);
    display: flex; flex-direction: column; justify-content: center; gap: 8px; min-width: 0;
}
.prw-desc p {
    margin: 0; font-size: 13px; line-height: 1.4; color: var(--slate); font-weight: 500;
    /* Clamp at a LINE, never mid-word. Replaces truncate(140, true) in the
       macro, which cut words in half and ignored the row's actual width. */
    display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3;
    overflow: hidden;
}
@media (max-width: 860px) { .prw-desc p { -webkit-line-clamp: 4; } }
.prw-langs { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.prw-lang {
    border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 2px 7px; white-space: nowrap;
    color: var(--ink); font-family: var(--font-mono); font-size: 9px;
    font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
}
.prw-lang-dot { display: none; }
.prw-metrics { display: grid; grid-template-columns: 1fr 1fr 1fr; }
.prw-metrics-two { grid-template-columns: 1fr 1fr; }
.prw-metric { padding: 0 12px; display: flex; flex-direction: column; justify-content: center; min-width: 0; }
.prw-metric + .prw-metric { border-left: 1px solid var(--border); }
.prw-metric-label {
    font-family: var(--font-mono); font-size: 9px; font-weight: 700;
    letter-spacing: 0.2em; text-transform: uppercase; color: var(--muted); margin-bottom: 5px;
    white-space: nowrap;
}
.prw-metric-value {
    font-family: var(--font-display); font-size: 26px; font-weight: 900;
    letter-spacing: -0.02em; line-height: 1; color: var(--ink); white-space: nowrap;
}
.prw-metric-kind { font-size: 18px; }
.prw-metric-today { background: var(--teal); }
.prw-metric-today .prw-metric-label, .prw-metric-today .prw-metric-value { color: #0a0a0a; }
.prw-serial {
    position: absolute; left: 7px; bottom: 5px; font-style: normal;
    font-family: var(--font-mono); font-size: 7.5px; font-weight: 700;
    letter-spacing: 0.2em; text-transform: uppercase; color: var(--bg);
}
.prw-stack { display: flex; flex-direction: column; gap: 14px; container-type: inline-size; }
@container (max-width: 900px) {
    .prw:not(.prw-card) { grid-template-columns: 72px 1fr; }
    .prw:not(.prw-card) .prw-desc, .prw:not(.prw-card) .prw-metrics { grid-column: 1 / -1; border-right: 0; border-top: 1px solid var(--border); }
    .prw-name { white-space: normal; }
}

/* Second hero CTA: the extractor, prominent beside the tools button. */
.hero-cta { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.hero-cta .btn-secondary {
    font-family: var(--font-display); font-weight: 700; text-transform: none;
    letter-spacing: 0; font-size: 19px; padding: 16px 18px;
    border: 1px solid var(--border); border-radius: var(--radius-lg); color: var(--ink);
}
.hero-cta .btn-secondary:hover { background: var(--teal); border-color: var(--teal); color: var(--bg); }

/* --- Product card (Tool Detail v2's related card, house palette): three
   bands in one link — kind + source, name + glyph, evidence strip. It
   reuses the wide row's .prw-* type and colour rules, so a fix to either
   reaches both. The grid container is .ai-cards on EVERY surface. --- */
/* THE GRID DECIDES THE WIDTH, NOT THE CONTENT. Column count follows the
   container (auto-fill) instead of three hard-coded breakpoints, and
   `min(100%, 280px)` is the track minimum so a 320px phone gets one column
   that FITS rather than one 280px card hanging over the edge.

   Every box down the chain carries `min-width: 0`. Without it a grid or
   flex item is sized by its longest unbreakable child — which is how a
   card whose top strip read "Open source · huggingface/speech-to-speech"
   walked out of its column and over the card beside it. */
.ai-cards {
    list-style: none; margin: 0; padding: 0; display: grid; gap: 20px;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
}
.ai-cards > li { display: flex; min-width: 0; }
.ai-cards > li > .prw { flex: 1; min-width: 0; }

.prw-card { display: flex; flex-direction: column; min-width: 0; overflow: hidden; }
.prw-card-top {
    display: flex; align-items: center; justify-content: space-between;
    gap: 10px; padding: 10px 16px; border-bottom: 1px solid var(--border);
    min-width: 0;
}
.prw-card-top .prw-category { flex: none; }
.prw-card-top .prw-tagline { text-align: right; min-width: 0; flex: 0 1 auto; }
.prw-card-body {
    flex: 1; display: grid; grid-template-columns: minmax(0, 1fr) 72px;
    gap: 14px; padding: 16px; min-width: 0;
}
.prw-card-body .prw-identity { padding: 0; border: 0; gap: 8px; justify-content: flex-start; }
.prw-card-body .prw-name { font-size: 22px; -webkit-line-clamp: 2; }
.prw-card-body .prw-desc { padding: 0; border: 0; }
.prw-card-body .prw-desc p { -webkit-line-clamp: 4; }
.prw-card-body .prw-glyph { border: 0; flex-direction: column; align-items: center; gap: 6px; }
.prw-card-body .prw-glyph > span {
    flex: none; width: 64px; height: 64px; min-height: 0; font-size: 34px;
}
/* The serial sits UNDER the glyph here, not inside it: on the wide row it is
   white-on-black and legible; on the card that put white text on the card. */
.prw-card-body .prw-serial {
    position: static; color: var(--muted); font-size: 8px; letter-spacing: 0.16em;
}
.prw-card-foot {
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-width: 0;
    padding: 10px 16px; border-top: 1px solid var(--border);
    background: var(--hover);
    font-family: var(--font-mono); font-size: 10px; font-weight: 700;
    letter-spacing: 0.08em; text-transform: uppercase;
}
.prw-card-foot .prw-foot-main { color: var(--teal); white-space: nowrap; }
.prw-card-foot .prw-foot-stars { color: var(--ink); white-space: nowrap; }
.prw-card-foot .prw-foot-kind { color: var(--muted); margin-left: auto; }

/* --- The tools map (spec 118): two views of one query. Families are the
   only grouping the data actually has, so they carry the colour. --- */
.tmap-head { text-align: left; }
/* The shared header centres its blurb; here it belongs under the title. */
.tmap .ideas-sub { margin: 0; max-width: 64ch; text-align: left; }
.tmap-legend {
    list-style: none; margin: 0 0 18px; padding: 0;
    display: flex; flex-wrap: wrap; gap: 14px;
}
.tmap-legend li {
    display: inline-flex; align-items: center; gap: 7px;
    font-family: var(--font-mono); font-size: 10px; font-weight: 500;
    letter-spacing: 0.1em; color: var(--muted); white-space: nowrap;
}
.tmap-dot { width: 10px; height: 10px; display: inline-block; }
.fam-ai_open    { --fam: var(--teal); }
.fam-ai_service { --fam: #f5a524; }
.fam-open_source{ --fam: #3b9ee6; }
.fam-tool       { --fam: var(--ink); }
.fam-resource   { --fam: #c04ee6; }
.tmap-dot.fam-ai_open, .tmap-dot.fam-ai_service, .tmap-dot.fam-open_source,
.tmap-dot.fam-tool, .tmap-dot.fam-resource { background: var(--fam); }

/* Share of voice: a dense grid where area is the number. */
.tmap-grid {
    display: grid; grid-template-columns: repeat(12, minmax(0, 1fr));
    grid-auto-rows: 74px; grid-auto-flow: dense; gap: 4px;
}
.tmap-tile, .tmap-cell {
    display: flex; flex-direction: column; justify-content: space-between;
    min-width: 0; overflow: hidden; text-decoration: none;
    background: var(--bg); color: var(--ink);
    border: 1px solid var(--fam, var(--border));
    transition: transform .12s, box-shadow .12s;
}
.tmap-tile:hover, .tmap-cell:hover {
    transform: translate(-2px, -2px); box-shadow: 4px 4px 0 var(--fam, var(--teal));
    color: var(--ink); text-decoration: none; z-index: 2;
}
.tmap-tile { padding: 9px 11px; }
.span-2 { grid-column: span 2; grid-row: span 2; }
.span-3 { grid-column: span 3; grid-row: span 3; }
.span-4 { grid-column: span 4; grid-row: span 4; }
.tmap-tile-top, .tmap-cell-top {
    display: flex; justify-content: space-between; gap: 6px;
    font-family: var(--font-mono); font-size: 9.5px; font-weight: 500;
    letter-spacing: 0.1em; color: var(--muted);
}
.tmap-tile-top i { font-style: normal; text-transform: uppercase; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tmap-tile-top b { color: var(--fam, var(--muted)); font-weight: 600; }
.tmap-tile-name {
    display: block; font-size: 15px; font-weight: 600; line-height: 1.1;
    overflow-wrap: anywhere; text-wrap: balance;
}
/* The name fills the block it earned: a span-4 tile is 300px of height and
   a 34px name left most of it empty. */
.span-2 .tmap-tile-name { font-size: 22px; }
.span-3 .tmap-tile-name { font-size: 34px; }
.span-4 .tmap-tile-name { font-size: 48px; line-height: 1; }
.span-3 .tmap-tile, .span-4 .tmap-tile { padding: 12px 14px; }
.span-3 .tmap-tile-meta, .span-4 .tmap-tile-meta { font-size: 11px; }
.tmap-tile-meta {
    display: block; margin-top: 5px; font-family: var(--font-mono);
    font-size: 9.5px; font-weight: 500; letter-spacing: 0.08em; color: var(--muted);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* Periodic table: one fixed cell each, columns grouped by family. */
.tmap-scroll { overflow-x: auto; }
.tmap-table {
    display: grid; grid-template-columns: repeat(18, minmax(0, 1fr));
    grid-auto-rows: 72px; gap: 4px; min-width: 1040px;
}
.tmap-cell { padding: 6px 7px; align-items: stretch; }
.tmap-cell-top i { font-style: normal; }
.tmap-cell-top b { color: var(--fam, var(--muted)); font-weight: 600; }
.tmap-symbol {
    text-align: center; font-size: 22px; font-weight: 600; line-height: 1;
}
.tmap-cell-name {
    text-align: center; font-family: var(--font-mono); font-size: 8.5px;
    font-weight: 500; letter-spacing: 0.04em; color: var(--muted);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.tmap-note { margin-top: 14px; }
@media (max-width: 900px) {
    .tmap-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
    .span-4 { grid-column: span 3; grid-row: span 3; }
}

/* --- STATE CONTRAST (owner: highlights made buttons disappear). Every
   interactive state pairs ink-on-ground or ground-on-ink explicitly —
   never two tokens that can resolve to the same side. --- */
.nav-cta { color: var(--bg); background: var(--ink); }
.nav-cta:hover, .nav-cta:focus-visible { background: var(--teal); color: #0a0a0a; }
.btn-primary:hover, a.btn-primary:hover,
.btn-primary:focus-visible, a.btn-primary:focus-visible {
    background: var(--teal); color: #0a0a0a;
}
.btn-secondary:hover, a.btn-secondary:hover,
.hero-cta .btn-secondary:hover { background: var(--teal); border-color: var(--teal); color: #0a0a0a; }
.btn-success, .btn-info { border-radius: 0; }
button:disabled, .btn-primary:disabled { opacity: 0.5; }
.section-link:hover { color: var(--teal-glow); }
a:hover { color: inherit; }

/* --- Homepage list rows (use cases, reports, ideas): the legacy link
   color painted them solid red — unreadable. Raw rows instead: ink
   titles, 2px separators, red only as the hover ground. --- */
.section .ideas-list.ideas-card {
    border: 1px solid var(--border); border-radius: var(--radius-lg);
    background: var(--bg); padding: 0; box-shadow: none;
    list-style: none; display: flex; flex-direction: column;
}
.section .ideas-list.ideas-card > li {
    border-bottom: 1px solid var(--border); margin: 0; padding: 0;
}
.section .ideas-list.ideas-card > li:last-child { border-bottom: 0; }
.section .ideas-list.ideas-card > li > strong { display: block; }
.section .ideas-list.ideas-card a {
    display: block; padding: 16px 20px; color: var(--ink);
    font-family: var(--font-display); font-weight: 800; font-size: 21px;
    letter-spacing: 0; text-transform: uppercase; line-height: 1.05;
    text-decoration: none; transition: background .12s, color .12s;
}
.section .ideas-list.ideas-card a:hover { background: var(--ink); color: var(--bg); }

.theme-toggle {
    border: 1px solid var(--border); background: var(--bg);
    color: var(--ink); width: 34px; height: 34px; cursor: pointer;
    font-size: 16px; line-height: 1; border-radius: var(--radius-lg); padding: 0;
    display: inline-flex; align-items: center; justify-content: center;
    box-shadow: none; transform: none;
}
.theme-toggle:hover { transform: none; }
.theme-toggle:hover { background: var(--ink); color: var(--bg); }

.hero-cta, .hero-note { background: none; box-shadow: none; }
.hero-cta::before, .hero-cta::after { display: none; }

/* Selection in the house style: red ground, dark ink — the gray default
   read as a rendering defect against the flat cards. */
::selection { background: var(--teal); color: #0a0a0a; }


/* ============================================================
   OWNER OVERRIDE (2026-09-03): kill the heavy/uppercase treatment
   EVERYWHERE. Default weights, default case, default sizes. The red
   accent and the 2px flat structure stay; the shouting goes.
   ============================================================ */
h1, h2, h3, h4,
.hero h1, .section-head h2,
.prw-name, .footer-brand, .brand-text,
.prw-metric-value, .prw-metric-kind,
.nav-cta, .btn-primary, a.btn-primary, .btn-secondary, .hero-cta .btn-secondary,
.section .ideas-list.ideas-card a,
.prw-glyph > span {
    font-family: 'Instrument Sans', system-ui, sans-serif !important;
    text-transform: none !important;
    font-weight: 600 !important;
    letter-spacing: normal !important;
}
.hero h1 { font-size: clamp(30px, 3.4vw, 46px) !important; line-height: 1.15 !important; font-weight: 700 !important; }
.section-head h2 { font-size: 24px !important; font-weight: 700 !important; }
.prw-name { font-size: 20px !important; font-weight: 500 !important; }
/* The row's small print — brand, category, tagline, metric labels, serial,
   language chips — obeys the same override: no heavy weight, no uppercase. */
.prw-brand, .prw-category, .prw-tagline, .prw-metric-label, .prw-serial, .prw-lang {
    font-weight: 500 !important; text-transform: none !important; letter-spacing: 0.04em !important;
}
.prw-brand { font-family: 'Instrument Sans', system-ui, sans-serif !important; font-size: 12px !important; }
.prw-brand-mark { font-weight: 600 !important; }
.prw-metric-value { font-size: 15px !important; font-weight: 600 !important; }
.prw-metric-kind { font-size: 14px !important; }
.prw-glyph > span { font-size: 40px !important; font-weight: 600 !important; }
.nav-cta, .btn-primary, a.btn-primary, .btn-secondary, .hero-cta .btn-secondary { font-size: 15px !important; }
.section .ideas-list.ideas-card a { font-size: 16px !important; }


/* ONE-TOKEN BORDER FIX (owner, 2026-09-03): --border-strong now resolves
   to the light divider colour, so EVERY 2px border-strong frame across the
   WHOLE site goes thin and grey in one place. Width is trimmed to 1px with a
   broad catch below. The NAV is restored to its 2px dark rule explicitly —
   the one border the owner wants kept heavy. */
:root { --border-strong: var(--border); }
:root[data-theme="rawwhite"] { --border-strong: var(--border); }

/* Trim the widths raw.css hardcoded to 2px/1.5px down to 1px, everywhere. */
.prw, .prw-glyph, .prw-identity, .prw-desc,
.section-head, .hero, .footer,
.section .ideas-list.ideas-card > li,
.product-stat, .art-card, .idea-card, .admin-card, .video-card,
.btn-secondary, .hero-cta .btn-secondary, .theme-toggle,
.prw-lang {
    border-width: 1px !important;
    border-radius: var(--radius-lg) !important;
}
.prw-glyph, .prw-identity, .prw-desc { border-right-width: 1px !important; }
.prw-metric + .prw-metric { border-left-width: 1px !important; }
@media (max-width: 860px) {
    .prw-desc, .prw-metrics { border-top-width: 1px !important; }
}

/* NAV keeps its heavy rule — hardcoded so the token flip cannot lighten it. */
.nav { border-bottom: 2px solid #f2f2f2 !important; }
:root[data-theme="rawwhite"] .nav { border-bottom: 2px solid #0a0a0a !important; }

/* Light theme footer contrast fix: dark text on light background */
:root[data-theme="rawwhite"] .footer-brand span:last-child { color: var(--ink) !important; }
:root[data-theme="rawwhite"] .footer-section p { color: var(--muted) !important; }
:root[data-theme="rawwhite"] .footer-links a { color: var(--muted) !important; }
:root[data-theme="rawwhite"] .footer-links a:hover { color: var(--ink) !important; }

.prw:hover, .video-card:hover, .ai-card:hover { box-shadow: 4px 4px 0 var(--teal) !important; }


/* --- The analyze box ---------------------------------------------------
   style.css paints this input `rgba(0, 0, 0, 0.28)` with white text, which
   was right when the hero was always dark. On rawwhite the hero ground is
   #f2f2f2, so 28% black over it is a mid-grey slab, the white text vanishes
   into it and the placeholder token (--dark-faint, #5a5a5a) reads grey on
   grey — the owner's screenshot. Tokens both ways, like every other
   surface here. */
.hero .tool #youtube-url,
.tool #youtube-url {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--ink);
}
.hero .tool #youtube-url::placeholder,
.tool #youtube-url::placeholder {
    /* --muted, not --faint: this placeholder is the instruction for the
       page's only control, so it has to be readable, not decorative. */
    color: var(--muted);
}
.hero .tool #youtube-url:focus,
.tool #youtube-url:focus {
    border-color: var(--teal);
    box-shadow: 0 0 0 2px var(--hover-accent);
    outline: none;
}

/* --- THE GATE: one component, two scales, one block ---------------------
   Every paywall lock on the site is `unlock_banner` or `compact_gate` from
   templates/_gate.html and lands here. A black card in BOTH themes (the
   owner's call) with the house red edge; the compact one is the same card
   at row scale, and it is itself a link to the page banner. --- */
/* The gate is the black card in BOTH themes, so it gets its own three
   tokens: --dark* means "the inverted surface" and flips to near-white in
   RawWhite, which rendered the lock light-on-light. */
:root, :root[data-theme="rawwhite"] {
    --gate-bg: #0a0a0a;
    --gate-ink: #f2f2f2;
    --gate-muted: #b4b4b4;
}
.unlock-banner, a.unlock-banner {
    display: flex; align-items: center; justify-content: space-between;
    gap: 28px; margin: 34px 0; padding: 26px 30px;
    background: var(--gate-bg); border: 2px solid var(--teal);
    border-radius: 0; box-shadow: none; text-decoration: none;
}
.unlock-banner-body { min-width: 0; }
.unlock-banner-pill {
    display: inline-flex; align-items: center; gap: 6px;
    font-family: var(--font-mono); font-size: 12px; font-weight: 700;
    letter-spacing: .08em; text-transform: uppercase;
    color: var(--teal); background: rgba(230, 59, 46, .14);
    border-radius: 0; padding: 6px 12px;
}
.unlock-banner-title {
    color: var(--gate-ink); font-size: 26px; line-height: 1.1; margin: 14px 0 8px;
}
.unlock-banner-sub {
    color: var(--gate-muted); font-size: 15px; line-height: 1.55;
    margin: 0; max-width: 60ch;
}
/* The CTA is the primary button on a dark ground: white, red on hover. */
.unlock-banner-cta {
    flex-shrink: 0; align-self: center; white-space: nowrap;
    font-family: var(--font-display); font-weight: 700; font-size: 17px;
    line-height: 1; letter-spacing: 0; text-decoration: none;
    background: var(--gate-ink); color: var(--gate-bg);
    border: 0; border-radius: 0; box-shadow: none; padding: 15px 26px;
    transition: background .14s, color .14s;
}
.unlock-banner-cta:hover,
a.unlock-banner:hover .unlock-banner-cta { background: var(--teal); color: var(--gate-ink); }

/* Row scale. Same card, same button, one line of copy. */
.unlock-banner.is-compact { padding: 12px 14px; gap: 16px; margin: 14px 0; }
.unlock-banner.is-compact .unlock-banner-body > span { display: block; }
.unlock-banner.is-compact .unlock-banner-title { font-size: 15px; font-weight: 600; margin: 0; }
.unlock-banner.is-compact .unlock-banner-sub { font-size: 13px; margin: 3px 0 0; }
.unlock-banner.is-compact .unlock-banner-cta { font-size: 14px; padding: 10px 20px; }

@media (max-width: 680px) {
    .unlock-banner { flex-direction: column; align-items: stretch; gap: 18px; padding: 22px; }
    .unlock-banner-title { font-size: 22px; }
    .unlock-banner-cta { text-align: center; }
    .unlock-banner.is-compact { gap: 12px; }
}

/* --- The account and plans pages (.credits-page) ------------------------
   A left-aligned column with real vertical rhythm. `.ideas-sub` centres
   itself for the /ideas header, which indented every paragraph here while
   the h1 beside it stayed flush left. --- */
.credits-page .ideas-sub { margin: 0 0 20px; max-width: 68ch; }
.credits-page h2 { margin: 36px 0 14px; }
.credits-page .ideas-list + form,
.credits-page .ideas-sub + form { margin-top: 28px; }
.credits-page form { margin-top: 24px; }
/* The sign-up button is the page's first action; the card below it is not
   an extension of it. */
.credits-page .credits-cta { margin: 0 0 26px; }
/* The filter chip's count. Quiet — the label is the choice, the number is
   why a reader would make it. */
.ai-filter .ai-tag-count { opacity: .65; font-variant-numeric: tabular-nums; }
.ai-filter .ai-tag-on .ai-tag-count { opacity: .8; }
/* --- THE TOOL PAGE (Tool Detail v2, house palette) ----------------------
   One block, house tokens, zero radius. Three parts: the band (what it is
   and its two addresses), the fact card (the repository, when there is
   one), and TOC + sections. The related list renders the SAME product_card
   the directory uses. --- */
.product-page { max-width: var(--max, 1440px); margin: 0 auto; padding: 0 24px 72px; }

.product-band {
    display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 380px);
    gap: 40px; align-items: start;
    padding: 8px 0 32px; border-bottom: 1px solid var(--border); margin-bottom: 32px;
}
.product-band-main { min-width: 0; }
.product-band h1 {
    margin: 10px 0 14px; font-family: var(--font-display); font-weight: 900;
    font-size: clamp(34px, 4vw, 52px); line-height: 1.02; letter-spacing: -0.02em;
}
.product-band-lead {
    margin: 0; font-size: 17px; line-height: 1.6; color: var(--slate); max-width: 68ch;
}
.product-pills { display: flex; gap: 8px; flex-wrap: wrap; margin: 0; }
.product-pill {
    font-family: var(--font-mono); font-size: 10px; font-weight: 700;
    letter-spacing: 0.14em; text-transform: uppercase;
    padding: 5px 10px; border: 1px solid var(--border); color: var(--muted);
}
.product-pill-ai { border-color: var(--teal); color: var(--teal); }
.product-pill-warn { border-color: var(--border-strong); color: var(--ink); }

.product-band-actions {
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 22px 0 0;
}
.product-repo-btn, .product-site-btn {
    display: inline-flex; align-items: center; gap: 8px;
    font-family: var(--font-display); font-weight: 700; font-size: 16px;
    padding: 12px 20px; text-decoration: none; border: 1px solid var(--ink);
    background: var(--ink); color: var(--bg);
}
.product-site-btn { background: transparent; color: var(--ink); }
.product-repo-btn:hover, .product-site-btn:hover {
    background: var(--teal); border-color: var(--teal); color: #0a0a0a;
}
.product-band-jump { font-size: 14px; font-weight: 600; color: var(--teal); padding: 12px 4px; }

/* The fact card: the repository, and the numbers a reader can check. */
.product-fact { border: 1px solid var(--border); background: var(--card); }
.product-fact-image { display: block; border-bottom: 1px solid var(--border); }
.product-fact-image img { display: block; width: 100%; height: auto; }
.product-fact-glyph {
    aspect-ratio: 2 / 1; display: flex; align-items: center; justify-content: center;
    background: var(--ink);
    background-image: repeating-linear-gradient(135deg, transparent 0 14px, rgba(10,10,10,0.07) 14px 15px);
    border-bottom: 1px solid var(--border);
}
.product-fact-glyph span {
    font-family: var(--font-display); font-size: 72px; font-weight: 900;
    letter-spacing: -0.05em; color: var(--bg);
}
.product-fact-stats {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(78px, 1fr));
    border-bottom: 1px solid var(--border);
}
.product-fact-stat {
    padding: 12px 8px; text-align: center; border-right: 1px solid var(--border);
    min-width: 0;
}
.product-fact-stat:last-child { border-right: 0; }
.product-fact-stat b {
    display: block; font-family: var(--font-display); font-size: 17px; font-weight: 800;
    color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.product-fact-stat span {
    display: block; margin-top: 2px; font-family: var(--font-mono); font-size: 9px;
    font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted);
}
.product-fact-rows { margin: 0; }
.product-fact-rows > div {
    display: flex; justify-content: space-between; gap: 12px;
    padding: 11px 16px; border-bottom: 1px solid var(--border);
}
.product-fact-rows > div:last-child { border-bottom: 0; }
.product-fact-rows dt {
    font-family: var(--font-mono); font-size: 9.5px; font-weight: 700;
    letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted);
    white-space: nowrap;
}
.product-fact-rows dd {
    margin: 0; font-size: 14px; font-weight: 600; text-align: right;
    min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* TOC + content. */
.product-body {
    display: grid; grid-template-columns: minmax(170px, 210px) minmax(0, 1fr);
    gap: clamp(24px, 4vw, 48px); align-items: start;
}
.product-toc { position: sticky; top: 24px; border-left: 2px solid var(--border); }
.product-toc-head {
    margin: 0 0 8px 14px; font-family: var(--font-mono); font-size: 9.5px;
    font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted);
}
.product-toc a {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    padding: 8px 14px; margin-left: -2px; border-left: 2px solid transparent;
    font-size: 14px; font-weight: 600; color: var(--slate); text-decoration: none;
}
.product-toc a:hover { color: var(--teal); border-left-color: var(--teal); }
.product-toc a span {
    font-family: var(--font-mono); font-size: 10px; font-weight: 700; color: var(--muted);
}
.product-content { min-width: 0; display: flex; flex-direction: column; gap: 48px; }
.product-content > * { min-width: 0; }
.product-h2 {
    margin: 0 0 6px; font-family: var(--font-display); font-size: 28px;
    font-weight: 900; letter-spacing: -0.02em;
}
.product-h2-sub { margin: 0 0 16px; font-size: 14px; color: var(--muted); }
.product-prose p { margin: 0 0 12px; font-size: 16px; line-height: 1.7; color: var(--slate); }
.product-prose p:last-child { margin-bottom: 0; }

.product-uses {
    list-style: none; margin: 0; padding: 0;
    display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px;
}
.product-use {
    display: flex; flex-direction: column; gap: 12px; justify-content: space-between;
    border: 1px solid var(--border); background: var(--card); padding: 16px 18px;
}
.product-use-text { margin: 0; font-size: 15px; line-height: 1.55; color: var(--ink); }
.product-use-meta {
    display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
    padding-top: 10px; border-top: 1px solid var(--border); min-width: 0;
}
/* A channel name can be "Chris Koerner on The Koerner Office Podcast". The
   NAME truncates; the timestamp never does — it is the part that says which
   moment the link opens. */
.product-chip {
    display: inline-flex; align-items: baseline; gap: 6px;
    max-width: 100%; min-width: 0;
    font-family: var(--font-mono); font-size: 10px; font-weight: 700;
    letter-spacing: 0.08em; text-transform: uppercase;
    padding: 4px 9px; border: 1px solid var(--border);
    color: var(--slate); text-decoration: none;
}
.product-chip-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.product-chip-at { flex: none; color: var(--muted); }
.product-chip:hover { border-color: var(--teal); color: var(--teal); }
.product-chip:hover .product-chip-at { color: var(--teal); }

.product-videos { list-style: none; margin: 0; padding: 0; border: 1px solid var(--border); }
.product-videos li { border-bottom: 1px solid var(--border); }
.product-videos li:last-child { border-bottom: 0; }
.product-videos a {
    display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 16px;
    padding: 13px 18px; text-decoration: none; color: inherit; align-items: center;
}
.product-videos a:hover { background: var(--hover); }
.product-video-title {
    font-size: 15px; font-weight: 600; color: var(--ink);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.product-video-channel {
    grid-row: 2; font-family: var(--font-mono); font-size: 10px; font-weight: 700;
    letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted);
}
.product-video-at {
    grid-row: 1 / span 2; grid-column: 2; font-family: var(--font-mono);
    font-size: 11px; font-weight: 700; color: var(--teal); white-space: nowrap;
}

@media (max-width: 900px) {
    .product-band { grid-template-columns: 1fr; gap: 24px; }
    .product-body { grid-template-columns: 1fr; }
    .product-toc { position: static; display: flex; flex-wrap: wrap; border-left: 0; border-bottom: 1px solid var(--border); padding-bottom: 8px; }
    .product-toc-head { width: 100%; margin-left: 0; }
    .product-toc a { border-left: 0; padding: 6px 12px 6px 0; }
}

/* --- THE INVITATION (spec 152): account · newsletter · follow ----------
   Three equal cards at the end of a page the reader liked. House tokens,
   zero radius, the primary button — it is not a fourth kind of banner. --- */
.invite {
    display: grid; gap: 16px; margin: 8px 0 0;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
}
.invite-card {
    display: flex; flex-direction: column; gap: 8px; min-width: 0;
    border: 1px solid var(--border); background: var(--card); padding: 20px;
}
.invite-kicker {
    margin: 0; font-family: var(--font-mono); font-size: 9.5px; font-weight: 700;
    letter-spacing: 0.16em; text-transform: uppercase; color: var(--teal);
}
.invite-title {
    margin: 0; font-family: var(--font-display); font-size: 21px;
    font-weight: 800; letter-spacing: -0.01em; line-height: 1.15; color: var(--ink);
}
.invite-body { margin: 0 0 4px; font-size: 14px; line-height: 1.55; color: var(--slate); }
.invite-note { margin: 8px 0 0; font-size: 12.5px; color: var(--teal); }
.invite-form { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; min-width: 0; }
.invite-form input[type="email"] {
    flex: 1 1 140px; min-width: 0; font: inherit; font-size: 14px;
    padding: 10px 12px; border: 1px solid var(--border);
    background: var(--bg); color: var(--ink); border-radius: 0;
}
.invite-form input[type="email"]:focus-visible { outline: none; border-color: var(--teal); }
.invite-btn {
    align-self: flex-start; margin-top: auto; flex: none;
    display: inline-flex; align-items: center; gap: 8px;
    font-family: var(--font-display); font-weight: 700; font-size: 15px;
    line-height: 1; padding: 12px 18px; border: 1px solid var(--ink);
    background: var(--ink); color: var(--bg); text-decoration: none; cursor: pointer;
}
.invite-btn:hover { background: var(--teal); border-color: var(--teal); color: #0a0a0a; }
.invite-form .invite-btn { margin-top: 0; }
.invite-btn-x { background: transparent; color: var(--ink); }
