/* ============================================================
   parallengine.com — Translucent Frost / Cyberpunk Cryogenics
   Palette: Void Indigo #0b0e1a, Deep Slate #141b2d,
            Twilight Navy #1a2540, Frost White #e8edf5,
            Pale Steel #b8c4d4, Muted Slate #8a96a8,
            Frost Cyan #a8d8ea, Aurora Teal #5ec4b6,
            Phantom Lavender #9b8ec4, Cryo Pink #d4a0b9,
            Glacial Mist #c8dce8
   Fonts: Playfair Display 700/400i, Inter 300/400, Fira Code 300
   ============================================================ */

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

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    background-color: #0b0e1a;
    color: #b8c4d4;
    font-family: 'Inter', sans-serif;
    font-weight: 300;
    font-size: clamp(0.95rem, 1.1vw, 1.15rem);
    line-height: 1.72;
    letter-spacing: 0.01em;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Scanline Overlay */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(168, 216, 234, 0.015) 2px,
        rgba(168, 216, 234, 0.015) 4px
    );
    pointer-events: none;
    z-index: 9999;
}

.svg-defs {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
}

/* --- Frost Canopy Background --- */
#frost-canopy {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    background: linear-gradient(170deg, #0b0e1a 0%, #141b2d 35%, #1a2540 65%, #0d1117 100%);
    opacity: 0;
    transition: opacity 1.5s ease-out;
}

#frost-canopy.visible {
    opacity: 1;
}

.frost-layer {
    position: absolute;
    top: -10%;
    left: -10%;
    width: 120%;
    height: 120%;
    opacity: 0;
    transition: opacity 15s ease-in-out;
}

.frost-layer-1 {
    filter: url(#frost-filter-1);
    background: transparent;
}
.frost-layer-2 {
    filter: url(#frost-filter-2);
    background: transparent;
}
.frost-layer-3 {
    filter: url(#frost-filter-3);
    background: transparent;
}
.frost-layer-4 {
    filter: url(#frost-filter-4);
    background: transparent;
}

/* Cross-fade frost textures over 60s cycle */
@keyframes frostCycle1 {
    0%, 100% { opacity: 1; }
    25% { opacity: 0; }
    50% { opacity: 0; }
    75% { opacity: 0; }
}
@keyframes frostCycle2 {
    0% { opacity: 0; }
    25% { opacity: 1; }
    50% { opacity: 0; }
    75% { opacity: 0; }
    100% { opacity: 0; }
}
@keyframes frostCycle3 {
    0% { opacity: 0; }
    25% { opacity: 0; }
    50% { opacity: 1; }
    75% { opacity: 0; }
    100% { opacity: 0; }
}
@keyframes frostCycle4 {
    0% { opacity: 0; }
    25% { opacity: 0; }
    50% { opacity: 0; }
    75% { opacity: 1; }
    100% { opacity: 0; }
}

.frost-layer-1.animated { animation: frostCycle1 60s linear infinite; }
.frost-layer-2.animated { animation: frostCycle2 60s linear infinite; }
.frost-layer-3.animated { animation: frostCycle3 60s linear infinite; }
.frost-layer-4.animated { animation: frostCycle4 60s linear infinite; }

.crystal-lattice-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.4;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='46'%3E%3Cpolygon points='20,0 40,11.5 40,34.5 20,46 0,34.5 0,11.5' fill='none' stroke='%23a8d8ea' stroke-width='0.5' opacity='0.08'/%3E%3C/svg%3E");
    background-repeat: repeat;
}

/* --- Cursor Glow --- */
#cursor-glow {
    position: fixed;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(168, 216, 234, 0.12) 0%, transparent 70%);
    pointer-events: none;
    z-index: 9998;
    transform: translate(-50%, -50%);
    opacity: 0;
    transition: opacity 0.3s ease;
    will-change: transform;
}

#cursor-glow.active {
    opacity: 1;
}

/* --- HUD Frame --- */
#hud-frame {
    position: fixed;
    top: 24px;
    left: 24px;
    right: 24px;
    bottom: 24px;
    z-index: 100;
    pointer-events: none;
}

.hud-border {
    position: absolute;
    background-color: rgba(168, 216, 234, 0.2);
    transform-origin: left top;
}

