/* =====================================================
   addrproxy.com — Atlas of routed identity
   Palette: cool grays only.
   #F2F4F6 paper · #E4E8EC ruling · #AAB4BE graphite-mid
   #6E7A86 slate · #3B4550 deep-engraving · #1A1F26 abyss
   #C9CFD6 mist · #8FA3B3 estuary
   ===================================================== */

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

:root {
    --paper: #F2F4F6;
    --rule: #E4E8EC;
    --graphite: #AAB4BE;
    --slate: #6E7A86;
    --engraving: #3B4550;
    --abyss: #1A1F26;
    --mist: #C9CFD6;
    --estuary: #8FA3B3;

    --font-display: "Space Grotesk", system-ui, sans-serif;
    --font-small: "Familjen Grotesk", "Space Grotesk", system-ui, sans-serif;
    --font-italic: "Cormorant Garamond", Georgia, serif;
}

html, body {
    height: 100%;
    width: 100%;
    overflow: hidden;
    background: var(--paper);
    color: var(--engraving);
    font-family: var(--font-display);
    font-size: 15px;
    line-height: 1.7;
    font-weight: 400;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    position: relative;
    background:
        radial-gradient(ellipse at 50% 30%, rgba(255,255,255,0.6), transparent 70%),
        var(--paper);
}

/* =====================================================
   TOP RULER — engraved scale across the top edge
   ===================================================== */
.ruler {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 36px;
    z-index: 50;
    background: linear-gradient(to bottom, rgba(242,244,246,0.96), rgba(242,244,246,0.86));
    border-bottom: 0.5px solid var(--rule);
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.ruler::before,
.ruler::after {
    content: "";
    position: absolute;
    left: 0; right: 0;
    height: 1px;
    background: repeating-linear-gradient(to right,
        var(--graphite) 0, var(--graphite) 1px,
        transparent 1px, transparent 8px);
    opacity: 0.5;
}
.ruler::before { top: 6px; }
.ruler::after  { bottom: 6px; }

.ruler-marks {
    position: relative;
    display: flex;
    gap: clamp(40px, 14vw, 160px);
    font-family: var(--font-small);
    font-size: 11px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--slate);
}
.ruler-mark {
    position: relative;
    padding: 0 6px;
    transition: color 0.6s ease;
}
.ruler-mark.active {
    color: var(--engraving);
}
.ruler-mark.active::after {
    content: "";
    position: absolute;
    left: 50%; bottom: -8px;
    width: 4px; height: 4px;
    transform: translateX(-50%) rotate(45deg);
    background: var(--engraving);
}

.ruler-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 1px;
    width: 0;
    background: var(--engraving);
    transition: width 0.18s linear;
}

.ruler-imprint {
    position: absolute;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    font-family: var(--font-italic);
    font-style: italic;
    font-size: 12px;
    color: var(--slate);
    letter-spacing: 0.02em;
}

@media (max-width: 720px) {
    .ruler-imprint { display: none; }
}

/* =====================================================
   ATLAS — single horizontal scroll element
   ===================================================== */
.atlas {
    position: relative;
    display: flex;
    flex-direction: row;
    width: 620vw;
    height: 100vh;
    will-change: transform;
    transform: translate3d(0, 0, 0);
}

.plate {
    position: relative;
    flex: 0 0 auto;
    width: 100vw;
    height: 100vh;
    padding: 80px 7vw 70px;
    overflow: hidden;
    border-right: 0.5px dashed var(--rule);
}

.plate-bg-graph {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(var(--rule) 0.5px, transparent 0.5px),
        linear-gradient(90deg, var(--rule) 0.5px, transparent 0.5px);
    background-size: 32px 32px;
    opacity: 0.45;
    pointer-events: none;
}

/* =====================================================
   CORNERS — fleurons at each plate corner
   ===================================================== */
.corner {
    position: absolute;
    width: 56px;
    height: 56px;
    color: var(--engraving);
    opacity: 0.75;
}
.corner-tl { top: 48px; left: 36px; }
.corner-tr { top: 48px; right: 36px; transform: scaleX(-1); }
.corner-bl { bottom: 36px; left: 36px; transform: scaleY(-1); }
.corner-br { bottom: 36px; right: 36px; transform: scale(-1, -1); }

/* =====================================================
   PLATE STAMP & MARGINALIA
   ===================================================== */
.plate-stamp {
    position: absolute;
    top: 56px;
    right: 110px;
    font-family: var(--font-small);
    font-size: 10.5px;
    letter-spacing: 0.2em;
    color: var(--slate);
    text-transform: uppercase;
}
.plate-stamp::before,
.plate-stamp::after {
    content: "";
    display: inline-block;
    width: 28px;
    height: 0.5px;
    background: var(--slate);
    vertical-align: middle;
    margin: 0 8px;
}

