/* =====================================================================
   muhan.dev — neubrutalist data-city
   Palette:
     #0D0D0D  void black     (page bg)
     #1A1A1A  carbon black   (borders / shadows)
     #2A2A2A  carbon dark
     #F0F0F0  concrete white (cards)
     #E0E0E0  body on dark
     #666666  concrete gray
     #FF2D6B  hot magenta    (spine, accent primary)
     #00F5D4  electric mint  (markers, data)
     #FFD93D  electric yellow(numerics)
     #7B2FFF  ultraviolet    (gradients, glow)
   ===================================================================== */

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

html { scroll-behavior: smooth; }

body {
    background: #0D0D0D;
    color: #E0E0E0;
    font-family: "Inter", system-ui, -apple-system, "Helvetica Neue", sans-serif;
    font-weight: 400;
    line-height: 1.65;
    overflow-x: hidden;
    cursor: crosshair;
    position: relative;
}

/* faint city-grid pattern over the entire page */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(to right, rgba(26,26,26,0.6) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(26,26,26,0.6) 1px, transparent 1px);
    background-size: 40px 40px;
    pointer-events: none;
    z-index: 0;
}

main, .timeline, section, article { position: relative; z-index: 1; }

/* =====================================================================
   CURSOR SPOTLIGHT (cursor-follow primary pattern)
   ===================================================================== */
#cursor-spotlight {
    position: fixed;
    top: 0; left: 0;
    width: 120px; height: 120px;
    pointer-events: none;
    z-index: 9998;
    transform: translate3d(-9999px, -9999px, 0);
    background: radial-gradient(circle at center,
        rgba(255, 45, 107, 0.08) 0%,
        rgba(255, 45, 107, 0.04) 40%,
        transparent 70%);
    transition: width 220ms cubic-bezier(0.25, 0.1, 0.25, 1),
                height 220ms cubic-bezier(0.25, 0.1, 0.25, 1),
                background 220ms cubic-bezier(0.25, 0.1, 0.25, 1);
    will-change: transform;
    mix-blend-mode: screen;
}

#cursor-spotlight.is-probing {
    width: 200px; height: 200px;
    background: radial-gradient(circle at center,
        rgba(255, 45, 107, 0.15) 0%,
        rgba(255, 45, 107, 0.06) 40%,
        transparent 70%);
}

#particle-canvas {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 9997;
}

/* =====================================================================
   HERO / OPENING VIEWPORT
   ===================================================================== */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4rem 6vw;
    overflow: hidden;
}

.hero__grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(to right, rgba(26,26,26,1) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(26,26,26,1) 1px, transparent 1px);
    background-size: 40px 40px;
    mask-image: radial-gradient(ellipse at center, black 30%, transparent 80%);
    -webkit-mask-image: radial-gradient(ellipse at center, black 30%, transparent 80%);
    pointer-events: none;
}

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

.hero__korean {
    font-family: "Noto Sans KR", "Inter", sans-serif;
    font-weight: 900;
    font-size: clamp(120px, 20vw, 300px);
    line-height: 0.85;
    color: #FF2D6B;
    letter-spacing: -0.04em;
    text-shadow:
        0 0 40px rgba(255, 45, 107, 0.4),
        0 0 80px rgba(123, 47, 255, 0.2);
    animation: hero-pulse 4s ease-in-out infinite;
}

@keyframes hero-pulse {
    0%, 100% { text-shadow: 0 0 40px rgba(255, 45, 107, 0.4), 0 0 80px rgba(123, 47, 255, 0.2); }
    50%      { text-shadow: 0 0 60px rgba(255, 45, 107, 0.6), 0 0 120px rgba(123, 47, 255, 0.3); }
}

.hero__english {
    font-family: "Space Grotesk", "Inter", sans-serif;
    font-weight: 700;
    font-size: clamp(60px, 10vw, 150px);
    line-height: 1;
    color: #00F5D4;
    letter-spacing: 0.02em;
    margin-top: -0.1em;
    text-shadow: 0 0 24px rgba(0, 245, 212, 0.35);
}