.hud-border-top {
    top: 0;
    left: 0;
    width: 100%;
    height: 1px;
    transform: scaleX(0);
    transform-origin: left center;
}
.hud-border-right {
    top: 0;
    right: 0;
    width: 1px;
    height: 100%;
    transform: scaleY(0);
    transform-origin: center top;
}
.hud-border-bottom {
    bottom: 0;
    left: 0;
    width: 100%;
    height: 1px;
    transform: scaleX(0);
    transform-origin: right center;
}
.hud-border-left {
    top: 0;
    left: 0;
    width: 1px;
    height: 100%;
    transform: scaleY(0);
    transform-origin: center bottom;
}

.hud-border-top.animate {
    animation: drawHorizontal 600ms ease-out forwards;
}
.hud-border-right.animate {
    animation: drawVertical 400ms ease-out 500ms forwards;
}
.hud-border-bottom.animate {
    animation: drawHorizontalReverse 600ms ease-out 800ms forwards;
}
.hud-border-left.animate {
    animation: drawVerticalReverse 400ms ease-out 1100ms forwards;
}

@keyframes drawHorizontal {
    to { transform: scaleX(1); }
}
@keyframes drawVertical {
    to { transform: scaleY(1); }
}
@keyframes drawHorizontalReverse {
    from { transform: scaleX(0); transform-origin: right center; }
    to { transform: scaleX(1); transform-origin: right center; }
}
@keyframes drawVerticalReverse {
    from { transform: scaleY(0); transform-origin: center bottom; }
    to { transform: scaleY(1); transform-origin: center bottom; }
}

/* HUD Corners */
.hud-corner {
    position: absolute;
    width: 12px;
    height: 12px;
    opacity: 0;
    transition: opacity 150ms ease;
}

.hud-corner.visible {
    opacity: 1;
}

.hud-corner-tl {
    top: -1px;
    left: -1px;
    border-top: 2px solid rgba(168, 216, 234, 0.4);
    border-left: 2px solid rgba(168, 216, 234, 0.4);
}
.hud-corner-tr {
    top: -1px;
    right: -1px;
    border-top: 2px solid rgba(168, 216, 234, 0.4);
    border-right: 2px solid rgba(168, 216, 234, 0.4);
}
.hud-corner-bl {
    bottom: -1px;
    left: -1px;
    border-bottom: 2px solid rgba(168, 216, 234, 0.4);
    border-left: 2px solid rgba(168, 216, 234, 0.4);
}
.hud-corner-br {
    bottom: -1px;
    right: -1px;
    border-bottom: 2px solid rgba(168, 216, 234, 0.4);
    border-right: 2px solid rgba(168, 216, 234, 0.4);
}

/* HUD Status Strip */
.hud-status-strip {
    position: absolute;
    top: 8px;
    left: 16px;
    right: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: 'Fira Code', monospace;
    font-weight: 300;
    font-size: 0.7rem;
    color: rgba(168, 216, 234, 0.4);
    pointer-events: none;
}

.hud-domain {
    overflow: hidden;
    white-space: nowrap;
    border-right: 2px solid rgba(168, 216, 234, 0.4);
    animation: none;
}

.hud-domain.typing {
    animation: typingCursor 600ms step-end infinite;
}

.hud-domain.done {
    border-right-color: transparent;
}

@keyframes typingCursor {
    0%, 100% { border-right-color: rgba(168, 216, 234, 0.4); }
    50% { border-right-color: transparent; }
}

.hud-clock {
    opacity: 0;
    transition: opacity 0.5s ease;
}

.hud-clock.visible {
    opacity: 1;
}

/* --- Data Channels --- */
.data-channel {
    position: fixed;
    top: 48px;
    width: 48px;
    bottom: 48px;
    z-index: 50;
    overflow: hidden;
    pointer-events: none;
}

#data-channel-left {
    left: 28px;
}

#data-channel-right {
    right: 28px;
}

.data-stream {
    display: flex;
    flex-direction: column;
    gap: 12px;
    font-family: 'Fira Code', monospace;
    font-weight: 300;
    font-size: 0.6rem;
    color: rgba(168, 216, 234, 0.15);
    line-height: 1.4;
    will-change: transform;
}

.data-stream span {
    white-space: nowrap;
}

/* --- Main Content --- */
#main-content {
    position: relative;
    z-index: 10;
    padding: 0 calc(24px + 56px);
}

