/* ============================================
   lrx.st - Nordic Aurora Chrome
   Scandinavian Luxury Observatory Timeline
   ============================================ */

/* CSS Custom Properties */
:root {
    --nordic-parchment: #f0ebe3;
    --deep-nordic-night: #1a1b2e;
    --burnished-copper: #d4a574;
    --aurora-teal: #5bb5a2;
    --obsidian-ink: #1a1b2e;
    --parchment-cream: #f0ebe3;
    --lavender-mist: #8a8698;
    --pewter-chrome: #c4b5a0;
    --text-secondary: #4a4a5a;
    --text-dark-body: #b8b5c0;
    --blueprint-line: #2a2b3e;

    --font-display: 'Libre Baskerville', Georgia, serif;
    --font-body: 'Nunito Sans', 'Segoe UI', sans-serif;
    --font-meta: 'DM Sans', 'Helvetica Neue', sans-serif;

    --ease-overshoot: cubic-bezier(0.22, 1, 0.36, 1);
    --ease-decel: cubic-bezier(0.16, 1, 0.3, 1);
}

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

html {
    scroll-behavior: smooth;
    scroll-snap-type: y proximity;
}

body {
    font-family: var(--font-body);
    background: var(--nordic-parchment);
    color: var(--text-secondary);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Scroll Progress Indicator */
.scroll-progress {
    position: fixed;
    top: 0;
    right: 0;
    width: 4px;
    height: 0%;
    background: var(--burnished-copper);
    z-index: 100;
    transition: height 0.1s linear;
}

/* Domain Mark */
.domain-mark {
    position: fixed;
    top: 32px;
    left: 32px;
    font-family: var(--font-display);
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.35em;
    text-transform: uppercase;
    color: var(--parchment-cream);
    z-index: 100;
    mix-blend-mode: difference;
}

/* Timeline Spine */
.timeline-spine {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10;
}

/* Main Container */
.timeline-container {
    position: relative;
    width: 100%;
}

/* ============================================
   Opening Gate (Node 0)
   ============================================ */
.opening-gate {
    min-height: 100vh;
    background: var(--deep-nordic-night);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    scroll-snap-align: start;
}

.gate-content {
    text-align: center;
    position: relative;
    z-index: 5;
}

.gate-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(6rem, 12vw, 14rem);
    color: var(--parchment-cream);
    letter-spacing: 0.04em;
    line-height: 1.08;
    position: relative;
}

.gate-line {
    width: 2px;
    height: 0;
    background: var(--burnished-copper);
    margin: 0 auto;
    transition: height 1.2s var(--ease-overshoot);
}

.gate-line.active {
    height: 120px;
}

.scroll-sentinel {
    position: absolute;
    bottom: 20vh;
    width: 1px;
    height: 1px;
}

/* Orbital Rings */
.orbital-ring {
    position: absolute;
    pointer-events: none;
    z-index: 1;
}

.orbital-ring-1 {
    width: 80%;
    top: 10%;
    left: 10%;
    animation: orbit 75s linear infinite;
}

.orbital-ring-2 {
    width: 60%;
    top: 25%;
    right: -5%;
    animation: orbit 100s linear infinite reverse;
}

.orbital-ring-3 {
    width: 90%;
    bottom: 5%;
    left: -10%;
    animation: orbit 55s linear infinite;
}

@keyframes orbit {
    to { transform: rotate(360deg); }
}

/* ============================================
   Timeline Nodes
   ============================================ */
.timeline-node {
    min-height: 100vh;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    scroll-snap-align: start;
    overflow: hidden;
}

/* Theme: Light */
[data-theme="light"] {
    background: var(--nordic-parchment);
}

[data-theme="light"] .node-headline {
    color: var(--obsidian-ink);
}

[data-theme="light"] .content-body p {
    color: var(--text-secondary);
}

[data-theme="light"] .collage-geometric {
    mix-blend-mode: multiply;
}

/* Theme: Dark */
[data-theme="dark"] {
    background: var(--deep-nordic-night);
}

[data-theme="dark"] .node-headline {
    color: var(--parchment-cream);
}

[data-theme="dark"] .content-body p {
    color: var(--text-dark-body);
}

[data-theme="dark"] .collage-geometric {
    mix-blend-mode: screen;
}

/* Blueprint Grid (dark nodes only) */
.blueprint-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(var(--blueprint-line) 1px, transparent 1px),
        linear-gradient(90deg, var(--blueprint-line) 1px, transparent 1px);
    background-size: 40px 40px;
    opacity: 0.35;
    pointer-events: none;
    z-index: 0;
}

/* Node Markers */
.node-marker {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%) scale(0);
    z-index: 15;
    transition: transform 600ms var(--ease-overshoot);
}

.node-marker.animated {
    transform: translate(-50%, -50%) scale(1);
}

.node-marker-final {
    top: 30%;
}

.node-marker-final.animated {
    transform: translate(-50%, -50%) scale(1);
}

/* Node Connectors */
.node-connector {
    position: absolute;
    top: 50%;
    height: 2px;
    background: var(--burnished-copper);
    z-index: 12;
    transform-origin: left center;
    width: 0;
    transition: width 300ms var(--ease-decel) 200ms;
}

.node-connector.left {
    right: 50%;
    left: auto;
    transform-origin: right center;
    margin-right: 12px;
    width: 0;
}

.node-connector.right {
    left: 50%;
    margin-left: 12px;
    width: 0;
}

.node-connector.animated {
    width: min(15vw, 120px);
}

/* Node Content */
.node-content {
    position: relative;
    width: min(42vw, 520px);
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 800ms var(--ease-decel) 400ms, transform 800ms var(--ease-decel) 400ms;
    z-index: 5;
}