.plate-number {
    font-family: var(--font-small);
    font-size: 12px;
    letter-spacing: 0.22em;
    color: var(--slate);
    text-transform: uppercase;
    margin-bottom: 14px;
}

.plate-heading {
    font-family: var(--font-display);
    font-weight: 500;
    font-size: clamp(2.25rem, 4.4vw, 4rem);
    letter-spacing: -0.025em;
    color: var(--engraving);
    line-height: 1.05;
    margin-bottom: 18px;
}

.plate-epigraph {
    font-family: var(--font-italic);
    font-style: italic;
    font-weight: 400;
    color: var(--slate);
    font-size: clamp(1rem, 1.2vw, 1.15rem);
    max-width: 38ch;
    line-height: 1.5;
}

.plate-header {
    position: relative;
    z-index: 2;
    max-width: 540px;
    margin-bottom: 30px;
}

/* =====================================================
   PATH-DRAW-SVG utility — the unifying motion
   ===================================================== */
.draw-path {
    stroke-dasharray: var(--len, 1000);
    stroke-dashoffset: var(--len, 1000);
    transition: stroke-dashoffset 1.6s cubic-bezier(0.25, 0.1, 0.25, 1);
}
.draw-path.drawn {
    stroke-dashoffset: 0;
}

/* =====================================================
   PLATE I — THE ENVOI
   ===================================================== */
.plate-i {
    display: flex;
    align-items: center;
    justify-content: center;
}
.envoi-center {
    position: relative;
    width: 100%;
    max-width: 840px;
    text-align: center;
    z-index: 2;
}
.hero-blob {
    width: 100%;
    max-width: 600px;
    height: auto;
    display: block;
    margin: 0 auto 18px;
    filter: drop-shadow(0 1px 0 rgba(26, 31, 38, 0.04));
}
.hero-blob-path,
.hero-blob-outline { transition: stroke-dashoffset 2.6s cubic-bezier(0.25, 0.1, 0.25, 1); }

.blob-label {
    font-family: var(--font-small);
    font-size: 12px;
    letter-spacing: 0.32em;
    fill: var(--engraving);
    text-transform: uppercase;
    opacity: 0;
    animation: ink-settle 2.4s ease 1.6s forwards;
}
.blob-sublabel {
    font-family: var(--font-italic);
    font-style: italic;
    font-size: 11.5px;
    fill: var(--slate);
    opacity: 0;
    animation: ink-settle 2.4s ease 2.0s forwards;
}

@keyframes ink-settle {
    0%   { opacity: 0; }
    100% { opacity: 1; }
}

.site-title {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 18px;
    font-family: var(--font-display);
    font-weight: 500;
    font-size: clamp(2.75rem, 6vw, 6.5rem);
    letter-spacing: -0.025em;
    color: var(--engraving);
    line-height: 1;
    margin-top: 10px;
}
.title-bracket {
    width: 22px;
    height: 60px;
    color: var(--engraving);
}

.envoi-epigraph {
    margin-top: 28px;
    font-family: var(--font-italic);
    font-style: italic;
    color: var(--slate);
    font-size: 1.1rem;
    letter-spacing: 0.01em;
}

.begin-mark {
    margin-top: 38px;
    font-family: var(--font-small);
    font-size: 12px;
    letter-spacing: 0.22em;
    color: var(--engraving);
    text-transform: uppercase;
    cursor: pointer;
    user-select: none;
    transition: color 0.4s ease, letter-spacing 0.6s ease;
}
.begin-mark:hover {
    color: var(--abyss);
    letter-spacing: 0.34em;
}

.margin-rose {
    position: absolute;
    width: 64px; height: 64px;
    color: var(--slate);
    opacity: 0.75;
}
.corner-marg-bl { left: 60px; bottom: 60px; }
.scale-bar {
    position: absolute;
    right: 70px;
    bottom: 70px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-small);
    font-size: 10.5px;
    letter-spacing: 0.18em;
    color: var(--slate);
    text-transform: uppercase;
}
.scale-line {
    display: inline-block;
    width: 90px;
    height: 1px;
    background: repeating-linear-gradient(to right,
        var(--slate) 0, var(--slate) 6px,
        transparent 6px, transparent 10px);
}

/* =====================================================
   PLATE II — TRANSIT CHART
   ===================================================== */
