/* =============================================================================
   Security systems

   The layers between a request and the platform, each with its own colour
   along a spectrum from the edge inwards: intelligence violet, TLS cyan, the
   firewall red, rate limits amber, bots orange, human verification green, the
   federated model blue. Signal green is what passes; rose is what was
   stopped. Every number on the page comes from a source read when it was
   built (includes/security-facts.php).
   ========================================================================== */

:root {
    --ss-bg: #05070b;
    --ss-card: rgba(12, 16, 24, 0.88);
    --ss-card-2: rgba(7, 10, 15, 0.7);
    --ss-border: #1b2636;
    --ss-border-2: #2a3a52;
    --ss-text: #eef4fb;
    --ss-dim: #a2b2c6;
    --ss-muted: #67798f;
    --ss-pass: #00e58a;
    --ss-stop: #ff3d6e;
    --ss-accent: #00ccff;
    --ss-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    /* The layers */
    --ss-intel: #a78bfa;
    --ss-tls: #22d3ee;
    --ss-waf: #ff4d6d;
    --ss-limits: #fbbf24;
    --ss-bots: #fb923c;
    --ss-human: #34d399;
    --ss-federated: #60a5fa;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--ss-bg);
    color: var(--ss-text);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--ss-accent);
    text-underline-offset: 2px;
}
a:hover {
    color: #b3f0ff;
}

code {
    font-family: var(--ss-mono);
    font-size: 0.86em;
    color: #d8e6f5;
    background: rgba(148, 163, 184, 0.1);
    border: 1px solid rgba(148, 163, 184, 0.14);
    border-radius: 5px;
    padding: 0.05em 0.35em;
    overflow-wrap: anywhere;
    -webkit-box-decoration-break: clone;
    box-decoration-break: clone;
}

/* Each layer's colour, for its gate, its section and its bars */
.ss-g-intel,
.ss-c-intel {
    --c: var(--ss-intel);
}
.ss-g-tls,
.ss-c-tls {
    --c: var(--ss-tls);
}
.ss-g-waf,
.ss-c-waf {
    --c: var(--ss-waf);
}
.ss-g-limits,
.ss-c-limits {
    --c: var(--ss-limits);
}
.ss-g-bots,
.ss-c-bots {
    --c: var(--ss-bots);
}
.ss-g-human,
.ss-c-human {
    --c: var(--ss-human);
}
.ss-g-federated {
    --c: var(--ss-federated);
}
.ss-c-hit {
    --c: var(--ss-stop);
}

/* --- Background ------------------------------------------------------------ */
.ss-bg-container {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
}
.ss-bg-canvas {
    display: block;
    width: 100%;
    height: 100%;
}
.ss-motion-toggle {
    position: fixed;
    right: 14px;
    bottom: 14px;
    z-index: 5;
    padding: 6px 12px;
    font: inherit;
    font-size: 0.78rem;
    color: var(--ss-dim);
    background: rgba(12, 16, 24, 0.94);
    border: 1px solid var(--ss-border);
    border-radius: 999px;
    cursor: pointer;
}
.ss-motion-toggle:hover {
    color: var(--ss-pass);
    border-color: var(--ss-pass);
}
.ss-motion-toggle:focus-visible,
.ss-gate a:focus-visible,
.ss-play:focus-visible {
    outline: 2px solid var(--ss-accent);
    outline-offset: 2px;
}

/* --- Header ---------------------------------------------------------------- */
.ss-header {
    position: relative;
    z-index: 1;
    padding-block: 3rem 1.4rem;
}
.ss-header-inner,
.ss-wrap {
    max-width: 1140px;
    margin: 0 auto;
    padding-inline: 20px;
}
.ss-header-inner {
    display: flex;
    gap: 20px;
    align-items: center;
}
.ss-logo {
    display: block;
    width: 68px;
    height: 68px;
    border-radius: 16px;
    border: 1px solid var(--ss-border-2);
    box-shadow:
        0 0 0 4px rgba(0, 229, 138, 0.08),
        0 12px 32px -12px rgba(0, 229, 138, 0.45);
}
.ss-eyebrow {
    margin: 0 0 0.3rem;
    font-size: 0.78rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--ss-pass);
}
.ss-live::before {
    content: '';
    display: inline-block;
    width: 7px;
    height: 7px;
    margin: 0 6px 1px 0;
    border-radius: 50%;
    background: var(--ss-pass);
    animation: ss-pulse 2.4s ease-out infinite;
}
@keyframes ss-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(0, 229, 138, 0.55);
    }
    70%,
    100% {
        box-shadow: 0 0 0 8px rgba(0, 229, 138, 0);
    }
}
.ss-title {
    margin: 0;
    font-size: clamp(2rem, 4.4vw, 3.2rem);
    line-height: 1.05;
    letter-spacing: -0.025em;
    background: linear-gradient(100deg, #fff 0%, #b3f0ff 40%, var(--ss-pass) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.ss-subtitle {
    margin: 0.55rem 0 0;
    color: var(--ss-dim);
    max-width: 70ch;
    font-size: 1.04rem;
}

/* --- Layout ---------------------------------------------------------------- */
.ss-wrap {
    position: relative;
    z-index: 1;
    padding-bottom: 3rem;
}
.ss-wrap p {
    max-width: 82ch;
}
h2 {
    font-size: 1.6rem;
    line-height: 1.25;
    letter-spacing: -0.01em;
    margin: 0 0 0.6rem;
}
h3 {
    font-size: 0.82rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--ss-muted);
    margin: 1.2rem 0 0.5rem;
}
.ss-small {
    font-size: 0.86rem;
    color: var(--ss-dim);
}
.ss-source {
    color: var(--ss-muted);
    font-size: 0.82rem;
    margin: 12px 0 0;
}

