/* ============================================================
   chika.quest — Bauhaus Digital Manifesto
   Palette: Midnight Blue Control Room
   Typography: Futura-Geometric System (Jost + Josefin Sans + DM Sans + Space Mono)
   ============================================================ */

/* ── Custom Properties ─────────────────────────────────────── */
:root {
    --deep-void:      #0D1B2A;
    --blueprint-dark: #0A1628;
    --grid-line:      #1E3A5F;
    --cobalt-signal:  #4A90D9;
    --electric-ice:   #7EC8F0;
    --off-white-cold: #E8F0FE;
    --editorial-grey: #B8C8DC;
    --error-flash:    #FF3A5C;
    --schematic-ghost:#1E3A5F;

    --gutter: 24px;
    --col: calc((100vw - 11 * var(--gutter)) / 12);
}

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

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--deep-void);
    color: var(--editorial-grey);
    font-family: 'DM Sans', sans-serif;
    font-size: 17px;
    line-height: 1.75;
    overflow-x: hidden;
}

/* ── Bauhaus Grid Hairlines (Fixed, Full Viewport Height) ───── */
.grid-overlay {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
}

.grid-line {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 1px;
    background-color: var(--grid-line);
    opacity: 0.45;
}

/* ── Typography ─────────────────────────────────────────────── */
h1, h2, h3 {
    font-family: 'Jost', sans-serif;
    color: var(--off-white-cold);
    letter-spacing: -0.02em;
    line-height: 1.05;
}

.hero-headline {
    font-family: 'Jost', sans-serif;
    font-weight: 800;
    font-size: clamp(72px, 14vw, 160px);
    color: var(--off-white-cold);
    letter-spacing: -0.02em;
    line-height: 0.92;
    display: flex;
    flex-direction: column;
}

.hero-line-1 {
    display: block;
}

.hero-line-2 {
    display: block;
    color: var(--cobalt-signal);
}

.hero-descriptor {
    font-family: 'Space Mono', monospace;
    font-size: 13px;
    letter-spacing: 0.18em;
    color: var(--cobalt-signal);
    opacity: 0.75;
    margin-top: 28px;
    text-transform: uppercase;
}

.editorial-headline {
    font-family: 'Jost', sans-serif;
    font-weight: 700;
    font-size: clamp(28px, 2.8vw, 40px);
    color: var(--off-white-cold);
    letter-spacing: -0.015em;
    line-height: 1.2;
    margin-bottom: 32px;
}

.section-subhead {
    font-family: 'Josefin Sans', sans-serif;
    font-weight: 700;
    font-size: clamp(26px, 2.5vw, 38px);
    color: var(--cobalt-signal);
    letter-spacing: -0.01em;
    line-height: 1.15;
    margin-bottom: 28px;
}

.body-text {
    font-family: 'DM Sans', sans-serif;
    font-weight: 400;
    font-size: clamp(15px, 1vw, 17px);
    line-height: 1.8;
    color: var(--editorial-grey);
    margin-bottom: 20px;
    max-width: 64ch;
}

.diagram-headline {
    font-family: 'Jost', sans-serif;
    font-weight: 800;
    font-size: clamp(36px, 4vw, 56px);
    color: var(--cobalt-signal);
    letter-spacing: -0.02em;
    text-align: center;
    margin-bottom: 12px;
    position: relative;
    z-index: 2;
}

.diagram-headline--close {
    color: var(--off-white-cold);
}

.diagram-subtext {
    font-family: 'Space Mono', monospace;
    font-size: 12px;
    letter-spacing: 0.12em;
    color: var(--cobalt-signal);
    opacity: 0.65;
    text-align: center;
    text-transform: uppercase;
    position: relative;
    z-index: 2;
}

.glyph-marker {
    font-size: 0.85em;
    color: var(--cobalt-signal);
    margin-right: 14px;
    opacity: 0.85;
    vertical-align: middle;
}

/* ── Hero Panel ─────────────────────────────────────────────── */
.hero-panel {
    position: relative;
    width: 100%;
    height: 100vh;
    min-height: 600px;
    background-color: var(--deep-void);
    display: flex;
    align-items: stretch;
    overflow: hidden;
}

.hero-inner {
    position: relative;
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 0 calc(var(--gutter) * 3);
    z-index: 1;
}

.hero-bg-circle {
    position: absolute;
    top: 50%;
    left: 35%;
    transform: translate(-50%, -60%);
    width: clamp(400px, 60vw, 700px);
    height: clamp(400px, 60vw, 700px);
    pointer-events: none;
    z-index: 0;
}

