/* =========================================================
   addrproxy.com — Y2K futurism, translucent-frost, z-pattern
   Palette:
     #0a0e1a  Obsidian Blue      (deep void)
     #c8d6e5  Frost Glass        (primary surface / text on dark)
     #7b8fa8  Circuit Silver     (traces, secondary text)
     #a8e0eb  Pale Cyan          (signal pulse)
     #f0ece4  Bone Ivory         (display headings)
     #d4a0a0  Frosted Rose       (alert accent)
   Typography:
      Libre Baskerville (display)
      DM Sans (body)
      IBM Plex Mono (labels)
      Libre Baskerville (Google Fonts) / DM Sans (Google Fonts) / IBM Plex Mono (Google Fonts)
      Magnetic Cursor Interaction:** Interactive elements (the navigation station dots use IntersectionObserver with threshold 0.15 reveals.
      Interaction
   ========================================================= */

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

:root {
    --void: #0a0e1a;
    --frost: #c8d6e5;
    --silver: #7b8fa8;
    --pulse: #a8e0eb;
    --ivory: #f0ece4;
    --rose: #d4a0a0;

    --glass-tint: rgba(200, 214, 229, 0.08);
    --glass-tint-strong: rgba(200, 214, 229, 0.12);
    --glass-edge: rgba(200, 214, 229, 0.15);
    --glass-edge-bright: rgba(200, 214, 229, 0.32);
    --pulse-glow: rgba(168, 224, 235, 0.5);

    --font-display: "Libre Baskerville", Georgia, "Times New Roman", serif;
    --font-body: "DM Sans", "Inter", system-ui, -apple-system, sans-serif;
    --font-mono: "IBM Plex Mono", "Space Mono", "Menlo", monospace;
    --design-token-interaction: "Interaction:**";
}

html {
    scroll-behavior: smooth;
    background: var(--void);
}

body {
    min-height: 100vh;
    background: var(--void);
    background-image:
        radial-gradient(ellipse 80vw 60vh at 20% 10%, rgba(168, 224, 235, 0.04), transparent 55%),
        radial-gradient(ellipse 70vw 60vh at 85% 35%, rgba(200, 214, 229, 0.03), transparent 60%),
        radial-gradient(ellipse 90vw 70vh at 50% 75%, rgba(123, 143, 168, 0.04), transparent 65%);
    color: var(--frost);
    font-family: var(--font-body);
    font-weight: 300;
    line-height: 1.7;
    letter-spacing: 0.01em;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ---------- Shared panel (frosted glass) ---------- */

.panel {
    position: absolute;
    background: var(--glass-tint);
    border: 1px solid var(--glass-edge);
    backdrop-filter: blur(16px) saturate(110%);
    -webkit-backdrop-filter: blur(16px) saturate(110%);
    padding: clamp(1.5rem, 2.5vw, 2.4rem);
    opacity: 0;
    transform: translateY(20px) translateZ(0);
    transition: opacity 800ms ease, transform 800ms cubic-bezier(0.2, 0.7, 0.2, 1), border-color 400ms ease;
    will-change: opacity, transform;
}

@supports not (backdrop-filter: blur(16px)) {
    .panel {
        background: rgba(10, 14, 26, 0.92);
    }
}

.panel.is-visible {
    opacity: 1;
    transform: translateY(0) translateZ(20px);
}

.panel__label {
    display: inline-block;
    font-family: var(--font-mono);
    font-weight: 300;
    font-size: 0.7rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--silver);
    margin-bottom: 1rem;
}

.panel__label::before {
    content: "// ";
    color: var(--pulse);
    opacity: 0.65;
}

.panel__coord {
    display: block;
    margin-top: 1.4rem;
    font-family: var(--font-mono);
    font-weight: 300;
    font-size: 0.65rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--silver);
    opacity: 0.7;
}

/* ---------- Typography ---------- */

.brand {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(2.4rem, 5.5vw, 5rem);
    letter-spacing: 0.02em;
    line-height: 1.1;
    color: var(--ivory);
}

.brand__tick {
    color: var(--pulse);
    font-weight: 400;
    display: inline-block;
    transform: translateY(-0.18em);
    font-size: 0.6em;
    margin: 0 0.05em;
}

