/* ============================================
   koomimi.com — Swiss HUD Console
   ============================================ */

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

:root {
    --bg-primary: #0C0C10;
    --fg-primary: #E8E4DC;
    --accent-red: #D72638;
    --accent-teal: #6B8F9E;
    --surface: #1A1A22;
    --divider: #2A2A2E;
    --highlight: #F0C756;
    --font-display: 'Space Grotesk', sans-serif;
    --font-body: 'Cormorant Garamond', serif;
    --font-mono: 'IBM Plex Mono', monospace;
    --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

html {
    font-size: 16px;
    scroll-behavior: auto;
}

body {
    background: var(--bg-primary);
    color: var(--fg-primary);
    font-family: var(--font-body);
    line-height: 1.72;
    overflow-x: hidden;
}

/* --- Navigation Bar --- */
.nav-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    height: 48px;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0 32px;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--divider);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    letter-spacing: 0.04em;
    color: var(--accent-teal);
}

.nav-divider {
    opacity: 0.4;
}

.nav-section-label {
    margin-left: 16px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 0.7rem;
    color: var(--fg-primary);
}

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

/* --- Section Base --- */
.section {
    position: relative;
    width: 100%;
    min-height: 100vh;
    scroll-snap-align: start;
    overflow: hidden;
}

/* --- Grid Overlay --- */
.grid-overlay {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background-image:
        repeating-linear-gradient(
            to right,
            transparent,
            transparent calc(8.333% - 24px),
            rgba(42, 42, 46, 0.08) calc(8.333% - 24px),
            rgba(42, 42, 46, 0.08) 8.333%
        );
}

/* Scan lines */
.grid-overlay::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image: repeating-linear-gradient(
        to bottom,
        transparent,
        transparent 31px,
        var(--divider) 31px,
        var(--divider) 32px
    );
    opacity: 0.15;
}

/* --- Crosshair Markers --- */
.crosshair {
    position: absolute;
    z-index: 2;
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--accent-teal);
    opacity: 0.6;
    pointer-events: none;
}

.crosshair-tl { top: 16px; left: 16px; }
.crosshair-tr { top: 16px; right: 16px; }
.crosshair-bl { bottom: 16px; left: 16px; }
.crosshair-br { bottom: 16px; right: 16px; }

/* --- Section Content --- */
.section-content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 48px 32px;
}

/* --- Bracket Frames --- */
.bracket-frame {
    position: relative;
    padding: 20px 28px;
}

.bracket-frame::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 40px;
    height: 40px;
    border-top: 2px solid var(--accent-teal);
    border-left: 2px solid var(--accent-teal);
    transform: scaleX(0) scaleY(0);
    transform-origin: top left;
    transition: transform 0.6s var(--spring);
}

.bracket-frame::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 40px;
    height: 40px;
    border-bottom: 2px solid var(--accent-teal);
    border-right: 2px solid var(--accent-teal);
    transform: scaleX(0) scaleY(0);
    transform-origin: bottom right;
    transition: transform 0.6s var(--spring);
}

.in-view .bracket-frame::before,
.in-view .bracket-frame::after {
    transform: scaleX(1) scaleY(1);
}

/* --- Title Section (Section 0) --- */
.section-title .section-content {
    gap: 0;
}

.wordmark {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(4rem, 11vw, 9rem);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--fg-primary);
    opacity: 0;
    animation: fadeIn 1.2s var(--spring) 0.2s forwards;
}

.wordmark-k {
    color: var(--accent-red);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.title-rule {
    width: 0;
    height: 1px;
    background: var(--divider);
    margin: 24px auto;
    animation: drawRule 0.8s var(--spring) 1.4s forwards;
}

@keyframes drawRule {
    from { width: 0; }
    to { width: 60%; }
}

.coordinates {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    color: var(--accent-teal);
    opacity: 0;
    animation: fadeIn 0.6s ease 2s forwards;
}

.descriptor {
    font-family: var(--font-body);
    font-size: clamp(1rem, 1.2vw, 1.25rem);
    color: var(--fg-primary);
    opacity: 0;
    margin-top: 16px;
    animation: fadeIn 0.6s ease 2.2s forwards;
}

/* Title bracket animation */
.section-title .bracket-frame::before,
.section-title .bracket-frame::after {
    animation: bracketDraw 0.6s var(--spring) 1.8s forwards;
}

@keyframes bracketDraw {
    from { transform: scaleX(0) scaleY(0); }
    to { transform: scaleX(1) scaleY(1); }
}

/* --- Parallax Sections --- */
.parallax-section {
    background: var(--bg-primary);
}

.parallax-foreground {
    will-change: transform;
}

/* --- Panel Layout --- */
.panel-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 48px;
    max-width: 1100px;
    width: 100%;
    align-items: center;
}

