/* Traffic & Protocol Analysis — PQ Crypta Article Stylesheet
   Theme: deep space navy · QUIC teal #00d4ff · PQ violet #7b2fff · flow green #3ad29f
   Strict CSP: no inline styles anywhere — every visual is a class here.
   SVG charts use presentation attributes + SMIL <animate> (CSP-safe, no JS, no style="").
*/

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

:root {
    --accent:      #00d4ff;   /* HTTP/3 · QUIC teal       */
    --accent-dim:  rgba(0,212,255,0.18);
    --accent-glow: 0 0 20px rgba(0,212,255,0.30);
    --steel:       #5b7da0;   /* HTTP/1.1 · TCP           */
    --ghost:       #2a3a4d;   /* HTTP/2 · the missing middle */
    --warn:        #ff6b35;   /* timeouts · legacy        */
    --warn-dim:    rgba(255,107,53,0.18);
    --ok:          #3ad29f;   /* established · validated  */
    --ok-dim:      rgba(58,210,159,0.16);
    --pq:          #7b2fff;   /* post-quantum             */
    --pq-dim:      rgba(123,47,255,0.16);
    --gold:        #ffd23f;   /* A++ grade                */
    --bg:          #030810;
    --surface:     rgba(8,16,30,0.88);
    --surface-alt: rgba(0,212,255,0.05);
    --border:      rgba(0,212,255,0.18);
    --text:        #d8e8f8;
    --text-dim:    #7890a8;
    --heading:     #e8f4ff;
}

html { scroll-behavior: smooth; }

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: radial-gradient(ellipse at 50% 20%, rgba(0,40,80,0.55) 0%, rgba(3,8,16,0.97) 65%, #030810 100%);
    background-color: var(--bg);
    color: var(--text);
    line-height: 1.75;
    min-height: 100vh;
}

/* ── Site header ── */
.ta-site-header {
    position: relative;
    z-index: 50;
    background: linear-gradient(180deg, rgba(3,8,16,0.94) 0%, rgba(8,15,30,0.88) 100%);
    border-bottom: 1px solid var(--border);
}
.ta-site-header-inner { max-width: 1180px; margin: 0 auto; padding: 28px 2rem 22px; }
.ta-site-header-top { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.ta-logo-link { flex-shrink: 0; display: block; text-decoration: none; }
.ta-logo-img { height: 52px; width: auto; border-radius: 8px; display: block; }
.ta-header-text { flex: 1; min-width: 200px; }
.ta-page-title {
    font-size: clamp(1.35rem, 3.5vw, 2rem);
    font-weight: 800;
    color: var(--accent);
    text-shadow: var(--accent-glow);
    letter-spacing: -0.02em;
    line-height: 1.2;
}
.ta-page-subtitle { font-size: 0.92rem; color: var(--text-dim); margin-top: 6px; max-width: 64ch; }
.ta-header-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.ta-meta-badge {
    font-size: 0.7rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
    padding: 4px 10px; border-radius: 999px; border: 1px solid var(--border);
    color: var(--accent); background: var(--accent-dim);
}
.ta-meta-badge-pq { color: var(--pq); border-color: rgba(123,47,255,0.4); background: var(--pq-dim); }
.ta-meta-badge-flow { color: var(--ok); border-color: rgba(58,210,159,0.4); background: var(--ok-dim); }
.ta-meta-author { font-size: 0.78rem; color: var(--text-dim); margin-left: auto; }

/* ── Background canvas + stacking ── */
.ta-canvas { position: fixed; inset: 0; z-index: 0; pointer-events: none; display: block; }

/* ── Custom cursor ── */
.ta-cursor-active { cursor: none; }
.ta-cursor-active a, .ta-cursor-active button, .ta-cursor-active .ta-faq-q { cursor: none; }
#ta-cursor-dot {
    position: fixed; top: 0; left: 0; width: 14px; height: 14px; z-index: 9999;
    pointer-events: none; border-radius: 50%; background: var(--accent);
    box-shadow: 0 0 12px var(--accent), 0 0 4px #fff; will-change: transform;
}
#ta-cursor-ring {
    position: fixed; top: 0; left: 0; width: 32px; height: 32px; z-index: 9998;
    pointer-events: none; border-radius: 50%;
    border: 1.5px solid rgba(0,212,255,0.55); border-top-color: var(--pq);
    will-change: transform;
}
.ta-trail-wrap { position: fixed; inset: 0; z-index: 9997; pointer-events: none; }
.ta-trail-label {
    position: fixed; transform: translate(-50%, -50%);
    font-family: 'Cascadia Code', 'Fira Mono', monospace; font-size: 10px;
    font-weight: 600; white-space: nowrap; pointer-events: none; will-change: top, opacity, transform;
}

