/* ==========================================================================
   Signal Kernel Framework // Brief pages
   Shared by the brief pages and the throughput snapshot.
   Palette and type scale track index.html.
   ========================================================================== */

:root {
    --bg-color: #050507;
    --panel: #0a0a0e;
    --panel-2: #0e0e14;
    --grid-color: rgba(255, 255, 255, 0.02);
    --accent-glow: rgba(0, 240, 255, 0.15);
    --neon-blue: #00f0ff;
    --neon-deep: #0b6f7a;
    --text-primary: #f3f4f6;
    --text-dim: #9ca3af;
    --text-muted: #6b7280;
    --text-faint: #4b5563;
    --border-color: rgba(255, 255, 255, 0.07);
    --border-strong: rgba(255, 255, 255, 0.14);
    --warn: #e9b24c;
    --ok: #6fd08c;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

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

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    * { animation: none !important; transition: none !important; }
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    font-size: 16px;
    line-height: 1.6;
    font-weight: 300;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    -webkit-font-smoothing: antialiased;
}

/* Tactical background grid: identical rhythm to the landing page */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(to right, var(--grid-color) 1px, transparent 1px),
        linear-gradient(to bottom, var(--grid-color) 1px, transparent 1px);
    background-size: 40px 40px;
    z-index: 0;
    pointer-events: none;
}

.ambient-glow {
    position: absolute;
    /* A percentage here resolves against the body height, so on a long brief the
       glow was parked thousands of pixels above the fold. Fixed offset instead. */
    top: -80px;
    left: 50%;
    transform: translateX(-50%);
    width: 900px;
    max-width: 100%;
    height: 600px;
    background: radial-gradient(ellipse farthest-side at center, var(--accent-glow) 0%, transparent 70%);
    filter: blur(20px);
    z-index: 0;
    pointer-events: none;
}

/* --------------------------------------------------------------- nav bar */

.topbar {
    position: sticky;
    top: 0;
    z-index: 40;
    background: rgba(5, 5, 7, 0.92);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
}

.topbar-in {
    max-width: 1120px;
    margin: 0 auto;
    padding: 12px 24px;
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
}

.brandmark {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    white-space: nowrap;
}

.brandmark .logo-icon {
    font-family: 'Fira Code', monospace;
    color: var(--neon-blue);
    font-weight: 600;
    border: 1px solid var(--neon-blue);
    padding: 3px 7px;
    border-radius: 4px;
    box-shadow: 0 0 10px rgba(0, 240, 255, 0.2);
    font-size: 0.75rem;
    letter-spacing: 1px;
}

.brandmark .logo-text {
    font-family: 'Fira Code', monospace;
    font-size: 0.7rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--text-dim);
}

.tocnav {
    display: flex;
    gap: 2px;
    flex-wrap: wrap;
    margin-left: auto;
}

.tocnav a {
    font-family: 'Fira Code', monospace;
    font-size: 0.68rem;
    letter-spacing: 0.04em;
    color: var(--text-faint);
    text-decoration: none;
    padding: 4px 8px;
    border-radius: 3px;
    transition: color 0.15s ease, background 0.15s ease;
}

.tocnav a:hover {
    color: var(--neon-blue);
    background: rgba(0, 240, 255, 0.07);
}

a:focus-visible,
summary:focus-visible {
    outline: 2px solid var(--neon-blue);
    outline-offset: 3px;
}

/* ------------------------------------------------------------ page shell */

main {
    position: relative;
    z-index: 10;
}

.section {
    max-width: 1120px;
    margin: 0 auto;
    padding: 72px 24px 80px;
    border-bottom: 1px solid var(--border-color);
    scroll-margin-top: 60px;
}

.section:last-of-type {
    border-bottom: none;
}

.kicker {
    display: flex;
    align-items: baseline;
    gap: 12px;
    font-family: 'Fira Code', monospace;
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--neon-blue);
    margin-bottom: 20px;
}

.kicker .num {
    color: var(--text-faint);
}

.kicker::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--border-color);
}

h1 {
    font-size: clamp(2.2rem, 5.4vw, 3.6rem);
    font-weight: 800;
    line-height: 1.05;
    letter-spacing: -0.03em;
    /* background-clip:text paints over the box, so a tight line-height clips
       descenders. Pad the box and pull the margin back by the same amount. */
    padding-bottom: 0.14em;
    margin-bottom: calc(20px - 0.14em);
    background: linear-gradient(180deg, #FFFFFF 0%, #a3a3a3 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-wrap: balance;
}

h1 span,
h2 span.hl {
    color: var(--neon-blue);
    -webkit-text-fill-color: initial;
}

h2 {
    font-size: clamp(1.6rem, 3.4vw, 2.4rem);
    font-weight: 600;
    line-height: 1.12;
    letter-spacing: -0.022em;
    margin-bottom: 16px;
    color: var(--text-primary);
    text-wrap: balance;
}

h3 {
    font-family: 'Fira Code', monospace;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--neon-blue);
    margin-bottom: 12px;
}