.plate-ii {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.transit-chart {
    width: 100%;
    max-width: 1320px;
    height: auto;
    margin: 0 auto;
    aspect-ratio: 1400 / 720;
}
.transit-chart text.annot {
    font-family: var(--font-small);
    font-size: 11px;
    letter-spacing: 0.18em;
    fill: var(--slate);
    text-transform: uppercase;
}
.node-blob {
    transition: transform 0.6s cubic-bezier(0.25,0.1,0.25,1);
}
.node-label {
    font-family: var(--font-italic);
    font-style: italic;
    font-size: 13px;
    fill: var(--engraving);
    opacity: 0;
}
.node-meta {
    font-family: var(--font-small);
    font-size: 10px;
    letter-spacing: 0.16em;
    fill: var(--slate);
    text-transform: uppercase;
    opacity: 0;
}
.node-label.shown,
.node-meta.shown {
    opacity: 1;
    transition: opacity 1.2s ease;
}

.annot-block {
    position: absolute;
    max-width: 320px;
    font-family: var(--font-display);
    font-size: 14px;
    line-height: 1.7;
    color: var(--slate);
    z-index: 2;
}
.annot-block-bl { left: 7vw; bottom: 90px; }
.annot-block-tl { left: 7vw; top: 220px; }

.annot-block::before {
    content: "";
    display: block;
    width: 36px;
    height: 1px;
    background: var(--engraving);
    margin-bottom: 14px;
}

/* =====================================================
   PLATE III — THE ANONYMITY ENGINE
   ===================================================== */
.plate-iii {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}
.engine-frame {
    position: relative;
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}
.engine-svg {
    width: 100%;
    height: auto;
    aspect-ratio: 900 / 560;
}
.engine-label {
    font-family: var(--font-small);
    font-size: 9.5px;
    letter-spacing: 0.22em;
    fill: var(--engraving);
    text-transform: uppercase;
}
.engine-bars rect {
    fill: var(--graphite);
}
.engine-spark {
    transition: stroke-dashoffset 1.8s cubic-bezier(0.25, 0.1, 0.25, 1);
}

/* =====================================================
   PLATE IV — THE LEDGER
   ===================================================== */
.plate-iv {
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.ledger-row {
    display: flex;
    flex-direction: row;
    gap: 32px;
    width: 100%;
    max-width: 1300px;
    margin: 0 auto;
    padding: 0 20px;
}

.ledger-card {
    position: relative;
    flex: 1 1 0;
    min-width: 0;
    padding: 40px 26px 30px;
    background:
        linear-gradient(rgba(255,255,255,0.55), rgba(255,255,255,0.4)),
        var(--paper);
    border: 0.5px solid var(--graphite);
    box-shadow: inset 0 0 0 4px var(--paper), inset 0 0 0 4.5px var(--rule);
}
.ledger-card::before {
    content: "";
    position: absolute;
    inset: 12px;
    border: 0.5px solid var(--rule);
    pointer-events: none;
}
.card-corner {
    position: absolute;
    width: 28px; height: 28px;
}
.card-corner-tl { top: 6px; left: 6px; }
.card-corner-tr { top: 6px; right: 6px; transform: scaleX(-1); }
.card-corner-bl { bottom: 6px; left: 6px; transform: scaleY(-1); }
.card-corner-br { bottom: 6px; right: 6px; transform: scale(-1,-1); }

.card-cert {
    font-family: var(--font-small);
    font-size: 10.5px;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--slate);
    text-align: center;
    margin-bottom: 16px;
}
.card-title {
    font-family: var(--font-display);
    font-weight: 500;
    font-size: 1.45rem;
    letter-spacing: -0.02em;
    color: var(--engraving);
    text-align: center;
    margin-bottom: 14px;
    line-height: 1.2;
}
.card-text {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: 13.5px;
    line-height: 1.65;
    color: var(--slate);
    text-align: center;
}
.card-seal {
    position: absolute;
    bottom: 22px;
    left: 50%;
    transform: translateX(-50%);
    width: 36px;
    height: 36px;
    opacity: 0.85;
}

/* =====================================================
   PLATE V — COMPASS ROOM
   ===================================================== */
.plate-v {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}
.compass-stage {
    position: relative;
    width: 100%;
    max-width: 720px;
    margin: 0 auto;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}
.compass-rose {
    width: 100%;
    height: auto;
    max-height: 70vh;
    aspect-ratio: 1 / 1;
}
.compass-blob {
    transition: stroke-dashoffset 2.4s cubic-bezier(0.25, 0.1, 0.25, 1);
}
#compassNeedle > g {
    transition: transform 0.45s cubic-bezier(0.25, 0.1, 0.25, 1);
    transform-origin: center;
    transform-box: fill-box;
}
.testimonials text {
    font-family: var(--font-italic);
    font-style: italic;
    font-size: 12px;
    fill: var(--slate);
    opacity: 0;
}
.testimonials text.shown { opacity: 1; transition: opacity 1.4s ease; }