/* ── Layout ── */
.ta-wrap { max-width: 1180px; margin: 0 auto; padding: 0 2rem 4rem; position: relative; z-index: 10; }

.ta-header { padding: 2.4rem 0 1.2rem; }
.ta-lede { font-size: 1.06rem; color: var(--text); }
.ta-lede em { color: var(--accent); font-style: normal; }

.ta-findings {
    margin-top: 1.6rem; padding: 1.2rem 1.4rem;
    background: var(--surface); border: 1px solid var(--border);
    border-left: 3px solid var(--accent); border-radius: 8px;
}
.ta-findings-label {
    display: block; font-size: 0.72rem; font-weight: 800; letter-spacing: 0.1em;
    text-transform: uppercase; color: var(--accent); margin-bottom: 0.6rem;
}
.ta-findings ul { list-style: none; }
.ta-findings li { position: relative; padding-left: 1.4rem; margin-bottom: 0.5rem; font-size: 0.92rem; }
.ta-findings li::before {
    content: ""; position: absolute; left: 0; top: 0.62em;
    width: 7px; height: 7px; background: var(--accent); border-radius: 2px;
}
.ta-findings em { color: var(--heading); font-style: normal; font-weight: 600; }

/* ── Article ── */
.ta-article { margin-top: 1rem; }
.ta-section { padding: 1.8rem 0; border-top: 1px solid rgba(0,212,255,0.08); }
.ta-section.highlight {
    background: var(--surface-alt); border: 1px solid var(--border);
    border-radius: 10px; padding: 1.6rem 1.6rem; margin: 1.4rem 0;
}
.ta-eyebrow {
    display: block; font-size: 0.7rem; font-weight: 800; letter-spacing: 0.12em;
    text-transform: uppercase; color: var(--pq); margin-bottom: 0.4rem;
}
.ta-h2 {
    font-size: clamp(1.2rem, 2.6vw, 1.55rem); font-weight: 800;
    color: var(--heading); margin-bottom: 0.9rem; letter-spacing: -0.01em;
}
.ta-h3 { font-size: 1.04rem; font-weight: 700; color: var(--accent); margin: 1.4rem 0 0.6rem; }
.ta-section p { margin-bottom: 0.9rem; }
.ta-section p:last-child { margin-bottom: 0; }
.ta-section code {
    font-family: 'JetBrains Mono', 'Consolas', monospace; font-size: 0.86em;
    color: var(--accent); background: rgba(0,212,255,0.08);
    padding: 1px 6px; border-radius: 4px;
}
.ta-link { color: var(--accent); text-decoration: none; border-bottom: 1px solid var(--accent-dim); }
.ta-link:hover { border-bottom-color: var(--accent); }
.ta-em-warn { color: var(--warn); font-weight: 600; }
.ta-em-pq { color: var(--pq); font-weight: 600; }
.ta-em-ok { color: var(--ok); font-weight: 600; }

.ta-ol { margin: 0.5rem 0 0 1.2rem; }
.ta-ol li { margin-bottom: 0.6rem; }
.ta-mt { margin-top: 1rem; }

/* ── Code ── */
.ta-code {
    font-family: 'JetBrains Mono', 'Consolas', monospace; font-size: 0.82rem;
    line-height: 1.65; color: #b8e8ff; background: rgba(2,6,14,0.92);
    border: 1px solid var(--border); border-radius: 8px;
    padding: 1rem 1.2rem; margin: 1rem 0; overflow-x: auto; white-space: pre;
}

