/* =============================================================================
   Post-Quantum Authoritative DNS

   A page of measurements: tables, tiles and small SVG figures, every one with
   its source beneath it. The palette names what the page is about: teal for
   the transports, amber for what is signed (DNSSEC), violet for what is
   post-quantum.
   ========================================================================== */

:root {
    --dn-bg: #060a12;
    --dn-card: #0d1420;
    --dn-card-2: #111a29;
    --dn-border: #1c2a3d;
    --dn-text: #f1f5f9;
    --dn-dim: #a3b3c6;
    --dn-muted: #6b7c93;
    --dn-primary: #5eead4;
    --dn-primary-dark: #0f766e;
    --dn-sign: #fbbf24;
    --dn-pq: #c4b5fd;
    --dn-ok: #4ade80;
    --dn-warn: #fbbf24;
    --dn-bad: #f87171;
    --dn-code-bg: #0a1019;
}

* {
    box-sizing: border-box;
}

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

a {
    color: var(--dn-primary);
}
a:hover {
    color: #99f6e4;
}

code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.88em;
    color: #d6e2f0;
}

/* --- Background ------------------------------------------------------------ */
/* The canvas is fixed and forms a stacking context, so every band of the page
   sits above it with its own z-index. It never takes a click. */
.dn-bg-container {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
}
.dn-bg-canvas {
    display: block;
    width: 100%;
    height: 100%;
}

.dn-motion-toggle {
    position: fixed;
    right: 14px;
    bottom: 14px;
    z-index: 5;
    padding: 6px 12px;
    font: inherit;
    font-size: 0.78rem;
    color: var(--dn-dim);
    background: rgba(13, 20, 32, 0.92);
    border: 1px solid var(--dn-border);
    border-radius: 999px;
    cursor: pointer;
}
.dn-motion-toggle:hover {
    color: var(--dn-primary);
    border-color: var(--dn-primary-dark);
}
.dn-motion-toggle:focus-visible {
    outline: 2px solid var(--dn-primary);
    outline-offset: 2px;
}

/* --- Header ---------------------------------------------------------------- */
.dn-header {
    position: relative;
    z-index: 1;
    padding-block: 2.4rem 1rem;
}
.dn-header-inner {
    max-width: 1040px;
    margin: 0 auto;
    padding-inline: 20px;
    display: flex;
    gap: 1.1rem;
    align-items: center;
    flex-wrap: wrap;
}
.dn-logo-link {
    line-height: 0;
}
.dn-logo {
    width: 56px;
    height: 56px;
    border-radius: 12px;
}
.dn-title {
    margin: 0;
    font-size: clamp(1.7rem, 4.4vw, 2.6rem);
    line-height: 1.12;
    letter-spacing: -0.02em;
    text-wrap: balance;
}
.dn-subtitle {
    margin: 0.4rem 0 0;
    color: var(--dn-dim);
    max-width: 62ch;
}

/* --- Layout ---------------------------------------------------------------- */
.dn-wrap {
    position: relative;
    z-index: 1;
    max-width: 1040px;
    margin: 0 auto;
    padding: 0 20px 4rem;
}
.dn-section {
    margin-top: 2.6rem;
    scroll-margin-top: 80px;
}
.dn-wrap p {
    max-width: 76ch;
    color: var(--dn-dim);
}
.dn-wrap p strong {
    color: var(--dn-text);
}
.dn-h2 {
    margin: 0 0 0.9rem;
    font-size: 1.45rem;
    color: var(--dn-primary);
    letter-spacing: -0.01em;
    text-wrap: balance;
}
.dn-h3 {
    margin: 1.6rem 0 0.6rem;
    font-size: 1.08rem;
    color: var(--dn-text);
}
.dn-h4 {
    margin: 1rem 0 0.35rem;
    font-size: 0.82rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--dn-muted);
}

/* --- Status and contents ----------------------------------------------------- */
.dn-status-line {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    align-items: center;
    margin: 0;
}
.dn-pill {
    display: inline-block;
    padding: 2px 12px;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 600;
    border: 1px solid currentColor;
}
.dn-pill-ok {
    color: var(--dn-ok);
    background: rgba(74, 222, 128, 0.08);
}
.dn-pill-bad {
    color: var(--dn-bad);
    background: rgba(248, 113, 113, 0.08);
}

.dn-toc {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 0.5rem;
    margin-top: 1.4rem;
    padding: 0.8rem 1rem;
    background: rgba(13, 20, 32, 0.82);
    border: 1px solid var(--dn-border);
    border-radius: 10px;
}
.dn-toc a {
    font-size: 0.85rem;
    padding: 2px 10px;
    border-radius: 999px;
    border: 1px solid var(--dn-border);
    text-decoration: none;
    color: var(--dn-dim);
}
.dn-toc a:hover,
.dn-toc a:focus-visible {
    color: var(--dn-primary);
    border-color: var(--dn-primary-dark);
}

