/* HHUDDL.com - Terminal meets tactile material design */

:root {
    --abyss: #0A1628;
    --deep-current: #1B3A5C;
    --signal-blue: #4A7FB5;
    --pale-circuit: #8BAFD4;
    --worn-leather: #C4A882;
    --saddlebag: #7A5C3E;
    --parchment: #E8DFD0;
    --bone: #F5F0E8;
}

/* ========== RESET & BASE ========== */

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

html {
    scroll-behavior: smooth;
    font-size: 18px;
}

body {
    background-color: var(--abyss);
    color: var(--parchment);
    font-family: 'Work Sans', sans-serif;
    font-weight: 400;
    line-height: 1.75;
    overflow-x: hidden;
    position: relative;
}

/* ========== SCAN LINES OVERLAY ========== */

.scanlines {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    background: repeating-linear-gradient(
        to bottom,
        transparent 0px,
        transparent 2px,
        rgba(0, 0, 0, 0.03) 2px,
        rgba(0, 0, 0, 0.03) 4px
    );
}

.scanlines::after {
    content: '';
    position: absolute;
    top: -100%;
    left: 0;
    width: 100%;
    height: 300%;
    background: linear-gradient(
        to bottom,
        transparent 0%,
        rgba(74, 127, 181, 0.015) 50%,
        transparent 100%
    );
    animation: scanShimmer 8s linear infinite;
    pointer-events: none;
}

@keyframes scanShimmer {
    0% { transform: translateY(0); }
    100% { transform: translateY(33.33%); }
}

/* ========== TERMINAL HEADER BAR ========== */

.terminal-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 48px;
    background-color: var(--abyss);
    border-bottom: 1px solid var(--deep-current);
    display: flex;
    align-items: center;
    padding: 0 20px;
    z-index: 1000;
    gap: 16px;
}

