/* ============================================================
   tsundere.quest — Styles
   Palette: Nordic Neon / Scandinavian-HUD
   ============================================================ */

/* --- Custom Properties --- */
:root {
    --black: #000000;
    --arctic-white: #FAFAFA;
    --off-white: #F0F0F0;
    --plasma-cyan: #00F5FF;
    --acid-yellow: #E8FF00;
    --neon-magenta: #FF2D78;
    --deep-charcoal: #111111;
    --graphite: #1A1A1A;
    --dark-panel: #0A0A0A;

    --font-display: 'Bebas Neue', sans-serif;
    --font-mono: 'Share Tech Mono', monospace;
    --font-body: 'DM Sans', sans-serif;
    --font-terminal: 'Courier Prime', monospace;
}

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

html {
    font-size: 16px;
    background: var(--black);
}

body {
    overflow: hidden;
    width: 100vw;
    height: 100vh;
    background: var(--black);
}

/* --- Scroll Container --- */
.scroll-container {
    width: 100vw;
    height: 100vh;
    overflow-y: scroll;
    scroll-snap-type: y mandatory;
    scroll-behavior: auto;
}

/* --- Section Base --- */
.section {
    width: 100vw;
    height: 100vh;
    scroll-snap-align: start;
    overflow: hidden;
    position: relative;
    padding: 8vh 10vw;
}

.section--dark {
    background: var(--black);
}

.section--light {
    background: var(--arctic-white);
}

/* --- Background Layer (parallax target) --- */
.bg-layer {
    position: absolute;
    inset: -20%;
    will-change: transform;
    pointer-events: none;
    z-index: 0;
}

/* --- Scanline Overlay --- */
.scanline-overlay {
    position: absolute;
    inset: 0;
    background-image: repeating-linear-gradient(
        to bottom,
        transparent 0px,
        transparent 3px,
        rgba(0, 0, 0, 0.12) 3px,
        rgba(0, 0, 0, 0.12) 4px
    );
    pointer-events: none;
    z-index: 1;
}

/* ============================================================
   SECTION 0: INDUCTION
   ============================================================ */