.heading {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: clamp(1.6rem, 3.2vw, 2.6rem);
    letter-spacing: 0.02em;
    line-height: 1.2;
    color: var(--ivory);
}

.heading--lens {
    text-align: center;
    font-size: clamp(1.4rem, 2.6vw, 2.1rem);
    margin-bottom: 1rem;
}

.body {
    font-family: var(--font-body);
    font-weight: 300;
    font-size: clamp(0.95rem, 1.1vw, 1.15rem);
    line-height: 1.7;
    letter-spacing: 0.01em;
    color: var(--frost);
    opacity: 0.92;
}

.body--lens {
    text-align: center;
    max-width: 42ch;
    margin: 0 auto;
}

.tagline {
    font-family: var(--font-display);
    font-weight: 400;
    font-style: italic;
    font-size: clamp(1.1rem, 1.6vw, 1.45rem);
    line-height: 1.5;
    letter-spacing: 0.015em;
    color: var(--frost);
    max-width: 38ch;
}

.signoff {
    font-family: var(--font-display);
    font-weight: 400;
    font-style: italic;
    font-size: clamp(1.6rem, 3vw, 2.4rem);
    letter-spacing: 0.03em;
    color: var(--ivory);
}

.signoff__dot {
    color: var(--rose);
    font-style: normal;
}

/* ---------- Station marker label ---------- */

.station-marker {
    position: absolute;
    top: 6vh;
    left: 4vw;
    display: flex;
    align-items: baseline;
    gap: 0.8rem;
    font-family: var(--font-mono);
    font-weight: 300;
    font-size: 0.72rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--silver);
    z-index: 4;
}

.station-marker--right {
    left: auto;
    right: 4vw;
}

.station-marker__num {
    color: var(--pulse);
    font-size: 1rem;
    letter-spacing: 0.1em;
}

.station-marker__num::after {
    content: "";
    display: inline-block;
    width: 28px;
    height: 1px;
    background: var(--silver);
    vertical-align: middle;
    margin: 0 0.6rem 0.25rem 0.6rem;
}

/* ---------- Relay container ---------- */

.relay {
    position: relative;
    display: flex;
    flex-direction: column;
    z-index: 2;
}

/* ---------- Station base ---------- */

.station {
    position: relative;
    min-height: 100vh;
    width: 100%;
    overflow: hidden;
    padding: 8vh 4vw;
    isolation: isolate;
}

.station:not(:last-child) {
    margin-bottom: 40vh;
}

/* Give the last station a slightly longer tail of void, matches arrival */
.station:last-child {
    padding-bottom: 14vh;
}

/* ---------- Station 1 — ORIGIN ---------- */

.station-1 .panel--brand {
    top: 22vh;
    left: 8vw;
    width: min(44vw, 560px);
}

.station-1 .panel--tagline {
    top: 60vh;
    right: 10vw;
    width: min(36vw, 440px);
}

/* ---------- Station 2 — RELAY (Z-crossing) ---------- */

.station-2 .panel--relay-left {
    top: 20vh;
    left: 6vw;
    width: min(40vw, 500px);
    transform: rotate(-3deg) translateY(20px);
}

.station-2 .panel--relay-left.is-visible {
    transform: rotate(-3deg) translateY(0) translateZ(20px);
}

.station-2 .panel--relay-right {
    top: 52vh;
    right: 6vw;
    width: min(40vw, 520px);
    transform: rotate(3deg) translateY(20px);
}

.station-2 .panel--relay-right.is-visible {
    transform: rotate(3deg) translateY(0) translateZ(20px);
}

/* ---------- Station 3 — SHIELD (massive circle lens) ---------- */

.station-3 {
    display: flex;
    align-items: center;
    justify-content: center;
}

.station-3 .panel--lens {
    position: relative;
    top: auto;
    left: auto;
    width: clamp(300px, 50vw, 700px);
    height: clamp(300px, 50vw, 700px);
    border-radius: 50%;
    padding: 0;
    backdrop-filter: blur(12px) saturate(115%);
    -webkit-backdrop-filter: blur(12px) saturate(115%);
    background: radial-gradient(circle at 35% 30%, rgba(168, 224, 235, 0.06), var(--glass-tint) 55%, rgba(200, 214, 229, 0.04) 100%);
    box-shadow: inset 0 0 60px rgba(200, 214, 229, 0.06);
    display: flex;
    align-items: center;
    justify-content: center;
}

