/* ==========================================================================
   bada.news - Translucent Frost Design System
   ========================================================================== */

/* --- CSS Custom Properties --- */
:root {
    --midnight-frost: #0d1117;
    --frost-glass: #161b22;
    --breath-fog: rgba(255, 255, 255, 0.06);
    --rime-white: #e6edf3;
    --thaw-gray: #8b949e;
    --ice-blue: #58a6ff;
    --melt-gold: #d4a373;
    --crystal-edge: rgba(255, 255, 255, 0.12);
    --void-lavender: #1c1e2e;
    --panel-bg: rgba(255, 255, 255, 0.04);
    --panel-surface: #30363d;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Instrument Sans', sans-serif;
    font-weight: 400;
    color: var(--rime-white);
    background-color: var(--midnight-frost);
    overflow-x: hidden;
    min-height: 100vh;
    line-height: 1.7;
    letter-spacing: 0.005em;
}

/* --- Voronoi Background SVG --- */
#voronoi-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 0;
    pointer-events: none;
}

/* --- Peripheral L-System Lines --- */
#peripheral-lines {
    position: fixed;
    top: 0;
    right: 0;
    width: 45vw;
    height: 100vh;
    z-index: 1;
    pointer-events: none;
    opacity: 0.2;
    transition: transform 0.1s linear;
}

/* --- Masthead Bar --- */
#masthead {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: clamp(80px, 10vh, 120px);
    z-index: 100;
    backdrop-filter: blur(20px) saturate(120%);
    -webkit-backdrop-filter: blur(20px) saturate(120%);
    background: rgba(255, 255, 255, 0.08);
    border-bottom: 1px solid var(--crystal-edge);
    display: flex;
    align-items: center;
    opacity: 0;
    transform: translateY(-100%);
    transition: opacity 0.4s ease-out, transform 0.4s ease-out;
}

#masthead.visible {
    opacity: 1;
    transform: translateY(0);
}

.masthead-inner {
    width: 100%;
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 clamp(24px, 4vw, 60px);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.masthead-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.masthead-title {
    font-family: 'Archivo Black', sans-serif;
    font-weight: 400;
    font-size: clamp(2rem, 4vw, 3.2rem);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--rime-white);
    text-shadow: 0 0 40px rgba(88, 166, 255, 0.08), 0 0 2px rgba(255, 255, 255, 0.15);
}

.masthead-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.masthead-data {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
    font-size: clamp(0.75rem, 0.9vw, 0.85rem);
    letter-spacing: 0.06em;
    color: var(--ice-blue);
}

.masthead-separator {
    color: var(--crystal-edge);
}

/* --- Main Content Area --- */
#content-area {
    position: relative;
    z-index: 10;
    padding-top: calc(clamp(80px, 10vh, 120px) + 40px);
    padding-left: clamp(24px, 4vw, 60px);
    padding-right: clamp(24px, 4vw, 60px);
    padding-bottom: 80px;
    max-width: 1600px;
    margin: 0 auto;
}

/* --- Frost Panel Base --- */
.frost-panel {
    position: relative;
    backdrop-filter: blur(16px) saturate(120%);
    -webkit-backdrop-filter: blur(16px) saturate(120%);
    background: var(--panel-bg);
    border: 1px solid var(--crystal-edge);
    border-radius: 2px;
    overflow: hidden;
}

/* Frost-touch hover effect pseudo-element */
.frost-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    opacity: 0;
    transition: opacity 1.2s ease-out;
    background: radial-gradient(circle 200px at var(--frost-x, 50%) var(--frost-y, 50%), rgba(255, 255, 255, 0.06), transparent);
}

.frost-panel:hover::before {
    opacity: 1;
}

.frost-panel > * {
    position: relative;
    z-index: 2;
}

/* --- Primary Headline Zone --- */
#primary-zone {
    margin-bottom: 48px;
    width: 70%;
    opacity: 0;
    transition: opacity 0.6s ease-in-out;
}

#primary-zone.visible {
    opacity: 1;
}

.primary-content {
    display: flex;
    align-items: stretch;
    gap: 32px;
    padding: clamp(24px, 3vw, 48px);
}

.primary-text {
    flex: 1;
    min-width: 0;
}

.primary-headline {
    font-family: 'Archivo Black', sans-serif;
    font-weight: 400;
    font-size: clamp(2.8rem, 6vw, 5.5rem);
    letter-spacing: -0.02em;
    line-height: 1.05;
    color: var(--rime-white);
    margin-bottom: 24px;
    text-shadow: 0 0 40px rgba(88, 166, 255, 0.08), 0 0 2px rgba(255, 255, 255, 0.15);
}