.section--0 {
    background: var(--black);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

/* Reticle */
.reticle-container {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
    pointer-events: none;
}

.reticle {
    position: relative;
    width: 320px;
    height: 320px;
}

.reticle-bracket {
    position: absolute;
    width: 40px;
    height: 40px;
    border-color: var(--plasma-cyan);
    border-style: solid;
    opacity: 0;
    animation: bracket-appear 0.4s ease-out forwards;
}

.reticle-bracket--tl {
    top: 0;
    left: 0;
    border-width: 2px 0 0 2px;
    animation-delay: 0.2s;
    box-shadow: -2px -2px 8px rgba(0, 245, 255, 0.4);
}

.reticle-bracket--tr {
    top: 0;
    right: 0;
    border-width: 2px 2px 0 0;
    animation-delay: 0.25s;
    box-shadow: 2px -2px 8px rgba(0, 245, 255, 0.4);
}

.reticle-bracket--bl {
    bottom: 0;
    left: 0;
    border-width: 0 0 2px 2px;
    animation-delay: 0.3s;
    box-shadow: -2px 2px 8px rgba(0, 245, 255, 0.4);
}

.reticle-bracket--br {
    bottom: 0;
    right: 0;
    border-width: 0 2px 2px 0;
    animation-delay: 0.35s;
    box-shadow: 2px 2px 8px rgba(0, 245, 255, 0.4);
}

@keyframes bracket-appear {
    from { opacity: 0; }
    to { opacity: 1; }
}

.reticle-circle {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 120px;
    height: 120px;
    border: 1px solid rgba(0, 245, 255, 0.3);
    border-radius: 50%;
}

.reticle-crosshair {
    position: absolute;
    background: rgba(0, 245, 255, 0.2);
}

.reticle-crosshair--h {
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    transform: translateY(-50%);
}

.reticle-crosshair--v {
    left: 50%;
    top: 0;
    bottom: 0;
    width: 1px;
    transform: translateX(-50%);
}

/* Induction content */
.induction-content {
    position: relative;
    z-index: 2;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
}

.induction-label {
    color: var(--plasma-cyan);
    opacity: 0;
    animation: fade-in 0.6s ease-out 0.8s forwards;
}

.induction-sublabel {
    color: var(--plasma-cyan);
    opacity: 0;
    animation: fade-in 0.6s ease-out 1.2s forwards;
}

@keyframes fade-in {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

.hero-title {
    font-family: var(--font-display);
    font-size: clamp(80px, 12vw, 180px);
    letter-spacing: 0.3em;
    color: var(--arctic-white);
    line-height: 0.9;
    text-align: center;
    opacity: 0;
    animation: fade-in 0.8s ease-out 0.5s forwards;
    text-shadow:
        0 0 30px rgba(250, 250, 250, 0.15),
        0 0 60px rgba(250, 250, 250, 0.05);
}

/* Scanline sweep animation */
.scanline-sweep {
    position: absolute;
    top: -4px;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(to bottom, transparent, rgba(0, 245, 255, 0.6), transparent);
    z-index: 3;
    animation: sweep-down 2s ease-in-out 0.3s forwards;
    pointer-events: none;
}

@keyframes sweep-down {
    from { top: -4px; opacity: 1; }
    to { top: 100vh; opacity: 0; }
}

/* Coords */
.induction-coords {
    position: absolute;
    bottom: 8vh;
    right: 10vw;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    z-index: 2;
    opacity: 0;
    animation: fade-in 0.6s ease-out 1.4s forwards;
}

/* ============================================================
   SECTION 1: MANIFESTO
   ============================================================ */
.section--1 {
    background: var(--arctic-white);
    display: flex;
    align-items: center;
    padding-left: calc(10vw + 24px);
    gap: 8vw;
}

/* Cyan sidebar bar */
.manifesto-sidebar {
    position: absolute;
    left: 10vw;
    top: 8vh;
    bottom: 8vh;
    width: 3px;
    background: var(--plasma-cyan);
    box-shadow: 0 0 8px var(--plasma-cyan), 0 0 20px rgba(0, 245, 255, 0.4), 0 0 40px rgba(0, 245, 255, 0.2);
    animation: glow-pulse 2s ease-in-out infinite;
}

@keyframes glow-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.manifesto-content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    gap: 4vh;
    max-width: 680px;
}

.counter-block {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.counter-label {
    color: var(--graphite);
}

.counter {
    font-family: var(--font-display);
    font-size: clamp(64px, 8vw, 120px);
    letter-spacing: 0.2em;
    color: var(--deep-charcoal);
    line-height: 1;
}

.manifesto-text-block {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.section-title {
    font-family: var(--font-display);
    letter-spacing: 0.3em;
    line-height: 0.95;
    margin-bottom: 8px;
}

.section-title--dark {
    font-size: clamp(48px, 6vw, 80px);
    color: var(--deep-charcoal);
}

.section-title--light {
    font-size: clamp(48px, 6vw, 80px);
    color: var(--arctic-white);
}

.body-text {
    font-family: var(--font-body);
    font-size: 17px;
    line-height: 1.75;
    font-weight: 400;
    max-width: 56ch;
}

.body-text--dark {
    color: var(--graphite);
}

.body-text--light {
    color: var(--off-white);
}

.section--1 .body-text {
    color: var(--graphite);
}

.manifesto-tag {
    color: var(--deep-charcoal);
    border-left: 2px solid var(--deep-charcoal);
    padding-left: 12px;
}

/* Corner bracket */
.manifesto-corner-bracket {
    position: absolute;
    top: 8vh;
    right: 10vw;
    width: 120px;
    height: 120px;
    opacity: 0.4;
    z-index: 1;
}

.bracket-svg {
    width: 100%;
    height: 100%;
}

/* ============================================================
   SECTION 2: SYSTEM STATS
   ============================================================ */
.section--2 {
    background: var(--dark-panel);
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5vh;
}

.stats-header {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.stats-label {
    color: var(--acid-yellow);
}

.stats-grid {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 3vh 4vw;
    flex: 1;
    max-height: 55vh;
}

.hud-panel {
    position: relative;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.bracket-svg--panel {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.bracket-path {
    stroke-dasharray: 200;
    stroke-dashoffset: 200;
    transition: stroke-dashoffset 0.4s ease-out;
}

.hud-panel.bracket-drawn .bracket-path {
    stroke-dashoffset: 0;
}

.panel-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    text-align: center;
}

.panel-label {
    color: var(--acid-yellow);
}

.panel-counter {
    font-family: var(--font-display);
    font-size: clamp(48px, 5vw, 80px);
    letter-spacing: 0.2em;
    color: var(--arctic-white);
    line-height: 1;
    text-shadow: 0 0 20px rgba(250, 250, 250, 0.2);
}

.panel-unit {
    color: rgba(240, 240, 240, 0.4);
}

/* ============================================================
   SECTION 3: PROTOCOL (SPLIT)
   ============================================================ */
.section--3 {
    padding: 0;
    display: flex;
}

.protocol-left {
    width: 50%;
    height: 100%;
    background: var(--arctic-white);
    clip-path: polygon(0 0, 100% 0, calc(100% - 60px) 100%, 0 100%);
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 8vh 10vw 8vh 10vw;
    position: relative;
}

.protocol-left-content {
    display: flex;
    flex-direction: column;
    gap: 24px;
    max-width: 500px;
}

.protocol-eyebrow {
    color: var(--graphite);
}

.protocol-right {
    width: 50%;
    height: 100%;
    background: var(--deep-charcoal);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8vh 8vw 8vh 5vw;
}

.protocol-tags {
    display: flex;
    flex-direction: column;
    gap: 24px;
    width: 100%;
}

.protocol-tag {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.tag-label {
    color: rgba(255, 45, 120, 0.7);
}

.tag-text {
    font-family: var(--font-display);
    font-size: clamp(28px, 3vw, 44px);
    letter-spacing: 0.2em;
    color: var(--neon-magenta);
    text-shadow:
        0 0 8px var(--neon-magenta),
        0 0 20px rgba(255, 45, 120, 0.4),
        0 0 40px rgba(255, 45, 120, 0.2);
}

/* ============================================================
   SECTION 4: TERMINAL
   ============================================================ */
.section--4 {
    background: var(--black);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4vh;
}

.bg-layer--hex {
    opacity: 1;
}

.hex-pattern {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.terminal-wrapper {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 800px;
}

.terminal-window {
    background: var(--dark-panel);
    border: 1px solid rgba(0, 245, 255, 0.25);
    box-shadow:
        0 0 0 1px rgba(0, 245, 255, 0.1),
        0 0 40px rgba(0, 245, 255, 0.05),
        inset 0 0 20px rgba(0, 0, 0, 0.5);
}

.terminal-titlebar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    background: rgba(0, 245, 255, 0.06);
    border-bottom: 1px solid rgba(0, 245, 255, 0.15);
}

.terminal-title {
    color: var(--plasma-cyan);
}

.terminal-dots {
    display: flex;
    gap: 6px;
}

.terminal-dot {
    width: 8px;
    height: 8px;
    border: 1px solid rgba(0, 245, 255, 0.4);
}

.terminal-body {
    padding: 24px;
    min-height: 240px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.terminal-output {
    font-family: var(--font-terminal);
    font-size: 14px;
    line-height: 1.6;
    color: var(--off-white);
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.terminal-output .line {
    opacity: 0;
    animation: terminal-line-in 0.1s ease-out forwards;
}

.terminal-output .line--cyan {
    color: var(--plasma-cyan);
}

.terminal-output .line--yellow {
    color: var(--acid-yellow);
}

.terminal-output .line--magenta {
    color: var(--neon-magenta);
}

.terminal-output .line--dim {
    color: rgba(240, 240, 240, 0.4);
}

@keyframes terminal-line-in {
    from { opacity: 0; transform: translateX(-4px); }
    to { opacity: 1; transform: translateX(0); }
}

.terminal-prompt-line {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-terminal);
    font-size: 14px;
}

.terminal-prompt {
    color: var(--plasma-cyan);
}

.terminal-cursor {
    display: inline-block;
    width: 8px;
    height: 16px;
    background: var(--plasma-cyan);
    animation: blink 1s step-end infinite;
    box-shadow: 0 0 6px var(--plasma-cyan);
}

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

.terminal-footer {
    position: relative;
    z-index: 2;
    display: flex;
    gap: 4vw;
    opacity: 0.5;
}

/* ============================================================
   SHARED TYPOGRAPHY
   ============================================================ */
.hud-label {
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    display: block;
}

/* ============================================================
   RESPONSIVE ADJUSTMENTS
   ============================================================ */
@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: 1fr;
        grid-template-rows: repeat(4, 1fr);
        max-height: 80vh;
    }

    .protocol-left {
        clip-path: polygon(0 0, 100% 0, 100% calc(100% - 40px), 0 100%);
        width: 100%;
        height: 50%;
    }

    .protocol-right {
        width: 100%;
        height: 50%;
        padding: 4vh 10vw;
    }

    .section--3 {
        flex-direction: column;
    }

    .hero-title {
        font-size: clamp(60px, 15vw, 120px);
    }
}
