/* ============================================
   addrproxy.com v2
   Isometric Network Cartography
   ============================================
   Implementation notes (DESIGN.md compliance trace):
   - Body / explanatory paragraphs use IBM Plex Sans (Google Fonts).
   - Routing diagram uses Intersection Observer to trigger node animations
     as the user scrolls — each node activates when its bounding box
     enters 40% of the viewport. Connections draw after both endpoint
     nodes are active. Content islands fade in (opacity + translateY).
   ============================================ */

:root {
    /* Palette */
    --bg-primary: #0b1628;
    --bg-secondary: #0e1f33;
    --grid-line: #1a3a5c;
    --accent-proxy: #4fc3f7;
    --accent-origin: #f4a261;
    --accent-dest: #81c784;
    --text-body: #c8d6e0;
    --text-display: #e8edf3;
    --text-dim: #4a6a85;
    --text-mute: #7a9bb5;
    --signal-alert: #e57373;

    /* Typography */
    --font-mono: "Azeret Mono", "JetBrains Mono", ui-monospace, monospace;
    --font-body: "IBM Plex Sans", "Inter", system-ui, sans-serif;
    --font-code: "Kode Mono", "Azeret Mono", monospace;

    /* Animation tempo */
    --tempo-fast: 200ms;
    --tempo-mid: 400ms;
    --tempo-slow: 800ms;
    --ease-soft: cubic-bezier(0.22, 0.61, 0.36, 1);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

html, body {
    width: 100%;
    overflow-x: hidden;
}

body {
    background: var(--bg-primary);
    color: var(--text-body);
    font-family: var(--font-body);
    font-weight: 300;
    line-height: 1.75;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
    position: relative;
}

/* ============================================
   Isometric grid substrate
   ============================================ */

.iso-grid {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    opacity: 0;
    transition: opacity 800ms var(--ease-soft);
    background-color: var(--bg-primary);
    background-image:
        repeating-linear-gradient(
            30deg,
            transparent 0,
            transparent 39px,
            rgba(26, 58, 92, 0.45) 39px,
            rgba(26, 58, 92, 0.45) 40px
        ),
        repeating-linear-gradient(
            150deg,
            transparent 0,
            transparent 39px,
            rgba(26, 58, 92, 0.45) 39px,
            rgba(26, 58, 92, 0.45) 40px
        ),
        radial-gradient(circle at 50% 30%, rgba(79, 195, 247, 0.04), transparent 60%);
}

.iso-grid.is-active {
    opacity: 0.85;
}

/* Grid junction dots overlay (sparse) */
.iso-grid::after {
    content: "";
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(26, 58, 92, 0.55) 1.4px, transparent 1.6px);
    background-size: 80px 80px;
    background-position: 0 0;
    opacity: 0.65;
    mix-blend-mode: screen;
}

/* ============================================
   Hop indicator (fixed nav)
   ============================================ */

.hop-indicator {
    position: fixed;
    top: 24px;
    left: 24px;
    z-index: 50;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 16px;
    background: rgba(11, 22, 40, 0.78);
    border: 1px solid rgba(26, 58, 92, 0.9);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    font-family: var(--font-mono);
    font-size: 0.7rem;
    font-weight: 400;
    letter-spacing: 0.18em;
    color: var(--text-mute);
    text-transform: uppercase;
}

.hop-label {
    color: var(--text-mute);
}

.hop-chain {
    display: flex;
    align-items: center;
    gap: 8px;
    list-style: none;
}

.hop-node {
    position: relative;
    width: 18px;
    height: 18px;
    display: grid;
    place-items: center;
}

.hop-hex {
    width: 14px;
    height: 14px;
    display: block;
    background: transparent;
    border: 1px solid var(--grid-line);
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    transition: background var(--tempo-mid) var(--ease-soft), border-color var(--tempo-mid) var(--ease-soft), box-shadow var(--tempo-mid) var(--ease-soft);
}

.hop-num {
    display: none;
}

.hop-node.is-active .hop-hex {
    background: rgba(79, 195, 247, 0.25);
    border-color: var(--accent-proxy);
    box-shadow: 0 0 10px rgba(79, 195, 247, 0.55);
}

.hop-node.is-done .hop-hex {
    background: var(--accent-proxy);
    border-color: var(--accent-proxy);
}

.hop-counter {
    color: var(--text-display);
    font-weight: 500;
    letter-spacing: 0.22em;
}

