/* =============================================================================
   PQ Crypta homepage

   The site's measured-page language (see /dns/ and /handshake/): a near-black
   field, the page's own data drawn behind it, cards that say where each figure
   comes from. The three layers keep one colour each everywhere they appear:
   green to discover, teal to enforce, violet to carry. Amber is what is signed
   or dated (the ledger, the federal clock).

   Motion is SVG and CSS. `html.hp-still` (the corner control, js/home-bg.js)
   stops every animation on the page and shows each figure in its final state.
   ========================================================================== */

@layer tokens, base, layout, components, motion, utilities;

@layer tokens {
    :root {
        --hp-bg: #060a12;
        --hp-card: #0d1420;
        --hp-card-2: #111a29;
        --hp-border: #1c2a3d;
        --hp-border-hi: #2a3d57;
        --hp-text: #f1f5f9;
        --hp-dim: #a3b3c6;
        --hp-muted: #6b7c93;
        --hp-primary: #5eead4;
        --hp-primary-dark: #0f766e;
        --hp-discover: #4ade80;
        --hp-enforce: #5eead4;
        --hp-carry: #c4b5fd;
        --hp-sign: #fbbf24;
        --hp-warn: #fbbf24;
        --hp-bad: #f87171;
        --hp-classical: #94a3b8;
        --hp-radius: 14px;
        --hp-wrap: 1180px;
        --hp-ease: cubic-bezier(0.22, 1, 0.36, 1);
        --hp-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, 'Liberation Mono', monospace;
        color-scheme: dark;
    }
}

@layer base {
    *,
    *::before,
    *::after {
        box-sizing: border-box;
    }

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

    body.hp-body {
        margin: 0;
        min-height: 100vh;
        background:
            radial-gradient(1200px 600px at 78% -10%, rgb(94 234 212 / 0.07), transparent 60%),
            radial-gradient(900px 500px at 8% 8%, rgb(196 181 253 / 0.06), transparent 60%), var(--hp-bg);
        color: var(--hp-text);
        font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
        line-height: 1.6;
        -webkit-font-smoothing: antialiased;
        overflow-x: clip;
    }

    a {
        color: var(--hp-primary);
        text-underline-offset: 0.18em;
    }

    a:hover {
        color: #99f6e4;
    }

    :focus-visible {
        outline: 2px solid var(--hp-primary);
        outline-offset: 3px;
        border-radius: 6px;
    }

    p {
        text-wrap: pretty;
    }

    h1,
    h2,
    h3 {
        text-wrap: balance;
    }

    .hp-sr {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip-path: inset(50%);
        white-space: nowrap;
    }

    .hp-mono {
        font-family: var(--hp-mono);
        font-size: 0.92em;
        overflow-wrap: anywhere;
    }
}

@layer layout {
    /* The canvas is fixed and its own stacking context; every band of the
       page sits above it and it never takes a click. */
    .hp-bg-container {
        position: fixed;
        inset: 0;
        z-index: 0;
        pointer-events: none;
    }

    .hp-bg-canvas {
        display: block;
        width: 100%;
        height: 100%;
    }

    .hp-header,
    .hp-main,
    .hp-footer {
        position: relative;
        z-index: 1;
    }

    .hp-header {
        padding-block: 2.2rem 0.6rem;
    }

    .hp-header-inner,
    .hp-main,
    .hp-footer-inner,
    .hp-footer-base {
        max-width: var(--hp-wrap);
        margin-inline: auto;
        padding-inline: 20px;
    }

    /* The site menu's button sits at the top right of every page; the header
       leaves it room rather than running under it. */
    .hp-header-inner {
        display: flex;
        align-items: center;
        gap: 1rem;
        flex-wrap: wrap;
        /* The button's left edge is about 250px from the viewport's right; the
           wrap's right edge is (100vw + 1180px) / 2 until the wrap fills the
           viewport, so the room it needs is 850px - 50vw, within 20-260px. */
        padding-right: clamp(20px, calc(850px - 50vw), 260px);
    }

    .hp-main {
        padding-bottom: 4rem;
    }

    .hp-section {
        margin-top: clamp(3.5rem, 7vw, 6rem);
        scroll-margin-top: 24px;
    }

    .hp-section-head {
        max-width: 760px;
        margin-bottom: 1.8rem;
    }
}

