/* riron.org — theory as cinematic discourse
   Palette:
   #0d0d14 Void Navy   · primary background
   #141423 Deep Slate  · card backgrounds
   #f0ece4 Warm Ivory  · primary text
   #d4a843 Amber Gold  · primary accent
   #8b9cc2 Steel Lavender · secondary text, illustration strokes
   #2a2a44 Indigo Midnight · tertiary surfaces
   #e05757 Signal Red · rare emphasis
   #3d6b5e Theory Green · tertiary accent
   #000000 (avoided) — only as inert reference
*/

:root {
    --void-navy: #0d0d14;
    --deep-slate: #141423;
    --warm-ivory: #f0ece4;
    --amber-gold: #d4a843;
    --steel-lavender: #8b9cc2;
    --indigo-midnight: #2a2a44;
    --signal-red: #e05757;
    --theory-green: #3d6b5e;
    --pure-black: #000000;

    --font-display: 'Playfair Display', 'Lora', Georgia, serif;
    --font-body: 'Work Sans', 'Inter', system-ui, sans-serif;
    --font-jp: 'Noto Sans JP', 'Inter', sans-serif;
    --font-mono: 'JetBrains Mono', 'Space Mono', ui-monospace, monospace;

    --gutter: 5%;
    --side-pad: 8vw;
    --scroll-speed: 1;
}

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

html {
    scroll-behavior: smooth;
    scroll-snap-type: y proximity;
    background: var(--void-navy);
}

body {
    font-family: var(--font-body);
    font-weight: 300;
    font-size: 16px;
    line-height: 1.75;
    color: var(--warm-ivory);
    background: var(--void-navy);
    overflow-x: hidden;
    min-height: 100vh;
    position: relative;
}

/* ============================================================
   Particle field — drifting dots over the void
   ============================================================ */
.particle-field {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.particle-field .particle {
    position: absolute;
    background: var(--warm-ivory);
    border-radius: 50%;
    opacity: 0;
    animation-name: drift;
    animation-iteration-count: infinite;
    animation-timing-function: linear;
    animation-play-state: running;
    will-change: transform, opacity;
}

@keyframes drift {
    0% {
        transform: translate3d(var(--dx-start), var(--dy-start), 0) scale(0.6);
        opacity: 0;
    }
    10% {
        opacity: var(--p-opacity, 0.08);
    }
    90% {
        opacity: var(--p-opacity, 0.08);
    }
    100% {
        transform: translate3d(var(--dx-end), var(--dy-end), 0) scale(1);
        opacity: 0;
    }
}

/* ============================================================
   Connection threads (vertical dashed line through the spine)
   ============================================================ */
.connection-threads {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 1;
}

.connection-threads .thread {
    stroke: var(--steel-lavender);
    stroke-width: 1;
    stroke-dasharray: 4 2;
    opacity: 0.18;
}

/* ============================================================
   Projector warmup overlay
   ============================================================ */
.projector-overlay {
    position: fixed;
    inset: 0;
    background: var(--void-navy);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.projector-overlay.is-fading {
    animation: overlay-fade 1200ms ease 0ms forwards;
}

.projector-overlay.is-gone {
    display: none;
}

@keyframes overlay-fade {
    to {
        opacity: 0;
        visibility: hidden;
    }
}

.projector-light {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 0;
    height: 0;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(212, 168, 67, 0.55) 0%, rgba(212, 168, 67, 0.18) 35%, rgba(13, 13, 20, 0) 70%);
    animation: projector-bloom 2400ms cubic-bezier(0.22, 0.61, 0.36, 1) 800ms forwards;
}

@keyframes projector-bloom {
    0% {
        width: 0;
        height: 0;
        opacity: 0;
    }
    20% {
        opacity: 1;
    }
    100% {
        width: 220vmax;
        height: 220vmax;
        opacity: 0;
    }
}

.projector-content {
    position: relative;
    text-align: center;
    z-index: 2;
    opacity: 0;
    animation: projector-content 1600ms ease 1500ms forwards;
}

@keyframes projector-content {
    0% { opacity: 0; transform: translateY(8px); }
    40% { opacity: 1; transform: translateY(0); }
    100% { opacity: 0; transform: translateY(-4px); }
}

.projector-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 15vw;
    line-height: 1;
    color: var(--warm-ivory);
    letter-spacing: -0.02em;
    text-shadow: 0 0 28px rgba(212, 168, 67, 0.3);
}

