/* ============================================
   archetype.moe - Frutiger Aero + Neon Electric
   ============================================ */

/* CSS Custom Properties */
:root {
    --electric-cyan: #00FFD1;
    --hot-magenta: #FF00C8;
    --acid-lime: #AAFF00;
    --void-indigo: #0A0E27;
    --aero-glass: #1A1F4A;
    --solar-amber: #FFB800;
    --frost-white: #E8EDF5;
    --haze-lavender: #8B92B3;
    --deep-purple: #1A0A2E;
    --deep-blue: #0A1A2E;

    --font-display: 'Outfit', sans-serif;
    --font-body: 'Sora', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;

    --glass-bg: rgba(26, 31, 74, 0.65);
    --glass-border: rgba(0, 255, 209, 0.15);
    --glass-inner-highlight: inset 0 1px 0 rgba(255, 255, 255, 0.08);
    --glass-outer-glow: 0 8px 32px rgba(0, 255, 209, 0.08);
    --glass-radius: 16px;
}

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

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-body);
    font-weight: 300;
    color: var(--frost-white);
    background: var(--void-indigo);
    background: linear-gradient(135deg, #0A0E27 0%, #1A0A2E 40%, #0A1A2E 100%);
    background-attachment: fixed;
    overflow-x: hidden;
    line-height: 1.75;
    letter-spacing: 0.01em;
    font-size: 1.125rem;
}

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

/* ============================================
   Navigation - Floating Glass Pill
   ============================================ */
#nav-pill {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 1000;
    background: var(--glass-bg);
    backdrop-filter: blur(20px) saturate(1.4);
    -webkit-backdrop-filter: blur(20px) saturate(1.4);
    border: 1px solid var(--glass-border);
    border-radius: 28px;
    padding: 10px 16px;
    box-shadow: var(--glass-inner-highlight), var(--glass-outer-glow), 0 0 20px rgba(0, 255, 209, 0.1);
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    display: flex;
    align-items: center;
    gap: 12px;
}

#nav-pill:hover {
    box-shadow: var(--glass-inner-highlight), 0 8px 40px rgba(0, 255, 209, 0.2), 0 0 30px rgba(0, 255, 209, 0.15);
    padding-right: 20px;
}

#nav-icon {
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 20px;
}

#nav-icon span {
    display: block;
    height: 2px;
    background: var(--electric-cyan);
    border-radius: 1px;
    transition: all 0.3s ease;
}

#nav-icon span:nth-child(1) { width: 20px; }
#nav-icon span:nth-child(2) { width: 14px; }
#nav-icon span:nth-child(3) { width: 18px; }

#nav-pill:hover #nav-icon span { width: 20px; }

#nav-links {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.4s ease, opacity 0.3s ease;
}

#nav-pill.expanded #nav-links {
    max-height: 200px;
    opacity: 1;
}

#nav-pill.expanded {
    flex-direction: column;
    align-items: flex-start;
    border-radius: var(--glass-radius);
    padding: 16px 20px;
}

.nav-link {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    color: var(--haze-lavender);
    text-decoration: none;
    transition: color 0.2s ease;
    white-space: nowrap;
    overflow: hidden;
}