/* ── Stat cards ── */
.ta-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0.9rem; margin: 1.4rem 0; }
.ta-stat {
    background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
    padding: 1.1rem 1.2rem; position: relative; overflow: hidden;
}
.ta-stat::before {
    content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--accent);
}
.ta-stat.pq::before { background: var(--pq); }
.ta-stat.ok::before { background: var(--ok); }
.ta-stat.warn::before { background: var(--warn); }
.ta-stat-num { font-size: 1.9rem; font-weight: 800; color: var(--heading); line-height: 1.1; letter-spacing: -0.02em; }
.ta-stat.pq .ta-stat-num { color: var(--pq); }
.ta-stat.ok .ta-stat-num { color: var(--ok); }
.ta-stat.warn .ta-stat-num { color: var(--warn); }
.ta-stat-num small { font-size: 0.95rem; font-weight: 700; color: var(--text-dim); }
.ta-stat-label { font-size: 0.78rem; color: var(--text-dim); margin-top: 0.35rem; line-height: 1.4; }

/* ── Figure / chart frame ── */
.ta-figure {
    margin: 1.5rem 0; padding: 1.3rem 1.4rem 1.1rem;
    background: rgba(2,6,14,0.78); border: 1px solid var(--border); border-radius: 12px;
}
.ta-figure-title { font-size: 0.92rem; font-weight: 700; color: var(--heading); margin-bottom: 0.2rem; }
.ta-figure-sub { font-size: 0.76rem; color: var(--text-dim); margin-bottom: 0.9rem; }
.ta-figure-cap { font-size: 0.74rem; color: var(--text-dim); margin-top: 0.7rem; font-style: italic; }
.ta-chart { width: 100%; height: auto; display: block; overflow: visible; }
.ta-grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.2rem; }