.lede {
    font-size: clamp(1rem, 1.5vw, 1.15rem);
    line-height: 1.6;
    color: var(--text-dim);
    max-width: 68ch;
    margin-bottom: 36px;
}

.lede strong,
p strong {
    color: var(--text-primary);
    font-weight: 500;
}

p {
    max-width: 72ch;
    color: var(--text-dim);
}

/* ----------------------------------------------------------- hero header */

.hero {
    padding-top: 96px;
    padding-bottom: 88px;
}

.eyebrow {
    font-family: 'Fira Code', monospace;
    font-size: 0.78rem;
    letter-spacing: 0.24em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 28px;
    /* the generic p rule caps at 72ch, which is narrower than this tracked line */
    max-width: none;
}

.hero-rule {
    height: 1px;
    background: linear-gradient(to right, var(--neon-blue), transparent);
    margin: 34px 0;
    max-width: 520px;
}

/* Hero spec tiles: same card treatment as the node cards on the landing page */
.meta-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-top: 40px;
}

.meta-grid > div {
    background-color: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 24px;
    text-align: left;
    flex: 1 1 100%;
    max-width: 100%;
}

.meta-grid dt {
    font-family: 'Fira Code', monospace;
    font-size: 0.85rem;
    text-transform: uppercase;
    color: var(--neon-blue);
    margin-bottom: 8px;
}

.meta-grid dd {
    font-family: 'Fira Code', monospace;
    font-size: 0.8rem;
    line-height: 1.4;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
}

@media (min-width: 768px) {
    .meta-grid > div {
        flex: 1 1 calc(50% - 4px);
        max-width: calc(50% - 4px);
    }
}

@media (min-width: 1025px) {
    .meta-grid > div {
        flex: 1 1 calc(25% - 6px);
        max-width: calc(25% - 6px);
    }
}

/* --------------------------------------------------------------- columns */

.cols {
    display: grid;
    gap: 28px;
}

.cols-2 { grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); }
.cols-3 { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }

/* ----------------------------------------------------------------- cards */

.card {
    background-color: var(--panel);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 22px 24px;
}

.card h3 {
    margin-bottom: 10px;
}

.card p {
    font-size: 0.92rem;
    color: var(--text-muted);
    line-height: 1.5;
}

.card p + p { margin-top: 10px; }

/* One item per row inside a card */
.card-list {
    list-style: none;
    display: flex;
    flex-direction: column;
}

.card-list li {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.45;
    padding: 9px 0;
    border-top: 1px solid var(--border-color);
}

.card-list li:first-child {
    border-top: none;
    padding-top: 2px;
}

.card-list li:last-child {
    padding-bottom: 2px;
}

/* stat tiles */

.stat {
    background: var(--panel);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 22px 24px;
}

.stat .figure {
    font-family: 'Fira Code', monospace;
    font-size: clamp(1.5rem, 3.2vw, 2rem);
    font-weight: 500;
    color: var(--neon-blue);
    letter-spacing: -0.01em;
    font-variant-numeric: tabular-nums;
    display: block;
    margin-bottom: 8px;
}

.stat .label {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.45;
}

/* --------------------------------------------------------------- bullets */

.bullets {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.bullets li {
    position: relative;
    padding-left: 22px;
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.55;
    max-width: 72ch;
}

.bullets li::before {
    content: "/";
    position: absolute;
    left: 0;
    top: 0;
    color: var(--neon-deep);
    font-family: 'Fira Code', monospace;
    font-weight: 600;
}

.bullets li strong {
    color: var(--text-primary);
    font-weight: 600;
}

/* Short qualifier under a bucket heading */
.bucket-note {
    font-size: 0.82rem;
    line-height: 1.45;
    color: var(--text-faint);
    font-style: italic;
    margin-top: -4px;
    margin-bottom: 14px;
    max-width: 40ch;
}

/* -------------------------------------------------------------- speclist */

.speclist {
    list-style: none;
}

.speclist li {
    padding: 16px 0;
    border-top: 1px solid var(--border-color);
    display: grid;
    grid-template-columns: 190px 1fr;
    gap: 24px;
    align-items: start;
}

.speclist li:last-child {
    border-bottom: 1px solid var(--border-color);
}

.speclist .k {
    font-family: 'Fira Code', monospace;
    font-size: 0.78rem;
    font-weight: 500;
    letter-spacing: 0.06em;
    color: var(--neon-blue);
    padding-top: 3px;
}

.speclist .v {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.55;
}

.speclist .v strong {
    color: var(--text-primary);
    font-weight: 600;
}

@media (max-width: 720px) {
    .speclist li {
        grid-template-columns: 1fr;
        gap: 6px;
    }
}

/* Region-to-standard pairs inside a speclist entry */
.stdlist {
    list-style: none;
    margin: 12px 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 2px 20px;
}

.stdlist li {
    display: flex;
    align-items: baseline;
    gap: 10px;
    padding: 4px 0;
    font-size: 0.88rem;
}

.stdlist li > span:first-child {
    color: var(--text-faint);
    min-width: 88px;
}

.stdlist li > span:last-child {
    color: var(--neon-blue);
}

/* ---------------------------------------------------------------- tables */

.table-wrap {
    overflow-x: auto;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--panel);
}