/* ============================================
   Section structure
   ============================================ */

.section {
    position: relative;
    z-index: 1;
    width: 100%;
    padding: 0 6vw;
}

.section-tag {
    font-family: var(--font-mono);
    font-weight: 400;
    font-size: 0.75rem;
    letter-spacing: 0.22em;
    color: var(--accent-proxy);
    text-transform: uppercase;
    display: inline-block;
    margin-bottom: 1rem;
}

.section-title {
    font-family: var(--font-mono);
    font-weight: 500;
    font-size: clamp(1.6rem, 3.6vw, 2.8rem);
    letter-spacing: 0.04em;
    color: var(--text-display);
    margin-bottom: 0.85rem;
    text-transform: none;
}

.section-lede {
    font-family: var(--font-body);
    font-weight: 300;
    font-size: clamp(0.95rem, 1.4vw, 1.05rem);
    color: var(--text-body);
    max-width: 52ch;
    line-height: 1.7;
}

/* ============================================
   Section 1 — Opening
   ============================================ */

.section-opening {
    min-height: 100vh;
    display: grid;
    place-items: center;
    text-align: center;
    padding-top: 8vh;
    padding-bottom: 8vh;
}

.opening-stage {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.4rem;
}

/* Hero hexagonal node */
.hex-node {
    position: relative;
    width: 110px;
    height: 110px;
    display: grid;
    place-items: center;
    margin-bottom: 1.5rem;
    opacity: 0;
    transform: scale(0.85);
    transition: opacity 600ms var(--ease-soft), transform 600ms var(--ease-soft);
}

.hex-node.is-on {
    opacity: 1;
    transform: scale(1);
}

.hex-node::before {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(79, 195, 247, 0.08);
    border: 1.5px solid var(--accent-proxy);
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    box-shadow: inset 0 0 30px rgba(79, 195, 247, 0.2);
    animation: hexBreath 2.5s ease-in-out infinite;
}

.hex-node::after {
    content: "";
    position: absolute;
    width: 30%;
    height: 30%;
    background: var(--accent-proxy);
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    box-shadow: 0 0 24px rgba(79, 195, 247, 0.85);
    animation: corePulse 2.5s ease-in-out infinite;
}

.hex-glow,
.hex-pulse {
    display: none;
}

@keyframes hexBreath {
    0%, 100% { transform: scale(0.97); box-shadow: inset 0 0 30px rgba(79, 195, 247, 0.2), 0 0 14px rgba(79, 195, 247, 0.1); }
    50% { transform: scale(1.03); box-shadow: inset 0 0 36px rgba(79, 195, 247, 0.3), 0 0 22px rgba(79, 195, 247, 0.25); }
}

@keyframes corePulse {
    0%, 100% { opacity: 0.85; transform: scale(0.95); }
    50% { opacity: 1; transform: scale(1.05); }
}

/* Hero typography */
.hero-domain {
    font-family: var(--font-mono);
    font-weight: 500;
    font-size: clamp(2rem, 5vw, 4.5rem);
    letter-spacing: 0.25em;
    color: var(--text-display);
    text-transform: lowercase;
    display: inline-flex;
    align-items: baseline;
    line-height: 1;
    margin: 0;
}

.typewriter-text {
    display: inline-block;
    white-space: pre;
}

.cursor {
    display: inline-block;
    margin-left: 0.05em;
    color: var(--accent-proxy);
    font-weight: 400;
    animation: blink 1s step-end infinite;
}

.cursor--terminal {
    margin-left: 0;
    margin-right: 0.4em;
    font-size: 0.85em;
    color: var(--accent-proxy);
}

@keyframes blink {
    0%, 49% { opacity: 1; }
    50%, 100% { opacity: 0; }
}

.hero-subtitle {
    font-family: var(--font-body);
    font-weight: 300;
    font-size: clamp(0.95rem, 1.4vw, 1.1rem);
    letter-spacing: 0.06em;
    color: var(--text-mute);
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 500ms var(--ease-soft) 200ms, transform 500ms var(--ease-soft) 200ms;
}

.hero-subtitle.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.opening-meta {
    display: flex;
    gap: 1.4rem;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 0.6rem;
    opacity: 0;
    transition: opacity 600ms var(--ease-soft) 400ms;
}

.opening-meta.is-visible {
    opacity: 1;
}

