/*
Theme Name: Conisec
Theme URI: https://conisec.com/
Author: Conisec
Description: The Conisec "Ledger" theme — slate + bone + deep violet. An institutional-record aesthetic for crypto security, incident and regulation reporting. Built lean: no page builder, no demo content, no vendor lock-in.
Version: 1.0.0
Requires at least: 6.5
Requires PHP: 8.2
License: GPL-2.0-or-later
Text Domain: conisec
*/

/* ============================================================
   1. DESIGN TOKENS  (Section 7)
   Components reference variables ONLY — never a hardcoded hex.
   ============================================================ */
:root {
    --bg:            #F7F5F2;   /* bone paper */
    --surface:       #EFEBE6;   /* band */
    --card:          #FFFFFF;
    --line:          #DED8D0;   /* warm hairline */
    --ink:           #111827;   /* slate */
    --muted:         #5D6472;

    --brand:         #5B21B6;   /* deep violet */
    --brand-deep:    #4C1D95;
    --brand-bright:  #7C3AED;
    --brand-soft:    #EDE9FE;
    /* --brand is used for TEXT (links, labels) and is lifted in dark mode for
       legibility. --brand-btn is the SOLID fill behind white text, so it must
       stay dark in both themes. Keep the two apart. */
    --brand-btn:     #5B21B6;

    --critical:      #B91C1C;   /* active */
    --critical-soft: #FEE2E2;
    --caution:       #B45309;   /* contained */
    --caution-soft:  #FEF3C7;
    --verified:      #15803D;   /* resolved */
    --verified-soft: #DCFCE7;
    --unknown:       #6B7280;   /* disputed */
    --unknown-soft:  #F3F4F6;

    --cat-security:   #B91C1C;
    --cat-regulation: #5B21B6;
    --cat-rules:      #4C1D95;
    --cat-crypto:     #0F766E;
    --cat-business:   #1D4ED8;
    --cat-market:     #4B5563;   /* lifted: #6B7280 was 3.9:1 on the chip tint */
    --cat-guides:     #92400E;   /* lifted: #B45309 was 4.2:1 on the chip tint */

    --font-serif: "Source Serif 4", "Spectral", Georgia, "Times New Roman", serif;
    --font-sans:  "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --font-mono:  "IBM Plex Mono", ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

    /* Masthead and footer are dark surfaces in BOTH themes, so their text
       colour must NOT be var(--bg) — that inverts to dark-on-dark in dark mode. */
    --on-dark:      #F7F5F2;
    --on-dark-mute: rgba(247,245,242,.62);
    --on-dark-line: rgba(247,245,242,.13);

    --wrap: 1200px;
    --col:  700px;
    --r:    4px;
    --ease: 200ms cubic-bezier(.2,.6,.2,1);
}

