/* =============================================
   showa.day — Cinematic Shōwa-Era Reverie
   Colors: Kodachrome palette, amber-verdigris axis
   ============================================= */

/* --- CSS Custom Properties --- */
:root {
    --burnt-cellar:    #1A1008;
    --tanned-leather:  #2E1F0E;
    --cognac-grain:    #5C3A1E;
    --patina-teal:     #2D5A4F;
    --verdigris-light: #4E8B7A;
    --amber-filament:  #C8860A;
    --aged-brass:      #B8912F;
    --cream-vellum:    #EDE0C8;
    --faded-ochre:     #A89060;
    --pale-smoke:      #D4C9B8;

    --font-display: 'Cormorant Garamond', Georgia, serif;
    --font-heading: 'Bebas Neue', Impact, sans-serif;
    --font-body:    'Lora', Georgia, serif;
    --font-mono:    'Space Mono', 'Courier New', monospace;

    --max-content: 680px;
    --scroll-blur: 8px;
}

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

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

body {
    background-color: var(--burnt-cellar);
    color: var(--cream-vellum);
    font-family: var(--font-body);
    font-size: 17px;
    line-height: 1.75;
    overflow-x: hidden;
    /* Leather canvas texture via CSS noise simulation */
    background-image:
        repeating-linear-gradient(
            45deg,
            transparent,
            transparent 2px,
            rgba(92,58,30,0.03) 2px,
            rgba(92,58,30,0.03) 4px
        ),
        repeating-linear-gradient(
            -45deg,
            transparent,
            transparent 3px,
            rgba(26,16,8,0.04) 3px,
            rgba(26,16,8,0.04) 6px
        );
}

/* --- Rain Field --- */
.rain-field {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 10;
    opacity: 0.07;
    overflow: hidden;
}

.raindrop {
    position: absolute;
    width: 1px;
    height: 80px;
    background: linear-gradient(to bottom, transparent, var(--amber-filament));
    animation: fall linear infinite;
}

@keyframes fall {
    0%   { transform: translateY(-100px); }
    100% { transform: translateY(110vh); }
}

/* --- Morph SVG Background --- */
.morph-svg {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

/* --- Side Navigation --- */
.side-nav {
    position: fixed;
    right: 2rem;
    top: 50%;
    transform: translateY(-50%);
    z-index: 100;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
}

.nav-line {
    position: absolute;
    left: 50%;
    top: 0;
    transform: translateX(-50%);
    width: 1px;
    height: 160px;
    background: var(--faded-ochre);
    opacity: 0.6;
}

.nav-dot {
    position: relative;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--tanned-leather);
    border: 1px solid var(--faded-ochre);
    cursor: pointer;
    margin: 16px 0;
    transition: box-shadow 0.3s ease, background 0.3s ease;
    z-index: 1;
}

.nav-dot:hover,
.nav-dot.active {
    background: var(--cognac-grain);
    box-shadow: 0 0 8px var(--amber-filament);
}

.nav-label {
    position: absolute;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--faded-ochre);
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.25s ease;
    letter-spacing: 0.05em;
}

.nav-dot:hover .nav-label {
    opacity: 1;
}

/* --- Scene Base --- */
.scene {
    position: relative;
    min-height: 100vh;
    display: grid;
    place-items: center;
    overflow: hidden;
    scroll-snap-align: start;
    padding: 20vh 4rem;
}

.scene-content {
    position: relative;
    z-index: 2;
    max-width: var(--max-content);
    width: 100%;
    margin: 0 auto;
}

/* --- Scene Numbers (Ghost) --- */
.scene-number {
    position: absolute;
    font-family: var(--font-heading);
    font-size: clamp(8rem, 20vw, 18rem);
    color: var(--cream-vellum);
    opacity: 0.04;
    letter-spacing: 0.05em;
    pointer-events: none;
    z-index: 1;
    bottom: 5vh;
    right: 4vw;
    line-height: 1;
}

/* --- Film Strip Edges --- */
.filmstrip-edge {
    position: absolute;
    left: 0;
    right: 0;
    height: 24px;
    z-index: 5;
    display: flex;
    align-items: center;
}

.filmstrip-bottom {
    bottom: 0;
}

.filmstrip-edge::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--faded-ochre);
    opacity: 0.15;
}

/* Film sprocket holes */
.filmstrip-edge::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    height: 10px;
    background-image: radial-gradient(
        circle at center,
        var(--tanned-leather) 4px,
        transparent 4px
    );
    background-size: 28px 10px;
    background-position: 14px center;
    opacity: 0.4;
}