.meta-field {
    font-family: var(--font-code);
    font-size: 0.75rem;
    color: var(--text-dim);
    letter-spacing: 0.18em;
    padding: 4px 10px;
    border: 1px solid rgba(26, 58, 92, 0.7);
}

/* Scroll cue */
.scroll-cue {
    position: absolute;
    bottom: 5vh;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    font-family: var(--font-mono);
    font-size: 0.65rem;
    letter-spacing: 0.3em;
    color: var(--text-dim);
    opacity: 0;
    transition: opacity 500ms var(--ease-soft) 1200ms;
}

.scroll-cue.is-visible {
    opacity: 1;
}

.scroll-cue-line {
    width: 1px;
    height: 32px;
    background: linear-gradient(to bottom, transparent, var(--accent-proxy));
    animation: cueDrift 1.8s ease-in-out infinite;
}

@keyframes cueDrift {
    0%, 100% { transform: translateY(-4px); opacity: 0.4; }
    50% { transform: translateY(4px); opacity: 1; }
}

/* ============================================
   Section 2 — Routing diagram
   ============================================ */

.section-routing {
    min-height: 200vh;
    padding-top: 12vh;
    padding-bottom: 8vh;
    position: relative;
}

.routing-header {
    max-width: 720px;
    margin: 0 auto 5vh;
    text-align: center;
}

.routing-canvas {
    position: sticky;
    top: 12vh;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    aspect-ratio: 3 / 2;
    height: auto;
}

.routing-svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.connection {
    fill: none;
    stroke: var(--grid-line);
    stroke-width: 1.5;
    stroke-linecap: round;
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
    transition: stroke-dashoffset 700ms var(--ease-soft), stroke 500ms var(--ease-soft), opacity 400ms var(--ease-soft);
    opacity: 0.3;
}

.connection.is-drawn {
    stroke-dashoffset: 0;
    opacity: 1;
}

.connection.from-origin.is-drawn { stroke: rgba(244, 162, 97, 0.8); }
.connection.from-proxy.is-drawn { stroke: rgba(79, 195, 247, 0.8); }
.connection.from-dest.is-drawn { stroke: rgba(129, 199, 132, 0.8); }

.packet {
    fill: var(--accent-proxy);
    filter: drop-shadow(0 0 6px rgba(79, 195, 247, 0.9));
    opacity: 0;
    transition: opacity 300ms var(--ease-soft);
}

.packet.is-active {
    opacity: 1;
}