/* --- Tiles ------------------------------------------------------------------- */
.dn-tiles {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 0.75rem;
}
.dn-tile {
    padding: 0.9rem 1rem;
    background: rgba(13, 20, 32, 0.88);
    border: 1px solid var(--dn-border);
    border-radius: 10px;
}
.dn-tile-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--dn-muted);
}
.dn-tile-value {
    margin-top: 0.2rem;
    font-size: 1.7rem;
    font-weight: 700;
    color: var(--dn-text);
    font-variant-numeric: tabular-nums;
}
.dn-tile-sub {
    margin-top: 0.15rem;
    font-size: 0.8rem;
    color: var(--dn-dim);
}

.dn-tldr {
    margin-top: 1.2rem;
    padding: 1.1rem 1.3rem;
    background: rgba(17, 26, 41, 0.9);
    border-left: 3px solid var(--dn-primary);
    border-radius: 0 10px 10px 0;
}
.dn-tldr p:last-child {
    margin-bottom: 0;
}

/* --- Figures ------------------------------------------------------------------- */
.dn-figure {
    margin: 1.2rem 0;
    padding: 1rem;
    background: rgba(13, 20, 32, 0.88);
    border: 1px solid var(--dn-border);
    border-radius: 10px;
}
.dn-figure figcaption {
    margin-top: 0.6rem;
    font-size: 0.82rem;
    color: var(--dn-muted);
}

.dn-arch {
    display: block;
    width: 100%;
    height: auto;
}
.dn-arch-node {
    fill: #0f1828;
    stroke: var(--dn-primary-dark);
    stroke-width: 1.4;
}
.dn-arch-signer {
    stroke: var(--dn-sign);
}
.dn-arch-clients {
    stroke: #6d5bd0;
}
.dn-arch-link {
    fill: none;
    stroke: rgba(94, 234, 212, 0.55);
    stroke-width: 1.5;
}
.dn-arch-link-out {
    stroke: rgba(167, 139, 250, 0.45);
}
.dn-arch-title {
    fill: var(--dn-text);
    font-size: 15px;
    font-weight: 600;
}
.dn-arch-sub {
    fill: var(--dn-dim);
    font-size: 11.5px;
}
.dn-arch-edge {
    fill: var(--dn-sign);
    font-size: 10.5px;
}
.dn-arch-chip {
    fill: var(--dn-dim);
    font-size: 12px;
}
.dn-arch-chip-enc {
    fill: var(--dn-pq);
}

.dn-spark {
    display: block;
    width: 100%;
    height: 90px;
}
.dn-spark-line {
    fill: none;
    stroke: var(--dn-primary);
    stroke-width: 1.6;
    vector-effect: non-scaling-stroke;
}

.dn-strip {
    display: block;
    width: 100%;
    max-width: 100%;
    height: 34px;
}
.dn-strip-ok {
    fill: rgba(74, 222, 128, 0.7);
}
.dn-strip-warn {
    fill: rgba(251, 191, 36, 0.75);
}
.dn-strip-bad {
    fill: rgba(248, 113, 113, 0.8);
}

/* --- Tables -------------------------------------------------------------------- */
.dn-table-wrap {
    overflow-x: auto;
    margin: 0.8rem 0;
    border: 1px solid var(--dn-border);
    border-radius: 10px;
    background: rgba(13, 20, 32, 0.9);
}
.dn-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}
.dn-table th,
.dn-table td {
    padding: 0.55rem 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--dn-border);
    vertical-align: top;
}
.dn-table thead th {
    font-size: 0.74rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--dn-muted);
    font-weight: 600;
    white-space: nowrap;
}
.dn-table tbody th {
    font-weight: 600;
    color: var(--dn-text);
    white-space: nowrap;
}
.dn-table tbody td {
    color: var(--dn-dim);
    font-variant-numeric: tabular-nums;
}
.dn-table tbody tr:last-child th,
.dn-table tbody tr:last-child td {
    border-bottom: 0;
}
.dn-table-compact th,
.dn-table-compact td {
    padding: 0.45rem 0.65rem;
}
.dn-table-sandbox td code {
    white-space: normal;
    word-break: break-word;
}
.dn-row-ours th,
.dn-row-ours td {
    background: rgba(94, 234, 212, 0.06);
}