/* ── SVG chart primitives (presentation via class) ── */
.ta-fill-h3   { fill: #00d4ff; }
.ta-fill-h1   { fill: #5b7da0; }
.ta-fill-h2   { fill: #2a3a4d; }
.ta-fill-pq   { fill: #7b2fff; }
.ta-fill-ok   { fill: #3ad29f; }
.ta-fill-warn { fill: #ff6b35; }
.ta-fill-gold { fill: #ffd23f; }
.ta-fill-steel{ fill: #5b7da0; }
.ta-fill-track{ fill: rgba(0,212,255,0.07); }
.ta-tx        { fill: #d8e8f8; font-family: 'Segoe UI', system-ui, sans-serif; }
.ta-tx-dim    { fill: #7890a8; font-family: 'Segoe UI', system-ui, sans-serif; }
.ta-tx-accent { fill: #00d4ff; font-family: 'Cascadia Code','Fira Mono',monospace; }
.ta-tx-mono   { fill: #b8e8ff; font-family: 'Cascadia Code','Fira Mono',monospace; }
.ta-tx-num    { fill: #e8f4ff; font-weight: 700; font-family: 'Cascadia Code','Fira Mono',monospace; }
.ta-stroke-h3   { fill: none; stroke: #00d4ff; }
.ta-stroke-h1   { fill: none; stroke: #5b7da0; }
.ta-stroke-h2   { fill: none; stroke: #2a3a4d; }
.ta-stroke-pq   { fill: none; stroke: #7b2fff; }
.ta-stroke-ok   { fill: none; stroke: #3ad29f; }
.ta-stroke-warn { fill: none; stroke: #ff6b35; }
.ta-stroke-gold { fill: none; stroke: #ffd23f; }
.ta-stroke-steel{ fill: none; stroke: #5b7da0; }
.ta-stroke-grid { fill: none; stroke: rgba(0,212,255,0.10); }
.ta-stroke-track{ fill: none; stroke: rgba(0,212,255,0.10); }
.ta-flow-line   { fill: none; stroke-linecap: round; opacity: 0.85; }
.ta-flow-node   { fill: #7b2fff; }
.ta-flow-dot    { fill: #3ad29f; }

/* gentle pulse for live dots in SVG */
@keyframes taPulse { 0%,100% { opacity: 0.35; } 50% { opacity: 1; } }
.ta-pulse { animation: taPulse 2.4s ease-in-out infinite; }

/* legend */
.ta-legend { display: flex; flex-wrap: wrap; gap: 0.6rem 1.1rem; margin-top: 0.8rem; }
.ta-legend-item { display: inline-flex; align-items: center; gap: 0.4rem; font-size: 0.76rem; color: var(--text-dim); }
.ta-swatch { width: 11px; height: 11px; border-radius: 3px; display: inline-block; flex-shrink: 0; }
.ta-sw-h3 { background: #00d4ff; } .ta-sw-h1 { background: #5b7da0; } .ta-sw-h2 { background: #2a3a4d; }
.ta-sw-pq { background: #7b2fff; } .ta-sw-ok { background: #3ad29f; } .ta-sw-warn { background: #ff6b35; }
.ta-sw-gold { background: #ffd23f; }

/* ── Tables ── */
.ta-table-wrap { overflow-x: auto; margin: 1.2rem 0; border-radius: 8px; border: 1px solid var(--border); }
.ta-table { width: 100%; border-collapse: collapse; font-size: 0.87rem; min-width: 560px; }
.ta-table thead th {
    background: rgba(0,212,255,0.1); color: var(--accent);
    text-align: left; padding: 0.7rem 0.9rem; font-weight: 700;
    text-transform: uppercase; font-size: 0.72rem; letter-spacing: 0.04em;
    border-bottom: 1px solid var(--border);
}
.ta-table tbody td { padding: 0.7rem 0.9rem; border-bottom: 1px solid rgba(0,212,255,0.08); vertical-align: top; }
.ta-table tbody tr:last-child td { border-bottom: none; }
.ta-table tbody tr:nth-child(even) { background: rgba(0,212,255,0.03); }
.ta-table td.num { text-align: right; font-family: 'Cascadia Code','Fira Mono',monospace; color: var(--heading); }
.ta-table code { white-space: nowrap; }
.ta-pill { display: inline-block; font-size: 0.68rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; letter-spacing: 0.03em; text-transform: uppercase; }
.ta-pill-ok { color: var(--ok); background: var(--ok-dim); border: 1px solid rgba(58,210,159,0.4); }
.ta-pill-pq { color: var(--pq); background: var(--pq-dim); border: 1px solid rgba(123,47,255,0.4); }
.ta-pill-warn { color: var(--warn); background: var(--warn-dim); border: 1px solid rgba(255,107,53,0.4); }

/* ── Callout ── */
.ta-callout {
    margin: 1.4rem 0; padding: 1.1rem 1.3rem; border-radius: 10px;
    background: var(--pq-dim); border: 1px solid rgba(123,47,255,0.35); border-left: 3px solid var(--pq);
    font-size: 0.92rem;
}
.ta-callout strong { color: var(--heading); }
.ta-callout.warn { background: var(--warn-dim); border-color: rgba(255,107,53,0.35); border-left-color: var(--warn); }

/* ── FAQ accordion ── */
.ta-faq { margin-top: 1rem; }
.ta-faq-item { border: 1px solid var(--border); border-radius: 8px; background: var(--surface); margin-bottom: 0.8rem; overflow: hidden; }
.ta-faq-q {
    font-weight: 700; color: var(--heading); padding: 0.95rem 2.6rem 0.95rem 1.2rem;
    position: relative; cursor: pointer; user-select: none; transition: color 0.15s ease;
}
.ta-faq-q:hover { color: var(--accent); }
.ta-faq-q:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.ta-faq-q::after {
    content: "+"; position: absolute; right: 1.1rem; top: 50%; transform: translateY(-50%);
    font-size: 1.3rem; font-weight: 400; color: var(--accent); transition: transform 0.2s ease;
}
.ta-faq-item.open .ta-faq-q::after { content: "\2212"; }
.ta-faq-a {
    font-size: 0.92rem; color: var(--text); max-height: 0; opacity: 0; padding: 0 1.2rem;
    transition: max-height 0.3s ease, opacity 0.25s ease, padding 0.3s ease;
}
.ta-faq-item.open .ta-faq-a { max-height: 480px; opacity: 1; padding: 0 1.2rem 1.1rem; }

/* ── Footer ── */
.ta-footer {
    max-width: 1180px; margin: 2rem auto 0; padding: 2rem; text-align: center;
    border-top: 1px solid var(--border); color: var(--text-dim); font-size: 0.85rem;
    position: relative; z-index: 10;
}
.ta-footer a { color: var(--accent); text-decoration: none; }
.ta-footer a:hover { text-decoration: underline; }
.ta-footer-links { margin-top: 0.4rem; }

@media (prefers-reduced-motion: reduce) {
    .ta-pulse { animation: none; opacity: 0.8; }
}
@media (max-width: 600px) {
    .ta-site-header-inner, .ta-wrap { padding-left: 1.2rem; padding-right: 1.2rem; }
    .ta-meta-author { margin-left: 0; width: 100%; }
    .ta-stat-num { font-size: 1.6rem; }
}
