/* ============================================================
   KOOMIMI.COM STYLESHEET
   Sci-fi through material warmth | Analog cockpit aesthetic
   ============================================================ */

/* CSS Variables - Color Palette */
:root {
    --deep-bg: #1A0E08;
    --primary-bg: #2B1810;
    --content-surface: #3D2B1F;
    --amber-signal: #F2A65A;
    --copper-trace: #D4915E;
    --patina-bronze: #8B5E3C;
    --parchment-warm: #E8D5C4;
    --text-light: #3D2B1F;
    --hot-solder: #FF6B35;
    --verdigris: #4A9E8E;
    --shadow-dark: #4A3528;
    --highlight-light: #5C3F2E;

    /* Typography */
    --font-display: 'Orbitron', monospace;
    --font-secondary: 'Exo 2', sans-serif;
    --font-body: 'Inter', sans-serif;
    --font-mono: 'Share Tech Mono', monospace;

    /* Spacing */
    --breath-width: 8.333%; /* 1/12 of viewport */
    --spring-curve: cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* ============================================================
   GLOBAL STYLES
   ============================================================ */

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background: linear-gradient(135deg, var(--primary-bg) 0%, var(--deep-bg) 100%);
    color: var(--parchment-warm);
    overflow-x: hidden;
    position: relative;
}

/* Leather texture overlay */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(ellipse at center, transparent 40%, rgba(26, 14, 8, 0.6) 100%),
        url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='4' seed='1' /%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23noise)' opacity='0.04'/%3E%3C/svg%3E");
    pointer-events: none;
    z-index: 0;
    mix-blend-mode: overlay;
}

/* ============================================================
   TYPOGRAPHY SYSTEM
   ============================================================ */

h1, h2, h3, h4, h5, h6 {
    font-weight: normal;
    letter-spacing: 0.08em;
}

.title-text {
    font-family: var(--font-display);
    font-size: 96px;
    font-weight: 400;
    color: var(--amber-signal);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    animation: title-assemble 3s ease-out forwards;
}

.secondary-heading {
    font-family: var(--font-secondary);
    font-size: 32px;
    font-weight: 600;
    color: var(--copper-trace);
    letter-spacing: 0.04em;
    margin-bottom: 2rem;
    animation: heading-slide-in 0.6s var(--spring-curve) forwards;
    opacity: 0;
    animation-delay: 0.2s;
}

.secondary-heading::after {
    content: '';
    display: block;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--amber-signal), transparent);
    animation: underline-draw 0.6s ease-out forwards;
    animation-delay: 0.3s;
}

.section-heading {
    font-family: var(--font-display);
    font-size: 56px;
    font-weight: 400;
    color: var(--amber-signal);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    margin-bottom: 3rem;
    animation: heading-assemble 2s ease-out forwards;
    opacity: 0;
}

.body-text {
    font-size: 18px;
    font-weight: 400;
    line-height: 1.72;
    letter-spacing: 0.005em;
    color: var(--parchment-warm);
    margin-bottom: 1.5rem;
    animation: text-fade-in 0.8s ease-out forwards;
    opacity: 0;
    animation-delay: 0.3s;
}

.engine-text {
    line-height: 1.85;
    animation-delay: calc(0.4s + var(--text-index, 0) * 0.1s);
}

.log-label,
.cargo-label,
.node-label {
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: rgba(242, 166, 90, 0.7);
}

/* ============================================================
   ANIMATIONS
   ============================================================ */

@keyframes title-assemble {
    from {
        opacity: 0;
        transform: translateY(8px);
        letter-spacing: 0.2em;
    }
    to {
        opacity: 1;
        transform: translateY(0);
        letter-spacing: 0.12em;
    }
}

@keyframes heading-slide-in {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes heading-assemble {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes underline-draw {
    from {
        width: 0;
    }
    to {
        width: 60px;
    }
}

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

@keyframes pulse-brightness {
    0%, 100% { opacity: 0.85; }
    50% { opacity: 1.0; }
}

@keyframes glow-pulse {
    0%, 100% {
        box-shadow: 0 0 20px rgba(242, 166, 90, 0.5);
    }
    50% {
        box-shadow: 0 0 40px rgba(242, 166, 90, 0.8);
    }
}

@keyframes scroll-indicator-bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(8px); }
}

@keyframes circuit-draw {
    from {
        stroke-dashoffset: 1000;
    }
    to {
        stroke-dashoffset: 0;
    }
}

@keyframes traveling-glow {
    0% {
        stop-color: rgba(242, 166, 90, 0);
    }
    50% {
        stop-color: rgba(242, 166, 90, 1);
    }
    100% {
        stop-color: rgba(242, 166, 90, 0);
    }
}

/* ============================================================
   SECTION STRUCTURE
   ============================================================ */

