/* relativity.studio — Styles */
/* Palette: Void #0a0a0f, Surface #f5f0e8, Redshift #ff6b35, Blueshift #4ecdc4, Horizon #2a2a35, Signal #e63946, Annotation #8a8a96, Phosphor #a8e6cf */

:root {
    --void: #0a0a0f;
    --surface: #f5f0e8;
    --redshift: #ff6b35;
    --blueshift: #4ecdc4;
    --horizon: #2a2a35;
    --signal: #e63946;
    --annotation: #8a8a96;
    --phosphor: #a8e6cf;
    --cursor-x: 50%;
    --cursor-y: 50%;
    --depth: 0;
}

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

html {
    scroll-snap-type: y mandatory;
    overflow-y: scroll;
    overflow-x: hidden;
    scrollbar-width: none;
}

html::-webkit-scrollbar {
    display: none;
}

body {
    background: var(--void);
    color: var(--surface);
    font-family: 'IBM Plex Sans', sans-serif;
    font-weight: 300;
    line-height: 1.72;
    letter-spacing: 0.01em;
    -webkit-font-smoothing: antialiased;
}

/* Cursor Lens Overlay */
#cursor-lens {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1000;
    background: radial-gradient(circle 15vw at var(--cursor-x) var(--cursor-y), rgba(245, 240, 232, 0.04), transparent);
}

/* Scroll Container */
#scroll-container {
    scroll-snap-type: y mandatory;
    overflow-y: scroll;
    overflow-x: hidden;
    height: 100vh;
    scrollbar-width: none;
}

#scroll-container::-webkit-scrollbar {
    display: none;
}

/* Frame Base */
.frame {
    min-height: 100vh;
    height: 100vh;
    scroll-snap-align: start;
    position: relative;
    overflow: hidden;
    display: grid;
    grid-template-columns: 1fr 1fr 2fr 1fr 2fr 1fr 1fr 2fr 1fr 2fr 1fr 1fr;
    grid-template-rows: 1fr;
    background: hsl(calc(240 - var(--depth) * 5), 10%, 4%);
}

/* HUD Elements */
.hud {
    position: absolute;
    z-index: 10;
    font-family: 'IBM Plex Mono', monospace;
    font-size: clamp(0.6rem, 0.8vw, 0.75rem);
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--annotation);
    opacity: 0.6;
}

.hud-tl { top: 1.5rem; left: 1.5rem; }
.hud-tr { top: 1.5rem; right: 1.5rem; }
.hud-bl { bottom: 3.5rem; left: 1.5rem; }
.hud-br { bottom: 3.5rem; right: 1.5rem; }

.hud-crosshair {
    font-size: 1.2rem;
    line-height: 1;
    color: var(--annotation);
    opacity: 0.4;
}

.hud-coord {
    font-variant-numeric: tabular-nums;
}

/* Typography */
.frame-title {
    font-family: 'Bebas Neue', sans-serif;
    font-weight: 400;
    text-transform: uppercase;
    font-size: clamp(3.5rem, 11vw, 9rem);
    letter-spacing: 0.08em;
    line-height: 0.92;
    color: var(--surface);
}

.frame-title-sm {
    font-size: clamp(2rem, 5vw, 4rem);
}

.frame-title-md {
    font-size: clamp(2.5rem, 7vw, 6rem);
}

.frame-title .char {
    display: inline-block;
    transform: translateY(-120vh);
    transition: transform 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
    transition-delay: calc(0.04s * var(--char-index));
}

.frame-title.animated .char,
.frame.is-visible .frame-title .char {
    transform: translateY(0);
}

.body-text {
    font-family: 'IBM Plex Sans', sans-serif;
    font-weight: 300;
    font-size: clamp(0.95rem, 1.5vw, 1.15rem);
    line-height: 1.72;
    letter-spacing: 0.01em;
    color: var(--surface);
}

.annotation {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
    font-size: clamp(0.7rem, 1vw, 0.85rem);
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--annotation);
}

.pull-quote {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 300;
    font-style: italic;
    font-size: clamp(1.3rem, 3vw, 2.2rem);
    color: var(--surface);
    opacity: 0.7;
}

/* Light Cone Dividers */
.light-cone-divider {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 40px;
    z-index: 5;
}

.light-cone-divider svg {
    width: 100%;
    height: 100%;
}

/* ========================================
   FRAME 1 — THE OBSERVER
   ======================================== */
#frame-observer {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
    padding: 10vh 5vw 60px 5vw;
}

.observer-content {
    display: flex;
    flex-direction: column;
    gap: 4rem;
    width: 100%;
}

#title-observer {
    align-self: flex-start;
}

.observer-footnote {
    align-self: flex-end;
    max-width: 380px;
    text-align: right;
}

.observer-footnote .body-text {
    margin-bottom: 0.8rem;
}

/* ========================================
   FRAME 2 — THE FIELD
   ======================================== */
#frame-field {
    display: flex;
    align-items: center;
    justify-content: center;
}