.station-3 .panel--lens::before,
.station-3 .panel--lens::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
}

.station-3 .panel--lens::before {
    top: 6px;
    left: 6px;
    right: 6px;
    bottom: 6px;
    border: 1px solid rgba(200, 214, 229, 0.07);
}

.station-3 .panel--lens::after {
    top: 3%;
    left: 8%;
    width: 30%;
    height: 18%;
    background: radial-gradient(ellipse at 50% 50%, rgba(240, 236, 228, 0.08), transparent 70%);
    transform: rotate(-18deg);
}

.station-3 .lens-inner {
    position: relative;
    z-index: 2;
    padding: 2rem clamp(1.5rem, 4vw, 3.5rem);
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Faint circuit pattern behind the lens */
.lens-background {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    opacity: 0.7;
    pointer-events: none;
}

/* ---------- Station 4 — ARRIVAL (inverted Z) ---------- */

.station-4 .panel--arrival-top {
    top: 18vh;
    right: 8vw;
    width: min(44vw, 560px);
}

.station-4 .panel--signoff {
    top: 62vh;
    left: 10vw;
    width: min(36vw, 420px);
}

/* ---------- Station inline diagonal traces ---------- */

.station-trace {
    position: absolute;
    top: 20vh;
    left: 5vw;
    right: 5vw;
    bottom: 20vh;
    width: 90vw;
    height: 60vh;
    pointer-events: none;
    z-index: 1;
    opacity: 0.55;
}

.trace-line {
    fill: none;
    stroke: var(--silver);
    stroke-width: 1;
    stroke-dasharray: 2 4;
    opacity: 0.5;
}

.trace-pulse {
    fill: none;
    stroke: var(--pulse);
    stroke-width: 1.4;
    stroke-dasharray: 10 190;
    stroke-dashoffset: 0;
    animation: trace-flow 6s linear infinite;
    filter: drop-shadow(0 0 4px rgba(168, 224, 235, 0.55));
}

.station-trace--diag2 .trace-pulse {
    animation-duration: 7s;
    animation-direction: reverse;
}

.trace-node {
    fill: var(--silver);
    stroke: var(--pulse);
    stroke-width: 0.5;
    opacity: 0.9;
}

@keyframes trace-flow {
    from { stroke-dashoffset: 200; }
    to   { stroke-dashoffset: 0; }
}

/* ---------- Wireframe polyhedra ---------- */

.wireframe {
    position: absolute;
    pointer-events: none;
    z-index: 0;
    opacity: 0.7;
    mix-blend-mode: screen;
}

.wireframe__spin {
    transform-origin: center;
    transform-box: fill-box;
    animation: polyhedron-spin 60s linear infinite;
}

.wireframe--tetra {
    width: clamp(240px, 28vw, 380px);
    height: clamp(240px, 28vw, 380px);
    top: 52vh;
    left: 46vw;
}

.wireframe--octa {
    width: clamp(280px, 34vw, 460px);
    height: clamp(280px, 34vw, 460px);
    top: 22vh;
    left: 34vw;
    animation-direction: reverse;
}

.wireframe--ico {
    width: clamp(380px, 46vw, 640px);
    height: clamp(380px, 46vw, 640px);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0.55;
    z-index: 1;
}

.wireframe--ico .wireframe__spin {
    animation-duration: 80s;
}

.wireframe--stellar {
    width: clamp(320px, 38vw, 520px);
    height: clamp(320px, 38vw, 520px);
    top: 28vh;
    left: 18vw;
    animation-duration: 90s;
}

@keyframes polyhedron-spin {
    from { transform: rotateY(0deg) rotateZ(0deg); }
    to   { transform: rotateY(360deg) rotateZ(360deg); }
}

/* Keep the icosahedron centered while spinning */
.wireframe--ico .wireframe__spin {
    animation-name: ico-spin;
}

@keyframes ico-spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

/* ---------- Spine trace (between stations) ---------- */

.spine-trace {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100vw;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    opacity: 0.42;
}

.spine-line {
    fill: none;
    stroke: var(--silver);
    stroke-width: 0.35;
    stroke-dasharray: 1.2 3;
    opacity: 0.6;
}

.spine-pulse {
    fill: none;
    stroke: var(--pulse);
    stroke-width: 0.55;
    stroke-dasharray: 6 160;
    stroke-dashoffset: 0;
    animation: spine-flow 8s linear infinite;
    filter: drop-shadow(0 0 2px rgba(168, 224, 235, 0.7));
}

.spine-node {
    fill: var(--silver);
    opacity: 0.9;
    animation: spine-node-pulse 3s ease-in-out infinite;
}

.spine-node:nth-of-type(even) { animation-delay: 1.5s; }

@keyframes spine-flow {
    from { stroke-dashoffset: 166; }
    to   { stroke-dashoffset: 0; }
}

@keyframes spine-node-pulse {
    0%, 100% { fill: var(--silver); r: 1.2; }
    50%      { fill: var(--pulse); r: 1.6; }
}

/* ---------- Station navigation dots ---------- */

.station-nav {
    position: fixed;
    top: 50%;
    right: clamp(1rem, 2.4vw, 2rem);
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: clamp(1.6rem, 3vh, 2.6rem);
    z-index: 60;
}

.nav-dot {
    position: relative;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--glass-tint);
    border: 1px solid var(--glass-edge);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    cursor: pointer;
    padding: 0;
    transition: transform 300ms cubic-bezier(0.2, 0.7, 0.2, 1),
                border-color 300ms ease,
                box-shadow 400ms ease,
                background 300ms ease;
    font: inherit;
    color: inherit;
    will-change: transform;
}

