/* addrenvoy.com - Frutiger Aero Glossy Tech */
/* Palette: #0a6eb4, #e8f4fd, #f49e2c, #ffffff, #0d1b2a, #2ecc71, #1a2332, #4dabf7 */

:root {
    --blue: #0a6eb4;
    --ice: #e8f4fd;
    --amber: #f49e2c;
    --white: #ffffff;
    --navy: #0d1b2a;
    --navy-mid: #1a2332;
    --green: #2ecc71;
    --text-dark: #1a2332;
    --text-light: #e8f4fd;
    --glow: #4dabf7;
}

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

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--ice);
    color: var(--text-dark);
    font-family: 'Source Sans 3', sans-serif;
    font-weight: 400;
    line-height: 1.6;
    overflow-x: hidden;
}

/* ============================
   ROUTING LINE (scroll-tracking)
   ============================ */
.routing-line {
    position: fixed;
    left: 30px;
    top: 0;
    bottom: 0;
    width: 3px;
    background: rgba(10, 110, 180, 0.1);
    z-index: 100;
}

.routing-fill {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 0%;
    background: linear-gradient(to bottom, var(--blue), var(--glow));
    transition: height 0.1s linear;
    border-radius: 0 0 2px 2px;
}

.route-marker {
    position: absolute;
    left: -5px;
    width: 13px;
    height: 13px;
    border-radius: 50%;
    background: rgba(10, 110, 180, 0.12);
    border: 2px solid var(--blue);
    transition: background 0.5s ease, border-color 0.5s ease, box-shadow 0.5s ease;
    z-index: 1;
}

.route-marker.active {
    background: var(--amber);
    border-color: var(--amber);
    box-shadow: 0 0 8px rgba(244, 158, 44, 0.5);
}

.rm-1 { top: 12.5%; }
.rm-2 { top: 37.5%; }
.rm-3 { top: 62.5%; }
.rm-4 { top: 87.5%; }

/* ============================
   ENVELOPE SILHOUETTES
   ============================ */
.envelope-layer {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}

.envelope-float {
    position: absolute;
    width: 50px;
    height: 34px;
    color: rgba(10, 110, 180, 0.06);
    animation: envelopeDrift linear infinite;
}

.env-1 {
    top: 15%;
    left: -60px;
    animation-duration: 28s;
    animation-delay: 0s;
}

.env-2 {
    top: 40%;
    left: -60px;
    animation-duration: 34s;
    animation-delay: 7s;
    width: 40px;
    height: 27px;
}

.env-3 {
    top: 65%;
    left: -60px;
    animation-duration: 22s;
    animation-delay: 14s;
    width: 60px;
    height: 40px;
}

.env-4 {
    top: 85%;
    left: -60px;
    animation-duration: 30s;
    animation-delay: 4s;
    width: 35px;
    height: 24px;
}

@keyframes envelopeDrift {
    0% {
        transform: translateX(0) translateY(0) rotate(-5deg);
        opacity: 0;
    }
    5% {
        opacity: 1;
    }
    95% {
        opacity: 1;
    }
    100% {
        transform: translateX(calc(100vw + 80px)) translateY(-30px) rotate(5deg);
        opacity: 0;
    }
}

/* ============================
   SECTION BASE
   ============================ */
.envoy-section {
    min-height: 100vh;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 5rem 2rem 5rem 70px;
    z-index: 2;
}

/* ============================
   GLASS PANELS (Frutiger Aero)
   ============================ */
