/* longitude.day — nocturnal meridian observatory */
/* ---------------------------------------------- */

:root {
    --ink-night:        #070B14;
    --ink-meridian:     #0E1626;
    --ink-grid:         #1B2840;
    --mist-pale:        #D8DEE8;
    --mist-prose:       #A6B0C2;
    --neon-terminator:  #7DE8FF;
    --neon-firefly:     #9BFFC4;
    --neon-lantern:     #FFB7D5;
    --neon-dawn:        #F4E2A8;

    --col: 14.2857%;
    --gutter: 32px;
    --equator: 47vh;

    --sans: "Mulish", "Inter", "Helvetica Neue", Helvetica, Arial, sans-serif;
    --serif: "Cormorant Garamond", "Cormorant", Georgia, serif;
    --mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
}

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

html {
    background: var(--ink-night);
    color: var(--mist-pale);
    font-family: var(--sans);
    font-weight: 200;
    font-size: 16px;
    line-height: 1.4;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    scroll-behavior: auto;
    overflow-x: hidden;
}

body {
    background: var(--ink-night);
    color: var(--mist-pale);
    min-height: 100vh;
    cursor: none;
    overflow-x: hidden;
}

@media (pointer: coarse) {
    body { cursor: auto; }
}

/* === Meridian grid (7 hairlines) ============================ */

.meridian-grid {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 1;
}

.meridian {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 1px;
    background: var(--ink-grid);
    opacity: 0.18;
}

/* === Equator hairline ======================================= */

.equator {
    position: fixed;
    left: 0;
    right: 0;
    top: var(--equator);
    height: 1px;
    pointer-events: none;
    z-index: 2;
    display: flex;
    align-items: center;
}

.equator-line {
    flex: 1 1 auto;
    height: 1px;
    background: var(--ink-grid);
    opacity: 0.22;
}

.equator-gap {
    flex: 0 0 12px;
    height: 1px;
    background: transparent;
}

/* === Day-line wave overlay ================================== */

.day-wave {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 4;
    opacity: 0;
    transition: opacity 1200ms cubic-bezier(0.22, 0.61, 0.36, 1);
}

.day-wave.is-drawn {
    opacity: 1;
}

#terminator-path {
    stroke-dasharray: 4000;
    stroke-dashoffset: 4000;
}

.day-wave.is-drawing #terminator-path {
    transition: stroke-dashoffset 4200ms cubic-bezier(0.22, 0.61, 0.36, 1);
    stroke-dashoffset: 0;
}

/* === Lantern cursor ========================================= */

.lantern {
    position: fixed;
    top: 0;
    left: 0;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--neon-lantern);
    opacity: 0.7;
    box-shadow:
        0 0 14px 2px rgba(255, 183, 213, 0.55),
        0 0 28px 6px rgba(255, 183, 213, 0.32),
        0 0 48px 12px rgba(255, 183, 213, 0.14);
    pointer-events: none;
    z-index: 9999;
    transform: translate3d(-100px, -100px, 0);
    will-change: transform;
    mix-blend-mode: screen;
}

@media (pointer: coarse) {
    .lantern { display: none; }
}

/* === Document container ==================================== */

.document {
    position: relative;
    z-index: 3;
    width: 100%;
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 var(--gutter);
}

.section {
    position: relative;
    padding: 56vh 0 56vh;
    min-height: 100vh;
}

.section-head {
    position: relative;
    margin-bottom: 18vh;
    padding-left: calc(var(--col) * 1);
}

.section-head--right {
    text-align: right;
    padding-left: calc(var(--col) * 4);
    padding-right: calc(var(--col) * 0);
}

.section-label {
    display: block;
    font-family: var(--sans);
    font-weight: 300;
    font-size: 11px;
    letter-spacing: 0.32em;
    text-transform: lowercase;
    color: var(--mist-prose);
    margin-bottom: 18px;
    opacity: 0.78;
}

.section-title {
    font-family: var(--sans);
    font-weight: 200;
    font-size: clamp(1.6rem, 2.8vw, 2.4rem);
    letter-spacing: -0.012em;
    line-height: 1.08;
    color: var(--mist-pale);
    max-width: 24ch;
}

.section-head--right .section-title {
    margin-left: auto;
}

/* === 1. The Terminator ===================================== */