.hero-text-zone {
    position: relative;
    z-index: 1;
    padding-top: clamp(80px, 12vh, 140px);
    flex: 0 0 auto;
}

/* Circuit SVG drifts leftward — CSS animation only, no JS parallax */
@keyframes circuit-drift {
    from { transform: translateX(0); }
    to   { transform: translateX(-20vw); }
}

.hero-circuit-wrap {
    position: absolute;
    bottom: 0;
    left: -10vw;
    width: 140vw;
    height: 220px;
    overflow: hidden;
    z-index: 1;
}

.hero-circuit {
    width: 140vw;
    height: 220px;
    animation: circuit-drift 30s linear infinite;
}

/* Grid coordinate label */
.hero-coord {
    position: absolute;
    bottom: 240px;
    right: calc(var(--gutter) * 3);
    font-family: 'Space Mono', monospace;
    font-size: 11px;
    letter-spacing: 0.1em;
    color: var(--cobalt-signal);
    opacity: 0.5;
    z-index: 2;
}

/* Scroll indicator */
.scroll-indicator {
    position: absolute;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    z-index: 2;
}

.scroll-label {
    font-family: 'Space Mono', monospace;
    font-size: 9px;
    letter-spacing: 0.2em;
    color: var(--cobalt-signal);
    opacity: 0.45;
}

.scroll-line {
    width: 1px;
    height: 40px;
    background: var(--cobalt-signal);
    opacity: 0.3;
}

/* ── Editorial Strips ───────────────────────────────────────── */
.editorial-strip {
    position: relative;
    background-color: var(--blueprint-dark);
    padding: 100px calc(var(--gutter) * 3);
    overflow: hidden;
    z-index: 1;
}

.editorial-strip--alt {
    background-color: var(--deep-void);
}