.projector-domain {
    margin-top: 1.2rem;
    font-family: var(--font-mono);
    font-size: 14px;
    letter-spacing: 0.18em;
    color: var(--amber-gold);
    text-transform: lowercase;
}

/* ============================================================
   Section navigation dots
   ============================================================ */
.section-nav {
    position: fixed;
    top: 50%;
    right: 32px;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 24px;
    z-index: 50;
    padding: 10px 4px;
}

.nav-dot {
    position: relative;
    display: block;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    border: 1px solid var(--steel-lavender);
    background: transparent;
    transition: width 200ms ease-out, height 200ms ease-out, background 200ms ease-out, border-color 200ms ease-out, transform 200ms ease-out;
    cursor: pointer;
}

.nav-dot:hover {
    width: 8px;
    height: 8px;
    margin-left: -2px;
    margin-top: -2px;
    border-color: var(--amber-gold);
    background: rgba(212, 168, 67, 0.2);
}

.nav-dot.is-active {
    background: var(--amber-gold);
    border-color: var(--amber-gold);
    width: 8px;
    height: 8px;
    margin-left: -2px;
    margin-top: -2px;
    box-shadow: 0 0 12px rgba(212, 168, 67, 0.45);
}

.nav-tooltip {
    position: absolute;
    right: 18px;
    top: 50%;
    transform: translate(8px, -50%);
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--warm-ivory);
    background: rgba(20, 20, 35, 0.92);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    padding: 6px 10px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 200ms ease-out, transform 200ms ease-out;
    border-left: 1px solid var(--amber-gold);
    letter-spacing: 0.06em;
}

.nav-dot:hover .nav-tooltip,
.nav-dot.is-active .nav-tooltip {
    opacity: 1;
    transform: translate(0, -50%);
}

/* ============================================================
   Slide reel
   ============================================================ */
.reel {
    position: relative;
    z-index: 5;
}

.slide {
    position: relative;
    min-height: 100vh;
    padding: 12vh var(--side-pad) 12vh;
    display: flex;
    align-items: center;
    scroll-snap-align: start;
    scroll-snap-stop: normal;
    margin-bottom: 20vh;
    isolation: isolate;
}

.slide:last-of-type {
    margin-bottom: 0;
}

.slide-grid {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 55% 5% 40%;
    align-items: center;
    gap: 0;
}

.slide-text {
    grid-column: 1 / 2;
    position: relative;
    z-index: 3;
}

.slide-figure {
    grid-column: 3 / 4;
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Figure numbers behind illustrations */
.figure-number {
    position: absolute;
    right: var(--side-pad);
    top: 6vh;
    font-family: var(--font-display);
    font-weight: 900;
    font-size: clamp(80px, 12vw, 160px);
    line-height: 1;
    color: var(--warm-ivory);
    opacity: 0.06;
    pointer-events: none;
    user-select: none;
    z-index: 1;
    letter-spacing: -0.02em;
}

/* Illustration sizing */
.illustration {
    width: 100%;
    max-width: 520px;
    height: auto;
    display: block;
    opacity: 0;
    transform: scale(0.98);
    transition: opacity 600ms ease-out, transform 800ms ease-out;
}

.slide.is-visible .illustration {
    opacity: 1;
    transform: scale(1);
}

/* ============================================================
   Content cards — translucent surfaces with light cones
   ============================================================ */
.card {
    position: relative;
    background: rgba(20, 20, 35, 0.85);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border-radius: 0;
    padding: 44px 48px 40px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
    opacity: 0;
    transform: translateX(-30px);
    transition: opacity 400ms ease-out 100ms, transform 400ms ease-out 100ms;
    border-left: 2px solid var(--amber-gold);
}

.slide.is-visible .card {
    opacity: 1;
    transform: translateX(0);
}

/* Projection light cone above each card */
.card::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 100%;
    height: 60px;
    background: linear-gradient(to top, rgba(212, 168, 67, 0.06) 0%, rgba(212, 168, 67, 0) 100%);
    pointer-events: none;
}