.hero__meta {
    margin-top: 2.5rem;
    font-family: "JetBrains Mono", "Space Grotesk", monospace;
    font-size: clamp(11px, 0.9vw, 13px);
    letter-spacing: 0.18em;
    color: #666666;
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 1.4rem;
    justify-content: center;
}
.hero__meta-label { color: #666666; }
.hero__meta-value { color: #FFD93D; }

.hero__scroll-cue {
    position: absolute;
    bottom: 2.5rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    font-family: "Space Grotesk", sans-serif;
    font-weight: 500;
    font-size: 11px;
    letter-spacing: 0.3em;
    color: #00F5D4;
    z-index: 3;
}
.hero__scroll-text { margin-bottom: 0.5rem; }
.hero__scroll-arrow {
    font-size: 18px;
    animation: scroll-bounce 1.6s ease-in-out infinite;
}
@keyframes scroll-bounce {
    0%, 100% { transform: translateY(0); opacity: 1; }
    50%      { transform: translateY(8px); opacity: 0.4; }
}

/* corner annotations */
.hero__corners {
    position: absolute;
    inset: 1.5rem 1.5rem;
    pointer-events: none;
    font-family: "JetBrains Mono", monospace;
    font-size: 11px;
    letter-spacing: 0.15em;
    color: #666666;
}
.corner { position: absolute; }
.corner--tl { top: 0; left: 0; }
.corner--tr { top: 0; right: 0; }
.corner--bl { bottom: 0; left: 0; }
.corner--br { bottom: 0; right: 0; color: #00F5D4; }

/* =====================================================================
   TIMELINE / SPINE
   ===================================================================== */
.timeline {
    position: relative;
    padding: 4rem 0 8rem;
}

.timeline__spine {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 20%;
    width: 4px;
    background: #FF2D6B;
    box-shadow:
        0 0 8px rgba(255, 45, 107, 0.6),
        0 0 16px rgba(255, 45, 107, 0.3);
    z-index: 2;
}

/* notch marks down the spine, at every 80px */
.timeline__spine::before {
    content: "";
    position: absolute;
    inset: 0 -3px 0 -3px;
    background-image:
        linear-gradient(to bottom, transparent 38px, #1A1A1A 38px, #1A1A1A 42px, transparent 42px);
    background-size: 100% 80px;
    background-repeat: repeat-y;
    pointer-events: none;
    opacity: 0.7;
}

.timeline__progress {
    position: absolute;
    left: -2px;
    top: 0;
    width: 8px;
    height: 0;
    background: linear-gradient(to bottom, transparent, #00F5D4 60%, #00F5D4);
    pointer-events: none;
    opacity: 0.85;
}

.timeline__marker {
    position: absolute;
    left: -8px;
    top: 0;
    width: 20px;
    height: 20px;
    background: #00F5D4;
    border: 2px solid #FF2D6B;
    box-shadow:
        0 0 12px rgba(255, 45, 107, 0.6),
        0 0 24px rgba(0, 245, 212, 0.5);
    border-radius: 50%;
    transform: translateY(-50%);
    z-index: 3;
    animation: marker-pulse 1.6s ease-in-out infinite;
}
@keyframes marker-pulse {
    0%, 100% { transform: translateY(-50%) scale(1); }
    50%      { transform: translateY(-50%) scale(1.25); }
}

/* =====================================================================
   NODES
   ===================================================================== */
.node {
    position: relative;
    min-height: 60vh;
    padding: 6vh 4vw 6vh 0;
    display: grid;
    /* columns: 0..18% (left side), 18..22% spine gutter, 22..95% main */
    grid-template-columns: 18% 4% 1fr;
    align-items: start;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 600ms cubic-bezier(0.25,0.1,0.25,1), transform 600ms cubic-bezier(0.25,0.1,0.25,1);
}
.node.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.node__dot {
    position: absolute;
    left: 20%;
    top: 8vh;
    width: 16px;
    height: 16px;
    background: #00F5D4;
    border: 2px solid #FF2D6B;
    border-radius: 50%;
    transform: translateX(-50%);
    box-shadow:
        0 0 12px rgba(255, 45, 107, 0.6),
        0 0 22px rgba(0, 245, 212, 0.35);
    z-index: 3;
}
.node.is-visible .node__dot {
    animation: dot-arrive 400ms cubic-bezier(0.25,0.1,0.25,1) 100ms both,
               dot-pulse 2s ease-in-out 600ms infinite;
}
@keyframes dot-arrive {
    0%   { transform: translateX(-50%) scale(1); }
    50%  { transform: translateX(-50%) scale(1.4); }
    100% { transform: translateX(-50%) scale(1); }
}
@keyframes dot-pulse {
    0%, 100% { box-shadow: 0 0 12px rgba(255,45,107,0.6), 0 0 22px rgba(0,245,212,0.35); }
    50%      { box-shadow: 0 0 20px rgba(255,45,107,0.9), 0 0 40px rgba(0,245,212,0.6); }
}

/* left side compact column */
.node__side {
    grid-column: 1;
    padding-right: 1rem;
    padding-top: 8vh;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    transform: translateX(-30px);
    opacity: 0;
    transition: opacity 600ms cubic-bezier(0.25,0.1,0.25,1) 200ms,
                transform 600ms cubic-bezier(0.25,0.1,0.25,1) 200ms;
}
.node.is-visible .node__side {
    opacity: 1;
    transform: translateX(0);
}

/* main content panel: alternating slide direction */
.node__panel {
    grid-column: 3;
    background: #F0F0F0;
    border: 3px solid #1A1A1A;
    box-shadow: 6px 6px 0 #1A1A1A;
    padding: 2rem 2rem 2.25rem;
    color: #2A2A2A;
    transition: opacity 600ms cubic-bezier(0.25,0.1,0.25,1) 200ms,
                transform 600ms cubic-bezier(0.25,0.1,0.25,1) 200ms,
                box-shadow 200ms ease-out;
    opacity: 0;
}
.node--right .node__panel {
    transform: translateX(40px);
}
.node--left .node__panel {
    transform: translateX(-40px);
}
.node.is-visible .node__panel {
    opacity: 1;
    transform: translateX(0);
}
.node__panel:hover {
    box-shadow: 10px 10px 0 #FF2D6B;
}

.node__header {
    display: flex;
    justify-content: space-between;
    font-family: "JetBrains Mono", monospace;
    font-size: 12px;
    letter-spacing: 0.18em;
    color: #666666;
    border-bottom: 2px solid #1A1A1A;
    padding-bottom: 0.7rem;
    margin-bottom: 1.4rem;
}
.node__index { color: #1A1A1A; font-weight: 700; }
.node__date  { color: #7B2FFF; }

.node__title {
    font-family: "Space Grotesk", sans-serif;
    font-weight: 700;
    font-size: clamp(32px, 5vw, 72px);
    letter-spacing: -0.03em;
    line-height: 1;
    color: #1A1A1A;
    margin-bottom: 1.2rem;
}

.node__lede {
    font-family: "Inter", sans-serif;
    font-weight: 400;
    font-size: clamp(16px, 1.2vw, 20px);
    line-height: 1.65;
    color: #2A2A2A;
    max-width: 60ch;
    margin-bottom: 1.8rem;
}

/* Micro card on the left side */
.micro-card {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    padding: 0.7rem 0.8rem;
    background: #1A1A1A;
    border: 2px solid #FF2D6B;
    box-shadow: 3px 3px 0 #FF2D6B;
    color: #00F5D4;
}
.micro-card__label {
    font-family: "Space Grotesk", sans-serif;
    font-weight: 500;
    font-size: 11px;
    letter-spacing: 0.18em;
    color: #00F5D4;
    text-transform: uppercase;
}
.micro-card__value {
    font-family: "JetBrains Mono", monospace;
    font-weight: 700;
    font-size: 18px;
    color: #FFD93D;
    letter-spacing: 0.04em;
}

.sparkline {
    width: 100%;
    height: 24px;
    display: block;
}
.sparkline polyline {
    fill: none;
    stroke: #00F5D4;
    stroke-width: 1.5;
    stroke-linejoin: round;
    stroke-linecap: round;
    filter: drop-shadow(0 0 3px rgba(0,245,212,0.6));
}

/* =====================================================================
   DATA-VIZ PANELS (inside cards)
   ===================================================================== */
.dataviz {
    position: relative;
    background: #0D0D0D;
    border: 3px solid #1A1A1A;
    padding: 1.4rem;
    color: #E0E0E0;
    overflow: hidden;
}
/* CRT scanlines overlay */
.dataviz::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background-image: repeating-linear-gradient(
        to bottom,
        transparent 0,
        transparent 2px,
        rgba(255, 255, 255, 0.03) 2px,
        rgba(255, 255, 255, 0.03) 3px
    );
}

.dataviz__readout {
    margin-top: 1rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 1.6rem;
    font-family: "JetBrains Mono", monospace;
    font-size: clamp(12px, 1vw, 14px);
    color: #FFD93D;
    letter-spacing: 0.04em;
    position: relative;
    z-index: 2;
}
.dataviz__readout b {
    color: #00F5D4;
    font-weight: 400;
    margin-right: 0.4em;
}

/* === Lissajous === */
.dataviz--lissajous svg {
    width: 100%;
    height: auto;
    display: block;
    background: #0D0D0D;
}

/* === Heatmap === */
.dataviz--heatmap {
    display: grid;
    grid-template-columns: repeat(20, 1fr);
    gap: 2px;
    padding: 1rem;
    aspect-ratio: 1 / 1;
    max-width: 520px;
}
.heatmap-cell {
    background: #0D0D0D;
    border: 1px solid #1A1A1A;
    transition: background-color 480ms ease-out;
}

/* === Recursive tree === */
.dataviz--tree svg {
    width: 100%;
    height: 360px;
    display: block;
    background: #0D0D0D;
}

/* === Counter === */
.dataviz--counter {
    text-align: center;
    padding: 2rem 1rem 1.4rem;
}
.counter {
    font-family: "JetBrains Mono", monospace;
    font-weight: 700;
    font-size: clamp(56px, 8vw, 96px);
    line-height: 1;
    color: #FFD93D;
    letter-spacing: 0.04em;
    text-shadow:
        0 0 18px rgba(255, 217, 61, 0.45),
        0 0 36px rgba(123, 47, 255, 0.2);
    position: relative;
    z-index: 2;
}
.counter__label {
    margin-top: 0.6rem;
    font-family: "Space Grotesk", sans-serif;
    font-weight: 500;
    font-size: 12px;
    letter-spacing: 0.4em;
    color: #00F5D4;
    position: relative;
    z-index: 2;
}

/* === Stream === */
.dataviz--stream {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1px;
    background: #1A1A1A;
    border: 1px solid #1A1A1A;
}
.stream-cell {
    position: relative;
    background: #0D0D0D;
    padding: 0.6rem 0.8rem 0.7rem;
    height: 70px;
}
.stream-cell__label {
    font-family: "JetBrains Mono", monospace;
    font-size: 10px;
    color: #00F5D4;
    letter-spacing: 0.18em;
}
.stream-cell svg {
    width: 100%;
    height: 36px;
    margin-top: 4px;
    display: block;
}
.stream-cell svg polyline {
    fill: none;
    stroke: #FFD93D;
    stroke-width: 1.4;
    filter: drop-shadow(0 0 3px rgba(255,217,61,0.45));
}

/* === Recursion frames === */
.dataviz--recursion {
    padding: 0.5rem;
    aspect-ratio: 16 / 9;
    background: #0D0D0D;
}
.frame {
    border: 2px solid #FF2D6B;
    box-shadow: 4px 4px 0 #7B2FFF;
    padding: 0.9rem 1rem;
    background: rgba(13, 13, 13, 0.8);
    position: relative;
    height: 100%;
}
.frame .frame { margin-top: 0.6rem; }
.frame__label {
    display: inline-block;
    font-family: "JetBrains Mono", monospace;
    font-size: 11px;
    color: #00F5D4;
    letter-spacing: 0.14em;
    background: #1A1A1A;
    padding: 2px 6px;
    border: 1px solid #00F5D4;
    margin-bottom: 0.4rem;
}

/* === Rings === */
.dataviz--rings svg {
    width: 100%;
    height: 360px;
    display: block;
    background: #0D0D0D;
}

/* =====================================================================
   TERMINAL VIEWPORT
   ===================================================================== */
.terminal {
    position: relative;
    min-height: 90vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4rem 6vw;
    background: #0D0D0D;
    overflow: hidden;
}
.terminal__diverge {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0.55;
    filter: drop-shadow(0 0 6px rgba(255,45,107,0.6));
}

.terminal__content {
    position: relative;
    z-index: 2;
    text-align: center;
}
.terminal__korean {
    font-family: "Noto Sans KR", "Inter", sans-serif;
    font-weight: 900;
    font-size: clamp(48px, 7vw, 96px);
    color: #666666;
    letter-spacing: -0.02em;
    line-height: 1;
}
.terminal__english {
    margin-top: 1.4rem;
    font-family: "Space Grotesk", sans-serif;
    font-weight: 500;
    font-size: clamp(16px, 1.6vw, 22px);
    color: #666666;
    letter-spacing: 0.3em;
    text-transform: lowercase;
}
.terminal__sig {
    margin-top: 2.4rem;
    font-family: "JetBrains Mono", monospace;
    font-size: 12px;
    color: #00F5D4;
    letter-spacing: 0.2em;
}

/* =====================================================================
   RESPONSIVE
   ===================================================================== */
@media (max-width: 760px) {
    .timeline__spine { left: 8%; }
    .node__dot { left: 8%; }
    .node {
        grid-template-columns: 14% 1fr;
        padding-right: 4vw;
    }
    .node__side { grid-column: 1 / -1; flex-direction: row; padding-top: 2rem; padding-left: 14%; }
    .node__panel { grid-column: 1 / -1; margin-left: 14%; padding: 1.4rem; }
    .node--left .node__panel,
    .node--right .node__panel { transform: translateY(20px); }
    .node.is-visible .node__panel { transform: translateY(0); }
    .hero__korean { font-size: clamp(80px, 28vw, 200px); }
    .hero__english { font-size: clamp(40px, 14vw, 90px); }
    .dataviz--heatmap { max-width: 100%; }
}