.glass-panel {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 14px;
    padding: 2rem 2.5rem;
    box-shadow: 0 4px 24px rgba(10, 110, 180, 0.06), inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

/* ============================
   HERO SECTION (Dispatch)
   ============================ */
.hero-section {
    background: var(--navy);
    color: var(--text-light);
    overflow: hidden;
}

.network-bg {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.network-svg {
    width: 100%;
    max-width: 1200px;
    height: auto;
    opacity: 0.85;
}

.hero-panel {
    position: relative;
    z-index: 2;
    text-align: center;
    background: rgba(13, 27, 42, 0.75);
    border: 1px solid rgba(77, 171, 247, 0.2);
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(77, 171, 247, 0.1);
    padding: 3rem 4rem;
    opacity: 0;
    transform: translateX(-60px);
    transition: opacity 0.8s ease, transform 0.8s cubic-bezier(0.34, 1.2, 0.64, 1);
}

.hero-panel.visible {
    opacity: 1;
    transform: translateX(0);
}

.brand-name {
    font-family: 'Exo 2', sans-serif;
    font-weight: 700;
    font-size: clamp(2.8rem, 8vw, 4.5rem);
    color: var(--text-light);
    letter-spacing: 0.02em;
    text-shadow: 0 0 30px rgba(77, 171, 247, 0.2);
}

.brand-sub {
    font-family: 'Source Sans 3', sans-serif;
    font-size: 1rem;
    font-weight: 400;
    color: var(--glow);
    margin-top: 0.4rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
}

.tracking-num {
    font-family: 'Overpass Mono', monospace;
    font-size: 0.8rem;
    color: var(--amber);
    margin-top: 1.8rem;
    letter-spacing: 0.12em;
    min-height: 1.2em;
}

/* Typewriter cursor blink */
.tracking-num.typing::after {
    content: '|';
    animation: cursorBlink 0.6s step-end infinite;
    color: var(--amber);
}

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

/* ============================
   IN TRANSIT SECTION
   ============================ */
.transit-section {
    background: var(--ice);
    gap: 0;
    padding-top: 6rem;
    padding-bottom: 6rem;
    justify-content: flex-start;
    min-height: auto;
}

.transit-connector {
    display: none;
}

.transit-line-segment {
    width: 4px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.transit-dash {
    width: 4px;
    height: 100%;
}

.dash-animate {
    animation: dashPulse 3s linear infinite;
}

@keyframes dashPulse {
    0% { stroke-opacity: 0.15; stroke-dashoffset: 0; }
    50% { stroke-opacity: 0.5; }
    100% { stroke-opacity: 0.15; stroke-dashoffset: -20; }
}

/* Waypoint Bands */
.waypoint-band {
    display: flex;
    gap: 1.5rem;
    max-width: 720px;
    width: 100%;
    opacity: 0;
    transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.34, 1.3, 0.64, 1);
}

.waypoint-band.slide-left {
    transform: translateX(-40px);
}

.waypoint-band.slide-right {
    transform: translateX(40px);
}

.waypoint-band.visible {
    opacity: 1;
    transform: translateX(0);
}

.wp-sidebar {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.6rem;
    padding-top: 1.8rem;
    min-width: 40px;
}

.wp-num {
    font-family: 'Overpass Mono', monospace;
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--blue);
    letter-spacing: 0.12em;
}

.wp-node-icon {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid var(--blue);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.wp-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--amber);
}

.wp-content {
    flex: 1;
}

.wp-title {
    font-family: 'Exo 2', sans-serif;
    font-weight: 600;
    font-size: 1.35rem;
    color: var(--text-dark);
    margin-bottom: 0.8rem;
}

.wp-body {
    font-family: 'Source Sans 3', sans-serif;
    font-size: 0.95rem;
    line-height: 1.75;
    color: rgba(26, 35, 50, 0.7);
    margin-bottom: 1.2rem;
}