.nav-dot::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--silver);
    transform: translate(-50%, -50%);
    transition: background 300ms ease, box-shadow 400ms ease, width 300ms ease, height 300ms ease;
}

.nav-dot:hover {
    border-color: var(--glass-edge-bright);
    background: var(--glass-tint-strong);
}

.nav-dot:hover::before {
    background: var(--pulse);
    box-shadow: 0 0 10px rgba(168, 224, 235, 0.7);
}

.nav-dot.active {
    border-color: rgba(168, 224, 235, 0.45);
    box-shadow: 0 0 0 2px rgba(168, 224, 235, 0.12);
    animation: nav-pulse 3s ease-in-out infinite;
}

.nav-dot.active::before {
    background: var(--pulse);
    width: 10px;
    height: 10px;
    box-shadow: 0 0 12px rgba(168, 224, 235, 0.8);
}

@keyframes nav-pulse {
    0%, 100% { box-shadow: 0 0 0 2px rgba(168, 224, 235, 0.12), 0 0 0 0 rgba(168, 224, 235, 0.4); }
    50%      { box-shadow: 0 0 0 2px rgba(168, 224, 235, 0.2),  0 0 18px 6px rgba(168, 224, 235, 0.0); }
}

.nav-label {
    position: absolute;
    right: calc(100% + 14px);
    top: 50%;
    transform: translateY(-50%);
    font-family: var(--font-mono);
    font-weight: 300;
    font-size: 0.68rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--frost);
    white-space: nowrap;
    opacity: 0;
    transition: opacity 300ms ease, transform 300ms cubic-bezier(0.2, 0.7, 0.2, 1);
    pointer-events: none;
}

.nav-dot:hover .nav-label,
.nav-dot.active .nav-label {
    opacity: 0.9;
    transform: translate(-2px, -50%);
}

/* ---------- Ambient particle field ---------- */