/* --- Zones --- */
.zone {
    min-height: 100vh;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

/* --- Hero Zone --- */
#zone-hero {
    padding-top: 60px;
}

.hero-content {
    text-align: center;
    position: relative;
    z-index: 2;
}

.hero-title {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    font-size: clamp(2.6rem, 5.5vw, 4.8rem);
    letter-spacing: 0.03em;
    color: #e8edf5;
    text-shadow: 1px 1px 0 rgba(168, 216, 234, 0.08), -1px -1px 0 rgba(155, 142, 196, 0.06);
    margin-bottom: 1.5rem;
}

.hero-title .letter {
    display: inline-block;
    opacity: 0;
    transform: translateY(30px);
}

.hero-title .letter.visible {
    animation: letterFadeUp 1.2s ease-out forwards;
}

@keyframes letterFadeUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero-subtitle {
    font-family: 'Inter', sans-serif;
    font-weight: 300;
    font-size: clamp(1rem, 1.3vw, 1.25rem);
    color: #b8c4d4;
    letter-spacing: 0.02em;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 1.2s ease-out, transform 1.2s ease-out;
    max-width: 600px;
    margin: 0 auto;
}

.hero-subtitle.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Scroll Chevron */
.scroll-chevron {
    margin-top: 3rem;
    width: 30px;
    height: 20px;
    position: relative;
    display: inline-block;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.scroll-chevron.visible {
    opacity: 1;
    animation: chevronBounce 1.5s ease-in-out infinite;
}

@keyframes chevronBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(8px); }
}

.chevron-line {
    position: absolute;
    width: 16px;
    height: 1px;
    background-color: rgba(168, 216, 234, 0.4);
    top: 50%;
}

.chevron-line-left {
    left: 0;
    transform: rotate(45deg);
    transform-origin: right center;
}

.chevron-line-right {
    right: 0;
    transform: rotate(-45deg);
    transform-origin: left center;
}

/* --- Breathing Orbs --- */
.breathing-orb {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    z-index: 1;
}

.orb-1 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(94, 196, 182, 0.06) 0%, transparent 70%);
    bottom: 10%;
    right: 15%;
    animation: breatheOrb1 12s ease-in-out infinite;
}

.orb-2 {
    width: 350px;
    height: 350px;
    background: radial-gradient(circle, rgba(155, 142, 196, 0.05) 0%, transparent 70%);
    top: 20%;
    left: 10%;
    animation: breatheOrb2 15s ease-in-out infinite;
}

.orb-3 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(168, 216, 234, 0.04) 0%, transparent 70%);
    bottom: 15%;
    left: 30%;
    animation: breatheOrb3 18s ease-in-out infinite;
}

@keyframes breatheOrb1 {
    0%, 100% { transform: scale(0.95); opacity: 0.8; }
    50% { transform: scale(1.05); opacity: 1; }
}

@keyframes breatheOrb2 {
    0%, 100% { transform: scale(1.05); opacity: 1; }
    50% { transform: scale(0.95); opacity: 0.7; }
}

@keyframes breatheOrb3 {
    0%, 100% { transform: scale(0.95); opacity: 0.9; }
    50% { transform: scale(1.05); opacity: 1; }
}

/* --- Frost Particles --- */
.frost-particle {
    position: absolute;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background-color: rgba(168, 216, 234, 0.15);
    pointer-events: none;
    z-index: 1;
}

.frost-particle:nth-child(odd) {
    width: 3px;
    height: 3px;
    background-color: rgba(168, 216, 234, 0.1);
    animation: particleDrift1 60s linear infinite;
}

.frost-particle:nth-child(even) {
    width: 5px;
    height: 5px;
    background-color: rgba(168, 216, 234, 0.2);
    animation: particleDrift2 80s linear infinite;
}

.frost-particle:nth-child(3n) {
    width: 6px;
    height: 6px;
    background-color: rgba(168, 216, 234, 0.25);
    animation: particleDrift3 40s linear infinite;
}

@keyframes particleDrift1 {
    0% { transform: translateY(0); }
    100% { transform: translateY(-60px); }
}

@keyframes particleDrift2 {
    0% { transform: translateY(0); }
    100% { transform: translateY(-40px); }
}