.wp-footer {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.wp-stamp {
    font-family: 'Overpass Mono', monospace;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    color: var(--blue);
    padding: 3px 10px;
    border: 1px dashed var(--blue);
    border-radius: 4px;
    display: inline-block;
}

.wp-time {
    font-family: 'Overpass Mono', monospace;
    font-size: 0.6rem;
    color: rgba(10, 110, 180, 0.4);
    letter-spacing: 0.1em;
}

/* ============================
   CUSTOMS CHECK SECTION
   ============================ */
.customs-section {
    background: linear-gradient(175deg, var(--navy) 0%, var(--navy-mid) 100%);
    color: var(--text-light);
}

.customs-content {
    display: flex;
    gap: 3rem;
    align-items: flex-start;
    max-width: 650px;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

.customs-content.visible {
    opacity: 1;
    transform: translateY(0);
}

.radar-badge {
    width: 110px;
    height: 110px;
    border-radius: 50%;
    border: 2px dashed var(--glow);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
}

.radar-sweep {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: conic-gradient(from 0deg, transparent 0deg, rgba(77, 171, 247, 0.25) 70deg, transparent 70deg);
    animation: sweep 3s linear infinite;
}

@keyframes sweep {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.radar-crosshair {
    position: absolute;
    width: 100%;
    height: 100%;
}

.crosshair-h, .crosshair-v {
    position: absolute;
    background: rgba(77, 171, 247, 0.12);
}

.crosshair-h {
    top: 50%;
    left: 10%;
    right: 10%;
    height: 1px;
}

.crosshair-v {
    left: 50%;
    top: 10%;
    bottom: 10%;
    width: 1px;
}

.radar-label {
    font-family: 'Overpass Mono', monospace;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    color: var(--glow);
    position: relative;
    z-index: 2;
}

.customs-data {
    flex: 1;
}

.customs-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.8rem;
    border-bottom: 1px solid rgba(77, 171, 247, 0.2);
}

.customs-title {
    font-family: 'Exo 2', sans-serif;
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--text-light);
}

.customs-badge {
    font-family: 'Overpass Mono', monospace;
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    color: var(--green);
    padding: 2px 8px;
    border: 1px solid var(--green);
    border-radius: 3px;
}

.data-row {
    display: flex;
    justify-content: space-between;
    padding: 0.55rem 0;
    border-bottom: 1px solid rgba(77, 171, 247, 0.1);
    font-family: 'Overpass Mono', monospace;
    font-size: 0.75rem;
}

.data-key {
    color: var(--glow);
    opacity: 0.55;
}

.data-val {
    color: var(--text-light);
}

.integrity-ok {
    color: var(--green);
}

.status-ok {
    color: var(--green);
}

/* ============================
   DELIVERED SECTION
   ============================ */
.delivered-section {
    background: var(--ice);
    gap: 1.5rem;
    position: relative;
    overflow: hidden;
}

/* Final node background pulse */
.final-node-bg {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 300px;
    height: 300px;
    pointer-events: none;
}

.final-pulse {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 1px solid var(--green);
    opacity: 0;
    animation: finalPulse 3s ease-out infinite;
}

.final-pulse.pulse-2 {
    animation-delay: 1.5s;
}

@keyframes finalPulse {
    0% {
        transform: scale(0.3);
        opacity: 0.5;
    }
    100% {
        transform: scale(1);
        opacity: 0;
    }
}

.final-dot {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 10px;
    height: 10px;
    margin: -5px 0 0 -5px;
    border-radius: 50%;
    background: var(--green);
    box-shadow: 0 0 20px rgba(46, 204, 113, 0.4);
}

/* Delivered stamp */
.delivered-stamp {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    border: 3px double var(--green);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 2;
    opacity: 0;
    transform: scale(0.4) rotate(20deg);
    transition: opacity 0.6s ease, transform 0.7s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.delivered-stamp.visible {
    opacity: 1;
    transform: scale(1) rotate(0deg);
}

.stamp-ring {
    position: absolute;
    inset: 6px;
    border-radius: 50%;
    border: 1px dashed rgba(46, 204, 113, 0.3);
}

.stamp-text {
    font-family: 'Exo 2', sans-serif;
    font-weight: 700;
    font-size: 0.85rem;
    letter-spacing: 0.18em;
    color: var(--green);
    position: relative;
    z-index: 2;
}

.delivered-sub {
    font-family: 'Source Sans 3', sans-serif;
    font-size: 0.95rem;
    color: rgba(26, 35, 50, 0.5);
    position: relative;
    z-index: 2;
    opacity: 0;
    transform: translateY(15px);
    transition: opacity 0.6s ease 0.2s, transform 0.6s ease 0.2s;
}

.delivered-sub.visible {
    opacity: 1;
    transform: translateY(0);
}

.delivered-meta {
    font-family: 'Overpass Mono', monospace;
    font-size: 0.65rem;
    color: rgba(26, 35, 50, 0.3);
    letter-spacing: 0.1em;
    position: relative;
    z-index: 2;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.6s ease 0.4s, transform 0.6s ease 0.4s;
}

.delivered-meta.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ============================
   NETWORK EDGE ANIMATION
   ============================ */
.network-edges line {
    transition: opacity 0.6s ease;
}

.network-nodes circle {
    transition: opacity 0.6s ease;
}

/* Origin node pulse */
.origin-node {
    animation: originPulse 2.5s ease-in-out infinite;
}

@keyframes originPulse {
    0%, 100% { r: 10; opacity: 1; }
    50% { r: 12; opacity: 0.85; }
}

/* ============================
   FADE-IN UTILITY
   ============================ */
.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Override transform for slide variants */
.fade-in.slide-left {
    transform: translateX(-40px);
}

.fade-in.slide-right {
    transform: translateX(40px);
}

.fade-in.slide-left.visible,
.fade-in.slide-right.visible {
    transform: translateX(0);
}

/* ============================
   RESPONSIVE
   ============================ */
@media (max-width: 768px) {
    .routing-line {
        display: none;
    }

    .envoy-section {
        padding: 4rem 1.5rem;
    }

    .hero-panel {
        padding: 2rem 1.5rem;
    }

    .waypoint-band {
        flex-direction: column;
        gap: 0.75rem;
    }

    .wp-sidebar {
        flex-direction: row;
        padding-top: 0;
        gap: 0.75rem;
    }

    .customs-content {
        flex-direction: column;
        gap: 1.5rem;
        align-items: center;
    }

    .radar-badge {
        width: 90px;
        height: 90px;
    }

    .envelope-layer {
        display: none;
    }

    .brand-name {
        font-size: clamp(2rem, 10vw, 3rem);
    }
}

@media (max-width: 480px) {
    .glass-panel {
        padding: 1.5rem 1.2rem;
    }

    .data-row {
        font-size: 0.65rem;
    }
}