.particle-field {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.particle {
    position: absolute;
    width: 2px;
    height: 2px;
    border-radius: 50%;
    background: var(--silver);
    opacity: 0.3;
    will-change: transform;
}

.particle--bright {
    background: var(--pulse);
    opacity: 0.45;
    box-shadow: 0 0 4px rgba(168, 224, 235, 0.5);
}

@keyframes drift-a {
    0%   { transform: translate(0, 0); }
    25%  { transform: translate(18vw, -8vh); }
    50%  { transform: translate(-6vw, -18vh); }
    75%  { transform: translate(12vw, 10vh); }
    100% { transform: translate(0, 0); }
}

@keyframes drift-b {
    0%   { transform: translate(0, 0); }
    33%  { transform: translate(-14vw, 12vh); }
    66%  { transform: translate(8vw, -10vh); }
    100% { transform: translate(0, 0); }
}

@keyframes drift-c {
    0%   { transform: translate(0, 0); }
    50%  { transform: translate(22vw, 14vh); }
    100% { transform: translate(0, 0); }
}

/* ---------- Status ticker ---------- */

.status-ticker {
    position: fixed;
    left: 50%;
    bottom: clamp(1rem, 2vh, 1.6rem);
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 0.9rem;
    padding: 0.55rem 1.2rem;
    background: var(--glass-tint);
    border: 1px solid var(--glass-edge);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 999px;
    font-family: var(--font-mono);
    font-weight: 300;
    font-size: 0.66rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--silver);
    z-index: 55;
}

.ticker-item {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.ticker-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--pulse);
    box-shadow: 0 0 8px rgba(168, 224, 235, 0.8);
    animation: ticker-blink 2s ease-in-out infinite;
}

@keyframes ticker-blink {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%      { opacity: 0.45; transform: scale(0.75); }
}

.ticker-divider {
    color: var(--silver);
    opacity: 0.5;
}

.ticker-text {
    color: var(--frost);
    opacity: 0.85;
}

/* ---------- Responsive ---------- */

@media (max-width: 900px) {
    .wireframe--tetra,
    .wireframe--octa,
    .wireframe--stellar {
        width: clamp(220px, 60vw, 360px);
        height: clamp(220px, 60vw, 360px);
        left: 50%;
        transform: translateX(-50%);
    }
    .wireframe--tetra { top: 55vh; }
    .wireframe--octa { top: 30vh; }
    .wireframe--stellar { top: 32vh; }

    .station-1 .panel--brand {
        top: 16vh;
        left: 6vw;
        right: 6vw;
        width: auto;
    }

    .station-1 .panel--tagline {
        top: auto;
        bottom: 14vh;
        right: 6vw;
        left: 6vw;
        width: auto;
    }

    .station-2 .panel--relay-left,
    .station-2 .panel--relay-right {
        left: 6vw;
        right: 6vw;
        width: auto;
        transform: rotate(0deg) translateY(20px);
    }
    .station-2 .panel--relay-left.is-visible,
    .station-2 .panel--relay-right.is-visible {
        transform: rotate(0deg) translateY(0) translateZ(20px);
    }
    .station-2 .panel--relay-left { top: 16vh; }
    .station-2 .panel--relay-right { top: 58vh; }

    .station-3 .panel--lens {
        width: min(86vw, 560px);
        height: min(86vw, 560px);
    }

    .station-4 .panel--arrival-top {
        top: 16vh;
        right: 6vw;
        left: 6vw;
        width: auto;
    }
    .station-4 .panel--signoff {
        top: auto;
        bottom: 14vh;
        left: 6vw;
        right: 6vw;
        width: auto;
    }

    .station-nav {
        top: auto;
        bottom: clamp(3.5rem, 7vh, 5rem);
        right: 50%;
        transform: translateX(50%);
        flex-direction: row;
        gap: 1.2rem;
    }

    .nav-label {
        display: none;
    }

    .station-trace {
        display: none;
    }

    .spine-trace {
        opacity: 0.22;
    }
}

@media (max-width: 560px) {
    .station-marker {
        font-size: 0.62rem;
    }
    .brand {
        font-size: clamp(2rem, 10vw, 3.2rem);
    }
    .heading {
        font-size: clamp(1.3rem, 5vw, 1.8rem);
    }
    .panel {
        padding: 1.2rem;
    }
    .status-ticker {
        font-size: 0.58rem;
        padding: 0.45rem 0.9rem;
        gap: 0.55rem;
    }
}

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
        scroll-behavior: auto !important;
    }
    .panel { opacity: 1; transform: none; }
}