.primary-excerpt {
    font-family: 'Instrument Sans', sans-serif;
    font-weight: 400;
    font-size: clamp(0.95rem, 1.1vw, 1.15rem);
    line-height: 1.7;
    letter-spacing: 0.005em;
    color: var(--thaw-gray);
    max-width: 58ch;
}

/* --- Lottie-style SVG Animation --- */
.primary-illustration {
    flex-shrink: 0;
    width: 300px;
    height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#lottie-anim {
    width: 300px;
    height: 300px;
}

.node-central {
    fill: var(--ice-blue);
    animation: nodePulse 3s ease-in-out infinite;
}

.node-sat {
    fill: var(--ice-blue);
    opacity: var(--opacity, 0.5);
    animation: nodePulse 3s ease-in-out infinite;
    animation-delay: var(--delay, 0s);
}

.conn-line {
    stroke: var(--ice-blue);
    stroke-opacity: 0.15;
    stroke-width: 1;
    stroke-dasharray: 200;
    stroke-dashoffset: 200;
    animation: drawLine 12s linear infinite;
    animation-delay: var(--delay, 0s);
}

.frost-crystal {
    fill: rgba(255, 255, 255, 0.08);
    transform-origin: center;
    animation: crystalScale 12s ease-in-out infinite;
    animation-delay: var(--delay, 0s);
}

@keyframes nodePulse {
    0%, 100% { opacity: var(--opacity, 1); transform: scale(1); }
    50% { opacity: calc(var(--opacity, 1) * 0.5); transform: scale(0.7); }
}

@keyframes drawLine {
    0% { stroke-dashoffset: 200; }
    25% { stroke-dashoffset: 0; }
    50% { stroke-dashoffset: 0; }
    75% { stroke-dashoffset: -200; }
    100% { stroke-dashoffset: -200; }
}

@keyframes crystalScale {
    0%, 100% { transform: scale(0); opacity: 0; }
    20% { transform: scale(1.5); opacity: 1; }
    40% { transform: scale(1); opacity: 0.6; }
    60% { transform: scale(0); opacity: 0; }
}

/* --- Secondary Scan Zone --- */
#secondary-zone {
    width: 55%;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.secondary-card {
    margin-left: var(--stagger-margin, 0px);
    padding: clamp(20px, 2.5vw, 32px);
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}

.secondary-card.visible {
    opacity: 1;
    transform: translateY(0);
}

.secondary-headline {
    font-family: 'Archivo Black', sans-serif;
    font-weight: 400;
    font-size: clamp(1.4rem, 2.5vw, 2rem);
    letter-spacing: 0em;
    line-height: 1.15;
    color: var(--rime-white);
    margin-bottom: 12px;
    text-shadow: 0 0 40px rgba(88, 166, 255, 0.08), 0 0 2px rgba(255, 255, 255, 0.15);
}

.secondary-excerpt {
    font-family: 'Instrument Sans', sans-serif;
    font-weight: 400;
    font-size: clamp(0.95rem, 1.1vw, 1.15rem);
    line-height: 1.7;
    letter-spacing: 0.005em;
    color: var(--thaw-gray);
    max-width: 58ch;
}

/* --- Deep Footer --- */
#deep-footer {
    position: relative;
    z-index: 10;
    padding: 40px clamp(24px, 4vw, 60px);
    display: flex;
    align-items: center;
    gap: 12px;
    opacity: 0.3;
    max-width: 1600px;
    margin: 0 auto;
}

.footer-domain {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
    font-size: clamp(0.75rem, 0.9vw, 0.85rem);
    letter-spacing: 0.06em;
    color: var(--thaw-gray);
}

.footer-separator {
    color: var(--crystal-edge);
    font-size: 0.75rem;
}

.footer-hash {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
    font-size: clamp(0.75rem, 0.9vw, 0.85rem);
    letter-spacing: 0.06em;
    color: var(--ice-blue);
}

/* --- Melt Gold Emphasis (rare hover accent) --- */
.secondary-card:hover .secondary-headline {
    color: var(--melt-gold);
    transition: color 0.4s ease-out;
}

/* --- Responsive --- */
@media (max-width: 1024px) {
    #primary-zone {
        width: 85%;
    }

    #secondary-zone {
        width: 75%;
    }

    .primary-content {
        flex-direction: column;
    }

    .primary-illustration {
        width: 200px;
        height: 200px;
        align-self: center;
    }

    #lottie-anim {
        width: 200px;
        height: 200px;
    }
}

@media (max-width: 768px) {
    #primary-zone {
        width: 100%;
    }

    #secondary-zone {
        width: 100%;
    }

    .secondary-card {
        margin-left: 0 !important;
    }

    .primary-illustration {
        width: 180px;
        height: 180px;
    }

    #lottie-anim {
        width: 180px;
        height: 180px;
    }

    #peripheral-lines {
        display: none;
    }
}