.editorial-inner {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: calc(var(--gutter) * 3);
    max-width: 1400px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.editorial-main {
    grid-column: 1 / 2;
}

/* Annotation strip (columns 9–12 in 12-col grid) */
.annotation-strip {
    grid-column: 2 / 3;
    display: flex;
    flex-direction: column;
    gap: 24px;
    padding-top: 8px;
}

.callout-box {
    border: 1px solid var(--grid-line);
    padding: 16px 20px;
    position: relative;
}

.callout-box--offset {
    margin-left: 24px;
}

.callout-box::before {
    content: '';
    position: absolute;
    top: -1px;
    left: 0;
    width: 32px;
    height: 2px;
    background: var(--cobalt-signal);
}

.callout-label {
    font-family: 'Space Mono', monospace;
    font-size: 10px;
    letter-spacing: 0.12em;
    color: var(--cobalt-signal);
    opacity: 0.7;
    margin-bottom: 8px;
    text-transform: uppercase;
}

.callout-text {
    font-family: 'Space Mono', monospace;
    font-size: 11px;
    line-height: 1.6;
    color: var(--editorial-grey);
    opacity: 0.75;
}

/* Circuit overlay in editorial-2 */
.editorial-circuit-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 220px;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

/* ── Diagram Break Panels ───────────────────────────────────── */
.diagram-break {
    position: relative;
    background-color: var(--blueprint-dark);
    padding: 120px calc(var(--gutter) * 3);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 480px;
    overflow: hidden;
}

.diagram-bg-svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.exploded-schematic {
    position: relative;
    z-index: 2;
    width: clamp(280px, 35vw, 520px);
    height: auto;
    margin-bottom: 40px;
}

/* Closing diagram break */
.diagram-break--close {
    background-color: var(--deep-void);
    min-height: 520px;
}

.hatch-overlay {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.close-diagram-content {
    position: relative;
    z-index: 2;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
}

.close-statement {
    font-family: 'Space Mono', monospace;
    font-size: 13px;
    line-height: 1.9;
    letter-spacing: 0.06em;
    color: var(--editorial-grey);
    opacity: 0.7;
    max-width: 56ch;
}

.bauhaus-composition {
    width: clamp(200px, 25vw, 320px);
    height: auto;
    margin-top: 12px;
}

/* ── Shake-Error Zone ───────────────────────────────────────── */
.shake-zone {
    background-color: var(--deep-void);
    padding: 100px calc(var(--gutter) * 3);
    position: relative;
    z-index: 1;
}

.shake-inner {
    max-width: 760px;
    margin: 0 auto;
}

.shake-section-title {
    margin-bottom: 12px;
}

.shake-desc {
    margin-bottom: 48px;
    opacity: 0.65;
}

.shake-form-wrap {
    position: relative;
}

.shake-module {
    border: 1px solid var(--grid-line);
    padding: 36px 40px 32px;
    position: relative;
    transition: border-color 0.2s ease;
}

.shake-module::before {
    content: '';
    position: absolute;
    top: -1px;
    left: 0;
    width: 48px;
    height: 2px;
    background: var(--cobalt-signal);
}

.shake-label {
    display: block;
    font-family: 'Space Mono', monospace;
    font-size: 11px;
    letter-spacing: 0.15em;
    color: var(--cobalt-signal);
    opacity: 0.75;
    margin-bottom: 16px;
    text-transform: uppercase;
    transition: color 0.2s ease, opacity 0.2s ease;
}

.shake-label--invalid {
    color: var(--error-flash);
    opacity: 1;
}

.shake-input-row {
    display: flex;
    gap: 0;
    align-items: stretch;
}

.shake-input {
    flex: 1;
    background: transparent;
    border: 1px solid var(--grid-line);
    border-right: none;
    color: var(--off-white-cold);
    font-family: 'Space Mono', monospace;
    font-size: 14px;
    letter-spacing: 0.05em;
    padding: 14px 18px;
    outline: none;
    transition: border-color 0.2s ease;
}

.shake-input::placeholder {
    color: var(--editorial-grey);
    opacity: 0.35;
}

.shake-input:focus {
    border-color: var(--cobalt-signal);
}

.shake-btn {
    background: var(--cobalt-signal);
    border: 1px solid var(--cobalt-signal);
    color: var(--deep-void);
    font-family: 'Space Mono', monospace;
    font-size: 11px;
    letter-spacing: 0.12em;
    padding: 14px 24px;
    cursor: pointer;
    text-transform: uppercase;
    transition: background-color 0.2s ease, color 0.2s ease;
    white-space: nowrap;
}

.shake-btn:hover {
    background: var(--electric-ice);
    border-color: var(--electric-ice);
}

.shake-rule {
    height: 1px;
    background: var(--grid-line);
    margin-top: 24px;
    opacity: 0.6;
}

/* ── Shake-Error Keyframe ───────────────────────────────────── */
@keyframes shake-error {
    0%, 100% { transform: translateX(0);   border-color: var(--grid-line); }
    15%       { transform: translateX(-8px); border-color: var(--error-flash); }
    30%       { transform: translateX(8px);  border-color: var(--error-flash); }
    45%       { transform: translateX(-6px); border-color: var(--error-flash); }
    60%       { transform: translateX(6px);  border-color: var(--error-flash); }
    75%       { transform: translateX(-4px); border-color: var(--error-flash); }
    90%       { transform: translateX(4px);  border-color: var(--error-flash); }
}

.shake-module.shake {
    animation: shake-error 400ms ease;
    border-color: var(--error-flash);
}

/* ── Footer ─────────────────────────────────────────────────── */
.site-footer {
    background-color: var(--blueprint-dark);
    padding: 0 calc(var(--gutter) * 3) 40px;
    position: relative;
    z-index: 1;
}

.footer-rule {
    height: 2px;
    background: var(--cobalt-signal);
    margin-bottom: 24px;
}

.footer-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-domain {
    font-family: 'Jost', sans-serif;
    font-weight: 800;
    font-size: 11px;
    letter-spacing: 0.12em;
    color: var(--off-white-cold);
    text-transform: lowercase;
    font-variant: small-caps;
    opacity: 0.6;
}

.footer-coord {
    font-family: 'Space Mono', monospace;
    font-size: 11px;
    letter-spacing: 0.08em;
    color: var(--cobalt-signal);
    opacity: 0.5;
}

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 900px) {
    .editorial-inner {
        grid-template-columns: 1fr;
    }

    .annotation-strip {
        grid-column: 1;
    }

    .callout-box--offset {
        margin-left: 0;
    }

    .hero-inner {
        padding: 0 var(--gutter);
    }

    .editorial-strip,
    .shake-zone,
    .site-footer {
        padding-left: var(--gutter);
        padding-right: var(--gutter);
    }

    .diagram-break {
        padding: 80px var(--gutter);
    }
}

@media (max-width: 600px) {
    .shake-input-row {
        flex-direction: column;
    }

    .shake-input {
        border-right: 1px solid var(--grid-line);
        border-bottom: none;
    }

    .shake-btn {
        border-top: none;
    }

    .footer-inner {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }

    .grid-line {
        opacity: 0.2;
    }
}
