/* addrenvoy.com - Surreal Postal Cartography */

:root {
    --void: #0B1026;
    --astral: #121B3A;
    --silver: #D4DCE8;
    --envoy-blue: #7B9EC7;
    --star-gold: #C9A84C;
    --nebula: #6B5B95;
    --edge: #1E2747;
    --parchment: #F0E6D3;

    --font-display: 'Space Grotesk', sans-serif;
    --font-body: 'Libre Baskerville', serif;
    --font-mono: 'DM Mono', monospace;

    --ease-morph: cubic-bezier(0.23, 1, 0.32, 1);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

html { scroll-behavior: smooth; }

body {
    background: var(--void);
    color: var(--silver);
    font-family: var(--font-body);
    font-weight: 400;
    font-size: clamp(1rem, 1.15vw, 1.25rem);
    line-height: 1.75;
    overflow-x: hidden;
}

/* Starfield Canvas */
#starfield {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

/* Noise Overlay */
.noise-overlay {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 999;
    opacity: 0.03;
    mix-blend-mode: overlay;
}

/* Envoy Path SVG */
.envoy-path {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 100%;
    z-index: 2;
    pointer-events: none;
}

/* Sidebar Navigation */
.sidebar-nav {
    position: fixed;
    right: 2rem;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    z-index: 100;
    opacity: 0.6;
    transition: opacity 0.3s ease;
}

.sidebar-nav:hover {
    opacity: 1;
}

.nav-diamond {
    width: 10px;
    height: 10px;
    background: var(--edge);
    border: 1px solid var(--envoy-blue);
    transform: rotate(45deg);
    display: block;
    transition: background 0.3s ease, box-shadow 0.3s ease, transform 0.4s var(--ease-spring);
}

.nav-diamond.active {
    background: var(--star-gold);
    border-color: var(--star-gold);
    box-shadow: 0 0 12px rgba(201, 168, 76, 0.3);
}

.nav-diamond:hover {
    transform: rotate(45deg) scale(1.3);
    box-shadow: 0 0 16px rgba(201, 168, 76, 0.4);
}

/* Diagonal Sections */
.diagonal-section {
    position: relative;
    min-height: 100vh;
    padding: clamp(4rem, 8vw, 10rem);
    overflow: hidden;
    z-index: 3;
}

.section-origin {
    background: var(--void);
    clip-path: polygon(0 0, 100% 0, 100% calc(100% - 60px), 0 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.section-transit {
    background: var(--astral);
    clip-path: polygon(0 60px, 100% 0, 100% calc(100% - 40px), 0 100%);
    margin-top: -60px;
}

.section-cartography {
    background: var(--void);
    clip-path: polygon(0 40px, 100% 0, 100% calc(100% - 50px), 0 100%);
    margin-top: -40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.section-dispatch {
    background: var(--astral);
    clip-path: polygon(0 50px, 100% 0, 100% calc(100% - 60px), 0 100%);
    margin-top: -50px;
}

.section-arrival {
    background: linear-gradient(180deg, var(--void) 0%, var(--edge) 100%);
    clip-path: polygon(0 60px, 100% 0, 100% 100%, 0 100%);
    margin-top: -60px;
}

/* Constellation BG */
.constellation {
    position: absolute;
    width: 60%;
    max-width: 600px;
    top: 15%;
    right: 5%;
    opacity: 0.4;
    animation: constellationRotate 200s linear infinite;
    z-index: 1;
}

.constellation-large {
    position: absolute;
    width: 80%;
    max-width: 800px;
    top: 10%;
    left: 10%;
    z-index: 1;
}

@keyframes constellationRotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.draw-line {
    stroke-dasharray: 800;
    stroke-dashoffset: 800;
    transition: stroke-dashoffset 2s var(--ease-morph);
}

.draw-line.drawn {
    stroke-dashoffset: 0;
}

/* Section Inner */
.section-inner {
    position: relative;
    z-index: 5;
    max-width: 1100px;
    margin: 0 auto;
}

/* Hero */
.hero-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(3.5rem, 9vw, 12rem);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--parchment);
    text-align: center;
    line-height: 1;
    margin-bottom: 1.5rem;
}

.hero-sub {
    font-family: var(--font-body);
    font-style: italic;
    font-size: 1.1rem;
    color: var(--envoy-blue);
    text-align: center;
}

/* Section Heading */
.section-heading {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(2rem, 4vw, 4rem);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--parchment);
    line-height: 1.1;
    margin-bottom: 1.5rem;
}

/* Offset Pair Layout */
.offset-pair {
    display: flex;
    gap: 4rem;
    align-items: flex-start;
}

.offset-pair.reverse {
    flex-direction: row-reverse;
}

.block-left {
    flex: 0 0 45%;
}

.block-right {
    flex: 1;
}

.body-text {
    margin-bottom: 1.25rem;
    color: var(--silver);
}

/* Pull Quote */
.pull-quote {
    font-family: var(--font-body);
    font-weight: 700;
    font-style: italic;
    font-size: 1.2rem;
    color: var(--parchment);
    border-left: 3px solid var(--star-gold);
    padding-left: 1.5rem;
    margin: 2rem 0;
}

/* Coord Labels */
.coord-label {
    font-family: var(--font-mono);
    font-weight: 400;
    font-size: 0.75rem;
    letter-spacing: 0.2em;
    color: var(--envoy-blue);
    display: block;
    margin-bottom: 1rem;
}

.coord-labels {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* Waypoint Diamonds */
.waypoint-diamond {
    width: 16px;
    height: 16px;
    background: var(--star-gold);
    transform: rotate(45deg);
    box-shadow: 0 0 12px rgba(201, 168, 76, 0.3);
    margin: 2rem auto;
}

.diamond-pulse {
    animation: diamondPulse 3s ease-in-out infinite;
}

.diamond-large {
    width: 40px;
    height: 40px;
}

@keyframes diamondPulse {
    0%, 100% { box-shadow: 0 0 12px rgba(201, 168, 76, 0.3); }
    50% { box-shadow: 0 0 24px rgba(201, 168, 76, 0.6); }
}

/* Arrival Center */
.arrival-center {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Morph Animation */
.morph-in {
    opacity: 0;
    transform: scaleY(0.7);
    transition: opacity 1s var(--ease-morph), transform 1s var(--ease-morph);
}

.morph-in.visible {
    opacity: 1;
    transform: scaleY(1);
}

/* Responsive */
@media (max-width: 768px) {
    .offset-pair {
        flex-direction: column;
    }

    .offset-pair.reverse {
        flex-direction: column;
    }

    .block-left { flex: none; }

    .sidebar-nav {
        right: 0.75rem;
    }

    .diagonal-section {
        padding: clamp(3rem, 6vw, 6rem);
    }
}