/* --- Morph Transition Strips --- */
.morph-strip {
    position: relative;
    height: 120px;
    overflow: hidden;
    margin-top: -1px;
}

.morph-clip {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* --- Leather Surface Overlay --- */
.leather-surface {
    position: absolute;
    inset: 0;
    z-index: 0;
    background-blend-mode: multiply;
    opacity: 0.18;
}

.leather-surface-01 {
    /* Simulate leather grain with layered gradients */
    background:
        repeating-conic-gradient(
            from 0deg at 30% 40%,
            rgba(92,58,30,0.08) 0deg,
            transparent 1deg,
            transparent 3deg,
            rgba(92,58,30,0.04) 4deg
        ),
        repeating-linear-gradient(
            78deg,
            transparent,
            transparent 8px,
            rgba(92,58,30,0.12) 8px,
            rgba(92,58,30,0.12) 9px
        ),
        radial-gradient(ellipse 140% 80% at 25% 60%, rgba(92,58,30,0.5) 0%, rgba(46,31,14,0.9) 70%);
    opacity: 0.22;
}

.leather-surface-02 {
    background:
        repeating-conic-gradient(
            from 45deg at 70% 30%,
            rgba(92,58,30,0.06) 0deg,
            transparent 1deg,
            transparent 3deg,
            rgba(92,58,30,0.04) 4deg
        ),
        repeating-linear-gradient(
            -62deg,
            transparent,
            transparent 10px,
            rgba(92,58,30,0.10) 10px,
            rgba(92,58,30,0.10) 11px
        ),
        radial-gradient(ellipse 120% 90% at 75% 50%, rgba(184,145,47,0.3) 0%, rgba(26,16,8,0.95) 65%);
    opacity: 0.20;
}

/* --- Hero Scene --- */
.scene-hero {
    background-color: var(--burnt-cellar);
    align-items: flex-end;
    padding-bottom: 28vh;
}

.wire-network {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 200px;
    opacity: 0.12;
    z-index: 1;
}

.wire {
    stroke-dasharray: 2000;
    stroke-dashoffset: 2000;
    animation: drawWire 2s ease forwards;
}

.wire:nth-child(1)  { animation-delay: 0.0s; }
.wire:nth-child(2)  { animation-delay: 0.2s; }
.wire:nth-child(3)  { animation-delay: 0.4s; }
.wire:nth-child(4)  { animation-delay: 0.6s; }
.wire:nth-child(5)  { animation-delay: 0.1s; }
.wire:nth-child(6)  { animation-delay: 0.3s; }
.wire:nth-child(7)  { animation-delay: 0.5s; }
.wire:nth-child(8)  { animation-delay: 0.7s; }
.wire:nth-child(9)  { animation-delay: 0.9s; }
.wire:nth-child(10) { animation-delay: 1.1s; }
.wire:nth-child(11) { animation-delay: 0.8s; }
.wire:nth-child(12) { animation-delay: 1.0s; }

@keyframes drawWire {
    to { stroke-dashoffset: 0; }
}

.hero-text-wrap {
    position: relative;
}

.hero-prelude {
    display: block;
    font-family: var(--font-heading);
    font-size: 13px;
    letter-spacing: 0.35em;
    color: var(--verdigris-light);
    margin-bottom: 1.2rem;
    opacity: 0;
    animation: fadeUp 1.2s ease 0.8s forwards;
}

.hero-headline {
    position: relative;
    font-family: var(--font-display);
    font-size: clamp(4rem, 10vw, 9rem);
    font-weight: 300;
    line-height: 0.95;
    letter-spacing: 0.08em;
    color: var(--cream-vellum);
    font-feature-settings: "kern" 1, "liga" 1, "calt" 1;
    text-rendering: optimizeLegibility;
    -webkit-text-stroke: 0.5px rgba(237,224,200,0.3);
    opacity: 0;
    animation: fadeUp 1.4s ease 0.6s forwards;
}

.headline-ghost {
    position: absolute;
    inset: 0;
    filter: blur(var(--scroll-blur));
    opacity: 0.3;
    color: var(--amber-filament);
    pointer-events: none;
    transition: filter 0.1s linear;
    font-style: inherit;
    font-size: inherit;
    font-weight: inherit;
    letter-spacing: inherit;
    line-height: inherit;
}

.hero-sub {
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.75;
    color: var(--faded-ochre);
    margin-top: 2rem;
    font-style: italic;
    opacity: 0;
    animation: fadeUp 1.4s ease 1.0s forwards;
}

.hero-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 2.5rem;
    opacity: 0;
    animation: fadeUp 1.2s ease 1.2s forwards;
}

