/* a6c.dev - Surreal Cosmography */

:root {
    --void: #08080f;
    --nebula: #1a1444;
    --signal: #00e5c8;
    --stellar: #d4a843;
    --plasma: #c43b6f;
    --dust: #e8e4df;
    --argon: #3a3a5c;

    --font-display: 'Syne', sans-serif;
    --font-body: 'Crimson Pro', serif;
    --font-mono: 'Azeret Mono', monospace;

    --ease-elastic: cubic-bezier(0.34, 1.56, 0.64, 1);
    --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
    --duration: 800ms;
}

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

html {
    scroll-behavior: smooth;
}

body {
    background: var(--void);
    color: var(--dust);
    font-family: var(--font-body);
    font-weight: 300;
    font-size: 1.125rem;
    line-height: 1.85;
    overflow-x: hidden;
}

/* Noise Overlay */
.noise-overlay {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1000;
    opacity: 0.04;
    mix-blend-mode: overlay;
}

/* Particle Canvas */
#particleCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
}

/* Sections */
.section {
    position: relative;
    min-height: 100vh;
    display: grid;
    place-items: center;
    overflow: hidden;
}

.section-id {
    font-family: var(--font-mono);
    font-weight: 400;
    font-size: 0.75rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--signal);
    opacity: 0.5;
    display: block;
    margin-bottom: 2rem;
}

.section-heading {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: clamp(2.5rem, 6vw, 5rem);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--dust);
    line-height: 1.05;
    margin-bottom: 2rem;
}

.body-text {
    font-family: var(--font-body);
    font-weight: 300;
    font-size: 1.125rem;
    line-height: 1.85;
    color: var(--dust);
    max-width: 42ch;
    margin-bottom: 1.25rem;
}

/* ======= ACT 1: SIGNAL ACQUISITION ======= */
.section-hero {
    background: var(--void);
    flex-direction: column;
}

.hero-focal-point {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--plasma);
    box-shadow: 0 0 20px var(--plasma), 0 0 60px rgba(196, 59, 111, 0.4), 0 0 120px rgba(196, 59, 111, 0.15);
    animation: focalPulse 3s ease-in-out infinite;
    margin-bottom: 2rem;
}

@keyframes focalPulse {
    0%, 100% { transform: scale(1); opacity: 0.8; }
    50% { transform: scale(1.3); opacity: 1; }
}

.hero-title {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: clamp(3rem, 14vw, 12rem);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--dust);
    text-align: center;
    min-height: 1.2em;
}

