/* riron.net - Theory Walk */
/* Fonts: Space Mono (display), IBM Plex Mono (body), Fira Code (labels) */

/* Logical symbols background pattern */
:root {
    --burnt-orange: #d4641a;
    --amber-neon: #e8913a;
    --wet-asphalt: #1a1a1f;
    --charcoal-concrete: #2a2a32;
    --warm-cream: #f0e6d8;
    --faded-chalk: #9a9088;
    --polished-steel: #c8bfb0;
    --hot-tangerine: #ff7b2e;
    --dawn-warm: #1f1a18;
    --chrome-dark: #8b7355;
}

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

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--wet-asphalt);
    color: var(--warm-cream);
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
    font-size: clamp(0.95rem, 1.1vw, 1.1rem);
    line-height: 1.65;
    letter-spacing: 0.01em;
    overflow-x: hidden;
    background-image:
        repeating-linear-gradient(180deg, transparent, transparent 120px, rgba(212, 100, 26, 0.015) 120px, rgba(212, 100, 26, 0.015) 121px),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Ctext x='10' y='20' font-family='monospace' font-size='10' fill='%23f0e6d8' opacity='0.03'%3E∀%3C/text%3E%3Ctext x='50' y='45' font-family='monospace' font-size='10' fill='%23f0e6d8' opacity='0.03'%3E∃%3C/text%3E%3Ctext x='90' y='20' font-family='monospace' font-size='10' fill='%23f0e6d8' opacity='0.03'%3E⊢%3C/text%3E%3Ctext x='130' y='45' font-family='monospace' font-size='10' fill='%23f0e6d8' opacity='0.03'%3E¬%3C/text%3E%3Ctext x='170' y='20' font-family='monospace' font-size='10' fill='%23f0e6d8' opacity='0.03'%3E∧%3C/text%3E%3Ctext x='30' y='70' font-family='monospace' font-size='10' fill='%23f0e6d8' opacity='0.03'%3E∨%3C/text%3E%3Ctext x='70' y='95' font-family='monospace' font-size='10' fill='%23f0e6d8' opacity='0.03'%3E→%3C/text%3E%3Ctext x='110' y='70' font-family='monospace' font-size='10' fill='%23f0e6d8' opacity='0.03'%3E⊥%3C/text%3E%3Ctext x='150' y='95' font-family='monospace' font-size='10' fill='%23f0e6d8' opacity='0.03'%3E∀%3C/text%3E%3Ctext x='10' y='120' font-family='monospace' font-size='10' fill='%23f0e6d8' opacity='0.03'%3E∃%3C/text%3E%3Ctext x='50' y='145' font-family='monospace' font-size='10' fill='%23f0e6d8' opacity='0.03'%3E⊢%3C/text%3E%3Ctext x='90' y='120' font-family='monospace' font-size='10' fill='%23f0e6d8' opacity='0.03'%3E¬%3C/text%3E%3Ctext x='130' y='145' font-family='monospace' font-size='10' fill='%23f0e6d8' opacity='0.03'%3E∧%3C/text%3E%3Ctext x='170' y='120' font-family='monospace' font-size='10' fill='%23f0e6d8' opacity='0.03'%3E∨%3C/text%3E%3Ctext x='30' y='170' font-family='monospace' font-size='10' fill='%23f0e6d8' opacity='0.03'%3E→%3C/text%3E%3Ctext x='70' y='195' font-family='monospace' font-size='10' fill='%23f0e6d8' opacity='0.03'%3E⊥%3C/text%3E%3Ctext x='110' y='170' font-family='monospace' font-size='10' fill='%23f0e6d8' opacity='0.03'%3E∀%3C/text%3E%3Ctext x='150' y='195' font-family='monospace' font-size='10' fill='%23f0e6d8' opacity='0.03'%3E∃%3C/text%3E%3C/svg%3E");
}

/* Progress Bar */
#progress-bar {
    position: fixed;
    top: 0;
    right: 0;
    width: 3px;
    height: 0%;
    background: var(--burnt-orange);
    z-index: 1000;
    transition: height 0.1s linear;
    box-shadow: 0 0 8px rgba(212, 100, 26, 0.4);
}

/* ========== ZONE 1: ORIGIN (HERO) ========== */
#zone-origin {
    position: relative;
    width: 100%;
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.hero-content {
    text-align: center;
    z-index: 2;
    position: relative;
}

