/* ============================================================
   jill.moe — Styles
   Palette:
     #0A0D0F  deep signal black
     #0F2318  dark forest-circuit
     #1A4A32  phosphor mid-ground
     #2E8B57  sea-circuit green
     #5EE89A  bright signal green
     #C8D4CC  mist-terminal
     #E8FF00  phosphor acid
     #FF3D5A  error-signal red
   Fonts: Space Grotesk 700/900, JetBrains Mono 400/500, Share Tech Mono 400
   ============================================================ */

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

html {
    scroll-behavior: smooth;
    scroll-snap-type: y proximity;
}

body {
    background: #0A0D0F;
    color: #C8D4CC;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 400;
    overflow-x: hidden;
    min-height: 100vh;
}

a {
    color: #5EE89A;
    text-decoration: none;
}

a:hover {
    color: #E8FF00;
}

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

#particle-canvas.active {
    opacity: 1;
}

/* ---- Circuit SVG Underlayer ---- */
#circuit-svg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    opacity: 0.18;
    overflow: visible;
}

#circuit-svg line,
#circuit-svg circle,
#circuit-svg rect {
    stroke: #1A4A32;
    stroke-width: 1;
    fill: none;
}

#circuit-svg rect {
    fill: #1A4A32;
    stroke: none;
}

/* Boost circuit visibility in section 4 */
body.in-section-4 #circuit-svg {
    opacity: 0.55;
    transition: opacity 400ms ease;
}

/* ---- Section Layout ---- */
.section {
    position: relative;
    min-height: 100vh;
    height: 100vh;
    display: grid;
    grid-template-columns: 180px 1fr 140px;
    overflow: hidden;
    z-index: 2;
    scroll-snap-align: start;
}