.panel-main {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.section-header {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(4rem, 11vw, 9rem);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--fg-primary);
    line-height: 1;
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.6s var(--spring), transform 0.6s var(--spring);
}

.in-view .section-header {
    opacity: 1;
    transform: translateY(0);
}

.section-body {
    font-family: var(--font-body);
    font-size: clamp(1rem, 1.2vw, 1.25rem);
    font-weight: 400;
    line-height: 1.72;
    color: var(--fg-primary);
    max-width: 480px;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease 0.2s, transform 0.6s ease 0.2s;
}

.in-view .section-body {
    opacity: 1;
    transform: translateY(0);
}

/* --- Panel Side --- */
.panel-side {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 16px;
}

/* --- Specimen Photos (CSS-only duotone) --- */
.specimen-photo {
    position: relative;
    border: 1px solid var(--divider);
    overflow: hidden;
    opacity: 0;
    transform: scale(0.95);
    transition: opacity 0.4s var(--spring), transform 0.4s var(--spring);
}

.in-view .specimen-photo {
    opacity: 1;
    transform: scale(1);
}

.specimen-1 { width: 200px; height: 280px; }
.specimen-2 { width: 320px; height: 200px; }
.specimen-3 { width: 200px; height: 280px; }
.specimen-4 { width: 320px; height: 200px; }

.photo-inner {
    width: 100%;
    height: 100%;
    background: var(--bg-primary);
}

/* Duotone patterns via gradients to simulate texture */
.specimen-1 .photo-inner {
    background: linear-gradient(135deg, var(--bg-primary) 0%, var(--highlight) 40%, var(--bg-primary) 60%, var(--highlight) 80%, var(--bg-primary) 100%);
    opacity: 0.7;
}

.specimen-2 .photo-inner {
    background: repeating-linear-gradient(45deg, var(--bg-primary), var(--bg-primary) 4px, var(--highlight) 4px, var(--highlight) 5px);
    opacity: 0.5;
}

.specimen-3 .photo-inner {
    background: radial-gradient(circle at 30% 40%, var(--highlight) 0%, var(--bg-primary) 50%), radial-gradient(circle at 70% 60%, var(--highlight) 0%, var(--bg-primary) 40%);
    opacity: 0.6;
}

.specimen-4 .photo-inner {
    background: repeating-conic-gradient(var(--bg-primary) 0deg 10deg, var(--highlight) 10deg 20deg) center / 60px 60px;
    opacity: 0.4;
}

.photo-caption {
    display: block;
    font-family: var(--font-mono);
    font-size: 0.6875rem;
    letter-spacing: 0.04em;
    color: var(--accent-teal);
    padding: 6px 8px;
    background: var(--surface);
}

/* --- Coordinate Labels --- */
.coord-label {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    letter-spacing: 0.04em;
    color: var(--accent-teal);
    opacity: 0.5;
}

/* --- Data Ribbons --- */
.data-ribbon {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 32px;
    background: var(--surface);
    overflow: hidden;
    z-index: 5;
}

.marquee-track {
    display: flex;
    white-space: nowrap;
    animation: marquee 30s linear infinite;
    animation-play-state: paused;
}

.in-view .marquee-track {
    animation-play-state: running;
}

.marquee-text {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--accent-teal);
    line-height: 32px;
    padding-right: 0;
    flex-shrink: 0;
}

@keyframes marquee {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* --- Terminal Section (Section 5) --- */
.section-terminal {
    background: var(--surface);
    min-height: 40vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: sticky;
    bottom: 0;
}

.terminal-content {
    padding: 48px 32px;
    max-width: 600px;
    width: 100%;
}

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

.prompt-char {
    color: var(--accent-red);
    font-weight: 400;
}

.terminal-domain {
    color: var(--accent-teal);
}

.cursor {
    display: inline-block;
    width: 10px;
    height: 1.25rem;
    background: var(--accent-teal);
    animation: blink 1.2s steps(1) infinite;
}

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

.terminal-rule {
    border: none;
    height: 1px;
    background: var(--divider);
    margin: 24px 0;
}

.terminal-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.04em;
    color: var(--accent-teal);
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .panel-layout {
        grid-template-columns: 1fr;
        gap: 32px;
    }

    .panel-side {
        align-items: flex-start;
    }

    .specimen-1, .specimen-3 { width: 160px; height: 224px; }
    .specimen-2, .specimen-4 { width: 240px; height: 150px; }

    .section-header {
        font-size: clamp(2.5rem, 10vw, 5rem);
    }

    .wordmark {
        font-size: clamp(2.5rem, 12vw, 5rem);
    }

    .nav-bar {
        padding: 0 16px;
    }

    .section-content {
        padding: 48px 16px;
    }
}