@keyframes particleDrift3 {
    0% { transform: translateY(0); }
    100% { transform: translateY(-80px); }
}

/* --- Interstitial Zones --- */
.interstitial-zone {
    min-height: 45vh;
    position: relative;
}

/* --- Content Panels --- */
.content-panel {
    backdrop-filter: blur(12px) saturate(120%);
    -webkit-backdrop-filter: blur(12px) saturate(120%);
    background: rgba(15, 20, 35, 0.55);
    border: 1px solid rgba(168, 216, 234, 0.12);
    border-radius: 2px;
    padding: clamp(1.5rem, 3vw, 2.5rem);
    position: relative;
    overflow: hidden;
    box-shadow: 0 0 20px rgba(168, 216, 234, 0.04);
    transition: backdrop-filter 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.content-panel.cursor-near {
    backdrop-filter: blur(12px) saturate(150%);
    -webkit-backdrop-filter: blur(12px) saturate(150%);
    border-color: rgba(168, 216, 234, 0.25);
    box-shadow: 0 0 30px rgba(168, 216, 234, 0.08);
}

/* --- Scroll Reveal (frozen state) --- */
.scroll-reveal {
    opacity: 0;
    transform: translateY(40px) scale(0.97);
    filter: blur(6px);
    transition: opacity 800ms ease-out, transform 800ms ease-out, filter 800ms ease-out;
}

.scroll-reveal.thawed {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
}

/* Stagger children */
.scroll-reveal .panel-heading,
.scroll-reveal .panel-subheading {
    opacity: 0;
    transform: translateY(15px);
    transition: opacity 600ms ease-out 150ms, transform 600ms ease-out 150ms;
}

.scroll-reveal .panel-body,
.scroll-reveal .panel-body-sm,
.scroll-reveal .fragment-text {
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 600ms ease-out 300ms, transform 600ms ease-out 300ms;
}

.scroll-reveal .metric-row,
.scroll-reveal .frost-particle {
    opacity: 0;
    transition: opacity 600ms ease-out 450ms;
}

.scroll-reveal.thawed .panel-heading,
.scroll-reveal.thawed .panel-subheading,
.scroll-reveal.thawed .panel-body,
.scroll-reveal.thawed .panel-body-sm,
.scroll-reveal.thawed .fragment-text,
.scroll-reveal.thawed .metric-row {
    opacity: 1;
    transform: translateY(0);
}

.scroll-reveal.thawed .frost-particle {
    opacity: 1;
}

/* --- Signal Detection Grid (Zone 2) --- */
.signal-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: clamp(1.5rem, 4vw, 3rem);
    width: 100%;
    max-width: 900px;
    padding: clamp(2rem, 5vh, 4rem) 0;
}

.panel-fragment {
    padding: clamp(1.5rem, 3vw, 2.5rem);
}

.fragment-text {
    font-family: 'Playfair Display', serif;
    font-weight: 400;
    font-style: italic;
    font-size: clamp(1.1rem, 1.5vw, 1.35rem);
    color: #e8edf5;
    line-height: 1.6;
    letter-spacing: 0.01em;
    text-shadow: 1px 1px 0 rgba(168, 216, 234, 0.08), -1px -1px 0 rgba(155, 142, 196, 0.06);
}

.fragment-text em {
    font-style: italic;
}

/* --- Core Systems Grid (Zone 3) --- */
.core-grid {
    display: grid;
    gap: clamp(1.5rem, 4vw, 3rem);
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    padding: clamp(1.5rem, 3vh, 2.5rem) 0;
}

.core-grid-odd {
    grid-template-columns: 1fr 0.6fr;
}

.core-grid-even {
    grid-template-columns: 0.6fr 1fr;
}

.panel-heading {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    font-size: clamp(1.4rem, 3vw, 2.2rem);
    letter-spacing: 0.03em;
    color: #e8edf5;
    margin-bottom: 1.2rem;
    text-shadow: 1px 1px 0 rgba(168, 216, 234, 0.08), -1px -1px 0 rgba(155, 142, 196, 0.06);
}

.panel-subheading {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    font-size: clamp(1.1rem, 2vw, 1.5rem);
    letter-spacing: 0.03em;
    color: #e8edf5;
    margin-bottom: 1rem;
    text-shadow: 1px 1px 0 rgba(168, 216, 234, 0.08), -1px -1px 0 rgba(155, 142, 196, 0.06);
}