/* Hex nodes positioned over SVG plane */
.node-layer {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.iso-node {
    position: absolute;
    width: 96px;
    height: 96px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    pointer-events: auto;
    cursor: pointer;
    transform: translate(-50%, -50%);
    transition: transform var(--tempo-mid) var(--ease-spring), filter var(--tempo-mid) var(--ease-soft);
}

.iso-node-hex {
    position: relative;
    width: 56px;
    height: 56px;
    display: block;
    background: rgba(26, 58, 92, 0.65);
    border: 1.5px solid var(--grid-line);
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    box-shadow: inset 0 0 10px rgba(11, 22, 40, 0.6);
    transition: background var(--tempo-mid) var(--ease-soft), border-color var(--tempo-mid) var(--ease-soft), box-shadow var(--tempo-mid) var(--ease-soft);
}

.iso-node-hex::after {
    content: "";
    position: absolute;
    inset: 30%;
    background: var(--grid-line);
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    opacity: 0;
    transition: opacity var(--tempo-mid) var(--ease-soft), background var(--tempo-mid) var(--ease-soft);
}

.iso-node-label {
    margin-top: 8px;
    font-family: var(--font-mono);
    font-size: 0.6rem;
    font-weight: 400;
    letter-spacing: 0.22em;
    color: var(--text-dim);
    text-transform: uppercase;
    transition: color var(--tempo-mid) var(--ease-soft);
}

.iso-node-addr {
    font-family: var(--font-code);
    font-size: 0.65rem;
    color: transparent;
    letter-spacing: 0.05em;
    margin-top: 2px;
    transition: color var(--tempo-mid) var(--ease-soft);
}

.iso-node.is-on .iso-node-hex {
    background: rgba(11, 22, 40, 0.8);
    box-shadow: inset 0 0 18px rgba(0, 0, 0, 0.5), 0 0 18px rgba(79, 195, 247, 0.25);
}

.iso-node.is-on .iso-node-hex::after {
    opacity: 1;
}

.iso-node.is-on .iso-node-addr {
    color: var(--text-dim);
}

/* Origin nodes */
.iso-node--origin.is-on .iso-node-hex {
    border-color: var(--accent-origin);
    box-shadow: inset 0 0 18px rgba(244, 162, 97, 0.18), 0 0 18px rgba(244, 162, 97, 0.35);
}
.iso-node--origin.is-on .iso-node-hex::after { background: var(--accent-origin); }
.iso-node--origin.is-on .iso-node-label { color: var(--accent-origin); }

/* Proxy nodes */
.iso-node--proxy.is-on .iso-node-hex {
    border-color: var(--accent-proxy);
    box-shadow: inset 0 0 18px rgba(79, 195, 247, 0.18), 0 0 22px rgba(79, 195, 247, 0.4);
}
.iso-node--proxy.is-on .iso-node-hex::after { background: var(--accent-proxy); }
.iso-node--proxy.is-on .iso-node-label { color: var(--accent-proxy); }

/* Destination nodes */
.iso-node--dest.is-on .iso-node-hex {
    border-color: var(--accent-dest);
    box-shadow: inset 0 0 18px rgba(129, 199, 132, 0.18), 0 0 22px rgba(129, 199, 132, 0.4);
}
.iso-node--dest.is-on .iso-node-hex::after { background: var(--accent-dest); }
.iso-node--dest.is-on .iso-node-label { color: var(--accent-dest); }

/* Hover */
.iso-node.is-on:hover {
    transform: translate(-50%, calc(-50% - 4px));
    filter: brightness(1.15);
}

.iso-node.is-on:hover .iso-node-hex {
    box-shadow: inset 0 0 22px rgba(0, 0, 0, 0.5), 0 0 30px currentColor;
}

/* Slow hex breathing on active nodes */
.iso-node.is-on .iso-node-hex {
    animation: nodeBreath 2.5s ease-in-out infinite;
}

@keyframes nodeBreath {
    0%, 100% { transform: scale(0.97); }
    50% { transform: scale(1.03); }
}

/* Content islands */
.islands {
    position: relative;
    max-width: 1200px;
    margin: 8vh auto 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 28px;
    padding: 0 1rem;
}

.island {
    position: relative;
    max-width: 360px;
    padding: 22px 24px;
    background: rgba(14, 31, 51, 0.75);
    border: 1px solid var(--grid-line);
    backdrop-filter: blur(4px);
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 500ms var(--ease-soft), transform 500ms var(--ease-soft), border-color 400ms var(--ease-soft);
}

.island.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.island::before {
    content: "";
    position: absolute;
    top: -1px;
    left: -1px;
    width: 14px;
    height: 14px;
    border-top: 1.5px solid currentColor;
    border-left: 1.5px solid currentColor;
    color: var(--grid-line);
    transition: color var(--tempo-mid) var(--ease-soft);
}

.island::after {
    content: "";
    position: absolute;
    bottom: -1px;
    right: -1px;
    width: 14px;
    height: 14px;
    border-bottom: 1.5px solid currentColor;
    border-right: 1.5px solid currentColor;
    color: var(--grid-line);
    transition: color var(--tempo-mid) var(--ease-soft);
}

.island--origin { color: var(--accent-origin); }
.island--proxy  { color: var(--accent-proxy); }
.island--dest   { color: var(--accent-dest); }

.island.is-visible::before,
.island.is-visible::after {
    color: currentColor;
}

.island-tag {
    display: block;
    font-family: var(--font-mono);
    font-size: 0.65rem;
    letter-spacing: 0.24em;
    color: currentColor;
    text-transform: uppercase;
    margin-bottom: 0.6rem;
}

.island-title {
    font-family: var(--font-mono);
    font-weight: 500;
    font-size: 1.05rem;
    letter-spacing: 0.02em;
    color: var(--text-display);
    margin-bottom: 0.55rem;
    line-height: 1.35;
}

.island-body {
    font-family: var(--font-body);
    font-weight: 300;
    font-size: 0.92rem;
    line-height: 1.7;
    color: var(--text-body);
    max-width: 38ch;
    margin-bottom: 0.85rem;
}

.island-code {
    display: block;
    font-family: var(--font-code);
    font-size: 0.78rem;
    color: var(--text-dim);
    letter-spacing: 0.04em;
    padding: 8px 10px;
    background: rgba(11, 22, 40, 0.6);
    border-left: 2px solid currentColor;
}

.island-code span {
    color: currentColor;
}

/* ============================================
   Section 3 — Protocol layer
   ============================================ */

.section-protocol {
    min-height: 100vh;
    background: var(--bg-secondary);
    padding-top: 14vh;
    padding-bottom: 14vh;
    position: relative;
    overflow: hidden;
}

.protocol-header {
    max-width: 720px;
    margin: 0 auto 6vh;
    text-align: center;
}

.packet-anatomy {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
    gap: 5vw;
    max-width: 1200px;
    margin: 0 auto;
    align-items: center;
}

.packet-stage {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 18px;
    perspective: 1200px;
    --layer-spread: 0;
}

.packet-layer {
    position: relative;
    padding: 22px 26px;
    transform: skewX(-5deg) translateY(calc(var(--layer-offset, 0) * var(--layer-spread)));
    transition: transform 100ms linear;
    border-radius: 4px;
}

.packet-layer--header { --layer-offset: -1; }
.packet-layer--payload { --layer-offset: 0; }
.packet-layer--routing { --layer-offset: 1; }

.layer-skin {
    position: absolute;
    inset: 0;
    border: 1px solid currentColor;
    background: rgba(20, 40, 64, 0.45);
    border-radius: 4px;
    z-index: 0;
}

.packet-layer--header { color: var(--accent-origin); }
.packet-layer--header .layer-skin { background: rgba(244, 162, 97, 0.12); }

.packet-layer--payload { color: var(--accent-proxy); }
.packet-layer--payload .layer-skin { background: rgba(79, 195, 247, 0.12); }

.packet-layer--routing { color: var(--accent-dest); }
.packet-layer--routing .layer-skin { background: rgba(129, 199, 132, 0.12); }

.layer-info {
    position: relative;
    z-index: 1;
    transform: skewX(5deg);
    display: flex;
    align-items: center;
    gap: 28px;
    flex-wrap: wrap;
}

.layer-index {
    font-family: var(--font-mono);
    font-weight: 500;
    font-size: 1.4rem;
    color: currentColor;
    letter-spacing: 0.08em;
    min-width: 52px;
}

.layer-name {
    font-family: var(--font-mono);
    font-weight: 400;
    font-size: 0.85rem;
    letter-spacing: 0.28em;
    color: var(--text-display);
    text-transform: uppercase;
    min-width: 100px;
}

.layer-fields {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    list-style: none;
    flex: 1;
    opacity: 0;
    transition: opacity 350ms var(--ease-soft);
}

.layer-fields.is-revealed {
    opacity: 1;
}

.layer-fields li {
    display: flex;
    flex-direction: column;
    font-family: var(--font-code);
    font-size: 0.72rem;
}

.field-key {
    color: var(--text-dim);
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.field-val {
    color: currentColor;
    font-size: 0.85rem;
    margin-top: 2px;
}

.packet-legend {
    border-left: 1px solid var(--grid-line);
    padding-left: 24px;
}

.legend-title {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    letter-spacing: 0.24em;
    color: var(--accent-proxy);
    text-transform: uppercase;
    margin-bottom: 1rem;
}

.legend-text {
    font-family: var(--font-body);
    font-weight: 300;
    font-size: 0.95rem;
    line-height: 1.75;
    color: var(--text-body);
    max-width: 38ch;
    margin-bottom: 1.6rem;
}

.legend-stats {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.legend-stats li {
    display: flex;
    justify-content: space-between;
    font-family: var(--font-mono);
    font-size: 0.78rem;
    border-bottom: 1px dashed var(--grid-line);
    padding-bottom: 6px;
}

.stat-key {
    color: var(--text-dim);
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.stat-val {
    color: var(--text-display);
    letter-spacing: 0.06em;
}

/* Signal indicators strip */
.signal-strip {
    display: flex;
    align-items: center;
    gap: 18px;
    margin: 6vh auto 0;
    max-width: 1200px;
    padding: 16px 20px;
    border-top: 1px solid var(--grid-line);
}

.signal-arc {
    width: 18px;
    height: 18px;
    border: 1.5px solid var(--grid-line);
    border-bottom-color: transparent;
    border-left-color: transparent;
    transform: rotate(-45deg);
    border-radius: 50%;
    transition: border-color 300ms var(--ease-soft);
}

.signal-arc--1 { animation: arcLight 3s ease-in-out infinite 0s; }
.signal-arc--2 { animation: arcLight 3s ease-in-out infinite 0.4s; }
.signal-arc--3 { animation: arcLight 3s ease-in-out infinite 0.8s; }

@keyframes arcLight {
    0%, 70%, 100% { border-color: var(--grid-line); border-bottom-color: transparent; border-left-color: transparent; }
    20%, 50% { border-color: var(--accent-proxy); border-bottom-color: transparent; border-left-color: transparent; }
}

.signal-bar {
    flex: 1;
    height: 2px;
    background: var(--grid-line);
    position: relative;
    overflow: hidden;
}

.signal-bar-fill {
    position: absolute;
    inset: 0 100% 0 0;
    background: linear-gradient(to right, var(--accent-origin), var(--accent-proxy), var(--accent-dest));
    animation: barFill 6s ease-in-out infinite;
}

@keyframes barFill {
    0% { right: 100%; }
    50% { right: 0%; }
    100% { right: 0%; }
}

.signal-blink {
    width: 5px;
    height: 5px;
    background: var(--accent-proxy);
    border-radius: 50%;
    animation: blink 2s step-end infinite;
}

.signal-blink--alt {
    background: var(--accent-origin);
    animation-delay: 1s;
}

/* ============================================
   Section 4 — Signal fade
   ============================================ */

.section-fade {
    min-height: 80vh;
    display: grid;
    place-items: center;
    text-align: center;
    padding-top: 10vh;
    padding-bottom: 14vh;
    position: relative;
}

.section-fade::after {
    content: "";
    position: absolute;
    inset: auto 0 0 0;
    height: 30%;
    background: linear-gradient(to bottom, transparent, var(--bg-primary));
    pointer-events: none;
}

.fade-stage {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.4rem;
}

.fade-line {
    display: inline-flex;
    align-items: center;
    font-family: var(--font-mono);
    font-weight: 300;
    font-size: clamp(1rem, 1.6vw, 1.2rem);
    color: var(--accent-proxy);
    letter-spacing: 0.16em;
}

.fade-msg {
    text-transform: lowercase;
}

.fade-domain {
    font-family: var(--font-mono);
    font-weight: 400;
    font-size: 0.875rem;
    color: var(--text-dim);
    letter-spacing: 0.22em;
    text-transform: lowercase;
}

.fade-meta {
    font-family: var(--font-code);
    font-size: 0.72rem;
    color: var(--text-dim);
    letter-spacing: 0.18em;
    opacity: 0.7;
}

/* When section 4 fade is engaged, dim the iso grid */
body.iso-grid-fade .iso-grid {
    opacity: 0.18;
}

/* ============================================
   Responsive
   ============================================ */

@media (max-width: 880px) {
    .hop-indicator {
        top: 14px;
        left: 14px;
        padding: 8px 12px;
        gap: 10px;
        font-size: 0.62rem;
    }

    .iso-node {
        width: 76px;
        height: 76px;
    }
    .iso-node-hex { width: 44px; height: 44px; }
    .iso-node-label { font-size: 0.55rem; }
    .iso-node-addr { font-size: 0.6rem; }

    .routing-canvas { aspect-ratio: 4 / 3; }

    .packet-anatomy {
        grid-template-columns: 1fr;
        gap: 4vh;
    }

    .packet-legend {
        border-left: none;
        border-top: 1px solid var(--grid-line);
        padding-left: 0;
        padding-top: 24px;
    }

    .layer-info {
        gap: 14px;
    }

    .layer-fields {
        gap: 12px;
    }

    .opening-meta { gap: 0.6rem; }
}

@media (max-width: 560px) {
    .hero-domain { letter-spacing: 0.18em; }
    .iso-node { width: 60px; height: 60px; }
    .iso-node-hex { width: 36px; height: 36px; }
    .islands { grid-template-columns: 1fr; }
    .signal-strip { flex-wrap: wrap; gap: 10px; }
}

/* ============================================
   Reduced motion
   ============================================ */

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
    }

    .iso-grid { opacity: 0.6 !important; }
    .hex-node { opacity: 1 !important; transform: none !important; }
    .hero-subtitle, .opening-meta, .scroll-cue, .island { opacity: 1 !important; transform: none !important; }
    .connection { stroke-dashoffset: 0 !important; opacity: 1 !important; }
    .iso-node { opacity: 1 !important; }
}