.section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 60px 0;
    z-index: 1;
}

.section::before {
    content: '';
    position: absolute;
    top: 15vh;
    left: 0;
    right: 0;
    height: 60vh;
    z-index: -1;
}

/* Entry Hatch */
.entry-hatch {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg, var(--deep-bg) 0%, var(--primary-bg) 100%);
    position: relative;
    overflow: hidden;
}

.circuit-container {
    position: relative;
    width: 100%;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.center-node {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--amber-signal);
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 30px rgba(242, 166, 90, 0.6);
    animation: glow-pulse 2s ease-in-out infinite;
}

.page-title {
    position: relative;
    z-index: 10;
}

.log-label {
    position: absolute;
    top: 40px;
    left: 40px;
    font-family: var(--font-mono);
    font-size: 12px;
    color: rgba(212, 145, 94, 0.8);
    letter-spacing: 0.1em;
}

.scroll-indicator {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    width: 24px;
    height: 24px;
    color: var(--copper-trace);
    animation: scroll-indicator-bounce 2s ease-in-out infinite;
}

.scroll-indicator svg {
    width: 100%;
    height: 100%;
}

/* Bridge Overview */
.bridge-overview {
    min-height: 120vh;
    display: block;
    padding: 100px 40px;
}

.section-content {
    max-width: 900px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 80px;
    align-items: start;
}

.content-dense {
    grid-column: 1 / 2;
    padding: 40px;
    background: rgba(61, 43, 31, 0.5);
    border: 1px solid rgba(139, 94, 60, 0.3);
    border-radius: 2px;
}

.schematic-assembly {
    grid-column: 2 / 3;
    width: 100%;
    height: auto;
}

/* Cargo Manifest */
.cargo-manifest {
    min-height: 150vh;
    display: block;
    padding: 80px 40px;
}

.cargo-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 60px;
    max-width: 1200px;
    margin: 0 auto;
    margin-top: 40px;
}

.cargo-card {
    background: rgba(61, 43, 31, 0.6);
    border: 1px solid rgba(139, 94, 60, 0.4);
    padding: 30px;
    transition: all 0.3s var(--spring-curve);
    animation: text-fade-in 0.8s ease-out forwards;
    opacity: 0;
}

.cargo-card:nth-child(1) { animation-delay: 0.2s; }
.cargo-card:nth-child(2) { animation-delay: 0.4s; }
.cargo-card:nth-child(3) { animation-delay: 0.6s; }
.cargo-card:nth-child(4) { animation-delay: 0.8s; }
.cargo-card:nth-child(5) { animation-delay: 1.0s; }
.cargo-card:nth-child(6) { animation-delay: 1.2s; }

.cargo-card:hover {
    background: rgba(61, 43, 31, 0.9);
    border-color: rgba(242, 166, 90, 0.5);
    box-shadow: 0 0 30px rgba(242, 166, 90, 0.2), inset 1px 1px 0 rgba(92, 63, 46, 0.5), inset -1px -1px 0 rgba(74, 53, 40, 0.5);
    transform: translateY(-4px);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.cargo-label {
    font-size: 13px;
}

.status-node {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    transition: all 0.3s ease-out;
}

.status-node.active {
    background: var(--hot-solder);
    box-shadow: 0 0 12px rgba(255, 107, 53, 0.6);
}

.status-node.in-transit {
    background: var(--amber-signal);
    box-shadow: 0 0 12px rgba(242, 166, 90, 0.4);
}

.status-node.loading {
    background: var(--copper-trace);
    box-shadow: 0 0 12px rgba(212, 145, 94, 0.4);
    animation: pulse-brightness 2s ease-in-out infinite;
}

.status-node.complete {
    background: var(--verdigris);
    box-shadow: 0 0 12px rgba(74, 158, 142, 0.4);
}

.card-text {
    font-size: 15px;
    line-height: 1.6;
    color: rgba(232, 213, 196, 0.9);
}

/* Airlock Transition */
.airlock-transition {
    min-height: 40vh;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
}

.transition-line {
    width: 80%;
    height: 60px;
}

.airlock-trace {
    stroke: var(--patina-bronze);
    stroke-width: 2;
    opacity: 0.5;
    stroke-dasharray: 400;
    animation: circuit-draw 4s ease-out forwards;
}

#airlock-1 .airlock-trace {
    animation-delay: 0.2s;
}

#airlock-3 .airlock-trace {
    animation-delay: 0.2s;
    transform: scaleX(-1);
    transform-origin: center;
}

/* Engine Room */
.engine-room {
    min-height: 120vh;
    display: block;
    padding: 80px 40px;
}

.engine-room .section-content {
    display: block;
}

.engine-room .secondary-heading {
    margin-bottom: 2rem;
}