.panel-body {
    font-family: 'Inter', sans-serif;
    font-weight: 300;
    font-size: clamp(0.95rem, 1.1vw, 1.15rem);
    line-height: 1.72;
    color: #b8c4d4;
    margin-bottom: 1rem;
    letter-spacing: 0.01em;
}

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

.panel-body-sm {
    font-family: 'Inter', sans-serif;
    font-weight: 300;
    font-size: clamp(0.88rem, 1vw, 1.05rem);
    line-height: 1.72;
    color: #b8c4d4;
    letter-spacing: 0.01em;
}

/* Metric rows */
.metric-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 0.6rem 0;
    border-bottom: 1px solid rgba(168, 216, 234, 0.08);
}

.metric-row:last-child {
    border-bottom: none;
}

.metric-label {
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    font-size: 0.85rem;
    color: #8a96a8;
    letter-spacing: 0.01em;
}

.metric-value {
    font-family: 'Fira Code', monospace;
    font-weight: 300;
    font-size: 0.85rem;
    color: #a8d8ea;
    letter-spacing: 0;
}

/* --- Deep Scan (Zone 4) --- */
#zone-deepscan {
    padding: clamp(2rem, 5vh, 4rem) 0;
}

.deepscan-panel {
    width: 100%;
    max-width: 1100px;
}

.deepscan-content {
    columns: 2;
    column-gap: 2.5rem;
}

.deepscan-content .panel-body {
    break-inside: avoid;
}

/* --- Signal Fade (Zone 5) --- */
#zone-fade {
    min-height: 150vh;
    justify-content: flex-start;
    padding-top: clamp(3rem, 8vh, 6rem);
}

.fade-panels {
    display: flex;
    flex-direction: column;
    gap: clamp(3rem, 8vh, 6rem);
    width: 100%;
    max-width: 800px;
}

.panel-fading.fade-level-1 {
    /* Normal frost */
}

.panel-fading.fade-level-2 {
    background: rgba(15, 20, 35, 0.35);
    border-color: rgba(168, 216, 234, 0.08);
}

.panel-fading.fade-level-2 .panel-body {
    color: rgba(184, 196, 212, 0.6);
}

.panel-fading.fade-level-3 {
    background: rgba(15, 20, 35, 0.2);
    border-color: rgba(168, 216, 234, 0.05);
}

.panel-fading.fade-level-3 .panel-body {
    color: rgba(184, 196, 212, 0.35);
    font-family: 'Playfair Display', serif;
    font-weight: 400;
    font-style: italic;
    text-align: center;
}

/* Signal Terminus */
.signal-terminus {
    margin-top: auto;
    padding-bottom: 10vh;
    text-align: center;
}

.terminus-text {
    font-family: 'Fira Code', monospace;
    font-weight: 300;
    font-size: clamp(0.65rem, 0.8vw, 0.8rem);
    color: rgba(168, 216, 234, 0.3);
    letter-spacing: 0.05em;
}

/* --- Link / Interactive Accents --- */
a {
    color: #5ec4b6;
    text-decoration: none;
    transition: color 0.3s ease, box-shadow 0.3s ease;
}

a:hover {
    color: #a8d8ea;
    box-shadow: 0 0 16px rgba(94, 196, 182, 0.12);
}

/* --- Responsive --- */
@media (max-width: 768px) {
    #main-content {
        padding: 0 calc(24px + 12px);
    }

    .data-channel {
        display: none;
    }

    #hud-frame {
        top: 12px;
        left: 12px;
        right: 12px;
        bottom: 12px;
    }

    .signal-grid {
        grid-template-columns: 1fr;
    }

    .signal-grid .content-panel {
        grid-column: 1 !important;
    }

    .core-grid-odd,
    .core-grid-even {
        grid-template-columns: 1fr;
    }

    .deepscan-content {
        columns: 1;
    }

    #cursor-glow {
        display: none;
    }

    .hero-title {
        font-size: clamp(2rem, 8vw, 3.2rem);
    }
}

@media (max-width: 480px) {
    .hud-status-strip {
        font-size: 0.6rem;
    }

    .panel-heading {
        font-size: clamp(1.2rem, 5vw, 1.6rem);
    }
}