.hero-domain {
    font-family: 'Space Mono', monospace;
    font-weight: 700;
    font-size: clamp(3rem, 10vw, 7rem);
    letter-spacing: 0.06em;
    color: var(--warm-cream);
    text-shadow: 1px 1px 0 rgba(212, 100, 26, 0.15);
    margin-bottom: 0.2em;
}

.hero-kanji {
    font-family: 'Space Mono', monospace;
    font-weight: 700;
    font-size: clamp(3rem, 10vw, 7rem);
    letter-spacing: 0.06em;
    background: linear-gradient(135deg, #c8bfb0, #e8913a, #c8bfb0);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.neon-fragments {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.neon-katakana {
    position: absolute;
    font-family: 'Space Mono', monospace;
    font-size: clamp(2rem, 4vw, 4rem);
    color: var(--burnt-orange);
    opacity: 0;
    filter: drop-shadow(0 0 4px rgba(212, 100, 26, 0.6));
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.neon-ri {
    top: 20%;
    left: 15%;
}

.neon-ro {
    top: 35%;
    right: 18%;
}

.neon-n {
    top: 55%;
    left: 22%;
}

.neon-katakana.visible {
    opacity: 0.6;
    transform: translateY(-8px);
}

.hero-skyline {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 80px;
    z-index: 1;
}

.hero-skyline svg {
    width: 100%;
    height: 100%;
}

.power-line {
    animation: sway 8s ease-in-out infinite;
    transform-origin: 0% 50%;
}

@keyframes sway {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(2px); }
}

/* Window lighting animation */
.window-lit.lit {
    opacity: 1 !important;
    transition: opacity 0.4s ease;
}

/* ========== TIMELINE SPINE ========== */
.timeline-spine {
    position: fixed;
    left: 30%;
    top: 0;
    width: 2px;
    height: 100vh;
    background: var(--burnt-orange);
    box-shadow: 0 0 8px rgba(212, 100, 26, 0.4);
    z-index: 5;
    opacity: 0;
    transition: opacity 0.5s ease, width 0.5s ease;
    pointer-events: none;
}

.timeline-spine.visible {
    opacity: 1;
}

.timeline-spine.thick {
    width: 4px;
    left: calc(30% - 1px);
}

.timeline-spine.dissolving {
    background: transparent;
    box-shadow: none;
}

/* ========== ZONE MARKERS (Starbursts) ========== */
.zone-marker {
    display: flex;
    justify-content: center;
    padding: 2rem 0;
    position: relative;
    z-index: 6;
}

.starburst {
    width: 36px;
    height: 36px;
    opacity: 0;
    transform: scale(0.5) rotate(-30deg);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.starburst.visible {
    opacity: 1;
    transform: scale(1) rotate(0deg);
}

.starburst-large {
    width: 48px;
    height: 48px;
}

/* ========== NEON SIDE FRAGMENTS ========== */
.neon-side-fragment {
    position: absolute;
    font-family: 'Space Mono', monospace;
    font-size: clamp(3rem, 6vw, 6rem);
    color: transparent;
    -webkit-text-stroke: 1px var(--burnt-orange);
    filter: drop-shadow(0 0 4px rgba(212, 100, 26, 0.6));
    opacity: 0;
    transition: opacity 0.8s ease;
    pointer-events: none;
    z-index: 1;
}

.fragment-left {
    left: 3%;
    top: 30%;
}

.fragment-right {
    right: 3%;
    top: 25%;
}

.neon-side-fragment.visible {
    opacity: 0.25;
}

/* ========== TIMELINE NODES ========== */
.timeline-node {
    position: relative;
    max-width: 380px;
    padding: 1.5rem 0;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.timeline-node.visible {
    opacity: 1;
    transform: translateY(0);
}

.timeline-node.expanded {
    max-width: 520px;
}

/* Left nodes */
.node-left {
    margin-left: calc(30% + 40px);
}

.node-left .node-connector {
    position: absolute;
    left: -40px;
    top: 2rem;
    width: 40px;
    height: 2px;
    background: var(--burnt-orange);
    display: flex;
    align-items: center;
}

.node-left .chrome-circle {
    position: absolute;
    left: -12px;
    top: -11px;
}

.node-left .node-content {
    border-left: 3px solid var(--burnt-orange);
    padding-left: 1.5rem;
}

/* Right nodes */
.node-right {
    margin-left: calc(30% - 420px);
    text-align: right;
}

.node-right.expanded {
    margin-left: calc(30% - 560px);
}

.node-right .node-connector {
    position: absolute;
    right: -40px;
    top: 2rem;
    width: 40px;
    height: 2px;
    background: var(--burnt-orange);
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.node-right .chrome-circle {
    position: absolute;
    right: -12px;
    top: -11px;
}

.node-right .node-content {
    border-right: 3px solid var(--burnt-orange);
    padding-right: 1.5rem;
}

/* Chrome circle */
.chrome-circle {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 35%, #e8e0d4, #c8bfb0, #8b7355);
    box-shadow: 0 0 6px rgba(200, 191, 176, 0.3);
    transform: scale(0.8);
    transition: transform 0.3s ease-out;
    position: relative;
}

.timeline-node.visible .chrome-circle {
    transform: scale(1);
}

.chrome-circle-large {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.node-icon {
    width: 18px;
    height: 18px;
}

/* Node content */
.node-content {
    background: var(--charcoal-concrete);
    padding: 1.5rem;
    position: relative;
}

.node-label {
    font-family: 'Fira Code', monospace;
    font-weight: 300;
    font-size: clamp(0.7rem, 0.9vw, 0.85rem);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--faded-chalk);
    display: block;
    margin-bottom: 0.75rem;
}

.node-content h2 {
    font-family: 'Space Mono', monospace;
    font-weight: 700;
    font-size: clamp(1.4rem, 3vw, 2.4rem);
    letter-spacing: 0.04em;
    color: var(--warm-cream);
    text-shadow: 1px 1px 0 rgba(212, 100, 26, 0.15);
    margin-bottom: 1rem;
    line-height: 1.3;
    text-align: left;
}

.node-content p {
    max-width: 58ch;
    margin-bottom: 1rem;
    color: var(--warm-cream);
}

.node-content p:last-child {
    margin-bottom: 0;
}

/* Draw underline effect */
.draw-underline {
    background-image: linear-gradient(var(--burnt-orange), var(--burnt-orange));
    background-size: 0% 2px;
    background-position: left bottom;
    background-repeat: no-repeat;
    transition: background-size 0.35s cubic-bezier(0.25, 0.1, 0.25, 1);
    padding-bottom: 4px;
}

.draw-underline.drawn {
    background-size: 100% 2px;
}

/* Highlight phrases */
.highlight-phrase {
    background-image: linear-gradient(var(--amber-neon), var(--amber-neon));
    background-size: 0% 2px;
    background-position: left bottom;
    background-repeat: no-repeat;
    transition: background-size 0.35s cubic-bezier(0.25, 0.1, 0.25, 1);
    padding-bottom: 2px;
}

.highlight-phrase.drawn {
    background-size: 100% 2px;
}

/* ========== OVERLAP NODES (Zone 4) ========== */
.node-overlap {
    max-width: 560px;
    margin-left: calc(30% - 120px);
    text-align: left;
    position: relative;
    z-index: 7;
}

.node-overlap .node-connector {
    position: absolute;
    left: 100px;
    top: 1.5rem;
}

.node-overlap .node-content {
    border-left: 3px solid var(--burnt-orange);
    padding-left: 1.5rem;
    background: rgba(42, 42, 50, 0.92);
}

.synthesis-content {
    backdrop-filter: blur(2px);
}

/* ========== BRANCH TIMELINE ========== */
.branch-timeline {
    position: relative;
    margin-left: calc(30% + 20px);
    padding: 2rem 0;
    opacity: 0;
    transform: translateX(-10px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.branch-timeline.visible {
    opacity: 1;
    transform: translateX(0);
}

.branch-line {
    position: absolute;
    left: 0;
    top: 0;
    width: 200px;
    height: 2px;
    background: linear-gradient(90deg, var(--burnt-orange), transparent);
    transform: rotate(30deg);
    transform-origin: left center;
    opacity: 0.5;
}

.branch-node {
    margin-left: 80px;
    margin-top: 40px;
    max-width: 380px;
    padding: 1.25rem;
    background: rgba(42, 42, 50, 0.6);
    border-left: 2px solid rgba(212, 100, 26, 0.3);
}

.branch-label {
    font-family: 'Fira Code', monospace;
    font-weight: 300;
    font-size: clamp(0.65rem, 0.8vw, 0.75rem);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--faded-chalk);
    opacity: 0.7;
    display: block;
    margin-bottom: 0.5rem;
}

.branch-text {
    font-family: 'Fira Code', monospace;
    font-weight: 300;
    font-size: clamp(0.82rem, 0.95vw, 0.95rem);
    color: var(--warm-cream);
    opacity: 0.7;
    line-height: 1.6;
    max-width: 52ch;
}

/* ========== FLOATING NODES (Zone 5) ========== */
.node-floating {
    max-width: 520px;
    margin: 0 auto;
    text-align: left;
    position: relative;
}

.node-floating .node-content {
    border-left: none;
    border-right: none;
    background: transparent;
    padding: 2rem;
}

.horizon-content {
    position: relative;
}

.horizon-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at center, rgba(42, 42, 50, 0.4) 0%, transparent 70%);
    pointer-events: none;
    z-index: -1;
}

/* Horizon dots (dissolving spine) */
.horizon-dots {
    position: absolute;
    top: 0;
    left: 30%;
    width: 4px;
    height: 100%;
    pointer-events: none;
    z-index: 4;
}

.horizon-dot {
    position: absolute;
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: var(--burnt-orange);
    box-shadow: 0 0 6px rgba(212, 100, 26, 0.4);
    opacity: 0.8;
    transition: transform 2s ease-out, opacity 2s ease-out;
}

.horizon-dot.scattered {
    opacity: 0.3;
}

/* ========== FOOTER ========== */
.footer-domain {
    text-align: center;
    padding: 4rem 0 3rem;
}

.footer-text {
    font-family: 'Fira Code', monospace;
    font-weight: 300;
    font-size: 0.85rem;
    color: var(--faded-chalk);
    letter-spacing: 0.08em;
}

/* ========== ZONE BACKGROUNDS ========== */
#zone-foundation,
#zone-expansion {
    position: relative;
    padding: 4rem 1.5rem;
}

#zone-synthesis {
    position: relative;
    padding: 4rem 1.5rem;
}

#zone-horizon {
    position: relative;
    padding: 4rem 1.5rem;
    background: linear-gradient(180deg, var(--wet-asphalt) 0%, var(--dawn-warm) 100%);
    min-height: 100vh;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 900px) {
    .timeline-spine {
        left: 20px;
    }

    .node-left {
        margin-left: 60px;
    }

    .node-right {
        margin-left: 60px;
        text-align: left;
    }

    .node-right.expanded {
        margin-left: 60px;
    }

    .node-right .node-content {
        border-right: none;
        border-left: 3px solid var(--burnt-orange);
        padding-right: 0;
        padding-left: 1.5rem;
    }

    .node-right .node-connector {
        right: auto;
        left: -40px;
    }

    .node-right .chrome-circle {
        right: auto;
        left: -12px;
    }

    .node-overlap {
        margin-left: 60px;
    }

    .node-overlap .node-connector {
        left: -40px;
    }

    .branch-timeline {
        margin-left: 60px;
    }

    .branch-line {
        width: 100px;
    }

    .branch-node {
        margin-left: 40px;
    }

    .timeline-node,
    .timeline-node.expanded {
        max-width: calc(100% - 80px);
    }

    .neon-side-fragment {
        display: none;
    }

    .horizon-dots {
        left: 20px;
    }
}