.engine-room .body-text {
    max-width: 700px;
    margin-bottom: 1.5rem;
}

/* Communications Bay */
.communications-bay {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 80px 40px;
    position: relative;
}

.contact-schematic {
    max-width: 600px;
    margin: 40px auto;
    position: relative;
}

.contact-nodes {
    display: grid;
    grid-template-columns: 1fr;
    gap: 40px;
    margin-top: 60px;
}

.contact-node {
    background: rgba(61, 43, 31, 0.5);
    border: 1px solid rgba(139, 94, 60, 0.3);
    padding: 30px;
    border-radius: 2px;
    position: relative;
    cursor: pointer;
    transition: all 0.3s var(--spring-curve);
    animation: text-fade-in 0.8s ease-out forwards;
    opacity: 0;
}

.contact-node:nth-child(1) { animation-delay: 0.3s; }
.contact-node:nth-child(2) { animation-delay: 0.6s; }
.contact-node:nth-child(3) { animation-delay: 0.9s; }

.contact-node:hover {
    background: rgba(61, 43, 31, 0.8);
    border-color: rgba(242, 166, 90, 0.5);
}

.node-circle {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--patina-bronze);
    position: absolute;
    left: 20px;
    top: 20px;
    transition: all 0.3s ease-out;
}

.contact-node:hover .node-circle {
    background: var(--hot-solder);
    box-shadow: 0 0 25px rgba(255, 107, 53, 0.8);
}

.node-label {
    font-size: 11px;
    margin-bottom: 12px;
    display: block;
}

.node-content {
    font-size: 15px;
    line-height: 1.6;
    color: rgba(232, 213, 196, 0.9);
}

.contact-node.active .node-content {
    max-height: 500px;
}

/* Form styles */
.form-input,
.form-textarea {
    width: 100%;
    background: rgba(26, 14, 8, 0.6);
    border: 1px solid rgba(139, 94, 60, 0.4);
    color: var(--parchment-warm);
    padding: 10px 12px;
    font-family: var(--font-body);
    font-size: 14px;
    margin-bottom: 10px;
    border-radius: 2px;
}

.form-textarea {
    resize: vertical;
    min-height: 80px;
}

.form-input::placeholder,
.form-textarea::placeholder {
    color: rgba(232, 213, 196, 0.5);
}

.form-submit {
    background: var(--amber-signal);
    color: var(--deep-bg);
    border: none;
    padding: 10px 20px;
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    cursor: pointer;
    border-radius: 2px;
    transition: all 0.3s var(--spring-curve);
}

.form-submit:hover {
    background: var(--hot-solder);
    box-shadow: 0 0 20px rgba(255, 107, 53, 0.5);
}

.social-links {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.social-link {
    color: var(--amber-signal);
    text-decoration: none;
    font-family: var(--font-mono);
    font-size: 13px;
    padding: 6px 12px;
    border: 1px solid rgba(242, 166, 90, 0.4);
    transition: all 0.3s ease-out;
}

.social-link:hover {
    background: rgba(242, 166, 90, 0.2);
    border-color: var(--hot-solder);
    color: var(--hot-solder);
}

/* ============================================================
   NAVIGATION
   ============================================================ */

.site-navigation {
    position: fixed;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 40px;
    padding-right: 20px;
    z-index: 100;
    opacity: 0;
    animation: text-fade-in 1.5s ease-out 0.5s forwards;
}

.nav-label {
    font-family: var(--font-mono);
    font-size: 11px;
    color: rgba(212, 145, 94, 0.6);
    letter-spacing: 0.08em;
    cursor: pointer;
    transition: all 0.3s ease-out;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    transform: rotate(180deg);
}

.nav-label:hover {
    color: var(--amber-signal);
    text-shadow: 0 0 10px rgba(242, 166, 90, 0.5);
}

/* ============================================================
   CIRCUIT BACKGROUND
   ============================================================ */

.background-circuits {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    z-index: -1;
    pointer-events: none;
}

.circuit-hatch {
    position: absolute;
    width: 300px;
    height: 300px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 768px) {
    .title-text {
        font-size: 56px;
    }

    .secondary-heading {
        font-size: 24px;
    }

    .section-heading {
        font-size: 36px;
    }

    .body-text {
        font-size: 16px;
    }

    .section-content {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .content-dense,
    .schematic-assembly {
        grid-column: 1 / -1;
    }

    .cargo-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .site-navigation {
        opacity: 0.4;
        padding-right: 10px;
    }

    .nav-label {
        font-size: 9px;
    }
}

/* ============================================================
   SCROLL TRIGGER CLASSES (populated by script)
   ============================================================ */

.visible {
    opacity: 1;
}

.scroll-in {
    animation: heading-assemble 0.6s var(--spring-curve) forwards;
}