.dn-ok {
    color: var(--dn-ok);
}
.dn-warn {
    color: var(--dn-warn);
}
.dn-bad {
    color: var(--dn-bad);
}
.dn-pq {
    color: var(--dn-pq);
}
.dn-muted {
    color: var(--dn-muted);
}

/* --- Bars ---------------------------------------------------------------------- */
.dn-two {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1rem;
}
.dn-card {
    padding: 0.4rem 1rem 1rem;
    background: rgba(13, 20, 32, 0.9);
    border: 1px solid var(--dn-border);
    border-radius: 10px;
}
.dn-bars {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.84rem;
}
.dn-bars th {
    width: 38%;
    padding: 0.15rem 0.5rem 0.15rem 0;
    text-align: left;
    font-weight: 500;
    color: var(--dn-dim);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 10rem;
}
.dn-bars td {
    padding: 0.15rem 0;
}
.dn-bars td:last-child {
    width: 4.5rem;
    text-align: right;
    color: var(--dn-text);
    font-variant-numeric: tabular-nums;
}
.dn-bar {
    display: block;
    width: 100%;
    height: 8px;
}
.dn-bar-track {
    fill: rgba(148, 163, 184, 0.12);
}
.dn-bar-fill {
    fill: var(--dn-primary);
}
.dn-bar-enc .dn-bar-fill {
    fill: var(--dn-pq);
}

/* --- Text blocks ----------------------------------------------------------------- */
.dn-source {
    margin-top: 0.4rem;
    font-size: 0.78rem;
    color: var(--dn-muted) !important;
}
.dn-note {
    font-size: 0.85rem;
}
.dn-unavailable {
    padding: 0.7rem 1rem;
    border: 1px dashed var(--dn-border);
    border-radius: 8px;
    color: var(--dn-muted) !important;
}
.dn-list {
    padding-left: 1.2rem;
    color: var(--dn-dim);
    max-width: 80ch;
}
.dn-list li {
    margin-bottom: 0.6rem;
}
.dn-list strong {
    color: var(--dn-text);
}

.dn-patches dt {
    margin-top: 0.9rem;
    font-weight: 600;
}
.dn-patches dd {
    margin: 0.25rem 0 0 0;
    color: var(--dn-dim);
    max-width: 80ch;
}

.dn-code {
    margin: 0.8rem 0;
    background: var(--dn-code-bg);
    border: 1px solid var(--dn-border);
    border-radius: 8px;
    overflow-x: auto;
}
.dn-code pre {
    margin: 0;
    padding: 0.9rem 1rem;
    font-size: 0.82rem;
    line-height: 1.55;
}

.dn-events {
    list-style: none;
    margin: 0;
    padding: 0;
    border: 1px solid var(--dn-border);
    border-radius: 10px;
    background: rgba(13, 20, 32, 0.9);
}
.dn-events li {
    display: grid;
    grid-template-columns: 11.5rem 4rem 1fr;
    gap: 0.6rem;
    padding: 0.45rem 0.8rem;
    font-size: 0.84rem;
    color: var(--dn-dim);
    border-bottom: 1px solid var(--dn-border);
}
.dn-events li:last-child {
    border-bottom: 0;
}
.dn-events time {
    color: var(--dn-muted);
    font-variant-numeric: tabular-nums;
}
.dn-ev-server {
    color: var(--dn-sign);
}

.dn-faq {
    margin: 0.5rem 0;
    padding: 0.7rem 1rem;
    background: rgba(13, 20, 32, 0.9);
    border: 1px solid var(--dn-border);
    border-radius: 8px;
}
.dn-faq summary {
    cursor: pointer;
    font-weight: 600;
    color: var(--dn-text);
}
.dn-faq p {
    margin: 0.6rem 0 0;
}

.dn-related {
    margin-top: 2.4rem;
    font-size: 0.9rem;
}

/* --- Footer -------------------------------------------------------------------- */
.dn-footer {
    position: relative;
    z-index: 1;
    padding: 2rem 20px 3rem;
    border-top: 1px solid var(--dn-border);
    text-align: center;
}
.dn-footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.4rem 1.2rem;
    list-style: none;
    margin: 0;
    padding: 0;
    font-size: 0.88rem;
}
.dn-footer-links a {
    color: var(--dn-dim);
    text-decoration: none;
}
.dn-footer-links a:hover {
    color: var(--dn-primary);
}
.dn-footer-copy {
    margin-top: 0.8rem;
    font-size: 0.8rem;
    color: var(--dn-muted);
}

@media (max-width: 640px) {
    .dn-events li {
        grid-template-columns: 1fr;
        gap: 0.1rem;
    }
    .dn-tile-value {
        font-size: 1.4rem;
    }
}