/* --- Summary: figures and the path ------------------------------------------ */
.ss-summary {
    background: linear-gradient(180deg, rgba(16, 24, 38, 0.94), rgba(10, 14, 22, 0.9));
    border: 1px solid var(--ss-border-2);
    border-radius: 18px;
    padding: 22px;
    margin-bottom: 2.6rem;
    box-shadow: 0 30px 60px -40px rgba(0, 0, 0, 0.9);
}
.ss-tiles {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 10px;
}
.ss-figs {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 10px;
    margin: 1rem 0 0.4rem;
}
.ss-fig {
    position: relative;
    display: flex;
    flex-direction: column;
    padding: 12px 14px;
    background: var(--ss-card-2);
    border: 1px solid var(--ss-border);
    border-radius: 12px;
    overflow: hidden;
}
.ss-fig::before {
    content: '';
    position: absolute;
    inset: 0 0 auto;
    height: 2px;
    background: var(--c, var(--ss-pass));
    opacity: 0.85;
}
.ss-fig-n {
    font-size: 1.9rem;
    font-weight: 750;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.02em;
    line-height: 1.1;
}
.ss-fig-l {
    font-size: 0.84rem;
    color: var(--ss-text);
    line-height: 1.35;
    margin-top: 3px;
}
.ss-fig-d {
    font-size: 0.74rem;
    color: var(--ss-muted);
    line-height: 1.35;
    margin-top: 2px;
}

/* The path: seven gates, a request crossing them left to right */
.ss-path {
    margin: 20px 0 0;
}
.ss-gates {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 6px;
    counter-reset: ss-gate;
}
.ss-gate {
    position: relative;
    margin: 0;
}
.ss-gate a {
    display: flex;
    flex-direction: column;
    gap: 4px;
    height: 100%;
    padding: 12px 10px 12px;
    color: var(--ss-text);
    text-decoration: none;
    background: linear-gradient(180deg, color-mix(in srgb, var(--c) 16%, transparent), rgba(7, 10, 15, 0.6));
    border: 1px solid color-mix(in srgb, var(--c) 45%, transparent);
    border-radius: 12px;
    transition:
        transform 0.15s ease,
        box-shadow 0.15s ease;
}
.ss-gate a:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px -14px var(--c);
}
.ss-gate:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 50%;
    right: -6px;
    z-index: 1;
    width: 6px;
    height: 2px;
    background: var(--ss-border-2);
}
.ss-gate-n {
    font-family: var(--ss-mono);
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--c);
}
.ss-gate-name {
    font-weight: 650;
    font-size: 0.86rem;
    line-height: 1.25;
}
.ss-gate-did {
    margin-top: auto;
    font-size: 0.74rem;
    color: var(--ss-dim);
    line-height: 1.3;
}
.ss-path figcaption {
    margin-top: 10px;
    font-size: 0.82rem;
    color: var(--ss-muted);
}

/* --- Layers ---------------------------------------------------------------- */
.ss-layer,
.ss-section {
    position: relative;
    margin-bottom: 2.2rem;
    padding: 22px 24px 18px;
    background: var(--ss-card);
    border: 1px solid var(--ss-border);
    border-radius: 16px;
    scroll-margin-top: 80px;
}
.ss-layer::before {
    content: '';
    position: absolute;
    left: -1px;
    top: 18px;
    bottom: 18px;
    width: 3px;
    border-radius: 0 3px 3px 0;
    background: var(--c);
    box-shadow: 0 0 14px -2px var(--c);
}
.ss-layer:target {
    border-color: color-mix(in srgb, var(--c) 60%, transparent);
}
.ss-layer-n {
    margin: 0 0 0.2rem;
    font-family: var(--ss-mono);
    font-size: 0.78rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--c);
}
.ss-cols {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 6px 28px;
}