.annot-cardinal {
    font-family: var(--font-small);
    font-size: 13px;
    letter-spacing: 0.3em;
    fill: var(--engraving);
    text-transform: uppercase;
}

/* =====================================================
   PLATE VI — COLOPHON
   ===================================================== */
.plate-vi {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-end;
    padding-right: 9vw;
}
.colophon-column {
    max-width: 420px;
    text-align: right;
    color: var(--engraving);
    border-right: 0.5px solid var(--engraving);
    padding-right: 28px;
}
.colophon-head {
    font-size: clamp(2.1rem, 3.6vw, 3rem);
    margin-bottom: 14px;
}
.colophon-rule {
    width: 200px;
    height: 12px;
    color: var(--engraving);
    margin: 18px 0 22px auto;
    display: block;
}
.colophon-imprint {
    font-family: var(--font-italic);
    font-style: italic;
    font-size: 1.05rem;
    line-height: 1.55;
    color: var(--slate);
    margin-bottom: 24px;
}
.colophon-meta {
    font-family: var(--font-display);
    font-size: 13px;
    line-height: 1.85;
    color: var(--engraving);
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 16px;
    row-gap: 4px;
    margin-bottom: 22px;
    text-align: right;
}
.colophon-meta dt {
    font-family: var(--font-small);
    font-size: 10.5px;
    letter-spacing: 0.18em;
    color: var(--slate);
    text-transform: uppercase;
}
.colophon-meta dd { color: var(--engraving); }

.colophon-toggle { margin-top: 14px; }
.ambient-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: transparent;
    border: 0.5px solid var(--engraving);
    padding: 10px 16px;
    font-family: var(--font-small);
    font-size: 11px;
    letter-spacing: 0.18em;
    color: var(--engraving);
    text-transform: uppercase;
    cursor: pointer;
    transition: background 0.4s ease, color 0.4s ease;
}
.ambient-btn:hover {
    background: var(--engraving);
    color: var(--paper);
}
.ambient-btn:hover svg g { stroke: var(--paper); }

.colophon-finis {
    margin-top: 30px;
    font-family: var(--font-italic);
    font-style: italic;
    color: var(--slate);
    font-size: 0.95rem;
}

/* =====================================================
   TENDRILS — ornamental dividers between plates
   ===================================================== */
.tendril {
    position: absolute;
    width: 56px;
    height: 200px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--engraving);
    opacity: 0.55;
    pointer-events: none;
}
.tendril-1 { left: calc(100vw - 28px); }
.tendril-2 { left: calc(200vw - 28px); }
.tendril-3 { left: calc(300vw - 28px); }
.tendril-4 { left: calc(400vw - 28px); }
.tendril-5 { left: calc(500vw - 28px); }

.acanthus-divider {
    position: absolute;
    width: 220px;
    height: 36px;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    color: var(--engraving);
    opacity: 0.7;
}

/* =====================================================
   FOOTER MARGINALIA
   ===================================================== */
.marginalia {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    height: 28px;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 0 24px;
    background: linear-gradient(to top, rgba(242,244,246,0.95), rgba(242,244,246,0.65));
    border-top: 0.5px solid var(--rule);
    font-family: var(--font-small);
    font-size: 10.5px;
    letter-spacing: 0.22em;
    color: var(--slate);
    text-transform: uppercase;
    pointer-events: none;
}
.marg-sep { opacity: 0.5; }

/* =====================================================
   REDUCED MOTION FALLBACK — vertical stacking
   ===================================================== */
@media (prefers-reduced-motion: reduce) {
    html, body { overflow: auto; height: auto; }
    .atlas {
        flex-direction: column;
        width: 100vw;
        height: auto;
    }
    .plate {
        width: 100vw;
        height: auto;
        min-height: 90vh;
        border-right: none;
        border-bottom: 0.5px dashed var(--rule);
    }
    .tendril { display: none; }
    .draw-path { stroke-dashoffset: 0 !important; }
    .blob-label, .blob-sublabel,
    .node-label, .node-meta { opacity: 1 !important; animation: none !important; }
}

/* =====================================================
   NARROW VIEWPORTS — graceful collapse
   ===================================================== */
@media (max-width: 720px) {
    .plate { padding: 70px 5vw 50px; }
    .plate-stamp { right: 18px; font-size: 9.5px; }
    .corner { width: 40px; height: 40px; }
    .corner-tl, .corner-tr { top: 44px; }
    .corner-tl, .corner-bl { left: 14px; }
    .corner-tr, .corner-br { right: 14px; }
    .corner-bl, .corner-br { bottom: 30px; }
    .ledger-row { gap: 14px; padding: 0 6px; }
    .ledger-card { padding: 28px 14px 26px; }
    .annot-block { display: none; }
    .colophon-column { max-width: 90vw; padding-right: 14px; }
}