table {
    border-collapse: collapse;
    width: 100%;
    min-width: 660px;
    font-size: 0.88rem;
}

thead th {
    text-align: left;
    font-family: 'Fira Code', monospace;
    font-size: 0.62rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--text-faint);
    padding: 13px 16px;
    border-bottom: 1px solid var(--border-strong);
    white-space: nowrap;
}

tbody td {
    padding: 13px 16px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-muted);
    vertical-align: top;
    font-variant-numeric: tabular-nums;
}

tbody tr:last-child td { border-bottom: none; }

tbody td:first-child {
    color: var(--text-primary);
    font-weight: 400;
}

.mono {
    font-family: 'Fira Code', monospace;
    font-size: 0.92em;
}

td .mono { color: var(--neon-blue); }

/* -------------------------------------------------------------- callouts */

.callout {
    border-left: 2px solid var(--neon-blue);
    background: var(--panel-2);
    border-radius: 0 8px 8px 0;
    padding: 18px 22px;
    margin-top: 32px;
}

.callout p {
    font-size: 0.95rem;
    color: var(--text-dim);
    line-height: 1.6;
}

.callout .label {
    display: block;
    font-family: 'Fira Code', monospace;
    font-size: 0.62rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--text-faint);
    margin-bottom: 8px;
}

.callout.accent-warn { border-left-color: var(--warn); }
.callout.accent-ok { border-left-color: var(--ok); }

/* ----------------------------------------------------------- flow strip */

.flow {
    display: flex;
    flex-wrap: wrap;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--panel);
    overflow: hidden;
}

.flow-step {
    flex: 1 1 170px;
    padding: 18px 20px;
    border-right: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

.flow-step .n {
    font-family: 'Fira Code', monospace;
    font-size: 0.62rem;
    color: var(--neon-blue);
    letter-spacing: 0.14em;
}

.flow-step .t {
    display: block;
    margin-top: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.flow-step .d {
    display: block;
    margin-top: 6px;
    font-size: 0.82rem;
    color: var(--text-faint);
    line-height: 1.5;
}

/* --------------------------------------------------------------- diagram */

.diagram-wrap {
    overflow-x: auto;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--panel);
    padding: 24px;
}

.diagram-wrap svg {
    width: 100%;
    min-width: 720px;
    height: auto;
    display: block;
}

.figcap {
    font-family: 'Fira Code', monospace;
    font-size: 0.7rem;
    color: var(--text-faint);
    letter-spacing: 0.04em;
    margin-top: 14px;
}

/* ------------------------------------------------------------------- faq */

.faq details {
    border-top: 1px solid var(--border-color);
}

.faq details:last-child {
    border-bottom: 1px solid var(--border-color);
}

.faq summary {
    cursor: pointer;
    padding: 16px 0;
    font-weight: 500;
    font-size: 0.98rem;
    color: var(--text-primary);
    list-style: none;
    display: flex;
    gap: 14px;
    align-items: baseline;
}

.faq summary::-webkit-details-marker { display: none; }

.faq summary::before {
    content: "+";
    font-family: 'Fira Code', monospace;
    color: var(--neon-blue);
    font-weight: 600;
}

.faq details[open] summary::before { content: "–"; }

.faq details > p {
    margin: 0 0 18px 28px;
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* --------------------------------------------------------------- buttons */

.cta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    align-items: center;
    margin-top: 8px;
}

.btn-primary,
.btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.92rem;
    padding: 10px 24px;
    border-radius: 6px;
    transition: all 0.2s ease-in-out;
}

.btn-primary {
    background-color: var(--text-primary);
    color: var(--bg-color);
    border: 1px solid var(--text-primary);
    box-shadow: 0 4px 20px rgba(255, 255, 255, 0.05);
}

.btn-primary:hover {
    background-color: transparent;
    color: var(--text-primary);
    transform: translateY(-2px);
}

.btn-secondary {
    background-color: transparent;
    color: var(--text-dim);
    border: 1px solid var(--border-strong);
}

.btn-secondary:hover {
    color: var(--neon-blue);
    border-color: var(--neon-blue);
    background: rgba(0, 240, 255, 0.05);
    transform: translateY(-2px);
}

.btn-primary svg,
.btn-secondary svg {
    transition: transform 0.2s ease;
}

.btn-primary:hover svg,
.btn-secondary:hover svg {
    transform: translateX(4px);
}

/* ---------------------------------------------------------------- footer */

footer {
    max-width: 1120px;
    margin: 0 auto;
    border-top: 1px solid var(--border-color);
    padding: 28px 24px 56px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: center;
    font-family: 'Fira Code', monospace;
    font-size: 0.7rem;
    color: var(--text-faint);
    letter-spacing: 0.06em;
    position: relative;
    z-index: 10;
}

footer a {
    color: var(--text-muted);
    text-decoration: none;
}

footer a:hover { color: var(--neon-blue); }

@media (min-width: 768px) {
    footer {
        flex-direction: row;
        justify-content: space-between;
    }
}