.terminal-dots {
    display: flex;
    gap: 8px;
    align-items: center;
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.dot-1 {
    background-color: var(--abyss);
    border: 1px solid var(--deep-current);
}

.dot-2 {
    background-color: var(--deep-current);
}

.dot-3 {
    background-color: var(--signal-blue);
}

.terminal-path {
    font-family: 'JetBrains Mono', monospace;
    font-size: 14px;
    color: var(--signal-blue);
    display: flex;
    align-items: center;
    gap: 4px;
}

.header-cursor {
    display: inline-block;
    width: 2px;
    height: 16px;
    background-color: var(--signal-blue);
    animation: cursorBlink 1s steps(1) infinite;
}

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

/* ========== HERO TERMINAL ========== */

.hero-terminal {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 80px 60px 60px;
    position: relative;
    overflow: hidden;
    background-color: var(--abyss);
}

.boot-sequence {
    max-width: 800px;
    margin-bottom: 60px;
}

.boot-line {
    font-family: 'JetBrains Mono', monospace;
    font-size: 15px;
    line-height: 1.8;
    color: var(--pale-circuit);
    opacity: 0;
    transform: translateX(-40px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.boot-line.visible {
    opacity: 1;
    transform: translateX(0);
}

.boot-line .status-ok {
    color: var(--signal-blue);
    font-weight: 500;
}

.hero-wordmark {
    display: flex;
    align-items: center;
    gap: 4px;
}

.wordmark-text {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 112px;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--bone);
    line-height: 1;
    overflow: hidden;
    white-space: nowrap;
}

.wordmark-cursor {
    display: inline-block;
    width: 4px;
    height: 100px;
    background-color: var(--signal-blue);
    animation: cursorBlink 1s steps(1) infinite;
    flex-shrink: 0;
}

.hero-bubbles {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.hero-bubbles .ambient-bubble {
    position: absolute;
    border-radius: 50%;
    background-color: var(--signal-blue);
    pointer-events: auto;
    cursor: pointer;
}

/* Leather Patch */
.leather-patch {
    position: absolute;
    bottom: 40px;
    right: 40px;
    width: 120px;
    height: 80px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--worn-leather), var(--saddlebag));
    border: 2px dashed var(--saddlebag);
    opacity: 0.6;
    z-index: 2;
}

.brass-rivet {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: radial-gradient(circle at 40% 40%, #D4B896, var(--worn-leather), var(--saddlebag));
}

/* ========== EDITORIAL SECTIONS ========== */

.editorial-section {
    position: relative;
    padding: 100px 0;
    min-height: 60vh;
    display: flex;
    align-items: stretch;
}

.editorial-section:nth-child(even) {
    background-color: var(--deep-current);
}

.editorial-columns {
    display: flex;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 60px;
    gap: 40px;
    align-items: flex-start;
}

.editorial-columns.left-weighted .col-wide {
    flex: 0 0 60%;
}

.editorial-columns.left-weighted .col-narrow {
    flex: 0 0 calc(40% - 40px);
}

.editorial-columns.right-weighted .col-narrow {
    flex: 0 0 calc(40% - 40px);
}

.editorial-columns.right-weighted .col-wide {
    flex: 0 0 60%;
}

.section-header {
    font-family: 'JetBrains Mono', monospace;
    font-size: 16px;
    font-weight: 400;
    color: var(--signal-blue);
    margin-bottom: 32px;
    line-height: 1.6;
}

.prompt-marker {
    color: var(--signal-blue);
    margin-right: 8px;
    font-weight: 500;
}

.col-wide h2 + p,
.col-wide p {
    font-family: 'Work Sans', sans-serif;
    font-size: 18px;
    font-weight: 400;
    line-height: 1.75;
    color: var(--parchment);
    margin-bottom: 24px;
}

.col-wide p:last-child {
    margin-bottom: 0;
}

/* Slide Reveal Animations */
.slide-reveal {
    opacity: 0;
    transition: opacity 600ms cubic-bezier(0.16, 1, 0.3, 1),
                transform 600ms cubic-bezier(0.16, 1, 0.3, 1);
}

.slide-left {
    transform: translateX(-80px);
}

.slide-right {
    transform: translateX(80px);
}

.slide-reveal.revealed {
    opacity: 1;
    transform: translateX(0);
}

/* ========== LEATHER SIDEBARS ========== */

.leather-sidebar {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 60px;
    background: linear-gradient(
        180deg,
        var(--deep-current) 0%,
        var(--saddlebag) 50%,
        var(--deep-current) 100%
    );
    opacity: 0.2;
}

.leather-sidebar-left {
    left: 0;
    border-right: 2px solid var(--saddlebag);
}

.leather-sidebar-right {
    right: 0;
    border-left: 2px solid var(--saddlebag);
}

/* Leather Card Borders */
.terminal-snippet {
    border: 2px solid transparent;
    border-image: linear-gradient(180deg, var(--worn-leather), var(--saddlebag)) 1;
    padding: 24px;
    background-color: rgba(10, 22, 40, 0.6);
    border-radius: 0;
}

/* ========== TERMINAL SNIPPETS ========== */

.snippet-line {
    font-family: 'JetBrains Mono', monospace;
    font-size: 14px;
    line-height: 1.8;
    color: var(--pale-circuit);
}

.snippet-prompt {
    color: var(--signal-blue);
    font-weight: 500;
}

.snippet-comment {
    color: var(--saddlebag);
    font-style: italic;
}

.snippet-output {
    color: var(--parchment);
}

.snippet-cursor {
    display: inline-block;
    width: 2px;
    height: 14px;
    background-color: var(--signal-blue);
    animation: cursorBlink 1s steps(1) infinite;
    vertical-align: text-bottom;
    margin-left: 2px;
}

/* ========== BUBBLE BREAK SECTIONS ========== */

.bubble-break {
    height: 50vh;
    position: relative;
    overflow: hidden;
    background: linear-gradient(180deg, var(--abyss) 0%, var(--deep-current) 50%, var(--abyss) 100%);
}

.bubble-field {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.bubble-field .ambient-bubble,
.hero-bubbles .ambient-bubble {
    position: absolute;
    border-radius: 50%;
    pointer-events: auto;
    cursor: pointer;
}

/* Ambient Bubble Animation */
@keyframes bubbleFloat {
    0% {
        transform: translateY(100%) scale(1);
        opacity: 0;
    }
    10% {
        opacity: var(--bubble-opacity, 0.2);
    }
    90% {
        opacity: var(--bubble-opacity, 0.2);
    }
    100% {
        transform: translateY(-120%) scale(1);
        opacity: 0;
    }
}

@keyframes bubblePop {
    0% { transform: scale(1); opacity: var(--bubble-opacity, 0.2); }
    50% { transform: scale(1.3); opacity: 0.4; }
    100% { transform: scale(1.5); opacity: 0; }
}

/* ========== STRUCTURAL BUBBLES ========== */

.structural-bubble {
    position: absolute;
    border-radius: 50%;
    border: 1px solid var(--signal-blue);
    background: transparent;
    opacity: 0.15;
}

.col-narrow {
    position: relative;
    min-height: 200px;
}

.structural-bubble-1 {
    width: 200px;
    height: 200px;
    top: 20px;
    right: 0;
}

.structural-bubble-2 {
    width: 140px;
    height: 140px;
    top: 120px;
    right: 80px;
}

/* ========== BUBBLE CLUSTERS ========== */

.bubble-cluster {
    position: relative;
    width: 100%;
    min-height: 200px;
}

.bubble-cluster .cluster-bubble {
    position: absolute;
    border-radius: 50%;
    background-color: var(--signal-blue);
}

/* ========== INTERACTIVE BUBBLES (on hover) ========== */

.hover-bubble {
    position: fixed;
    border-radius: 50%;
    background-color: var(--signal-blue);
    pointer-events: none;
    z-index: 100;
    animation: hoverBubbleRise 1.5s ease-out forwards;
}

@keyframes hoverBubbleRise {
    0% {
        transform: translateY(0) scale(1);
        opacity: 0.3;
    }
    100% {
        transform: translateY(-120px) scale(0.5);
        opacity: 0;
    }
}

/* ========== TERMINAL FOOTER ========== */

.terminal-footer {
    min-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 80px 60px;
    background-color: var(--abyss);
    position: relative;
}

.session-end {
    max-width: 600px;
}

.footer-line {
    font-family: 'JetBrains Mono', monospace;
    font-size: 16px;
    line-height: 2;
    color: var(--pale-circuit);
}

.footer-line:first-child {
    color: var(--signal-blue);
    margin-bottom: 16px;
    font-weight: 500;
}

.session-counter,
.bubble-counter {
    color: var(--bone);
    font-weight: 500;
}

.footer-goodbye {
    color: var(--bone);
    margin-top: 24px;
    font-size: 20px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 4px;
}

.footer-cursor {
    display: inline-block;
    width: 2px;
    height: 20px;
    background-color: var(--signal-blue);
    animation: cursorBlink 1s steps(1) infinite;
}

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

@media (max-width: 900px) {
    html {
        font-size: 16px;
    }

    .hero-terminal {
        padding: 80px 24px 40px;
    }

    .wordmark-text {
        font-size: 56px;
    }

    .wordmark-cursor {
        height: 50px;
        width: 3px;
    }

    .editorial-columns {
        flex-direction: column;
        padding: 0 24px;
    }

    .editorial-columns.left-weighted .col-wide,
    .editorial-columns.left-weighted .col-narrow,
    .editorial-columns.right-weighted .col-wide,
    .editorial-columns.right-weighted .col-narrow {
        flex: 0 0 100%;
    }

    .col-narrow {
        min-height: 120px;
    }

    .leather-sidebar {
        width: 20px;
    }

    .terminal-footer {
        padding: 60px 24px;
    }

    .leather-patch {
        width: 80px;
        height: 50px;
        bottom: 20px;
        right: 20px;
    }

    .editorial-section {
        padding: 60px 0;
    }

    .structural-bubble-1 {
        width: 120px;
        height: 120px;
    }

    .structural-bubble-2 {
        width: 80px;
        height: 80px;
        top: 80px;
        right: 40px;
    }
}

@media (max-width: 600px) {
    .wordmark-text {
        font-size: 40px;
    }

    .wordmark-cursor {
        height: 36px;
    }

    .boot-line {
        font-size: 12px;
    }

    .terminal-header {
        height: 40px;
        padding: 0 12px;
    }

    .bubble-break {
        height: 30vh;
    }
}