.section--terminator {
    min-height: 100vh;
    padding: 0;
    display: flex;
    align-items: center;
}

.terminator-frame {
    position: relative;
    width: 100%;
    height: 100vh;
}

.title-block {
    position: absolute;
    left: var(--gutter);
    top: calc(var(--equator) - 6px);
    transform: translateY(-100%);
    padding-bottom: 16px;
    opacity: 0;
    transition: opacity 900ms cubic-bezier(0.22, 0.61, 0.36, 1);
}

.title-block.is-visible {
    opacity: 1;
}

.title-coord {
    display: block;
    font-family: var(--mono);
    font-weight: 200;
    font-size: 12px;
    line-height: 1;
    color: var(--neon-terminator);
    margin-bottom: 18px;
    letter-spacing: 0.04em;
}

.title {
    font-family: var(--sans);
    font-weight: 200;
    font-size: 28px;
    letter-spacing: -0.018em;
    line-height: 0.96;
    color: var(--mist-pale);
}

.title-sub {
    display: block;
    margin-top: 12px;
    font-family: var(--serif);
    font-style: italic;
    font-weight: 300;
    font-size: 15px;
    color: var(--mist-prose);
    letter-spacing: -0.002em;
    line-height: 1.5;
    max-width: 38ch;
}

/* === 2. The Hour Belt ====================================== */

.section--hours {
    padding-top: 56vh;
    padding-bottom: 56vh;
}

.hour-belt {
    margin-top: 8vh;
    position: relative;
    border-top: 1px solid rgba(27, 40, 64, 0.6);
    border-bottom: 1px solid rgba(27, 40, 64, 0.6);
}

.hour {
    position: relative;
    height: 28vh;
    display: grid;
    grid-template-columns: 96px 1fr 200px;
    align-items: center;
    column-gap: var(--gutter);
    padding: 0 calc(var(--col) * 0.5);
    border-bottom: 1px solid rgba(27, 40, 64, 0.32);
    opacity: 0.16;
    transition: opacity 900ms cubic-bezier(0.22, 0.61, 0.36, 1);
}

.hour:last-child {
    border-bottom: none;
}

.hour.is-now {
    opacity: 1;
}

.hour-utc {
    font-family: var(--mono);
    font-weight: 200;
    font-size: 12px;
    color: var(--neon-terminator);
    letter-spacing: 0.04em;
}

.hour-label {
    font-family: var(--sans);
    font-weight: 200;
    font-size: clamp(1.6rem, 3.2vw, 2.6rem);
    letter-spacing: -0.018em;
    line-height: 0.96;
    color: var(--mist-pale);
}

.hour.is-now .hour-label {
    color: var(--mist-pale);
}

.hour-meridian {
    text-align: right;
    font-family: var(--serif);
    font-style: italic;
    font-weight: 300;
    font-size: 14px;
    color: var(--mist-prose);
    letter-spacing: -0.002em;
}

.hour-bar {
    position: absolute;
    left: 0;
    bottom: 0;
    height: 1px;
    background: var(--neon-terminator);
    box-shadow: 0 0 10px rgba(125, 232, 255, 0.45);
    width: 0%;
    transition: width 6000ms linear;
    opacity: 0;
}

.hour.is-now .hour-bar {
    opacity: 0.8;
}

/* === 3. The Day, in Verses ================================= */

.section--verses .verse {
    position: relative;
    margin: 30vh 0;
    padding: 0 calc(var(--col) * 1);
    max-width: 100%;
}

.verse {
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 1100ms cubic-bezier(0.22, 0.61, 0.36, 1),
                transform 1100ms cubic-bezier(0.22, 0.61, 0.36, 1);
}

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

.verse--right {
    margin-left: auto;
    text-align: right;
    padding-left: calc(var(--col) * 4);
    padding-right: calc(var(--col) * 1);
}

.verse-coord {
    display: block;
    font-family: var(--mono);
    font-weight: 200;
    font-size: 12px;
    color: var(--neon-terminator);
    letter-spacing: 0.04em;
    margin-bottom: 14px;
}

.verse-numeral {
    display: block;
    font-family: var(--sans);
    font-weight: 200;
    font-size: 13px;
    color: var(--mist-prose);
    letter-spacing: 0.4em;
    margin-bottom: 22px;
    opacity: 0.7;
}