.col {
    position: relative;
    padding: 48px 24px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.col-left {
    border-right: 1px solid #1A4A32;
    z-index: 10;
}

.col-center {
    padding: 48px 48px;
    z-index: 5;
}

.col-right {
    border-left: 1px solid #1A4A32;
    z-index: 10;
}

/* ---- Section Backgrounds ---- */
.s1 { background: #0A0D0F; }
.s2 { background: #0F2318; }
.s3 { background: #0A0D0F; }
.s4 { background: #0F2318; }
.s5 { background: #0A0D0F; }

/* ---- Coordinate Readout ---- */
.coord-readout {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    color: #2E8B57;
    letter-spacing: 0.08em;
    line-height: 1.8;
    margin-bottom: 24px;
}

.coord-label {
    color: #1A4A32;
    margin-right: 2px;
}

#coord-x,
#coord-y,
.coord-x-live,
.coord-y-live {
    font-weight: 500;
    margin-right: 8px;
}

/* ---- Waterfall Character Column ---- */
.waterfall-container {
    flex: 1;
    font-family: 'Share Tech Mono', monospace;
    font-size: 11px;
    color: #2E8B57;
    line-height: 1.4;
    overflow: hidden;
    word-break: break-all;
    opacity: 0;
    transition: opacity 400ms ease;
}

.waterfall-container.active {
    opacity: 1;
}

.waterfall-char {
    display: inline;
}

.waterfall-secondary {
    font-size: 10px;
    color: #1A4A32;
    opacity: 0;
}

.waterfall-secondary.active {
    opacity: 0.6;
}

/* ---- Status Stack (Right Column) ---- */
.status-stack {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.status-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    font-weight: 500;
    color: #2E8B57;
    letter-spacing: 0.06em;
}

.status-label--dim {
    color: #1A4A32;
}

.status-label--accent {
    color: #5EE89A;
}

.status-label--red {
    color: #FF3D5A;
}

/* ---- Noise Data (Left / Right columns) ---- */
.noise-data {
    margin-top: 16px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    color: #1A4A32;
    line-height: 1.8;
}

.noise-data--right {
    font-size: 10px;
    color: #1A4A32;
    margin-top: auto;
}

/* ---- Section 1: Domain Title ---- */
.domain-title-wrap {
    display: flex;
    flex-direction: column;
    justify-content: center;
    height: 100%;
}

.domain-title {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 900;
    font-size: clamp(56px, 8vw, 96px);
    color: #E8FF00;
    letter-spacing: -0.02em;
    line-height: 1;
    margin-bottom: 20px;
}

.domain-descriptor {
    font-family: 'JetBrains Mono', monospace;
    font-size: 14px;
    font-weight: 400;
    color: #C8D4CC;
    letter-spacing: 0.05em;
    min-height: 22px;
    margin-bottom: 32px;
}

/* ---- Typewriter Cursor ---- */
.cursor {
    display: inline-block;
    width: 12px;
    height: 16px;
    background: #E8FF00;
    vertical-align: middle;
    margin-left: 2px;
    animation: cursor-blink 600ms step-end infinite;
}

.cursor--small {
    width: 8px;
    height: 13px;
    background: #C8D4CC;
}

.cursor--red {
    background: #FF3D5A;
    animation: cursor-blink 600ms step-end infinite;
}

.cursor.hidden {
    display: none;
}

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

/* ---- Reveal Line (Section 1) ---- */
.reveal-line {
    height: 1px;
    background: #2E8B57;
    width: 0;
    max-width: 60%;
    transition: width 400ms ease;
}

.reveal-line.drawn {
    width: 60%;
}

/* ---- Section 2: Heading & Body ---- */
.section-heading {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: clamp(40px, 5vw, 64px);
    color: #C8D4CC;
    letter-spacing: 0.04em;
    line-height: 1.1;
    margin-bottom: 32px;
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 400ms ease, transform 400ms ease;
}

.section-heading.visible {
    opacity: 1;
    transform: translateY(0);
}

.body-text-block {
    max-width: 600px;
}

.body-line {
    font-family: 'JetBrains Mono', monospace;
    font-size: 14px;
    font-weight: 400;
    color: #C8D4CC;
    line-height: 1.7;
    margin-bottom: 18px;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 300ms ease, transform 300ms ease;
}

.body-line.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ---- Section 3: Large Words ---- */
.s3 .col-center {
    justify-content: center;
    align-items: flex-start;
}

.large-words {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-left: 0;
}

.large-word {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 900;
    font-size: clamp(60px, 9vw, 120px);
    letter-spacing: -0.03em;
    line-height: 0.95;
    opacity: 0;
    transform: translateX(-16px);
    transition: opacity 300ms ease, transform 300ms ease;
}

.large-word.visible {
    opacity: 1;
    transform: translateX(0);
}

/* ---- Section 4: Data Split ---- */
.s4 .col-center {
    justify-content: center;
}

.data-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    width: 100%;
}

.data-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.data-item {
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    font-weight: 400;
    color: #5EE89A;
    letter-spacing: 0.04em;
    opacity: 0;
    transform: translateX(-8px);
    transition: opacity 200ms ease, transform 200ms ease;
}

.data-item.visible {
    opacity: 1;
    transform: translateX(0);
}

.data-detail {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.data-number {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 900;
    font-size: clamp(48px, 5vw, 72px);
    color: #E8FF00;
    letter-spacing: -0.02em;
    line-height: 1;
}

.data-desc {
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    color: #C8D4CC;
    line-height: 1.7;
}

.data-code-block {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 12px;
    border: 1px solid #1A4A32;
    background: rgba(26, 74, 50, 0.15);
}

.code-line {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    color: #2E8B57;
    letter-spacing: 0.06em;
}

/* ---- Section 5: Close Transmission ---- */
.s5 .col-center {
    justify-content: center;
    gap: 32px;
}

.close-statement {
    max-width: 580px;
}

.de-type-text {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: clamp(22px, 3vw, 34px);
    color: #C8D4CC;
    letter-spacing: 0.03em;
    line-height: 1.4;
}

.contact-line {
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    color: #C8D4CC;
    letter-spacing: 0.04em;
    opacity: 0;
    transition: opacity 600ms ease;
}

.contact-line.visible {
    opacity: 1;
}

.contact-label {
    color: #2E8B57;
}

.contact-link {
    color: #5EE89A;
}

.end-line-container {
    position: absolute;
    bottom: 48px;
    left: 0;
    width: 100%;
    height: 1px;
    overflow: hidden;
}

.end-scanline {
    height: 1px;
    background: #FF3D5A;
    width: 0;
    opacity: 0;
    transition: width 1000ms linear, opacity 200ms ease;
}

.end-scanline.drawn {
    width: 100%;
    opacity: 1;
}

.end-scanline.fade {
    opacity: 0;
    transition: opacity 800ms ease;
}

/* ---- Glitch Effects ---- */
@keyframes glitch-burst {
    0%   { transform: translateX(0); clip-path: none; }
    20%  { transform: translateX(24px); clip-path: inset(10% 0 60% 0); }
    40%  { transform: translateX(-16px); clip-path: inset(50% 0 20% 0); }
    60%  { transform: translateX(8px); clip-path: inset(30% 0 40% 0); }
    80%  { transform: translateX(-4px); clip-path: none; }
    100% { transform: translateX(0); clip-path: none; }
}

@keyframes glitch-shake-small {
    0%   { transform: translateX(0); }
    25%  { transform: translateX(2px); }
    50%  { transform: translateX(-2px); }
    75%  { transform: translateX(2px); }
    100% { transform: translateX(0); }
}

@keyframes scanline-flash {
    0%   { opacity: 0; height: 0; }
    20%  { opacity: 1; height: 2px; }
    80%  { opacity: 1; height: 2px; }
    100% { opacity: 0; height: 0; }
}

.glitch-target.glitching {
    animation: glitch-burst 80ms steps(1) forwards;
}

.large-word.shake {
    animation: glitch-shake-small 100ms ease-in-out 2;
}

/* Red scanline overlay during glitch burst */
.glitch-scanline {
    position: fixed;
    left: 0;
    width: 100%;
    height: 2px;
    background: #FF3D5A;
    pointer-events: none;
    z-index: 9999;
    opacity: 0;
}

.glitch-scanline.active {
    animation: scanline-flash 150ms ease forwards;
}

/* Circuit glitch shift */
.circuit-group.glitch-shift {
    animation: circuit-shift 80ms steps(1) forwards;
}

@keyframes circuit-shift {
    0%   { transform: translate(0, 0); }
    33%  { transform: translate(6px, 2px); }
    66%  { transform: translate(-4px, -3px); }
    100% { transform: translate(0, 0); }
}

/* ---- Glitch burst characters (Share Tech Mono / FF3D5A) ---- */
.glitch-char-burst {
    font-family: 'Share Tech Mono', monospace;
    color: #FF3D5A;
    font-size: 14px;
    pointer-events: none;
    position: absolute;
    opacity: 0;
    animation: glitch-char-appear 150ms ease forwards;
}

@keyframes glitch-char-appear {
    0%   { opacity: 1; }
    70%  { opacity: 1; }
    100% { opacity: 0; }
}

/* ---- Column misalignment on scroll ---- */
.col-left.misaligned {
    transform: translateY(8px);
    transition: transform 200ms ease;
}

.col-right.misaligned {
    transform: translateY(-8px);
    transition: transform 200ms ease;
}

.col-left.realigned,
.col-right.realigned {
    transform: translateY(0);
    transition: transform 300ms ease;
}

/* ---- Mobile Responsive ---- */
@media (max-width: 768px) {
    .section {
        grid-template-columns: 0 1fr 0;
    }

    .col-left,
    .col-right {
        display: none;
        width: 0;
        padding: 0;
        overflow: hidden;
    }

    .col-center {
        padding: 40px 24px;
    }

    .domain-title {
        font-size: clamp(40px, 12vw, 64px);
    }

    .section-heading {
        font-size: clamp(28px, 8vw, 44px);
    }

    .large-word {
        font-size: clamp(42px, 14vw, 80px);
    }

    .data-split {
        grid-template-columns: 1fr;
    }

    .de-type-text {
        font-size: clamp(18px, 5vw, 26px);
    }
}

/* ---- Utility: Section number labels ---- */
.section-num {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    color: #E8FF00;
    letter-spacing: 0.12em;
    margin-bottom: 16px;
}