.node-content.animated {
    opacity: 1;
    transform: translateY(0);
}

.node-content.left {
    margin-right: calc(50% + min(15vw, 120px) + 24px);
    margin-left: auto;
}

.node-content.right {
    margin-left: calc(50% + min(15vw, 120px) + 24px);
    margin-right: auto;
}

/* Content Inner (two-column grid) */
.content-inner {
    display: grid;
    grid-template-columns: 30% 70%;
    gap: 24px;
}

.node-content.left .content-inner {
    grid-template-columns: 70% 30%;
}

.node-content.left .content-inner .content-meta {
    order: 2;
}

.node-content.left .content-inner .content-body {
    order: 1;
}

/* Content Meta */
.content-meta {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding-top: 8px;
}

.meta-date {
    font-family: var(--font-meta);
    font-weight: 500;
    font-size: clamp(0.7rem, 0.85vw, 0.85rem);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--lavender-mist);
}

.meta-category {
    font-family: var(--font-meta);
    font-weight: 500;
    font-size: clamp(0.7rem, 0.85vw, 0.85rem);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--lavender-mist);
    display: flex;
    align-items: center;
    gap: 6px;
}

.data-glyph {
    color: var(--lavender-mist);
    flex-shrink: 0;
}

/* Content Body */
.content-body {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.node-headline {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(2.5rem, 6vw, 5.5rem);
    letter-spacing: 0.04em;
    line-height: 1.08;
    opacity: 0;
    transition: opacity 500ms var(--ease-decel);
}

.node-content.animated .node-headline {
    opacity: 1;
}

.content-body p {
    font-family: var(--font-body);
    font-weight: 400;
    font-size: clamp(1rem, 1.15vw, 1.2rem);
    line-height: 1.72;
    letter-spacing: 0.01em;
    opacity: 0;
    transition: opacity 500ms var(--ease-decel);
}

.node-content.animated .content-body p:nth-child(2) {
    transition-delay: 600ms;
    opacity: 1;
}

.node-content.animated .content-body p:nth-child(3) {
    transition-delay: 700ms;
    opacity: 1;
}

.node-content.animated .content-body p {
    opacity: 1;
}

/* Collage Panels */
.collage-panel {
    position: relative;
    width: 100%;
    aspect-ratio: 3 / 2;
    border-radius: 2px;
    overflow: hidden;
    margin-top: 8px;
    opacity: 0;
    transform: scale(0.95);
    transition: opacity 700ms var(--ease-decel) 800ms, transform 700ms var(--ease-decel) 800ms;
}

.node-content.animated .collage-panel {
    opacity: 1;
    transform: scale(1);
}

.collage-photo {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg,
        var(--pewter-chrome) 0%,
        var(--lavender-mist) 40%,
        var(--pewter-chrome) 70%,
        var(--burnished-copper) 100%
    );
    filter: saturate(0.3) contrast(1.15);
    z-index: 1;
}

[data-theme="dark"] .collage-photo {
    background: linear-gradient(135deg,
        var(--deep-nordic-night) 0%,
        #3a3b4e 40%,
        var(--deep-nordic-night) 70%,
        #4a4a5a 100%
    );
}

.collage-geometric {
    position: absolute;
    inset: 0;
    z-index: 2;
}

.collage-grain {
    position: absolute;
    inset: 0;
    z-index: 3;
    opacity: 0.05;
    pointer-events: none;
}

.collage-grain::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
    background-size: 128px 128px;
}

/* Aurora Gradient Bar */
.aurora-bar {
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg,
        var(--burnished-copper),
        var(--aurora-teal),
        var(--lavender-mist),
        var(--burnished-copper)
    );
    background-size: 300% 100%;
    animation: auroraShimmer 24s ease-in-out infinite;
    position: relative;
    z-index: 20;
}

@keyframes auroraShimmer {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* ============================================
   Closing Node
   ============================================ */
.closing-node {
    min-height: 60vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 48px;
}

.closing-content {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 0 32px;
    gap: 24px;
}

.closing-line {
    flex: 1;
    height: 1px;
    background: var(--pewter-chrome);
}

.closing-domain {
    font-family: var(--font-meta);
    font-weight: 500;
    font-size: 1rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--lavender-mist);
    white-space: nowrap;
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 900px) {
    .node-content.left,
    .node-content.right {
        width: min(80vw, 400px);
        margin: 0 auto;
        margin-top: 60px;
    }

    .node-connector {
        display: none;
    }

    .content-inner {
        grid-template-columns: 1fr;
    }

    .node-content.left .content-inner {
        grid-template-columns: 1fr;
    }

    .node-content.left .content-inner .content-meta {
        order: 0;
    }

    .node-content.left .content-inner .content-body {
        order: 0;
    }

    .timeline-node {
        flex-direction: column;
        padding: 80px 24px;
    }

    .node-marker {
        top: 40px;
    }

    .gate-title {
        font-size: clamp(3rem, 10vw, 8rem);
    }

    .domain-mark {
        top: 16px;
        left: 16px;
    }
}

@media (max-width: 600px) {
    .node-headline {
        font-size: clamp(1.8rem, 5vw, 3rem);
    }

    .gate-title {
        font-size: clamp(2.5rem, 12vw, 6rem);
    }

    .node-content.left,
    .node-content.right {
        width: 90vw;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .orbital-ring {
        animation: none;
    }

    .aurora-bar {
        animation: none;
    }

    .node-marker,
    .node-connector,
    .node-content,
    .node-headline,
    .content-body p,
    .collage-panel,
    .gate-line {
        transition: none;
        opacity: 1;
        transform: none;
    }

    .node-marker {
        transform: translate(-50%, -50%) scale(1);
    }
}