.verse-prose {
    font-family: var(--serif);
    font-style: italic;
    font-weight: 300;
    font-size: 21px;
    line-height: 1.78;
    letter-spacing: -0.002em;
    color: var(--mist-prose);
    max-width: 56ch;
}

.verse--right .verse-prose {
    margin-left: auto;
}

/* === 4. Atlas of Soft Things =============================== */

.atlas {
    margin-top: 12vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24vh;
    padding: 0 calc(var(--col) * 1);
}

.vignette {
    position: relative;
    width: 100%;
    max-width: 380px;
    color: var(--mist-prose);
    transition: color 600ms cubic-bezier(0.22, 0.61, 0.36, 1),
                filter 600ms cubic-bezier(0.22, 0.61, 0.36, 1);
    filter: drop-shadow(0 0 0 rgba(155, 255, 196, 0));
}

.vignette--alt {
    margin-left: auto;
    margin-right: 0;
}

.vignette:nth-child(even) {
    align-self: flex-end;
}

.vignette:nth-child(odd) {
    align-self: flex-start;
}

.vignette-coord {
    display: block;
    font-family: var(--mono);
    font-weight: 200;
    font-size: 12px;
    color: var(--neon-terminator);
    letter-spacing: 0.04em;
    margin-bottom: 10px;
}

.vignette-name {
    display: block;
    font-family: var(--serif);
    font-style: italic;
    font-weight: 300;
    font-size: 15px;
    color: var(--mist-prose);
    letter-spacing: -0.002em;
    margin-bottom: 22px;
    opacity: 0.86;
}

.vignette-svg {
    width: 100%;
    height: auto;
    display: block;
    transition: color 600ms cubic-bezier(0.22, 0.61, 0.36, 1);
}

.vignette.is-near {
    color: var(--neon-firefly);
    filter: drop-shadow(0 0 8px rgba(155, 255, 196, 0.55))
            drop-shadow(0 0 18px rgba(155, 255, 196, 0.22));
}

.vignette.is-pulsing {
    animation: firefly-pulse 6s ease-in-out infinite;
}

@keyframes firefly-pulse {
    0%, 100% {
        color: var(--mist-prose);
        filter: drop-shadow(0 0 0 rgba(155, 255, 196, 0));
    }
    50% {
        color: var(--neon-firefly);
        filter: drop-shadow(0 0 8px rgba(155, 255, 196, 0.45));
    }
}

/* === 5. Coda ============================================== */

.section--coda {
    min-height: 100vh;
    padding: 56vh 0 56vh;
    display: flex;
    align-items: center;
}

.coda-frame {
    position: relative;
    width: 100%;
    height: 1px;
    top: calc(var(--equator) - 56vh);
}

.coda-prose {
    position: absolute;
    right: var(--gutter);
    top: 0;
    transform: translateY(-50%);
    font-family: var(--serif);
    font-style: italic;
    font-weight: 300;
    font-size: 19px;
    line-height: 1.6;
    color: var(--mist-prose);
    letter-spacing: -0.002em;
    text-align: right;
    max-width: 36ch;
    opacity: 0;
    transition: opacity 1100ms cubic-bezier(0.22, 0.61, 0.36, 1);
}

.coda-prose.is-visible {
    opacity: 1;
}

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

@media (max-width: 720px) {
    .meridian:nth-child(2),
    .meridian:nth-child(4),
    .meridian:nth-child(6) {
        display: none;
    }

    .section {
        padding: 32vh 0;
    }

    .section-head {
        padding-left: 0;
    }

    .section-head--right {
        padding-left: 0;
    }

    .section--verses .verse,
    .section--verses .verse--right {
        padding: 0;
        text-align: left;
        margin: 22vh 0;
    }

    .verse--right .verse-prose {
        margin-left: 0;
    }

    .hour {
        grid-template-columns: 64px 1fr;
        height: 22vh;
    }

    .hour-meridian {
        display: none;
    }

    .atlas {
        padding: 0;
        gap: 18vh;
    }

    .vignette:nth-child(even),
    .vignette:nth-child(odd) {
        align-self: stretch;
    }

    .title-block {
        left: var(--gutter);
    }

    .coda-prose {
        right: var(--gutter);
        left: var(--gutter);
        text-align: right;
    }
}