.hero-title .char {
    display: inline-block;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.hero-title .char.visible {
    opacity: 1;
}

.hero-coordinates {
    margin-top: 1.5rem;
}

.coord-text {
    font-family: var(--font-mono);
    font-weight: 400;
    font-size: 0.75rem;
    letter-spacing: 0.15em;
    color: var(--signal);
    opacity: 0.5;
}

/* ======= ACT 2: TRANSMISSION DECODED ======= */
.section-transmission {
    background: linear-gradient(to bottom, var(--void), var(--nebula));
}

.split-screen {
    display: flex;
    width: 90%;
    max-width: 1200px;
    gap: 4rem;
    align-items: center;
}

.split-left {
    flex: 0 0 45%;
    position: relative;
}

.split-right {
    flex: 1;
}

.star-chart {
    width: 100%;
    height: auto;
    max-height: 70vh;
}

.chart-line {
    stroke-dasharray: 200;
    stroke-dashoffset: 200;
    transition: stroke-dashoffset 2s var(--ease-out);
}

.chart-line.drawn {
    stroke-dashoffset: 0;
}

.transmission-log .body-text {
    font-family: var(--font-body);
    font-style: italic;
    color: var(--dust);
    opacity: 0.85;
}

.diagonal-line {
    position: absolute;
    width: 200%;
    height: 1px;
    background: var(--argon);
    opacity: 0.2;
    transform-origin: center;
}

.dl-1 {
    bottom: 20%;
    left: -50%;
    transform: rotate(-22deg);
}

/* ======= ACT 3: ORBITAL SURVEY ======= */
.section-orbital {
    background: linear-gradient(to bottom, var(--nebula), var(--void));
    flex-direction: column;
}

.orbital-id {
    position: relative;
    z-index: 5;
}

.orrery-container {
    position: relative;
    width: 700px;
    height: 500px;
    max-width: 90vw;
}

.orbital-ring {
    position: absolute;
    border: 1px dashed var(--signal);
    border-radius: 50%;
    opacity: 0.15;
}

.ring-1 {
    width: 250px; height: 180px;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    animation: orbitSpin 120s linear infinite;
}

.ring-2 {
    width: 420px; height: 300px;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    animation: orbitSpin 90s linear infinite reverse;
}

.ring-3 {
    width: 600px; height: 420px;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    animation: orbitSpin 150s linear infinite;
}

@keyframes orbitSpin {
    from { transform: translate(-50%, -50%) rotate(0deg); }
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

.orbital-card {
    position: absolute;
    background: rgba(26, 20, 68, 0.6);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(0, 229, 200, 0.2);
    border-radius: 8px;
    padding: 1.5rem;
    width: 220px;
    transition: transform 0.5s var(--ease-elastic), border-color 0.4s ease, box-shadow 0.4s ease;
    z-index: 4;
}

.orbital-card:hover {
    transform: scale(1.04);
    border-color: var(--signal);
    box-shadow: 0 0 20px rgba(0, 229, 200, 0.15);
}

.card-inner {
    top: 35%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.card-middle {
    top: 25%;
    left: 15%;
}

.card-outer {
    top: 65%;
    right: 5%;
}

.card-name {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.1rem;
    letter-spacing: 0.04em;
    color: var(--signal);
    margin-bottom: 0.5rem;
}

.card-desc {
    font-family: var(--font-body);
    font-weight: 300;
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--dust);
    opacity: 0.8;
}

/* ======= ACT 4: DEEP FIELD ======= */
.section-deepfield {
    background: var(--void);
}

.deepfield-content {
    position: relative;
    text-align: center;
    max-width: 700px;
    padding: 2rem;
}

.pull-quote {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: clamp(1.8rem, 5vw, 3.5rem);
    color: var(--stellar);
    line-height: 1.2;
    margin-bottom: 3rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.ring-accent {
    width: 300px;
    height: 200px;
    border: 1px solid var(--signal);
    border-radius: 50%;
    opacity: 0.1;
    position: absolute;
    top: 10%;
    right: -80px;
    animation: orbitSpin 80s linear infinite;
    pointer-events: none;
}

.centered-text {
    max-width: 50ch;
    margin-left: auto;
    margin-right: auto;
    text-align: left;
}

/* ======= ACT 5: SIGNAL RETURN ======= */
.section-return {
    background: linear-gradient(to bottom, var(--void), #050508);
}

.return-content {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.return-prompt {
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 1.3rem;
    color: var(--dust);
}

.transmission-input {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 2rem;
    border: 1px solid var(--signal);
    border-radius: 4px;
    background: rgba(0, 229, 200, 0.03);
    box-shadow: 0 0 10px rgba(0, 229, 200, 0.1), 0 0 40px rgba(0, 229, 200, 0.03);
}

.input-cursor {
    width: 2px;
    height: 1.2em;
    background: var(--signal);
    animation: cursorBlink 1s step-end infinite;
}

@keyframes cursorBlink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

.input-label {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--signal);
    letter-spacing: 0.1em;
}

.coord-annotations {
    display: flex;
    gap: 2rem;
    margin-top: 1rem;
}

.annotation {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 0.15em;
    color: var(--stellar);
    opacity: 0.5;
}

/* Reveal Animation */
.reveal-element {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity var(--duration) var(--ease-elastic), transform var(--duration) var(--ease-elastic);
}

.reveal-element.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Responsive */
@media (max-width: 768px) {
    .split-screen {
        flex-direction: column;
    }

    .split-left {
        flex: none;
        width: 100%;
    }

    .orrery-container {
        width: 100%;
        height: 600px;
    }

    .orbital-card {
        position: relative;
        width: 90%;
        top: auto;
        left: auto;
        right: auto;
        transform: none;
        margin: 0.5rem auto;
    }

    .card-inner { transform: none; }

    .coord-annotations {
        flex-direction: column;
        gap: 0.5rem;
    }
}