[data-theme="dark"] .cs-masthead { background: #08070B; }
[data-theme="dark"] .cs-footer { background: #08070B; }
[data-theme="dark"] .cs-ph { background: linear-gradient(155deg,#221E3A 0%,#12111A 62%,#0A0910 100%); }
[data-theme="dark"] .cs-chip-active   { background: #3a1517; }
[data-theme="dark"] .cs-chip-contained{ background: #3a2a10; }
[data-theme="dark"] .cs-chip-resolved { background: #12301d; }
[data-theme="dark"] .cs-chip-disputed { background: #23222b; }
[data-theme="dark"] .cs-card:hover { box-shadow: 0 24px 48px -32px rgba(124,58,237,.6); }

[data-theme="dark"] {
    /* The category and status hues are tuned for the bone paper field; on the
       dark surface they drop below 3:1. These are the same semantics, lifted
       into legibility — a red still means an unresolved risk. */
    --cat-security:   #F87171;
    --cat-regulation: #A78BFA;
    --cat-rules:      #C4B5FD;
    --cat-crypto:     #5EEAD4;
    --cat-business:   #93C5FD;
    --cat-market:     #9CA3AF;
    --cat-guides:     #FBBF24;

    --critical:  #F87171;
    --caution:   #FBBF24;
    --verified:  #4ADE80;
    --unknown:   #9CA3AF;
    --brand:     #A78BFA;
    --brand-deep:#C4B5FD;
    --brand-btn: #6D28D9;

    --bg:      #0E0D12;
    --surface: #1A1822;
    --card:    #1A1822;
    --line:    #2E2A3A;
    --ink:     #F7F5F2;
    --muted:   #A29CB0;
    --brand-soft: #241a3d;
    --critical-soft: #3a1517;
    --caution-soft:  #3a2a10;
    --verified-soft: #12301d;
    --unknown-soft:  #23222b;
}

/* ============================================================
   2. RESET + BASE
   ============================================================ */
*,*::before,*::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *,*::before,*::after { animation-duration:.01ms !important; transition-duration:.01ms !important; }
}
body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--font-sans);
    font-size: 17px;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    overflow-wrap: break-word;
}
img, svg, video { max-width: 100%; height: auto; display: block; }
a { color: var(--brand); text-underline-offset: .18em; }
a:hover { color: var(--brand-deep); }
h1,h2,h3,h4 { font-family: var(--font-serif); font-weight: 600; line-height: 1.22; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.125rem; }
p  { margin: 0 0 1.15em; }
hr { border: 0; border-top: 1px solid var(--line); margin: 2.5rem 0; }
code, kbd, pre { font-family: var(--font-mono); font-size: .92em; }
:focus-visible { outline: 2px solid var(--brand-bright); outline-offset: 2px; border-radius: 2px; }
::selection { background: var(--brand-soft); color: var(--ink); }

.cs-wrap { max-width: var(--wrap); margin-inline: auto; padding-inline: 20px; }
.cs-skip {
    position: absolute; left: -9999px; top: 0; z-index: 999;
    background: var(--brand-btn); color: #fff; padding: 10px 16px;
}
.cs-skip:focus { left: 8px; top: 8px; }
.screen-reader-text {
    position: absolute !important; width: 1px; height: 1px;
    overflow: hidden; clip-path: inset(50%); white-space: nowrap;
}

/* every figure, date, address, hash — tabular (Section 7.IMPL C7) */
.cs-num, time, .cs-addr, .cs-hash {
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
}

/* ============================================================
   3. MASTHEAD  (Section 7.IMPL C1 — pseudo-element depth, no rasters)
   ============================================================ */
.cs-masthead {
    position: relative;
    background: var(--ink);
    color: var(--on-dark);
    isolation: isolate;
    overflow: hidden;
}
.cs-masthead::before,
.cs-masthead::after { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.cs-masthead::before {
    background: radial-gradient(60% 140% at 18% 0%, rgba(124,58,237,.42), transparent 68%);
}
.cs-masthead::after {
    background-image:
        repeating-linear-gradient(0deg,  rgba(247,245,242,.07) 0 1px, transparent 1px 34px),
        repeating-linear-gradient(90deg, rgba(247,245,242,.07) 0 1px, transparent 1px 34px);
    -webkit-mask-image: radial-gradient(75% 120% at 30% 0%, #000 25%, transparent 78%);
            mask-image: radial-gradient(75% 120% at 30% 0%, #000 25%, transparent 78%);
}

.cs-statusbar {
    border-bottom: 1px solid var(--on-dark-line);
    font-family: var(--font-mono);
    font-size: 12px;
    letter-spacing: .04em;
}
.cs-statusbar .cs-wrap {
    display: flex; align-items: center; gap: 18px;
    min-height: 38px; flex-wrap: wrap;
}
.cs-statusbar a { color: var(--on-dark); text-decoration: none; }
.cs-statusbar a:hover { color: #fff; text-decoration: underline; }
.cs-statusbar .cs-sb-date { color: var(--on-dark-mute); }
.cs-statusbar .cs-sb-last { display: inline-flex; align-items: center; gap: 8px; }
.cs-statusbar .cs-sb-spacer { margin-left: auto; }
.cs-theme {
    background: none; border: 0; color: rgba(247,245,242,.62);
    cursor: pointer; padding: 4px; display: inline-flex; align-items: center;
    transition: color var(--ease);
}
.cs-theme:hover { color: #fff; }

.cs-header .cs-wrap {
    display: flex; align-items: center; gap: 28px;
    padding-block: 22px;
}
.cs-logo {
    display: inline-flex; align-items: center; gap: 11px;
    text-decoration: none; color: var(--on-dark); flex: 0 0 auto;
}
.cs-logo-mark { width: 34px; height: 34px; flex: 0 0 auto; }
.cs-logo-text {
    font-family: var(--font-serif);
    font-size: 27px; line-height: 1; letter-spacing: -.02em;
}
.cs-logo-text b { font-weight: 700; color: var(--brand-bright); }
.cs-tagline {
    font-family: var(--font-mono); font-size: 11px;
    letter-spacing: .1em; text-transform: uppercase;
    color: rgba(247,245,242,.55);
    margin-top: 4px; display: block;
}

.cs-nav { margin-left: auto; }
.cs-nav ul { list-style: none; display: flex; gap: 22px; margin: 0; padding: 0; align-items: center; }
.cs-nav a {
    color: var(--on-dark); text-decoration: none;
    font-size: 14px; font-weight: 500; letter-spacing: .01em;
    padding-block: 6px; display: inline-block;
    border-bottom: 2px solid transparent;
    transition: border-color var(--ease), color var(--ease);
}
.cs-nav a:hover, .cs-nav .current-menu-item > a { border-bottom-color: var(--brand-bright); color: #fff; }
.cs-nav-cta {
    background: var(--brand-btn); color: #fff !important;
    padding: 9px 16px !important; border-radius: var(--r);
    border-bottom: 0 !important; font-weight: 600;
}
.cs-nav-cta:hover { background: var(--brand-bright); }

.cs-burger {
    display: none; margin-left: auto; background: none; border: 0;
    color: var(--on-dark); cursor: pointer; padding: 8px;
}

/* ============================================================
   4. SECTION HEADS + CARDS
   ============================================================ */
.cs-section { padding-block: 46px; }
.cs-section + .cs-section { padding-top: 0; }
.cs-band { background: var(--surface); border-block: 1px solid var(--line); }

.cs-shead {
    display: flex; align-items: baseline; gap: 14px;
    border-bottom: 2px solid var(--ink);
    padding-bottom: 9px; margin-bottom: 26px;
}
.cs-shead h2 { margin: 0; font-size: 1.32rem; }
.cs-shead .cs-shead-more {
    margin-left: auto; font-family: var(--font-mono);
    font-size: 12px; letter-spacing: .06em; text-transform: uppercase;
    text-decoration: none;
}
.cs-shead .cs-shead-more:hover { text-decoration: underline; }

.cs-grid { display: grid; gap: 26px; }
.cs-grid-3 { grid-template-columns: repeat(3, 1fr); }
.cs-grid-4 { grid-template-columns: repeat(4, 1fr); }
.cs-grid-2 { grid-template-columns: repeat(2, 1fr); }

.cs-card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--r);
    overflow: hidden;
    display: flex; flex-direction: column;
    transition: border-color var(--ease), box-shadow var(--ease), transform var(--ease);
}
.cs-card:hover {
    transform: translateY(-3px);
    border-color: var(--brand);
    box-shadow: 0 24px 48px -32px rgba(91,33,182,.45);
}
/* aspect-ratio is ignored on an inline <a> — the wrapper must be block */
.cs-card-media { display: block; aspect-ratio: 3 / 2; background: var(--surface); overflow: hidden; }
.cs-card-media img { width: 100%; height: 100%; object-fit: cover; }
.cs-card-body { padding: 16px 18px 20px; display: flex; flex-direction: column; gap: 9px; flex: 1; }
.cs-card-body h3 { margin: 0; font-size: 1.06rem; line-height: 1.32; }
/* scope hover-underline so it cannot bleed onto the whole-card link */
.cs-card-body h3 a { color: var(--ink); text-decoration: none; }
.cs-card:hover .cs-card-body h3 a { text-decoration: underline; text-decoration-color: var(--brand); }
.cs-card-excerpt { font-size: .93rem; color: var(--muted); margin: 0; }
.cs-card-meta {
    margin-top: auto; font-family: var(--font-mono);
    font-size: 11.5px; letter-spacing: .04em; color: var(--muted);
    display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
}

/* missing-media placeholder — never a stock photo, never a blank grey box */
.cs-ph {
    position: relative; display: grid; place-items: center;
    width: 100%; height: 100%;
    background: linear-gradient(155deg, #1B1830 0%, #111827 62%, #0E0D12 100%);
    overflow: hidden;
}
.cs-ph::after {
    content: ""; position: absolute; inset: 0;
    background-image:
        repeating-linear-gradient(0deg,  rgba(247,245,242,.08) 0 1px, transparent 1px 26px),
        repeating-linear-gradient(90deg, rgba(247,245,242,.08) 0 1px, transparent 1px 26px);
    -webkit-mask-image: radial-gradient(70% 100% at 50% 0%, #000 20%, transparent 76%);
            mask-image: radial-gradient(70% 100% at 50% 0%, #000 20%, transparent 76%);
}
.cs-ph-mark {
    position: relative; z-index: 1; text-align: center;
    font-family: var(--font-serif); color: #F7F5F2;
    font-size: clamp(17px, 3.4vw, 25px); letter-spacing: -.02em;
}
.cs-ph-mark b { color: var(--brand-bright); font-weight: 700; }
.cs-ph-mark::after {
    content: ""; display: block; width: 46px; height: 2px;
    background: var(--brand-bright); margin: 9px auto 0;
}

/* Wide content (tables, diagrams) scrolls inside its own container so the
   page body never scrolls horizontally. This rule is layout-critical, so it
   lives here rather than in a component helper a template might not call. */
.cs-trackwrap { overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; }

/* ============================================================
   5. CHIPS  (status semantics — NEVER decorative)
   ============================================================ */
.cs-chip {
    display: inline-flex; align-items: center; gap: 6px;
    font-family: var(--font-mono); font-size: 11px;
    letter-spacing: .09em; text-transform: uppercase; font-weight: 500;
    padding: 3px 9px; border-radius: 2px;
    border: 1px solid currentColor; text-decoration: none;
    white-space: nowrap;
}
.cs-chip::before {
    content: ""; width: 6px; height: 6px; border-radius: 50%;
    background: currentColor; flex: 0 0 auto;
}
.cs-chip-plain::before { display: none; }
.cs-chip-active    { color: var(--critical); background: var(--critical-soft); }
.cs-chip-contained { color: var(--caution);  background: var(--caution-soft); }
.cs-chip-resolved  { color: var(--verified); background: var(--verified-soft); }
.cs-chip-disputed  { color: var(--unknown);  background: var(--unknown-soft); }
.cs-chip-cat       { color: var(--brand); background: var(--brand-soft); }

.cs-record .cs-wrap { max-width: 900px; }

/* ------------------------------------------------------------
   RECORD PAGES (incident + jurisdiction share this markup, so the
   styles must be global — not inline in one of the two templates)
   ------------------------------------------------------------ */
.cs-inc-hdmeta {
    display: flex; gap: 16px; flex-wrap: wrap; align-items: center;
    font-family: var(--font-mono); font-size: 12px;
    color: var(--muted); letter-spacing: .03em;
}
.cs-glance {
    border: 1px solid var(--line); border-radius: var(--r);
    background: var(--card); padding: 22px; margin: 0 0 30px;
}
.cs-glance h2 {
    font-family: var(--font-mono); font-size: 12px; font-weight: 600;
    letter-spacing: .14em; text-transform: uppercase;
    color: var(--brand-deep); margin: 0 0 16px;
}
.cs-glance dl { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px 26px; margin: 0; }
.cs-glance dt {
    font-family: var(--font-mono); font-size: 10.5px; font-weight: 600;
    letter-spacing: .11em; color: var(--muted); margin-bottom: 4px;
}
.cs-glance dd { margin: 0; font-family: var(--font-serif); font-size: 16px; line-height: 1.5; color: var(--ink); }
.cs-glance .cs-addr { font-size: 13px; word-break: break-all; }
.cs-check {
    border: 1px solid var(--line); border-left: 3px solid var(--verified);
    border-radius: var(--r); background: var(--card); padding: 20px 22px; margin: 34px 0;
}
.cs-check h2 {
    font-family: var(--font-mono); font-size: 12px; font-weight: 600;
    letter-spacing: .14em; text-transform: uppercase; color: var(--verified); margin: 0 0 12px;
}
.cs-check div p { margin: 0 0 .8em; font-size: 16px; }
.cs-check-warn {
    font-family: var(--font-mono); font-size: 11.5px; line-height: 1.65; color: var(--muted);
    border-top: 1px solid var(--line); padding-top: 12px; margin: 14px 0 0;
}
.cs-verified {
    font-family: var(--font-mono); font-size: 11.5px; color: var(--muted);
    border-top: 1px solid var(--line); padding-top: 14px; margin-top: 30px; letter-spacing: .03em;
}
.cs-asof { font-weight: 600; color: var(--brand); }
@media (max-width: 640px) { .cs-glance dl { grid-template-columns: 1fr; } }

/* ============================================================
   6. BUTTONS + FORMS
   ============================================================ */
.cs-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    font-family: var(--font-sans); font-size: 14px; font-weight: 600;
    padding: 11px 20px; border-radius: var(--r);
    border: 1px solid var(--brand-btn); background: var(--brand-btn); color: #fff;
    text-decoration: none; cursor: pointer;
    transition: background var(--ease), border-color var(--ease), transform var(--ease);
}
.cs-btn:hover { background: var(--brand-bright); border-color: var(--brand-bright); color: #fff; transform: translateY(-1px); }
.cs-btn-ghost { background: transparent; color: var(--brand); border-color: var(--brand); }
.cs-btn-ghost:hover { background: var(--brand-soft); color: var(--brand-deep); }

.cs-input {
    font-family: var(--font-sans); font-size: 15px;
    padding: 11px 14px; border-radius: var(--r);
    border: 1px solid var(--line); background: var(--card); color: var(--ink);
    width: 100%;
}
.cs-input:focus { border-color: var(--brand); outline: none; box-shadow: 0 0 0 3px var(--brand-soft); }

/* ============================================================
   7. FOOTER
   ============================================================ */
.cs-footer {
    background: var(--ink); color: rgba(247,245,242,.78);
    /* fixed light-on-dark: --ink stays dark in both themes */
    margin-top: 60px; font-size: 14px;
}
.cs-footer a { color: rgba(247,245,242,.78); text-decoration: none; }
.cs-footer a:hover { color: #fff; text-decoration: underline; }

/* brand + four link columns on ONE row. Legal is a separate full-width row —
   as a fifth grid child it wrapped and left three empty columns beside it. */
.cs-footer-top {
    padding-block: 46px 34px;
    display: grid;
    grid-template-columns: 2.1fr repeat(4, 1fr);
    gap: 34px;
    align-items: start;
}
.cs-footer h2 {
    font-family: var(--font-mono); font-size: 11px; font-weight: 600;
    letter-spacing: .12em; text-transform: uppercase;
    color: rgba(247,245,242,.5); margin: 0 0 14px;
}
.cs-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.cs-footer-brand .cs-logo { margin-bottom: 14px; }
.cs-footer-blurb { max-width: 46ch; color: rgba(247,245,242,.62); font-size: 14px; line-height: 1.65; }
.cs-footer-never {
    font-family: var(--font-mono); font-size: 11.5px; line-height: 1.6;
    color: rgba(247,245,242,.5);
    border-left: 2px solid var(--verified); padding-left: 12px;
}

/* legal: one full-width inline row rather than a tall 12-item column */
.cs-footer-legal {
    border-top: 1px solid var(--on-dark-line);
    padding-block: 22px;
}
.cs-footer-legal ul {
    display: flex; flex-wrap: wrap; gap: 8px 0;
    font-size: 13px;
}
.cs-footer-legal li { display: inline-flex; align-items: center; }
.cs-footer-legal li:not(:last-child)::after {
    content: "·"; margin-inline: 10px; color: rgba(247,245,242,.28);
}

.cs-footer-bottom {
    border-top: 1px solid var(--on-dark-line);
    padding-block: 22px 30px; font-size: 12.5px; color: rgba(247,245,242,.5);
    display: grid; gap: 14px;
}
.cs-copy { margin: 0; }
.cs-noadvice {
    font-family: var(--font-mono); font-size: 11.5px; line-height: 1.65;
    letter-spacing: .01em; color: rgba(247,245,242,.55);
    border-left: 2px solid var(--brand-bright); padding-left: 13px;
    max-width: 90ch; margin: 0;
}

/* page.php and the tool templates never load single.php's inline body CSS,
   so the reading measure has to live here or their copy runs full-width. */
.cs-article-body {
    max-width: 74ch;
    font-family: var(--font-serif); font-size: 17px; line-height: 1.78;
}
.cs-article-body h2 { font-size: 1.45rem; margin-top: 1.9em; }
.cs-article-body h3 { font-size: 1.2rem; margin-top: 1.6em; }
.cs-article-body ul, .cs-article-body ol { padding-left: 1.3em; margin-bottom: 1.2em; }
.cs-article-body li { margin-bottom: .45em; }
.cs-article-body a { color: var(--brand); }

/* ------------------------------------------------------------
   SHELL + RIGHT RAIL
   Narrow templates used 820-900px of a 1440px viewport. The shell
   widens the wrap and puts navigation in the space instead.
   ------------------------------------------------------------ */
.cs-shell { display: block; }
.cs-rail { display: none; }

@media (min-width: 1120px) {
    /* .cs-has-rail sits ON the <article>/<section>, not around it — a descendant
       selector never matches. Use the element itself. */
    .cs-has-rail > .cs-wrap { max-width: 1200px !important; }
    .cs-shell {
        display: grid;
        grid-template-columns: minmax(0, 1fr) 290px;
        gap: 46px;
        align-items: start;
    }
    .cs-shell-main { min-width: 0; }
    .cs-rail { display: block; position: sticky; top: 18px; }
    /* the inline A-Z duplicates the rail's sticky one once the rail is visible */
    .cs-has-rail .cs-az { display: none; }
}
.cs-rail section {
    border: 1px solid var(--line); border-radius: var(--r);
    background: var(--card); padding: 16px 18px; margin-bottom: 14px;
}
.cs-rail h2 {
    font-family: var(--font-mono); font-size: 10.5px; font-weight: 600;
    letter-spacing: .13em; text-transform: uppercase;
    color: var(--muted); margin: 0 0 10px;
}
.cs-rail ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; }
.cs-rail li { font-size: 14px; line-height: 1.45; display: flex; justify-content: space-between; gap: 10px; }
.cs-rail a { color: var(--ink); text-decoration: none; }
.cs-rail a:hover { color: var(--brand); text-decoration: underline; }
.cs-rail li > span { font-family: var(--font-mono); font-size: 11px; color: var(--muted); flex: 0 0 auto; }
.cs-rail-dl { margin: 0; display: grid; gap: 9px; }
.cs-rail-dl dt {
    font-family: var(--font-mono); font-size: 10px; font-weight: 600;
    letter-spacing: .1em; text-transform: uppercase; color: var(--muted);
}
.cs-rail-dl dd { margin: 0 0 2px; font-size: 14px; line-height: 1.45; color: var(--ink); }
.cs-rail-note { margin: 0; font-size: 13px; line-height: 1.6; color: var(--muted); }
.cs-rail-note a { color: var(--brand); text-decoration: underline; }
.cs-rail-az { display: flex; flex-wrap: wrap; gap: 5px; }
.cs-rail-az a {
    display: inline-flex; align-items: center; justify-content: center;
    width: 30px; height: 30px; border: 1px solid var(--line); border-radius: 3px;
    background: var(--bg); font-family: var(--font-mono); font-size: 12px;
    color: var(--ink); text-decoration: none;
}
.cs-rail-az a:hover { border-color: var(--brand); color: var(--brand); }

/* ------------------------------------------------------------
   GUIDES (Section 5.6) — restored. NOTE: this block previously sat
   between the FOOTER and RESPONSIVE markers and was destroyed by an
   index-sliced rewrite of the footer section. Keep it here.
   ------------------------------------------------------------ */
.cs-level {
    font-family: var(--font-mono); font-size: 10.5px; font-weight: 600;
    letter-spacing: .14em; text-transform: uppercase; color: var(--cat-guides);
    border: 1px solid currentColor; border-radius: 2px; padding: 3px 9px;
}
.cs-seq { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 46px; }
.cs-seq a {
    display: flex; flex-direction: column; gap: 4px;
    border: 1px solid var(--line); border-radius: var(--r); background: var(--card);
    padding: 14px 18px; text-decoration: none;
    transition: border-color var(--ease), transform var(--ease);
}
.cs-seq a:hover { border-color: var(--brand); transform: translateY(-2px); }
.cs-seq span { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .13em;
    text-transform: uppercase; color: var(--muted); }
.cs-seq strong { font-family: var(--font-serif); font-size: 15.5px; font-weight: 600;
    line-height: 1.35; color: var(--ink); }
.cs-seq-next { text-align: right; grid-column: 2; }
.cs-seq a:only-child { grid-column: 1 / -1; }
@media (max-width: 620px) {
    .cs-seq { grid-template-columns: 1fr; }
    .cs-seq-next { grid-column: 1; text-align: left; }
}

/* Guides use the same shell, but the contents rail sits on the LEFT so the
   reading column keeps its position on the page. */
@media (min-width: 1120px) {
    .cs-guide .cs-shell { grid-template-columns: 290px minmax(0, 1fr); }
    .cs-guide .cs-shell-main { order: 2; }
    .cs-guide .cs-rail { order: 1; }
}

/* ============================================================
   8. RESPONSIVE
   ============================================================ */
@media (max-width: 1180px) {
    /* Below the 5-across row the brand spans, so a menu column never lands in
       the wide brand slot and leaves the row ragged. */
    .cs-footer-top { grid-template-columns: repeat(4, 1fr); gap: 28px; }
    .cs-footer-brand { grid-column: 1 / -1; margin-bottom: 6px; }
    .cs-footer-blurb { max-width: 68ch; }
}
@media (max-width: 900px) {
    .cs-footer-top { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 1024px) {
    .cs-grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 860px) {
    .cs-nav { display: none; }
    .cs-nav.is-open {
        display: block; position: absolute; left: 0; right: 0; top: 100%;
        background: var(--ink); border-top: 1px solid rgba(247,245,242,.13);
        padding: 16px 20px; z-index: 40;
    }
    .cs-nav.is-open ul { flex-direction: column; align-items: stretch; gap: 4px; }
    .cs-burger { display: inline-flex; }
    .cs-header .cs-wrap { position: relative; }
    .cs-grid-3 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 700px) {
    /* the tagline is too wide here and pushes the burger past the viewport,
       where the masthead's overflow:hidden clips it away entirely */
    .cs-tagline { display: none; }
    .cs-logo-text { font-size: 22px; }
    .cs-logo-mark { width: 28px; height: 28px; }
    .cs-header .cs-wrap { gap: 12px; padding-block: 16px; }
    .cs-statusbar .cs-sb-last { display: none; }
}
@media (max-width: 600px) {
    body { font-size: 16px; }
    h1 { font-size: 1.6rem; }
    .cs-grid-3, .cs-grid-4, .cs-grid-2 { grid-template-columns: 1fr; }
    .cs-footer-top { grid-template-columns: 1fr; gap: 26px; }
    .cs-footer-legal ul { gap: 6px 0; }
    .cs-section { padding-block: 32px; }
}