/* Bars: label, bar, number */
.ss-bars {
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.ss-bar-row {
    display: grid;
    grid-template-columns: minmax(0, 13em) minmax(60px, 1fr) auto;
    align-items: center;
    gap: 10px;
    font-size: 0.84rem;
}
.ss-bar-l {
    color: var(--ss-dim);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.ss-bar {
    display: block;
    width: 100%;
    height: 9px;
}
.ss-bar-bg {
    fill: rgba(148, 163, 184, 0.1);
}
.ss-bar-fg {
    fill: var(--c, var(--ss-pass));
}
.ss-bar-n {
    font-variant-numeric: tabular-nums;
    font-family: var(--ss-mono);
    font-size: 0.8rem;
    color: var(--ss-text);
    text-align: right;
}

.ss-code {
    margin: 1rem 0 0;
    padding-top: 0.8rem;
    border-top: 1px solid var(--ss-border);
    font-size: 0.8rem;
    color: var(--ss-muted);
    max-width: none;
}
.ss-code code {
    background: none;
    border: 0;
    padding: 0;
    color: var(--ss-dim);
}
.ss-code-l {
    font-size: 0.68rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    margin-right: 4px;
}

/* --- Table ----------------------------------------------------------------- */
.ss-table-wrap {
    overflow-x: auto;
    margin-top: 0.8rem;
    border: 1px solid var(--ss-border);
    border-radius: 12px;
}
.ss-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.86rem;
}
.ss-table th,
.ss-table td {
    padding: 8px 12px;
    text-align: left;
    border-bottom: 1px solid var(--ss-border);
    font-variant-numeric: tabular-nums;
}
.ss-table th {
    color: var(--ss-dim);
    font-weight: 600;
    background: rgba(7, 10, 15, 0.5);
}
.ss-table tbody tr:last-child td {
    border-bottom: 0;
}

/* --- Soundtrack -------------------------------------------------------------- */
.ss-player {
    display: flex;
    align-items: center;
    gap: 16px;
}
.ss-player p {
    margin: 0;
}
.ss-track {
    font-weight: 650;
}
.ss-play {
    flex: none;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    border: 1px solid var(--ss-pass);
    background: radial-gradient(circle at 35% 35%, rgba(0, 229, 138, 0.35), rgba(0, 229, 138, 0.08));
    cursor: pointer;
    display: grid;
    place-items: center;
}
.ss-play-icon {
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 9px 0 9px 15px;
    border-color: transparent transparent transparent var(--ss-pass);
    margin-left: 4px;
}
.ss-play[aria-pressed='true'] .ss-play-icon {
    width: 14px;
    height: 18px;
    margin-left: 0;
    border-width: 0 5px;
    border-color: var(--ss-pass);
    border-style: solid;
}

/* --- FAQ, footer ------------------------------------------------------------ */
.ss-faq-item {
    background: var(--ss-card-2);
    border: 1px solid var(--ss-border);
    border-radius: 12px;
    padding: 12px 16px;
    margin: 8px 0;
}
.ss-faq-item summary {
    cursor: pointer;
    font-weight: 600;
}
.ss-faq-item summary::marker {
    color: var(--ss-pass);
}
.ss-faq-item p {
    margin: 0.5rem 0 0.2rem;
    color: var(--ss-dim);
}
.ss-related {
    color: var(--ss-dim);
    font-size: 0.9rem;
}
.ss-footer {
    position: relative;
    z-index: 1;
    border-top: 1px solid var(--ss-border);
    padding: 1.6rem 20px 2.4rem;
    text-align: center;
    color: var(--ss-muted);
}
.ss-footer-links {
    list-style: none;
    padding: 0;
    margin: 0 0 0.6rem;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px 18px;
}
.ss-footer-copy {
    margin: 0;
    font-size: 0.85rem;
}

/* --- Narrower screens -------------------------------------------------------- */
@media (max-width: 980px) {
    .ss-gates {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
    .ss-gate::after {
        display: none;
    }
}
@media (max-width: 640px) {
    .ss-header {
        padding-top: 4.6rem;
    }
    .ss-header-inner {
        align-items: flex-start;
    }
    .ss-logo {
        width: 48px;
        height: 48px;
    }
    .ss-gates {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .ss-summary,
    .ss-layer,
    .ss-section {
        padding-inline: 14px;
    }
    .ss-bar-row {
        grid-template-columns: minmax(0, 9em) minmax(40px, 1fr) auto;
    }
    .ss-cols {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (prefers-reduced-motion: reduce) {
    .ss-live::before {
        animation: none;
    }
    .ss-gate a {
        transition: none;
    }
}
.ss-still .ss-live::before {
    animation: none;
}