.meta-stamp {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--faded-ochre);
    letter-spacing: 0.12em;
    opacity: 0.7;
}

.meta-divider {
    color: var(--faded-ochre);
    opacity: 0.4;
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- Memory Scene --- */
.scene-memory {
    background-color: var(--tanned-leather);
}

/* --- Corner Brackets --- */
.corner-bracket {
    position: absolute;
    width: 24px;
    height: 24px;
}

.corner-tl {
    top: -1.5rem;
    left: -1.5rem;
    border-top: 1px solid var(--faded-ochre);
    border-left: 1px solid var(--faded-ochre);
    opacity: 0.5;
}

.corner-tr {
    top: -1.5rem;
    right: -1.5rem;
    border-top: 1px solid var(--faded-ochre);
    border-right: 1px solid var(--faded-ochre);
    opacity: 0.5;
}

.corner-bl {
    bottom: -1.5rem;
    left: -1.5rem;
    border-bottom: 1px solid var(--faded-ochre);
    border-left: 1px solid var(--faded-ochre);
    opacity: 0.5;
}

.corner-br {
    bottom: -1.5rem;
    right: -1.5rem;
    border-bottom: 1px solid var(--faded-ochre);
    border-right: 1px solid var(--faded-ochre);
    opacity: 0.5;
}

/* --- Section Labels --- */
.section-label {
    font-family: var(--font-heading);
    font-size: 12px;
    letter-spacing: 0.35em;
    color: var(--verdigris-light);
    margin-bottom: 1.5rem;
    opacity: 0.85;
}

/* --- Section Headings --- */
.section-heading {
    font-family: var(--font-display);
    font-size: clamp(2.5rem, 6vw, 5.5rem);
    font-weight: 300;
    line-height: 1.05;
    letter-spacing: 0.04em;
    color: var(--cream-vellum);
    margin-bottom: 2rem;
    font-feature-settings: "kern" 1, "liga" 1, "calt" 1;
    text-rendering: optimizeLegibility;
}

/* --- Body Text --- */
.body-text {
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.75;
    color: var(--pale-smoke);
    max-width: 560px;
}

.body-text p + p {
    margin-top: 1.2em;
}

/* --- Pull Quotes --- */
.pull-quote {
    margin-top: 3rem;
    position: relative;
}

.pull-quote-left {
    transform: translateX(-8%);
}

.pull-quote-right {
    transform: translateX(8%);
}

.pull-quote blockquote {
    font-family: var(--font-display);
    font-style: italic;
    font-size: clamp(1.1rem, 2.5vw, 1.5rem);
    color: var(--amber-filament);
    line-height: 1.5;
    border-left: 2px solid var(--aged-brass);
    padding-left: 1.5rem;
}

/* --- City Scene --- */
.scene-city {
    background-color: var(--burnt-cellar);
}

.city-silhouette {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    pointer-events: none;
    z-index: 1;
}

.timetable-grid {
    position: absolute;
    bottom: 120px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 3;
    width: 100%;
    max-width: 480px;
    border-top: 1px solid rgba(164,144,96,0.2);
    border-bottom: 1px solid rgba(164,144,96,0.2);
}

.timetable-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    border-bottom: 1px solid rgba(164,144,96,0.1);
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--faded-ochre);
    opacity: 0.6;
    letter-spacing: 0.08em;
}

/* --- Night Scene --- */
.scene-night {
    background-color: var(--tanned-leather);
}

.night-credits {
    display: flex;
    gap: 2rem;
    margin-top: 3rem;
    flex-wrap: wrap;
}

/* --- Footer Strip --- */
.filmstrip-footer {
    bottom: 40px;
}

.footer-strip {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 3rem;
    border-top: 1px solid rgba(164,144,96,0.12);
    z-index: 6;
}

.footer-meta {
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--faded-ochre);
    opacity: 0.5;
    letter-spacing: 0.1em;
}

/* --- Scene Reveal Animation --- */
.scene-content {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.9s ease, transform 0.9s ease;
}

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

/* --- Responsive --- */
@media (max-width: 768px) {
    .side-nav {
        display: none;
    }

    .scene {
        padding: 20vh 2rem;
    }

    .pull-quote-left,
    .pull-quote-right {
        transform: none;
    }

    .timetable-grid {
        display: none;
    }

    .hero-headline {
        font-size: clamp(3rem, 12vw, 5rem);
    }
}