#gravity-well {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.field-orbit-texts {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    pointer-events: none;
}

.orbit-text {
    position: absolute;
    white-space: nowrap;
}

.orbit-1 { top: 15%; left: 10%; font-size: 0.7rem; }
.orbit-2 { top: 25%; right: 15%; font-size: 1rem; }
.orbit-3 { bottom: 30%; left: 8%; font-size: 0.65rem; }
.orbit-4 { top: 40%; left: 25%; font-size: 0.85rem; }
.orbit-5 { bottom: 20%; right: 10%; font-size: 0.6rem; }
.orbit-6 { bottom: 15%; left: 30%; font-size: 0.9rem; }

.frame2-quote {
    position: absolute;
    bottom: 60px;
    left: 5vw;
    right: 5vw;
    z-index: 3;
    text-align: center;
}

/* ========================================
   FRAME 3 — THE LENS
   ======================================== */
#frame-lens {
    display: flex;
    flex-direction: column;
    padding: 8vh 5vw 60px 5vw;
    gap: 2rem;
}

#title-lens {
    align-self: center;
    text-align: center;
}

.lens-columns {
    display: flex;
    flex: 1;
    gap: 0;
    position: relative;
    align-items: flex-start;
    clip-path: polygon(5% 0%, 95% 0%, 80% 100%, 20% 100%);
    padding: 2rem 4vw;
}

.lens-col {
    flex: 1;
    padding: 1.5rem;
}

.lens-col-red .body-text,
.lens-col-red .lens-col-title {
    color: var(--redshift);
}

.lens-col-blue .body-text,
.lens-col-blue .lens-col-title {
    color: var(--blueshift);
}

.lens-col-title {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
    font-size: clamp(0.7rem, 1vw, 0.85rem);
    text-transform: uppercase;
    letter-spacing: 0.15em;
    margin-bottom: 1rem;
}

.lens-col-red .lens-col-title {
    font-size: clamp(0.9rem, 1.3vw, 1.1rem);
}

.geodesic-separator {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 100%;
    z-index: 2;
}

.frame3-quote {
    text-align: center;
    margin-top: auto;
}

/* ========================================
   FRAME 4 — THE HORIZON
   ======================================== */
#frame-horizon {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: stretch;
    padding: 0 5vw;
}

.horizon-above {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    padding-bottom: 2rem;
    text-align: center;
}

.horizon-text {
    max-width: 600px;
    text-align: center;
}

.horizon-svg {
    width: 100%;
    height: 4px;
    flex-shrink: 0;
}

.horizon-below {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    padding-top: 2rem;
    text-align: center;
    transform: scaleY(-1);
    filter: blur(2px);
    opacity: 0.3;
    mask-image: linear-gradient(to bottom, rgba(0,0,0,1) 0%, rgba(0,0,0,0) 80%);
    -webkit-mask-image: linear-gradient(to bottom, rgba(0,0,0,1) 0%, rgba(0,0,0,0) 80%);
}

.horizon-text-reflected {
    max-width: 600px;
    text-align: center;
    transform: scaleY(1.5);
    transform-origin: top center;
}

.horizon-title-reflected {
    transform: scaleY(1.3);
    transform-origin: top center;
}

/* ========================================
   FRAME 5 — THE SINGULARITY
   ======================================== */
#frame-singularity {
    display: flex;
    align-items: center;
    justify-content: center;
}

.spiral-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.spiral-word {
    position: absolute;
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--annotation);
    white-space: nowrap;
    transform-origin: center center;
}

.singularity-dot {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 4px;
    height: 4px;
    background: var(--signal);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    z-index: 5;
    animation: singularity-pulse 2.5s cubic-bezier(0.68, -0.55, 0.27, 1.55) infinite;
    box-shadow:
        0 0 4px 2px rgba(230, 57, 70, 0.6),
        0 0 12px 6px rgba(230, 57, 70, 0.3),
        0 0 24px 12px rgba(230, 57, 70, 0.15),
        0 0 48px 24px rgba(230, 57, 70, 0.07);
}

@keyframes singularity-pulse {
    0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
    30% { transform: translate(-50%, -50%) scale(1.8); opacity: 0.7; }
    60% { transform: translate(-50%, -50%) scale(0.8); opacity: 1; }
    80% { transform: translate(-50%, -50%) scale(1.2); opacity: 0.9; }
}

.frame5-quote {
    position: absolute;
    bottom: 60px;
    left: 5vw;
    right: 5vw;
    text-align: center;
    z-index: 3;
}

/* Responsive */
@media (max-width: 768px) {
    .lens-columns {
        flex-direction: column;
        clip-path: none;
        padding: 1rem;
    }

    .geodesic-separator {
        width: 100%;
        height: 4px;
        position: relative;
        left: 0;
        transform: none;
    }

    .observer-footnote {
        align-self: flex-start;
        text-align: left;
    }

    .hud {
        font-size: 0.55rem;
    }
}