.card::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: 100%;
    transform: translateX(-50%);
    width: 70%;
    height: 60px;
    background: radial-gradient(ellipse at bottom, rgba(212, 168, 67, 0.10) 0%, rgba(212, 168, 67, 0) 70%);
    pointer-events: none;
}

.card .kicker {
    font-family: var(--font-mono);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.24em;
    color: var(--amber-gold);
    margin-bottom: 18px;
}

.card .ja {
    font-family: var(--font-jp);
    font-weight: 300;
    font-size: clamp(28px, 3.2vw, 44px);
    color: var(--steel-lavender);
    margin-bottom: 14px;
    letter-spacing: 0.06em;
}

.card .title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(36px, 3.8vw, 56px);
    line-height: 1.12;
    color: var(--warm-ivory);
    margin-bottom: 22px;
    letter-spacing: -0.01em;
}

.card .body {
    font-family: var(--font-body);
    font-weight: 300;
    font-size: 16px;
    line-height: 1.75;
    color: var(--warm-ivory);
    max-width: 56ch;
    margin-bottom: 28px;
}

.card .caption {
    font-family: var(--font-mono);
    font-weight: 400;
    font-size: 11.5px;
    line-height: 1.6;
    color: var(--steel-lavender);
    letter-spacing: 0.05em;
    padding-top: 18px;
    border-top: 1px dashed rgba(139, 156, 194, 0.35);
}

/* Section number staggered reveal */
.figure-number {
    opacity: 0;
    transition: opacity 500ms ease-out 200ms;
}

.slide.is-visible .figure-number {
    opacity: 0.06;
}

/* ============================================================
   Inline link (would-be) styling — drawing underline
   ============================================================ */
.card a {
    color: var(--amber-gold);
    text-decoration: none;
    position: relative;
    display: inline-block;
    padding-bottom: 1px;
}

.card a::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    height: 1px;
    width: 0;
    background: var(--amber-gold);
    transition: width 250ms ease-out;
}

.card a:hover::after {
    width: 100%;
}

/* ============================================================
   Colophon footer
   ============================================================ */
.colophon {
    position: relative;
    padding: 12vh var(--side-pad);
    background: linear-gradient(to bottom, var(--void-navy) 0%, #050509 100%);
    border-top: 1px dashed rgba(139, 156, 194, 0.3);
    z-index: 5;
}

.colophon-inner {
    max-width: 1400px;
    margin: 0 auto;
    text-align: left;
}

.colophon-line {
    font-family: var(--font-mono);
    font-size: 12px;
    line-height: 2.1;
    letter-spacing: 0.1em;
    color: var(--warm-ivory);
}

.colophon-line.meta {
    color: var(--steel-lavender);
    font-size: 11px;
}

.colophon-line:first-child {
    color: var(--amber-gold);
    font-size: 14px;
    margin-bottom: 10px;
}

/* ============================================================
   Responsive — collapse to single column on narrow screens
   ============================================================ */
@media (max-width: 880px) {
    .slide {
        padding: 12vh 6vw 12vh;
    }

    .slide-grid {
        grid-template-columns: 1fr;
        gap: 36px;
    }

    .slide-text,
    .slide-figure {
        grid-column: 1 / -1;
    }

    .slide-figure {
        order: -1;
    }

    .illustration {
        max-width: 360px;
    }

    .card {
        padding: 32px 28px 28px;
    }

    .card .title {
        font-size: clamp(28px, 7vw, 40px);
    }

    .figure-number {
        right: 6vw;
        font-size: clamp(72px, 22vw, 120px);
        opacity: 0.05;
    }

    .section-nav {
        right: 12px;
        gap: 18px;
    }

    .nav-tooltip {
        display: none;
    }

    .projector-title {
        font-size: 28vw;
    }
}

/* ============================================================
   Selection
   ============================================================ */
::selection {
    background: rgba(212, 168, 67, 0.4);
    color: var(--warm-ivory);
}