@media (max-width: 600px) {
    .hero-domain {
        font-size: clamp(2rem, 12vw, 4rem);
    }

    .hero-kanji {
        font-size: clamp(2rem, 12vw, 4rem);
    }

    .node-content h2 {
        font-size: clamp(1.2rem, 5vw, 1.8rem);
    }

    .timeline-node,
    .timeline-node.expanded {
        max-width: calc(100vw - 80px);
    }
}

/* ========== POWER LINE CONNECTORS ========== */
.power-line-connector {
    position: absolute;
    left: 29%;
    top: 0;
    width: 100px;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    opacity: 0;
    transition: opacity 1s ease;
}

.power-line-connector.visible {
    opacity: 1;
}

/* ========== CITYSCAPE BACKGROUNDS ========== */
.cityscape-mid,
.cityscape-large {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    pointer-events: none;
    z-index: 0;
    opacity: 0;
    transition: opacity 1s ease;
}

.cityscape-mid {
    height: 120px;
}

.cityscape-large {
    height: 200px;
}

.cityscape-mid.visible,
.cityscape-large.visible {
    opacity: 1;
}

.cityscape-mid svg,
.cityscape-large svg {
    width: 100%;
    height: 100%;
}

.window-mid.lit,
.window-large.lit {
    opacity: 1 !important;
    transition: opacity 0.4s ease;
}

/* Zones need relative positioning for cityscapes */
#zone-expansion,
#zone-synthesis {
    position: relative;
    overflow: hidden;
}