.nav-link::before {
    content: '> ';
    color: var(--electric-cyan);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.nav-link:hover {
    color: var(--electric-cyan);
}

.nav-link:hover::before {
    opacity: 1;
}

/* ============================================
   Chapters - Common Styles
   ============================================ */
.chapter {
    position: relative;
    z-index: 2;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chapter-content {
    min-height: auto;
    padding: 20vh 5vw;
}

/* ============================================
   Chapter 1: SIGNAL_DETECTED (Hero)
   ============================================ */
.chapter-hero {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-glass-panel {
    position: relative;
    background: var(--glass-bg);
    backdrop-filter: blur(20px) saturate(1.4);
    -webkit-backdrop-filter: blur(20px) saturate(1.4);
    border: 1px solid var(--glass-border);
    border-radius: var(--glass-radius);
    box-shadow: var(--glass-inner-highlight), var(--glass-outer-glow), 0 0 60px rgba(0, 255, 209, 0.05);
    padding: clamp(3rem, 6vw, 6rem) clamp(2rem, 5vw, 5rem);
    max-width: 800px;
    width: 90%;
    text-align: center;
    overflow: hidden;
}

.hero-glass-panel h1 {
    font-family: var(--font-display);
    font-weight: 900;
    font-size: clamp(2.8rem, 7vw, 6rem);
    letter-spacing: -0.03em;
    color: var(--frost-white);
    min-height: 1.2em;
    line-height: 1.1;
}

.hero-glass-panel .typewriter-tagline {
    margin-top: 1.5rem;
    min-height: 1.6em;
}

/* Concentric Rings Background Motif */
.concentric-rings {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 500px;
    height: 500px;
    pointer-events: none;
    opacity: 0.08;
}

.concentric-rings::before,
.concentric-rings::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    border: 1px solid var(--aero-glass);
}

.concentric-rings::before {
    width: 300px;
    height: 300px;
}

.concentric-rings::after {
    width: 450px;
    height: 450px;
}

.concentric-rings.small {
    width: 250px;
    height: 250px;
}

.concentric-rings.small::before {
    width: 150px;
    height: 150px;
}

.concentric-rings.small::after {
    width: 230px;
    height: 230px;
}

/* ============================================
   Status Dot
   ============================================ */
.status-dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--acid-lime);
    box-shadow: 0 0 8px rgba(170, 255, 0, 0.6);
    animation: pulse-dot 2s ease-in-out infinite;
    vertical-align: middle;
    margin-right: 10px;
    flex-shrink: 0;
}

.status-dot.amber {
    background: var(--solar-amber);
    box-shadow: 0 0 8px rgba(255, 184, 0, 0.6);
}

.hero-glass-panel .status-dot {
    position: absolute;
    top: 20px;
    right: 20px;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.8); }
}

/* ============================================
   Typewriter & Mono Styles
   ============================================ */
.mono {
    font-family: var(--font-mono);
    font-weight: 400;
    font-size: 0.95rem;
    letter-spacing: 0.05em;
    color: var(--haze-lavender);
}

.typewriter-heading {
    position: relative;
    display: inline;
}

.typewriter-heading .tw-cursor {
    display: inline-block;
    width: 2px;
    height: 0.9em;
    background: var(--hot-magenta);
    margin-left: 3px;
    vertical-align: text-bottom;
    animation: blink-cursor 530ms step-end infinite;
}

.typewriter-heading .tw-cursor.fade-out {
    animation: blink-cursor 530ms step-end 2, fade-cursor 0.3s ease 1.06s forwards;
}