@layer components {
    /* --- Header --------------------------------------------------------- */
    .hp-logo-link {
        line-height: 0;
        border-radius: 12px;
    }

    .hp-logo {
        width: 56px;
        height: 56px;
        border-radius: 12px;
        box-shadow:
            0 0 0 1px var(--hp-border),
            0 8px 30px rgb(94 234 212 / 0.12);
    }

    .hp-brand {
        margin-right: auto;
    }

    .hp-brand-name {
        margin: 0;
        font-size: clamp(1.5rem, 3vw, 1.9rem);
        font-weight: 750;
        letter-spacing: -0.02em;
        line-height: 1.1;
        background: linear-gradient(92deg, #f1f5f9 0%, #99f6e4 55%, #c4b5fd 100%);
        background-clip: text;
        color: transparent;
    }

    .hp-brand-sub {
        margin: 0.25rem 0 0;
        color: var(--hp-dim);
        font-size: 0.95rem;
    }

    .hp-nav {
        display: flex;
        gap: 0.25rem;
        flex-wrap: wrap;

        & a {
            flex: none;
            white-space: nowrap;
            padding: 0.4rem 0.75rem;
            border-radius: 999px;
            color: var(--hp-dim);
            text-decoration: none;
            font-size: 0.92rem;
            border: 1px solid transparent;
            transition:
                color 0.15s,
                border-color 0.15s,
                background-color 0.15s;
        }

        & a:hover {
            color: var(--hp-text);
            border-color: var(--hp-border);
            background: rgb(13 20 32 / 0.7);
        }
    }

    /* --- Hero ------------------------------------------------------------ */
    .hp-hero {
        display: grid;
        grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
        gap: clamp(1.5rem, 4vw, 3.5rem);
        align-items: center;
        padding-top: clamp(1.5rem, 4vw, 3rem);
    }

    .hp-status-line {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 0.6rem;
        margin: 0 0 1.2rem;
        font-size: 0.85rem;
    }

    .hp-status-when {
        color: var(--hp-muted);
    }

    .hp-pill {
        display: inline-flex;
        align-items: center;
        gap: 0.45rem;
        padding: 0.2rem 0.75rem;
        border-radius: 999px;
        border: 1px solid currentColor;
        font-weight: 600;
        text-decoration: none;
    }

    .hp-pill-ok {
        color: var(--hp-discover);
        background: rgb(74 222 128 / 0.08);
    }

    .hp-pill-info {
        color: var(--hp-primary);
        background: rgb(94 234 212 / 0.08);
    }

    .hp-pill:hover {
        color: var(--hp-text);
    }

    .hp-pill-dot {
        width: 7px;
        height: 7px;
        border-radius: 50%;
        background: currentColor;
        box-shadow: 0 0 0 0 currentColor;
        animation: hp-beat 2.4s ease-out infinite;
    }

    .hp-title {
        margin: 0;
        font-size: clamp(2rem, 4vw, 3rem);
        line-height: 1.08;
        letter-spacing: -0.03em;
        font-weight: 760;
    }

    .hp-lede {
        margin: 1.2rem 0 0;
        max-width: 60ch;
        color: var(--hp-dim);
        font-size: clamp(1rem, 1.4vw, 1.12rem);
    }

    .hp-cta-row {
        display: flex;
        flex-wrap: wrap;
        gap: 0.7rem;
        margin-top: 1.8rem;
    }

    .hp-hero-note {
        margin: 1rem 0 0;
        color: var(--hp-muted);
        font-size: 0.88rem;
    }

    .hp-btn {
        display: inline-flex;
        align-items: center;
        gap: 0.5rem;
        padding: 0.72rem 1.15rem;
        border-radius: 10px;
        font-weight: 650;
        font-size: 0.98rem;
        text-decoration: none;
        border: 1px solid transparent;
        transition:
            transform 0.15s var(--hp-ease),
            background-color 0.15s,
            border-color 0.15s,
            color 0.15s,
            box-shadow 0.15s;

        &:hover {
            transform: translateY(-1px);
        }
    }

    .hp-btn-sm {
        padding: 0.5rem 0.9rem;
        font-size: 0.9rem;
    }

    .hp-btn-icon {
        width: 1.05em;
        height: 1.05em;
        fill: none;
        stroke: currentColor;
        stroke-width: 2;
        stroke-linecap: round;
        stroke-linejoin: round;
    }

    .hp-btn-primary {
        background: var(--hp-primary);
        color: #04201c;
        box-shadow: 0 6px 24px rgb(94 234 212 / 0.25);

        &:hover {
            background: #99f6e4;
            color: #04201c;
            box-shadow: 0 8px 30px rgb(94 234 212 / 0.35);
        }
    }

    .hp-btn-secondary {
        border-color: var(--hp-primary-dark);
        color: var(--hp-primary);
        background: rgb(13 20 32 / 0.85);

        &:hover {
            border-color: var(--hp-primary);
            color: #99f6e4;
        }
    }

    .hp-btn-ghost {
        color: var(--hp-dim);
        border-color: var(--hp-border);
        background: rgb(13 20 32 / 0.6);

        &:hover {
            color: var(--hp-text);
            border-color: var(--hp-border-hi);
        }
    }

    .hp-eyebrow {
        margin: 0;
        font-size: 0.76rem;
        font-weight: 700;
        letter-spacing: 0.12em;
        text-transform: uppercase;
        color: var(--hp-primary);
    }

    /* --- The handshake card --------------------------------------------- */
    .hp-hs {
        position: relative;
        margin: 0;
        padding: 1.2rem 1.25rem 1rem;
        border-radius: 18px;
        background: linear-gradient(180deg, rgb(17 26 41 / 0.92), rgb(13 20 32 / 0.92));
        border: 1px solid var(--hp-border);
        box-shadow:
            0 30px 80px rgb(0 0 0 / 0.45),
            inset 0 1px 0 rgb(255 255 255 / 0.03);
        isolation: isolate;
    }

    /* A slow light around the card's edge, in the verdict's colour. */
    .hp-hs::before {
        content: '';
        position: absolute;
        inset: -1px;
        z-index: -1;
        border-radius: inherit;
        padding: 1px;
        background: conic-gradient(
            from var(--hp-spin, 0deg),
            transparent 0 70%,
            var(--hp-hs-tone, var(--hp-primary)) 85%,
            transparent 100%
        );
        mask:
            linear-gradient(#000 0 0) content-box,
            linear-gradient(#000 0 0);
        mask-composite: exclude;
        animation: hp-spin 7s linear infinite;
        opacity: 0.8;
    }

    .hp-hs-post-quantum {
        --hp-hs-tone: var(--hp-carry);
    }
    .hp-hs-classical {
        --hp-hs-tone: var(--hp-warn);
    }
    .hp-hs-unmeasured {
        --hp-hs-tone: var(--hp-muted);
    }

    .hp-hs-head {
        display: flex;
        flex-wrap: wrap;
        justify-content: space-between;
        align-items: baseline;
        gap: 0.4rem 1rem;
    }

    .hp-hs-verdict {
        font-weight: 700;
        color: var(--hp-hs-tone, var(--hp-text));
    }

    .hp-hs-svg {
        display: block;
        width: 100%;
        height: auto;
        margin-top: 0.6rem;
        overflow: visible;
    }

    .hp-hs-actor {
        fill: rgb(6 10 18 / 0.85);
        stroke: var(--hp-border-hi);
    }

    .hp-hs-actor-edge {
        stroke: var(--hp-primary-dark);
    }

    .hp-hs-actor-label {
        fill: var(--hp-text);
        font-size: 12.5px;
        font-weight: 600;
        text-anchor: middle;
    }

    .hp-hs-lifeline {
        stroke: var(--hp-border-hi);
        stroke-dasharray: 3 5;
    }

    .hp-hs-label {
        fill: var(--hp-dim);
        font-family: var(--hp-mono);
        font-size: 10.5px;
        text-anchor: middle;
    }

    .hp-hs-label-enc {
        fill: var(--hp-primary);
    }

    .hp-hs-label-app {
        fill: var(--hp-text);
    }

    .hp-hs-line {
        fill: none;
        stroke: var(--hp-classical);
        stroke-width: 1.6;
        stroke-linecap: round;
    }

    .hp-hs-post-quantum .hp-hs-line-pq {
        stroke: var(--hp-carry);
    }

    .hp-hs-line-enc {
        stroke: var(--hp-primary);
        stroke-dasharray: 7 4;
    }

    .hp-hs-line-app {
        stroke: var(--hp-primary);
        stroke-width: 2.2;
    }

    .hp-hs-arrowhead {
        fill: var(--hp-dim);
    }

    .hp-hs-packet {
        fill: var(--hp-classical);
        filter: drop-shadow(0 0 4px rgb(148 163 184 / 0.8));
    }

    .hp-hs-packet-pq {
        fill: var(--hp-carry);
        filter: drop-shadow(0 0 6px rgb(196 181 253 / 0.9));
    }

    .hp-hs-packet-enc,
    .hp-hs-packet-app {
        fill: var(--hp-primary);
        filter: drop-shadow(0 0 6px rgb(94 234 212 / 0.9));
    }

    .hp-hs-facts {
        display: grid;
        gap: 0.45rem;
        margin: 0.8rem 0 0;
        padding-top: 0.8rem;
        border-top: 1px solid var(--hp-border);
        font-size: 0.9rem;

        & > div {
            display: grid;
            grid-template-columns: 11.5em 1fr;
            gap: 0.8rem;
            align-items: baseline;
        }

        & dt {
            color: var(--hp-muted);
        }

        & dd {
            margin: 0;
            color: var(--hp-text);
            display: flex;
            flex-wrap: wrap;
            gap: 0.4rem;
            align-items: baseline;
        }
    }

    .hp-tag {
        display: inline-block;
        padding: 0.05rem 0.5rem;
        border-radius: 999px;
        font-size: 0.72rem;
        font-weight: 700;
        letter-spacing: 0.03em;
        border: 1px solid currentColor;
    }

    .hp-tag-pq {
        color: var(--hp-carry);
        background: rgb(196 181 253 / 0.1);
    }

    .hp-tag-warn {
        color: var(--hp-warn);
        background: rgb(251 191 36 / 0.1);
    }

    /* The ECH outcome in a few words, linking to the whole explanation. */
    .hp-hs-hint {
        flex-basis: 100%;
        font-size: 0.78rem;
        color: var(--hp-muted);
        text-decoration: underline dotted;
        text-underline-offset: 0.2em;

        &:hover {
            color: var(--hp-dim);
        }
    }

    .hp-ech-good {
        color: var(--hp-discover) !important;
    }
    .hp-ech-warn {
        color: var(--hp-warn) !important;
    }
    .hp-ech-muted {
        color: var(--hp-dim) !important;
    }

    .hp-hs-foot {
        display: flex;
        flex-wrap: wrap;
        justify-content: space-between;
        gap: 0.5rem 1rem;
        margin-top: 0.9rem;
        font-size: 0.82rem;
        color: var(--hp-muted);
    }

    .hp-hs-actions {
        display: inline-flex;
        gap: 1rem;
        align-items: center;
    }

    .hp-link-btn {
        padding: 0;
        border: 0;
        background: none;
        color: var(--hp-primary);
        font: inherit;
        cursor: pointer;
        text-decoration: underline;
        text-underline-offset: 0.18em;
    }

    .hp-inline-icon {
        width: 0.95em;
        height: 0.95em;
        vertical-align: -0.12em;
        fill: none;
        stroke: currentColor;
        stroke-width: 2;
        stroke-linecap: round;
        stroke-linejoin: round;
    }

    /* --- Figures -------------------------------------------------------- */
    .hp-proof {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 0.8rem;
    }

    .hp-stat {
        display: flex;
        flex-direction: column;
        gap: 0.2rem;
        padding: 1rem 1.05rem;
        border-radius: var(--hp-radius);
        background: rgb(13 20 32 / 0.88);
        border: 1px solid var(--hp-border);
        text-decoration: none;
        color: var(--hp-text);
        transition:
            border-color 0.2s,
            transform 0.2s var(--hp-ease);

        &:hover {
            color: var(--hp-text);
            border-color: var(--hp-primary-dark);
            transform: translateY(-2px);
        }
    }

    .hp-stat-label {
        font-size: 0.72rem;
        font-weight: 700;
        letter-spacing: 0.08em;
        text-transform: uppercase;
        color: var(--hp-muted);
    }

    .hp-stat-value {
        font-size: 1.85rem;
        font-weight: 760;
        letter-spacing: -0.02em;
        font-variant-numeric: tabular-nums;
        line-height: 1.2;
    }

    .hp-stat-note {
        font-size: 0.84rem;
        color: var(--hp-dim);
    }

    .hp-h2 {
        margin: 0.35rem 0 0;
        font-size: clamp(1.55rem, 3vw, 2.15rem);
        letter-spacing: -0.02em;
        line-height: 1.15;
    }

    .hp-h3 {
        margin: 0.2rem 0 0;
        font-size: 1.2rem;
        line-height: 1.3;
    }

    .hp-section-sub {
        margin: 0.7rem 0 0;
        color: var(--hp-dim);
        font-size: 1.02rem;

        & strong {
            color: var(--hp-text);
        }
    }

    /* --- The federal clock ---------------------------------------------- */
    .hp-mandate {
        padding: clamp(1.4rem, 3vw, 2.2rem);
        border-radius: 20px;
        background: linear-gradient(135deg, rgb(251 191 36 / 0.06), transparent 45%), rgb(13 20 32 / 0.9);
        border: 1px solid rgb(251 191 36 / 0.22);
    }

    .hp-timeline {
        list-style: none;
        margin: 0;
        padding: 0;
        display: grid;
        grid-template-columns: repeat(7, minmax(0, 1fr));
        counter-reset: none;
    }

    .hp-tl-item {
        position: relative;
        display: flex;
        flex-direction: column;
        gap: 0.2rem;
        padding: 1.6rem 0.8rem 0 0;

        /* The track: each item draws the segment to its right. */
        &::before {
            content: '';
            position: absolute;
            top: 0.42rem;
            left: 0;
            right: 0;
            height: 2px;
            background: var(--hp-border-hi);
            transform-origin: left;
        }

        &:last-child::before {
            right: auto;
            width: 40%;
            background: linear-gradient(90deg, var(--hp-border-hi), transparent);
        }
    }

    .hp-tl-past::before {
        background: var(--hp-sign);
        opacity: 0.55;
    }

    .hp-tl-next::before {
        background: linear-gradient(90deg, var(--hp-sign) 0 18%, var(--hp-border-hi) 18%);
    }

    .hp-tl-node {
        position: absolute;
        top: 0;
        left: 0;
        width: 0.95rem;
        height: 0.95rem;
        border-radius: 50%;
        border: 2px solid var(--hp-border-hi);
        background: var(--hp-bg);
    }

    .hp-tl-past .hp-tl-node {
        border-color: var(--hp-sign);
        background: rgb(251 191 36 / 0.55);
    }

    .hp-tl-next .hp-tl-node {
        border-color: var(--hp-sign);
        background: var(--hp-sign);
        box-shadow: 0 0 0 0 rgb(251 191 36 / 0.7);
        animation: hp-beat-amber 2.2s ease-out infinite;
    }

    .hp-tl-now {
        position: absolute;
        top: -0.12rem;
        left: 1.35rem;
        padding: 0.05rem 0.5rem;
        border-radius: 999px;
        font-size: 0.7rem;
        font-weight: 700;
        color: #1a1203;
        background: var(--hp-sign);
    }

    .hp-tl-date {
        font-family: var(--hp-mono);
        font-size: 0.8rem;
        color: var(--hp-muted);
    }

    .hp-tl-past .hp-tl-date {
        color: rgb(251 191 36 / 0.75);
    }

    .hp-tl-next .hp-tl-date {
        color: var(--hp-sign);
    }

    .hp-tl-title {
        font-weight: 650;
        font-size: 0.93rem;
        line-height: 1.3;
    }

    .hp-tl-past .hp-tl-title {
        color: var(--hp-dim);
    }

    .hp-tl-detail {
        font-size: 0.8rem;
        color: var(--hp-muted);
        line-height: 1.4;
    }

    .hp-mandate-cta {
        margin: 1.6rem 0 0;
    }

    /* --- Three layers ----------------------------------------------------- */
    .hp-layers {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 1rem;
    }

    .hp-layer {
        --hp-tone: var(--hp-primary);
        display: flex;
        flex-direction: column;
        padding: 1.4rem 1.3rem 1.2rem;
        border-radius: 18px;
        background: rgb(13 20 32 / 0.9);
        border: 1px solid var(--hp-border);
        border-top: 2px solid var(--hp-tone);
        container-type: inline-size;
    }

    .hp-layer-discover {
        --hp-tone: var(--hp-discover);
    }
    .hp-layer-enforce {
        --hp-tone: var(--hp-enforce);
    }
    .hp-layer-carry {
        --hp-tone: var(--hp-carry);
    }

    .hp-layer-emblem {
        width: 96px;
        height: 96px;
        margin-bottom: 0.6rem;
    }

    .hp-emblem {
        width: 100%;
        height: 100%;
        overflow: visible;
    }

    .hp-layer-name {
        margin: 0;
        font-size: 0.78rem;
        font-weight: 800;
        letter-spacing: 0.14em;
        text-transform: uppercase;
        color: var(--hp-tone);
    }

    .hp-layer-about {
        margin: 0.55rem 0 0.9rem;
        color: var(--hp-dim);
        font-size: 0.94rem;
    }

    .hp-items {
        list-style: none;
        margin: 0;
        padding: 0;
        display: grid;
        gap: 0.35rem;
        flex: 1;
        align-content: start;
    }

    .hp-item {
        display: grid;
        grid-template-columns: 2.2rem 1fr;
        gap: 0.75rem;
        align-items: start;
        padding: 0.65rem 0.7rem;
        border-radius: 12px;
        text-decoration: none;
        color: var(--hp-text);
        border: 1px solid transparent;
        transition:
            background-color 0.15s,
            border-color 0.15s;

        &:hover {
            color: var(--hp-text);
            background: rgb(17 26 41 / 0.9);
            border-color: var(--hp-border);
        }

        &:hover .hp-item-name {
            color: var(--hp-tone, var(--hp-primary));
        }
    }

    .hp-item-icon,
    .hp-tool-icon {
        display: grid;
        place-items: center;
        width: 2.2rem;
        height: 2.2rem;
        border-radius: 10px;
        color: var(--hp-tone, var(--hp-primary));
        background: color-mix(in oklab, var(--hp-tone, var(--hp-primary)) 12%, transparent);
        border: 1px solid color-mix(in oklab, var(--hp-tone, var(--hp-primary)) 28%, transparent);
    }

    .hp-icon {
        width: 1.2rem;
        height: 1.2rem;
        fill: none;
        stroke: currentColor;
        stroke-width: 1.7;
        stroke-linecap: round;
        stroke-linejoin: round;
    }

    .hp-icon-fill {
        fill: currentColor;
        stroke: none;
    }

    .hp-icon-dash {
        stroke-dasharray: 2 2.5;
    }

    .hp-item-body {
        display: flex;
        flex-direction: column;
        gap: 0.15rem;
        min-width: 0;
    }

    .hp-item-name {
        font-weight: 650;
        transition: color 0.15s;
    }

    .hp-item-about {
        color: var(--hp-dim);
        font-size: 0.87rem;
        line-height: 1.5;
    }

    .hp-layer-link {
        margin-top: 0.9rem;
        font-size: 0.9rem;
        font-weight: 600;
        color: var(--hp-tone);
        text-decoration: none;

        &:hover {
            text-decoration: underline;
            color: var(--hp-tone);
        }
    }

    /* The emblems: radar, gate, encapsulation. */
    .hp-em-ring {
        fill: none;
        stroke: rgb(74 222 128 / 0.28);
    }
    .hp-em-axis {
        stroke: rgb(74 222 128 / 0.14);
    }
    .hp-sweep-stop-a {
        stop-color: var(--hp-discover);
        stop-opacity: 0.55;
    }
    .hp-sweep-stop-b {
        stop-color: var(--hp-discover);
        stop-opacity: 0;
    }
    .hp-em-asset {
        fill: var(--hp-discover);
        filter: drop-shadow(0 0 3px rgb(74 222 128 / 0.9));
    }
    .hp-em-wire {
        fill: none;
        stroke: rgb(148 163 184 / 0.25);
        stroke-dasharray: 2 4;
    }
    .hp-layer-enforce .hp-em-wire {
        stroke: rgb(94 234 212 / 0.25);
    }
    .hp-em-shield {
        fill: rgb(94 234 212 / 0.08);
        stroke: var(--hp-enforce);
        stroke-width: 1.8;
        stroke-linejoin: round;
    }
    .hp-em-check {
        fill: none;
        stroke: var(--hp-enforce);
        stroke-width: 2.2;
        stroke-linecap: round;
        stroke-linejoin: round;
    }
    .hp-em-packet {
        filter: drop-shadow(0 0 3px rgb(94 234 212 / 0.7));
    }
    .hp-em-capsule {
        fill: rgb(196 181 253 / 0.06);
        stroke: var(--hp-carry);
        stroke-width: 1.6;
    }
    .hp-em-lattice {
        fill: var(--hp-carry);
    }
    .hp-em-key-head {
        fill: var(--hp-sign);
        filter: drop-shadow(0 0 4px rgb(251 191 36 / 0.8));
    }
    .hp-em-ct {
        fill: var(--hp-carry);
        filter: drop-shadow(0 0 4px rgb(196 181 253 / 0.9));
    }

    /* --- The web today --------------------------------------------------- */
    .hp-web-grid {
        display: grid;
        grid-template-columns: minmax(220px, 300px) 1fr;
        gap: clamp(1.2rem, 4vw, 3rem);
        align-items: center;
        padding: clamp(1.2rem, 3vw, 2rem);
        border-radius: 20px;
        background: rgb(13 20 32 / 0.9);
        border: 1px solid var(--hp-border);
    }

    .hp-web-figure {
        text-align: center;
    }

    .hp-donut {
        width: min(100%, 240px);
        height: auto;
    }

    .hp-donut-track {
        fill: none;
        stroke: var(--hp-border);
        stroke-width: 16;
    }

    .hp-donut-arc {
        fill: none;
        stroke: var(--hp-carry);
        stroke-width: 16;
        stroke-linecap: round;
        filter: drop-shadow(0 0 10px rgb(196 181 253 / 0.45));
    }

    .hp-donut-value {
        fill: var(--hp-text);
        font-size: 40px;
        font-weight: 760;
        text-anchor: middle;
        letter-spacing: -1px;
    }

    .hp-donut-label {
        fill: var(--hp-dim);
        font-size: 13px;
        text-anchor: middle;
    }

    .hp-web-caption {
        margin: 0.6rem auto 0;
        max-width: 30ch;
        font-size: 0.86rem;
        color: var(--hp-muted);
    }

    .hp-ladder {
        list-style: none;
        margin: 0;
        padding: 0;
        display: grid;
        gap: 0.85rem;
    }

    .hp-rung {
        display: grid;
        grid-template-columns: minmax(0, 15rem) minmax(0, 1fr) 6.5rem;
        gap: 0.9rem;
        align-items: center;
        font-size: 0.92rem;
    }

    .hp-rung-label {
        color: var(--hp-dim);
    }

    .hp-rung-bar {
        width: 100%;
        height: 10px;
        border-radius: 999px;
        overflow: hidden;
    }

    .hp-rung-track {
        fill: var(--hp-border);
    }

    .hp-rung-fill {
        fill: var(--hp-primary);
        transform-box: fill-box;
        transform-origin: left center;
    }

    .hp-rung-fill-0 {
        fill: #64748b;
    }
    .hp-rung-fill-1 {
        fill: #7dd3fc;
    }
    .hp-rung-fill-2,
    .hp-rung-fill-3 {
        fill: var(--hp-carry);
    }
    .hp-rung-fill-4 {
        fill: var(--hp-primary);
    }
    .hp-rung-fill-5 {
        fill: var(--hp-discover);
    }

    .hp-rung-n {
        text-align: right;
        font-variant-numeric: tabular-nums;
        font-weight: 650;
    }

    .hp-rung-pct {
        color: var(--hp-muted);
        font-weight: 500;
        margin-left: 0.25rem;
    }

    .hp-grade {
        display: inline-block;
        min-width: 1.9em;
        padding: 0 0.35rem;
        border-radius: 6px;
        font-size: 0.75rem;
        font-weight: 800;
        text-align: center;
        border: 1px solid currentColor;
    }

    .hp-grade-b {
        color: #7dd3fc;
    }
    .hp-grade-a {
        color: var(--hp-primary);
    }
    .hp-grade-ap {
        color: var(--hp-discover);
    }

    .hp-web-foot {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        justify-content: space-between;
        gap: 0.8rem;
        margin: 1rem 0 0;
        font-size: 0.86rem;
        color: var(--hp-muted);

        & p {
            margin: 0;
        }
    }

    /* --- QUIC & HTTP/3 ------------------------------------------------------ */
    .hp-h3-grid {
        display: grid;
        grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
        gap: 1rem;
        margin-bottom: 1rem;
    }

    .hp-h3-streams {
        margin: 0;
        display: flex;
        flex-direction: column;
        gap: 0.7rem;
    }

    .hp-st-svg {
        width: 100%;
        height: auto;
        overflow: visible;
    }

    .hp-st-pipe {
        fill: rgb(6 10 18 / 0.7);
        stroke: var(--hp-border-hi);
    }

    .hp-st-recv {
        stroke: var(--hp-dim);
        stroke-width: 2;
        stroke-linecap: round;
    }

    .hp-st-label {
        fill: var(--hp-text);
        font-size: 12.5px;
        font-weight: 650;
    }

    .hp-st-sub,
    .hp-st-note {
        fill: var(--hp-muted);
        font-size: 10.5px;
    }

    .hp-st-note {
        font-style: italic;
    }

    .hp-st-pk {
        stroke: rgb(6 10 18 / 0.8);
        stroke-width: 1;
    }

    .hp-st-a {
        fill: var(--hp-enforce);
    }
    .hp-st-b {
        fill: var(--hp-carry);
    }
    .hp-st-c {
        fill: var(--hp-sign);
    }

    /* The retransmission: the same packet, sent again */
    .hp-st-retx {
        stroke: var(--hp-text);
        stroke-width: 1.4;
        stroke-dasharray: 2 2;
    }

    .hp-st-gap path {
        stroke: var(--hp-bad);
        stroke-width: 2.2;
        stroke-linecap: round;
    }

    .hp-st-you rect {
        fill: rgb(94 234 212 / 0.12);
        stroke: var(--hp-primary-dark);
    }

    .hp-st-you text {
        fill: var(--hp-primary);
        font-size: 10px;
        font-weight: 700;
        text-anchor: middle;
    }

    .hp-h3-web {
        display: flex;
        flex-direction: column;
        gap: 0.8rem;
    }

    .hp-h3-big {
        margin: 0;
        color: var(--hp-dim);
    }

    .hp-h3-big-n {
        display: block;
        font-size: 2.6rem;
        font-weight: 760;
        letter-spacing: -0.02em;
        line-height: 1.1;
        color: var(--hp-text);
    }

    .hp-ladder-sm {
        gap: 0.55rem;

        & .hp-rung {
            grid-template-columns: minmax(0, 13rem) minmax(0, 1fr) 5.2rem;
            font-size: 0.86rem;
        }
    }

    .hp-h3-fill {
        fill: var(--hp-enforce);
    }

    .hp-h3-conf {
        display: flex;
        flex-direction: column;
        gap: 0.8rem;
        margin-bottom: 1rem;
    }

    .hp-conf-rows {
        list-style: none;
        margin: 0;
        padding: 0;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.5rem 2rem;
    }

    .hp-conf-row {
        display: grid;
        grid-template-columns: 9.5rem minmax(0, 1fr) 3.6rem;
        gap: 0.8rem;
        align-items: center;
        font-size: 0.9rem;
    }

    .hp-conf-name {
        font-family: var(--hp-mono);
        font-size: 0.86rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .hp-conf-lang {
        color: var(--hp-muted);
        font-family: inherit;
        font-size: 0.78rem;
    }

    .hp-conf-bar {
        width: 100%;
        height: 10px;
        border-radius: 999px;
        overflow: hidden;
        background: var(--hp-border);
    }

    .hp-conf-n {
        text-align: right;
        font-weight: 650;
        font-variant-numeric: tabular-nums;
    }

    .hp-conf-of {
        color: var(--hp-muted);
        font-weight: 500;
    }

    .hp-conf-pass {
        fill: var(--hp-enforce);
        background: var(--hp-enforce);
    }
    .hp-conf-fail {
        fill: var(--hp-bad);
        background: var(--hp-bad);
    }
    .hp-conf-unsupported {
        fill: #64748b;
        background: #64748b;
    }
    .hp-conf-inconclusive {
        fill: var(--hp-sign);
        background: var(--hp-sign);
    }

    .hp-conf-legend {
        margin: 0;
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 0.35rem 0.5rem;
        font-size: 0.8rem;
        color: var(--hp-muted);
    }

    .hp-key {
        display: inline-block;
        width: 0.8rem;
        height: 0.5rem;
        border-radius: 2px;
        margin-left: 0.4rem;
    }

    .hp-tools-h3 {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    }

    /* --- Live --------------------------------------------------------------- */
    .hp-live-grid {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 1rem;
    }

    .hp-card {
        position: relative;
        padding: 1.2rem 1.25rem;
        border-radius: 18px;
        background: rgb(13 20 32 / 0.9);
        border: 1px solid var(--hp-border);
        color: var(--hp-text);
    }

    a.hp-card {
        text-decoration: none;
        transition:
            border-color 0.2s,
            transform 0.2s var(--hp-ease);

        &:hover {
            color: var(--hp-text);
            border-color: var(--hp-primary-dark);
            transform: translateY(-2px);
        }
    }

    .hp-live-card {
        display: flex;
        flex-direction: column;
        gap: 0.8rem;
    }

    .hp-card-label {
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 0.5rem;
        font-size: 0.74rem;
        font-weight: 700;
        letter-spacing: 0.1em;
        text-transform: uppercase;
        color: var(--hp-muted);
    }

    .hp-live-note {
        font-size: 0.85rem;
        color: var(--hp-dim);
        line-height: 1.5;
    }

    .hp-gauge {
        width: 170px;
        height: 170px;
        align-self: center;
    }

    .hp-gauge-track {
        fill: none;
        stroke: var(--hp-border);
        stroke-width: 12;
    }

    .hp-gauge-arc {
        fill: none;
        stroke: var(--hp-discover);
        stroke-width: 12;
        stroke-linecap: round;
        filter: drop-shadow(0 0 8px rgb(74 222 128 / 0.45));
    }

    .hp-gauge-value {
        fill: var(--hp-text);
        font-size: 32px;
        font-weight: 760;
        text-anchor: middle;
        font-variant-numeric: tabular-nums;
    }

    .hp-gauge-label {
        fill: var(--hp-dim);
        font-size: 12px;
        text-anchor: middle;
    }

    .hp-live-dot {
        display: inline-flex;
        align-items: center;
        gap: 0.35rem;
        font-size: 0.7rem;
        letter-spacing: 0.04em;
        text-transform: none;
        color: var(--hp-muted);

        &::before {
            content: '';
            width: 7px;
            height: 7px;
            border-radius: 50%;
            background: var(--hp-muted);
        }

        &.is-live {
            color: var(--hp-sign);
        }

        &.is-live::before {
            background: var(--hp-sign);
            animation: hp-beat-amber 2.2s ease-out infinite;
        }
    }

    .hp-ledger-svg {
        width: 100%;
        max-width: 260px;
        height: auto;
        align-self: center;
        overflow: visible;
    }

    .hp-ledger-link {
        stroke: rgb(251 191 36 / 0.16);
        stroke-width: 1.2;
        transition:
            stroke 0.4s,
            stroke-width 0.4s;

        &.is-signing {
            stroke: rgb(251 191 36 / 0.85);
            stroke-width: 2;
        }
    }

    .hp-ledger-halo {
        fill: rgb(251 191 36 / 0.06);
        stroke: rgb(251 191 36 / 0.18);
        transform-box: fill-box;
        transform-origin: center;
    }

    .hp-ledger-box {
        fill: rgb(6 10 18 / 0.9);
        stroke: var(--hp-sign);
        stroke-width: 1.5;
    }

    .hp-ledger-node.is-signer .hp-ledger-box {
        fill: rgb(251 191 36 / 0.35);
    }

    .hp-ledger-node.is-proposer .hp-ledger-box {
        fill: var(--hp-sign);
    }

    .hp-ledger-node.is-proposer .hp-ledger-halo {
        animation: hp-halo 1.4s var(--hp-ease);
    }

    .hp-ledger-name {
        fill: var(--hp-dim);
        font-family: var(--hp-mono);
        font-size: 10.5px;
        text-anchor: middle;
    }

    .hp-ledger-height {
        fill: var(--hp-text);
        font-size: 24px;
        font-weight: 760;
        text-anchor: middle;
        font-variant-numeric: tabular-nums;
    }

    .hp-ledger-height.is-new {
        animation: hp-tick 0.9s var(--hp-ease);
    }

    .hp-ledger-sub {
        fill: var(--hp-muted);
        font-size: 10.5px;
        text-anchor: middle;
    }

    .hp-engine-map {
        display: grid;
        gap: 0.55rem;
    }

    .hp-engine-family {
        --hp-fam: var(--hp-primary);
        display: grid;
        grid-template-columns: 9.5rem 1fr;
        gap: 0.6rem;
        align-items: center;
    }

    .hp-fam-0 {
        --hp-fam: #5eead4;
    }
    .hp-fam-1 {
        --hp-fam: #c4b5fd;
    }
    .hp-fam-2 {
        --hp-fam: #fbbf24;
    }
    .hp-fam-3 {
        --hp-fam: #f472b6;
    }
    .hp-fam-4 {
        --hp-fam: #7dd3fc;
    }
    .hp-fam-5 {
        --hp-fam: #4ade80;
    }
    .hp-fam-6 {
        --hp-fam: #fb923c;
    }
    .hp-fam-7 {
        --hp-fam: #94a3b8;
    }

    .hp-engine-family-name {
        font-size: 0.78rem;
        color: var(--hp-dim);
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .hp-engine-dots {
        display: flex;
        flex-wrap: wrap;
        gap: 0.32rem;
    }

    .hp-engine {
        position: relative;
        width: 0.95rem;
        height: 0.95rem;
        border-radius: 4px;
        background: color-mix(in oklab, var(--hp-fam) 30%, transparent);
        border: 1px solid var(--hp-fam);
        transition:
            transform 0.15s var(--hp-ease),
            background-color 0.15s;

        &:hover,
        &:focus-visible {
            transform: scale(1.35);
            background: var(--hp-fam);
        }
    }

    /* --- Tools ------------------------------------------------------------ */
    .hp-tools {
        list-style: none;
        margin: 0;
        padding: 0;
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 0.8rem;
    }

    .hp-tool {
        display: grid;
        grid-template-columns: 2.2rem 1fr;
        grid-template-rows: auto 1fr;
        column-gap: 0.8rem;
        row-gap: 0.2rem;
        height: 100%;
        padding: 1rem;
        border-radius: var(--hp-radius);
        background: rgb(13 20 32 / 0.9);
        border: 1px solid var(--hp-border);
        text-decoration: none;
        color: var(--hp-text);
        transition:
            border-color 0.2s,
            transform 0.2s var(--hp-ease),
            background-color 0.2s;

        &:hover {
            color: var(--hp-text);
            border-color: var(--hp-primary-dark);
            background: rgb(17 26 41 / 0.95);
            transform: translateY(-2px);
        }
    }

    .hp-tool-icon {
        grid-row: span 2;
    }

    .hp-tool-name {
        font-weight: 650;
        align-self: center;
    }

    .hp-tool-about {
        grid-column: 2;
        font-size: 0.86rem;
        color: var(--hp-dim);
        line-height: 1.5;
    }

    /* --- Open source ------------------------------------------------------ */
    .hp-oss-grid {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 1rem;
    }

    .hp-repo {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
        transition: border-color 0.2s;

        &:has(.hp-repo-head:hover) {
            border-color: var(--hp-primary-dark);
        }

        & p {
            margin: 0;
        }
    }

    /* The heading's link covers the card; the meta links sit above it. */
    .hp-repo-head {
        display: inline-flex;
        align-items: center;
        gap: 0.5rem;
        font-family: var(--hp-mono);
        font-size: 0.9rem;
        font-weight: 600;
        color: var(--hp-text);
        text-decoration: none;
        overflow-wrap: anywhere;

        &::after {
            content: '';
            position: absolute;
            inset: 0;
            border-radius: inherit;
        }

        & .hp-icon {
            flex: none;
            color: var(--hp-primary);
        }
    }

    .hp-repo-about {
        color: var(--hp-dim);
        font-size: 0.88rem;
        flex: 1;
    }

    .hp-repo-meta {
        position: relative;
        font-size: 0.8rem;
        color: var(--hp-muted);
    }

    .hp-lang::before {
        content: '';
        display: inline-block;
        width: 0.65em;
        height: 0.65em;
        margin-right: 0.35em;
        border-radius: 50%;
        background: #dea584;
        vertical-align: 0;
    }

    /* --- Research ------------------------------------------------------- */
    .hp-papers {
        list-style: none;
        margin: 0;
        padding: 0;
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
        gap: 0.2rem 1.5rem;
    }

    .hp-paper {
        display: flex;
        flex-direction: column;
        gap: 0.15rem;
        padding: 0.9rem 0.2rem;
        border-bottom: 1px solid var(--hp-border);
        text-decoration: none;
        color: var(--hp-text);

        &:hover {
            color: var(--hp-text);
        }

        &:hover .hp-paper-title {
            color: var(--hp-primary);
        }
    }

    .hp-paper-title {
        font-weight: 650;
        transition: color 0.15s;
    }

    .hp-paper-about {
        font-size: 0.87rem;
        color: var(--hp-dim);
    }

    /* --- Document security ------------------------------------------------ */
    .hp-docsec {
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        gap: clamp(1.2rem, 4vw, 3rem);
        align-items: center;
        padding: clamp(1.4rem, 3vw, 2.2rem);
        border-radius: 20px;
        background: linear-gradient(135deg, rgb(251 191 36 / 0.05), transparent 50%), rgb(13 20 32 / 0.9);
        border: 1px solid var(--hp-border);
        --hp-tone: var(--hp-sign);
    }

    .hp-docsec-links {
        display: flex;
        flex-wrap: wrap;
        gap: 0.6rem;
        margin: 1.2rem 0 0;
    }

    .hp-doc-tools {
        list-style: none;
        margin: 0;
        padding: 0;
        display: grid;
        gap: 0.35rem;
    }

    /* --- Questions --------------------------------------------------------- */
    .hp-faq-list {
        display: grid;
        gap: 0.6rem;
        max-width: 880px;
    }

    .hp-faq-item {
        border-radius: 12px;
        background: rgb(13 20 32 / 0.9);
        border: 1px solid var(--hp-border);
        interpolate-size: allow-keywords;

        & summary {
            cursor: pointer;
            padding: 0.95rem 1.1rem;
            font-weight: 650;
            list-style: none;
            display: flex;
            justify-content: space-between;
            gap: 1rem;
        }

        & summary::-webkit-details-marker {
            display: none;
        }

        & summary::after {
            content: '+';
            color: var(--hp-primary);
            font-weight: 400;
            font-size: 1.2rem;
            line-height: 1;
            transition: transform 0.25s var(--hp-ease);
        }

        &[open] summary::after {
            transform: rotate(45deg);
        }

        &::details-content {
            block-size: 0;
            overflow: clip;
            transition:
                block-size 0.3s var(--hp-ease),
                content-visibility 0.3s allow-discrete;
        }

        &[open]::details-content {
            block-size: auto;
        }

        & p {
            margin: 0;
            padding: 0 1.1rem 1.1rem;
            color: var(--hp-dim);
        }
    }

    /* --- Footer ------------------------------------------------------------- */
    .hp-footer {
        margin-top: 2rem;
        border-top: 1px solid var(--hp-border);
        background: rgb(6 10 18 / 0.88);
        backdrop-filter: blur(6px);
    }

    .hp-footer-inner {
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(0, 2.4fr);
        gap: 2rem;
        padding-block: 2.6rem 1.6rem;
    }

    .hp-footer-brand {
        display: flex;
        gap: 0.8rem;
        align-items: flex-start;

        & p {
            margin: 0;
            font-weight: 700;
        }

        & span {
            font-weight: 400;
            font-size: 0.86rem;
            color: var(--hp-muted);
        }
    }

    .hp-footer-logo {
        border-radius: 10px;
    }

    .hp-footer-cols {
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 1.5rem;

        & ul {
            list-style: none;
            margin: 0;
            padding: 0;
            display: grid;
            gap: 0.45rem;
        }

        & a {
            color: var(--hp-dim);
            text-decoration: none;
            font-size: 0.88rem;
        }

        & a:hover {
            color: var(--hp-primary);
        }
    }

    .hp-footer-h {
        margin: 0 0 0.7rem;
        font-size: 0.74rem;
        font-weight: 700;
        letter-spacing: 0.1em;
        text-transform: uppercase;
        color: var(--hp-muted);
    }

    .hp-footer-base {
        display: flex;
        flex-wrap: wrap;
        justify-content: space-between;
        gap: 0.5rem 1rem;
        padding-block: 1rem 2rem;
        border-top: 1px solid var(--hp-border);
        font-size: 0.82rem;
        color: var(--hp-muted);

        & p {
            margin: 0;
        }

        & a {
            color: var(--hp-dim);
        }
    }

    /* --- Corner control (js/home-bg.js) ----------------------------------- */
    .hp-motion-toggle {
        position: fixed;
        right: 14px;
        bottom: 14px;
        z-index: 5;
        padding: 6px 12px;
        font: inherit;
        font-size: 0.78rem;
        color: var(--hp-dim);
        background: rgb(13 20 32 / 0.92);
        border: 1px solid var(--hp-border);
        border-radius: 999px;
        cursor: pointer;

        &:hover {
            color: var(--hp-primary);
            border-color: var(--hp-primary-dark);
        }
    }

    /* --- Cursor (js/home-cursor.js) --------------------------------------- */
    /* Nothing applies until the script sets .hp-cursor-on: if it fails to
       load, the native pointer stays. */
    .hp-cursor-on,
    .hp-cursor-on a,
    .hp-cursor-on button,
    .hp-cursor-on summary,
    .hp-cursor-on code,
    .hp-cursor-on input,
    .hp-cursor-on select,
    .hp-cursor-on textarea {
        cursor: none;
    }

    .hp-cursor-layer {
        position: fixed;
        inset: 0;
        width: 100vw;
        height: 100vh;
        z-index: 9999;
        pointer-events: none;
        overflow: visible;
    }

    .hp-cursor-curve {
        fill: rgb(6 10 18 / 0.5);
        stroke: var(--hp-primary);
        stroke-width: 1.6;
        transition: stroke 0.15s;
    }

    .hp-cursor-lattice {
        fill: var(--hp-carry);
        transition: fill 0.15s;
    }

    .hp-cursor-head {
        filter: drop-shadow(0 0 4px rgb(94 234 212 / 0.55));
    }

    .hp-cursor-grid {
        transition: transform 0.2s var(--hp-ease);
    }

    /* Over something actionable the two halves agree: the lattice turns into
       the ring and both take the post-quantum colour. */
    .hp-cursor-agreed {
        filter: drop-shadow(0 0 7px rgb(196 181 253 / 0.85));

        & .hp-cursor-curve {
            stroke: var(--hp-carry);
            fill: rgb(196 181 253 / 0.22);
        }

        & .hp-cursor-lattice {
            fill: #f1f5f9;
        }

        & .hp-cursor-grid {
            transform: rotate(45deg) scale(0.8);
        }
    }

    .hp-cursor-chain {
        fill: none;
        stroke: rgb(94 234 212 / 0.4);
        stroke-width: 1.2;
    }

    .hp-cursor-node {
        stroke-width: 1.2;
    }
    .hp-cursor-node-discover {
        fill: rgb(74 222 128 / 0.7);
        stroke: var(--hp-discover);
    }
    .hp-cursor-node-enforce {
        fill: rgb(94 234 212 / 0.65);
        stroke: var(--hp-enforce);
    }
    .hp-cursor-node-carry {
        fill: rgb(196 181 253 / 0.75);
        stroke: var(--hp-carry);
    }

    .hp-cursor-ring {
        fill: none;
        stroke: var(--hp-primary);
        stroke-width: 1.4;
    }

    .hp-cursor-ring-pq {
        stroke: var(--hp-carry);
    }

    /* --- Narrow screens -------------------------------------------------- */
    @media (max-width: 1080px) {
        .hp-hero {
            grid-template-columns: 1fr;
        }

        .hp-layers,
        .hp-live-grid,
        .hp-oss-grid,
        .hp-h3-grid,
        .hp-conf-rows {
            grid-template-columns: 1fr;
        }

        .hp-layers {
            max-width: 720px;
        }

        .hp-timeline {
            grid-template-columns: 1fr;
            gap: 0;
        }

        .hp-tl-item {
            padding: 0 0 1.2rem 1.8rem;

            &::before {
                top: 0.95rem;
                bottom: 0;
                left: 0.43rem;
                right: auto;
                width: 2px;
                height: auto;
            }

            &:last-child::before {
                width: 2px;
                height: 40%;
                background: linear-gradient(180deg, var(--hp-border-hi), transparent);
            }
        }

        .hp-tl-next::before {
            background: linear-gradient(180deg, var(--hp-sign) 0 18%, var(--hp-border-hi) 18%);
        }

        .hp-tl-now {
            position: static;
            align-self: flex-start;
            margin-bottom: 0.2rem;
        }

        .hp-web-grid,
        .hp-docsec,
        .hp-footer-inner {
            grid-template-columns: 1fr;
        }

        .hp-nav {
            order: 3;
            width: 100%;
        }
    }

    @media (max-width: 640px) {
        .hp-header {
            padding-top: 4.6rem;
        }

        .hp-header-inner {
            padding-right: 20px;
        }

        .hp-logo {
            width: 46px;
            height: 46px;
        }

        .hp-nav {
            overflow-x: auto;
            flex-wrap: nowrap;
            scrollbar-width: none;
        }

        .hp-hs {
            padding-inline: 0.9rem;
        }

        /* The diagrams scale down with their cards: their text scales back up. */
        .hp-hs-label {
            font-size: 13px;
        }

        .hp-st-label {
            font-size: 19px;
        }

        .hp-st-sub {
            display: none;
        }

        .hp-st-note {
            font-size: 16px;
        }

        .hp-st-you text {
            font-size: 16px;
        }

        .hp-hs-actor-label {
            font-size: 15px;
        }

        .hp-hs-facts > div {
            grid-template-columns: 1fr;
            gap: 0.1rem;
        }

        .hp-rung {
            grid-template-columns: 1fr auto;
            gap: 0.3rem 0.8rem;
        }

        .hp-rung-bar {
            grid-column: 1 / -1;
            grid-row: 2;
        }

        .hp-engine-family {
            grid-template-columns: 1fr;
            gap: 0.25rem;
        }

        .hp-ladder-sm .hp-rung,
        .hp-conf-row {
            grid-template-columns: 1fr auto;
            gap: 0.3rem 0.8rem;
        }

        .hp-ladder-sm .hp-rung-bar,
        .hp-conf-bar {
            grid-column: 1 / -1;
            grid-row: 2;
        }

        .hp-footer-cols {
            grid-template-columns: repeat(2, minmax(0, 1fr));
        }

        .hp-cta-row .hp-btn {
            flex: 1 1 100%;
            justify-content: center;
        }
    }
}

@layer motion {
    @property --hp-spin {
        syntax: '<angle>';
        inherits: false;
        initial-value: 0deg;
    }

    @keyframes hp-spin {
        to {
            --hp-spin: 360deg;
        }
    }

    @keyframes hp-beat {
        0% {
            box-shadow: 0 0 0 0 color-mix(in oklab, currentColor 70%, transparent);
        }
        70%,
        100% {
            box-shadow: 0 0 0 8px transparent;
        }
    }

    @keyframes hp-beat-amber {
        0% {
            box-shadow: 0 0 0 0 rgb(251 191 36 / 0.7);
        }
        70%,
        100% {
            box-shadow: 0 0 0 9px rgb(251 191 36 / 0);
        }
    }

    @keyframes hp-draw {
        from {
            stroke-dashoffset: var(--hp-len, 280);
        }
        to {
            stroke-dashoffset: 0;
        }
    }

    @keyframes hp-fade-in {
        from {
            opacity: 0;
            transform: translateY(4px);
        }
        to {
            opacity: 1;
            transform: none;
        }
    }

    @keyframes hp-grow {
        from {
            transform: scaleX(0);
        }
        to {
            transform: scaleX(1);
        }
    }

    @keyframes hp-rise {
        from {
            opacity: 0;
            translate: 0 18px;
        }
        to {
            opacity: 1;
            translate: 0 0;
        }
    }

    @keyframes hp-halo {
        0% {
            scale: 1;
            opacity: 1;
        }
        100% {
            scale: 2.2;
            opacity: 0;
        }
    }

    @keyframes hp-tick {
        0% {
            fill: var(--hp-sign);
        }
        100% {
            fill: var(--hp-text);
        }
    }

    /* The handshake, message by message, timed with the packets' SMIL. */
    @keyframes hp-appear {
        from {
            opacity: 0;
        }
        to {
            opacity: 1;
        }
    }

    /* Drawn, with its arrowhead hidden until the line sets off. */
    .hp-hs-msg .hp-hs-line {
        stroke-dasharray: 280;
        animation:
            hp-draw 0.7s var(--hp-ease) both,
            hp-appear 0.15s linear both;
    }

    /* The encrypted messages keep their dash pattern (it is the encryption)
       and fade in rather than draw. */
    .hp-hs-msg .hp-hs-line-enc {
        stroke-dasharray: 7 4;
        animation: hp-appear 0.7s var(--hp-ease) both;
    }

    .hp-hs-msg .hp-hs-label {
        animation: hp-fade-in 0.5s var(--hp-ease) both;
    }

    .hp-hs-m1 > * {
        animation-delay: 0.3s;
    }
    .hp-hs-m2 > * {
        animation-delay: 1.1s;
    }
    .hp-hs-m3 > * {
        animation-delay: 1.9s;
    }
    .hp-hs-m4 > * {
        animation-delay: 2.7s;
    }
    .hp-hs-m5 > * {
        animation-delay: 3.5s;
    }

    /* Sections rise into place as they scroll in, where the browser can tie an
       animation to scrolling; elsewhere they are simply there. */
    @supports (animation-timeline: view()) {
        .hp-section > *,
        .hp-layer,
        .hp-tool,
        .hp-stat {
            animation: hp-rise linear both;
            animation-timeline: view();
            animation-range: entry 0% entry 40%;
        }

        .hp-rung-fill {
            animation: hp-grow linear both;
            animation-timeline: view();
            animation-range: entry 10% cover 40%;
        }

        .hp-donut-arc,
        .hp-gauge-arc {
            animation: hp-fade-in linear both;
            animation-timeline: view();
            animation-range: entry 0% entry 60%;
        }
    }

    /* Paused: every figure in its final state, nothing moving. */
    html.hp-still {
        & *,
        & *::before,
        & *::after {
            animation: none !important;
            transition: none !important;
        }

        & .hp-hs-msg .hp-hs-line {
            stroke-dashoffset: 0;
        }

        & .hp-hs-msg .hp-hs-line-enc {
            stroke-dasharray: 7 4;
        }
    }
}

/* Colour words: last, so a component's own colour never overrides them. */
@layer utilities {
    .hp-c-discover {
        color: var(--hp-discover);
    }
    .hp-c-enforce {
        color: var(--hp-enforce);
    }
    .hp-c-carry {
        color: var(--hp-carry);
    }
    .hp-c-sign {
        color: var(--hp-sign);
    }
}
