/* QUIC / HTTP3 / WebTransport Hardening — PQ Crypta Article Stylesheet
   Theme: deep space navy · QUIC teal #00d4ff · PQ violet #7b2fff
   Strict CSP: no inline styles anywhere — every visual is a class here.
*/

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

:root {
    --accent:      #00d4ff;
    --accent-dim:  rgba(0,212,255,0.18);
    --accent-glow: 0 0 20px rgba(0,212,255,0.30);
    --warn:        #ff6b35;
    --warn-dim:    rgba(255,107,53,0.18);
    --ok:          #3ad29f;
    --ok-dim:      rgba(58,210,159,0.16);
    --pq:          #7b2fff;
    --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 ── */
.qh-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);
}
.qh-site-header-inner { max-width: 1140px; margin: 0 auto; padding: 28px 2rem 22px; }
.qh-site-header-top { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.qh-logo-link { flex-shrink: 0; display: block; text-decoration: none; }
.qh-logo-img { height: 52px; width: auto; border-radius: 8px; display: block; }
.qh-header-text { flex: 1; min-width: 200px; }
.qh-page-title {
    font-size: clamp(1.35rem, 3.5vw, 1.95rem);
    font-weight: 800;
    color: var(--accent);
    text-shadow: var(--accent-glow);
    letter-spacing: -0.02em;
    line-height: 1.2;
}
.qh-page-subtitle { font-size: 0.92rem; color: var(--text-dim); margin-top: 6px; max-width: 60ch; }
.qh-header-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.qh-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);
}
.qh-meta-badge-pq { color: var(--pq); border-color: rgba(123,47,255,0.4); background: rgba(123,47,255,0.14); }
.qh-meta-badge-wt { color: var(--ok); border-color: rgba(58,210,159,0.4); background: var(--ok-dim); }
.qh-meta-author { font-size: 0.78rem; color: var(--text-dim); margin-left: auto; }

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

/* ── Custom cursor ── */
.qh-cursor-active { cursor: none; }
.qh-cursor-active a, .qh-cursor-active button, .qh-cursor-active .qh-faq-q { cursor: none; }
#qh-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;
}
#qh-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;
}
.qh-trail-wrap { position: fixed; inset: 0; z-index: 9997; pointer-events: none; }
.qh-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 ── */
.qh-wrap { max-width: 1140px; margin: 0 auto; padding: 0 2rem 4rem; position: relative; z-index: 10; }

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

.qh-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;
}
.qh-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;
}
.qh-findings ul { list-style: none; }
.qh-findings li { position: relative; padding-left: 1.4rem; margin-bottom: 0.5rem; font-size: 0.92rem; }
.qh-findings li::before {
    content: ""; position: absolute; left: 0; top: 0.62em;
    width: 7px; height: 7px; background: var(--accent); border-radius: 2px;
}
.qh-findings em { color: var(--heading); font-style: normal; font-weight: 600; }

/* ── Article ── */
.qh-article { margin-top: 1rem; }
.qh-section { padding: 1.8rem 0; border-top: 1px solid rgba(0,212,255,0.08); }
.qh-section.highlight {
    background: var(--surface-alt); border: 1px solid var(--border);
    border-radius: 10px; padding: 1.6rem 1.6rem; margin: 1.4rem 0;
}
.qh-h2 {
    font-size: clamp(1.2rem, 2.6vw, 1.5rem); font-weight: 800;
    color: var(--heading); margin-bottom: 0.9rem; letter-spacing: -0.01em;
}
.qh-h3 {
    font-size: 1.02rem; font-weight: 700; color: var(--accent);
    margin: 1.4rem 0 0.6rem;
}
.qh-section p { margin-bottom: 0.9rem; }
.qh-section p:last-child { margin-bottom: 0; }
.qh-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;
}
.qh-link { color: var(--accent); text-decoration: none; border-bottom: 1px solid var(--accent-dim); }
.qh-link:hover { border-bottom-color: var(--accent); }

.qh-cve { color: var(--warn); font-weight: 600; }

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

/* ── Code ── */
.qh-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;
}

/* ── Mapping table ── */
.qh-table-wrap { overflow-x: auto; margin: 1.2rem 0; border-radius: 8px; border: 1px solid var(--border); }
.qh-table { width: 100%; border-collapse: collapse; font-size: 0.87rem; min-width: 640px; }
.qh-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);
}
.qh-table tbody td { padding: 0.7rem 0.9rem; border-bottom: 1px solid rgba(0,212,255,0.08); vertical-align: top; }
.qh-table tbody tr:last-child td { border-bottom: none; }
.qh-table tbody tr:nth-child(even) { background: rgba(0,212,255,0.03); }
.qh-table code { white-space: nowrap; }
.qh-pill {
    display: inline-block; font-size: 0.68rem; font-weight: 700; padding: 2px 8px;
    border-radius: 999px; letter-spacing: 0.03em; text-transform: uppercase;
    margin: 0 0.3rem 0.3rem 0;
}
.qh-table td .qh-pill { margin-bottom: 0.3rem; }
.qh-table td .qh-pill:last-child { margin-bottom: 0; }
.qh-pill-impl { color: var(--ok); background: var(--ok-dim); border: 1px solid rgba(58,210,159,0.4); }
.qh-pill-stack { color: var(--accent); background: var(--accent-dim); border: 1px solid var(--border); }
.qh-pill-bound { color: var(--warn); background: var(--warn-dim); border: 1px solid rgba(255,107,53,0.4); }

/* ── FAQ accordion ── */
.qh-faq { margin-top: 1rem; }
.qh-faq-item {
    border: 1px solid var(--border); border-radius: 8px;
    background: var(--surface); margin-bottom: 0.8rem; overflow: hidden;
}
.qh-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;
}
.qh-faq-q:hover { color: var(--accent); }
.qh-faq-q:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.qh-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;
}
.qh-faq-item.open .qh-faq-q::after { content: "\2212"; }
.qh-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;
}
.qh-faq-item.open .qh-faq-a { max-height: 420px; opacity: 1; padding: 0 1.2rem 1.1rem; }

/* ── Footer ── */
.qh-footer {
    max-width: 1140px; 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;
}
.qh-footer a { color: var(--accent); text-decoration: none; }
.qh-footer a:hover { text-decoration: underline; }
.qh-footer-links { margin-top: 0.4rem; }

@media (max-width: 600px) {
    .qh-site-header-inner, .qh-wrap { padding-left: 1.2rem; padding-right: 1.2rem; }
    .qh-meta-author { margin-left: 0; width: 100%; }
}