@keyframes blink-cursor {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

@keyframes fade-cursor {
    to { opacity: 0; }
}

.coda-line .tw-cursor {
    animation: blink-cursor 530ms step-end infinite;
}

/* ============================================
   F-Pattern Layout
   ============================================ */
.f-layout {
    display: grid;
    grid-template-columns: 40% 1fr;
    gap: 5vw;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

.scan-column {
    position: relative;
    padding-left: 3vw;
}

.scan-column::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(180deg, var(--electric-cyan), var(--hot-magenta));
    opacity: 0.08;
}

.section-heading-wrap {
    display: flex;
    align-items: center;
    margin-bottom: 2rem;
}

.section-heading-wrap h2 {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: clamp(1.8rem, 4vw, 3.2rem);
    letter-spacing: -0.03em;
    color: var(--frost-white);
    min-height: 1.3em;
    line-height: 1.2;
}

.center-heading {
    justify-content: center;
    margin-bottom: 2rem;
}

/* ============================================
   Neon Divider
   ============================================ */
.neon-divider {
    height: 1px;
    background: linear-gradient(90deg, var(--electric-cyan), var(--hot-magenta));
    margin: 2rem 0;
    max-width: 70%;
    position: relative;
    overflow: hidden;
}

.neon-divider::after {
    content: '';
    position: absolute;
    top: -1px;
    left: -20%;
    width: 20%;
    height: 3px;
    background: rgba(255, 255, 255, 0.8);
    filter: blur(2px);
    animation: shimmer 3s linear infinite;
}

@keyframes shimmer {
    0% { left: -20%; }
    100% { left: 100%; }
}

.neon-divider.short {
    max-width: 40%;
}

.neon-divider.center-divider {
    max-width: 200px;
    margin: 1.5rem auto 3rem;
}

/* ============================================
   Body Text
   ============================================ */
.body-text {
    color: var(--frost-white);
    margin-bottom: 1.5rem;
    line-height: 1.75;
}

.body-text.muted, .muted {
    color: var(--haze-lavender);
}

.center-text {
    text-align: center;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.contemplative-text {
    margin-top: 3rem;
    font-weight: 300;
    line-height: 2;
}

/* ============================================
   Glass Panels
   ============================================ */
.glass-panel {
    position: relative;
    background: var(--glass-bg);
    backdrop-filter: blur(20px) saturate(1.4);
    -webkit-backdrop-filter: blur(20px) saturate(1.4);
    border: 1px solid var(--glass-border);
    border-radius: var(--glass-radius);
    box-shadow: var(--glass-inner-highlight), var(--glass-outer-glow);
    padding: 2rem;
    overflow: hidden;
}

.breakout-panel {
    opacity: 0;
    transform: translateX(60px);
    transition: opacity 0.8s ease, transform 0.8s cubic-bezier(0.34, 1.15, 0.64, 1);
}

.breakout-panel.visible {
    opacity: 1;
    transform: translateX(0);
}

.panel-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.4rem;
    letter-spacing: -0.02em;
    color: var(--frost-white);
    margin-bottom: 1rem;
}

.panel-caption {
    margin-top: 1rem;
    font-size: 0.85rem;
    min-height: 1.4em;
}

.panel-meta {
    margin-top: 1rem;
    font-size: 0.8rem;
}

/* Transparent Panel for Chapter 4 */
.transparent-panel {
    background: rgba(26, 31, 74, 0.45);
}

.panoramic-panel {
    max-width: 80%;
    margin: 0 auto 3rem;
    padding: 1.5rem;
}

/* ============================================
   Duotone Images
   ============================================ */
.duotone-image {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
}

.image-placeholder {
    width: 100%;
    display: block;
}

.image-placeholder svg {
    width: 100%;
    height: auto;
    display: block;
}

.image-placeholder.wide svg {
    width: 100%;
    height: auto;
}

/* ============================================
   Chapter 4: FREQUENCY_SHIFT (Warm)
   ============================================ */
.chapter-warm {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20vh 5vw;
}

.full-width-image-wrap {
    width: 100%;
    max-width: 1200px;
}

/* ============================================
   Chapter 5: TRANSMISSION_COMPLETE (Coda)
   ============================================ */
.chapter-coda {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.coda-content {
    text-align: center;
    max-width: 800px;
    width: 90%;
}

.coda-line {
    font-family: var(--font-mono);
    font-weight: 400;
    font-size: clamp(1rem, 2.5vw, 1.6rem);
    letter-spacing: 0.03em;
    color: var(--frost-white);
    min-height: 1.6em;
    display: inline;
}

.coda-cursor {
    display: none;
}

/* ============================================
   Breakout Zone
   ============================================ */
.breakout-zone {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* ============================================
   Responsive Design
   ============================================ */
@media (max-width: 768px) {
    .f-layout {
        grid-template-columns: 1fr;
        gap: 3rem;
    }

    .scan-column {
        padding-left: 1.5rem;
    }

    .breakout-zone {
        padding-left: 1.5rem;
    }

    .hero-glass-panel {
        padding: 2.5rem 1.5rem;
    }

    .panoramic-panel {
        max-width: 95%;
    }

    #nav-pill {
        top: 12px;
        right: 12px;
    }

    .section-heading-wrap h2 {
        font-size: clamp(1.4rem, 6vw, 2.2rem);
    }

    .chapter-content {
        padding: 10vh 4vw;
    }
}

/* ============================================
   Scroll-Triggered Section Visibility
   ============================================ */
.chapter-content .scan-column,
.chapter-warm .full-width-image-wrap {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.chapter-content .scan-column.visible,
.chapter-warm .full-width-image-wrap.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ============================================
   Typewriter Text (inline blocks)
   ============================================ */
.typewriter-text {
    min-height: 1.4em;
}

/* Nav link typewriter labels */
.nav-link .tw-typed {
    font-family: var(--font-mono);
}
