/* ============================================
   LRX.SH - Brutalist Command Vault
   ============================================ */

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

html {
    scroll-behavior: smooth;
}

body {
    background: #0F0D08;
    color: #8B7B5E;
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 400;
    font-size: clamp(0.9rem, 1.1vw, 1.05rem);
    line-height: 1.7;
    overflow-x: hidden;
}

/* --- Boot Screen --- */
#boot-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000000;
    z-index: 9999;
    transition: opacity 0.5s ease;
    pointer-events: none;
}

#boot-screen.fade-out {
    opacity: 0;
}

/* --- SVG Noise Filter (for leather texture) --- */
/* Defined inline via CSS using SVG data URI */

/* --- Hero Section --- */
.hero {
    position: relative;
    width: 100%;
    height: 100vh;
    overflow: hidden;
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
}

.hero-leather-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #2C2416;
    background-image: radial-gradient(ellipse at 30% 40%, #3D3225 0%, #2C2416 60%);
    z-index: 0;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.hero-leather-bg.visible {
    opacity: 1;
}

.hero-noise {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='400' height='400'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='400' height='400' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
    background-repeat: repeat;
    z-index: 1;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.hero-noise.visible {
    opacity: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    padding-left: 5vw;
    padding-top: 25vh;
}

.title {
    font-family: 'Anton', sans-serif;
    font-weight: 400;
    font-size: clamp(6rem, 18vw, 14rem);
    color: #C4A068;
    text-transform: uppercase;
    line-height: 1;
    letter-spacing: -0.02em;
}

#title-text {
    display: inline;
}

/* Individual character flash */
.char-flash {
    display: inline-block;
    animation: charFlash 50ms ease;
}

@keyframes charFlash {
    0% { opacity: 1; }
    50% { opacity: 0.8; }
    100% { opacity: 1; }
}

/* Blinking cursor */
.cursor {
    display: inline-block;
    font-family: 'Anton', sans-serif;
    font-weight: 400;
    color: #C4A068;
    animation: blink 1s step-end infinite;
}

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

/* Terminal prompt */
.terminal-prompt {
    font-family: 'Source Code Pro', monospace;
    font-weight: 400;
    font-size: 1.2rem;
    color: #8B7B5E;
    margin-top: 2rem;
    letter-spacing: 0.02em;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.terminal-prompt.visible {
    opacity: 1;
}

.prompt-prefix {
    color: #C4A068;
}

/* ============================================
   Hex Command Grid Section
   ============================================ */
.hex-grid-section {
    position: relative;
    width: 100%;
    min-height: 150vh;
    background-color: #2C2416;
    background-image: radial-gradient(ellipse at 70% 60%, #3D3225 0%, #2C2416 60%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10vh 5vw;
}

.hex-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    max-width: 900px;
    gap: 8px;
}

/* Hexagonal cells using clip-path */
.hex-cell {
    width: 140px;
    height: 162px; /* height = width * 1.1547 for regular hex */
    position: relative;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s ease;
    margin: -20px 4px;
}

.hex-cell:nth-child(even) {
    margin-top: 0px;
}

.hex-inner {
    width: 100%;
    height: 100%;
    background: #1E1A12;
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: background 0.2s ease;
}

.hex-inner::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    background: transparent;
    box-shadow: inset 0 0 0 2px #A88B55;
    z-index: 1;
}

/* Border simulation using a slightly larger hex behind */
.hex-cell::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    width: calc(100% + 4px);
    height: calc(100% + 4px);
    background: #A88B55;
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    z-index: -1;
    transition: background 0.2s ease;
}

.hex-cell.visible {
    opacity: 1;
}

.hex-cell.entry-shake {
    animation: shake 200ms ease;
}

.hex-cell.entry-shake::before {
    background: #C4A068;
}

.hex-cell:hover {
    animation: shake 200ms ease;
}

.hex-cell:hover::before {
    background: #C45040;
}

.hex-label {
    font-family: 'Anton', sans-serif;
    font-weight: 400;
    font-size: clamp(0.8rem, 1.2vw, 1rem);
    color: #C4A068;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    z-index: 2;
    position: relative;
}

@keyframes shake {
    0%, 100% { transform: translate(0); }
    25% { transform: translate(2px, 1px); }
    50% { transform: translate(-1px, -2px); }
    75% { transform: translate(1px, -1px); }
}

/* Hex grid honeycomb layout */
/* Offset every other cell for honeycomb pattern */
.hex-grid {
    display: grid;
    grid-template-columns: repeat(6, 140px);
    gap: 6px 6px;
    justify-content: center;
}

.hex-cell {
    margin: 0;
}

/* Offset odd rows */
.hex-cell:nth-child(n+7):nth-child(-n+12) {
    transform: translateX(73px);
}

.hex-cell:nth-child(n+7):nth-child(-n+12):hover {
    animation: shake 200ms ease;
    transform: translateX(73px);
}

.hex-cell:nth-child(n+7):nth-child(-n+12).entry-shake {
    animation: shakeOffset 200ms ease;
    transform: translateX(73px);
}

@keyframes shakeOffset {
    0%, 100% { transform: translateX(73px) translate(0); }
    25% { transform: translateX(73px) translate(2px, 1px); }
    50% { transform: translateX(73px) translate(-1px, -2px); }
    75% { transform: translateX(73px) translate(1px, -1px); }
}

/* Third row (13-18) same as first */
.hex-cell:nth-child(n+13):nth-child(-n+18) {
    transform: translateX(0);
}

/* Negative margin for overlapping hex rows */
.hex-cell:nth-child(n+7) {
    margin-top: -38px;
}

/* ============================================
   Log Stream Section
   ============================================ */
.log-section {
    position: relative;
    width: 100%;
    height: 100vh;
    background: #0F0D08;
    overflow: hidden;
}

.log-container {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.log-stream {
    font-family: 'Source Code Pro', monospace;
    font-weight: 400;
    font-size: 0.85rem;
    color: #8B7B5E;
    letter-spacing: 0.02em;
    line-height: 2;
    padding: 2rem 5vw;
    white-space: nowrap;
}

.log-stream,
.log-stream-duplicate {
    animation: scrollLog 60s linear infinite;
}

.log-stream-duplicate {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
}

@keyframes scrollLog {
    0% { transform: translateY(0); }
    100% { transform: translateY(-100%); }
}

.log-line {
    display: block;
    padding: 2px 0;
}

.log-line.highlight {
    color: #C4A068;
}

.log-line.gold {
    color: #D4B078;
}

/* ============================================
   Vault Door Footer
   ============================================ */
.footer {
    width: 100%;
    padding: 3rem 5vw;
    background: #1E1A12;
}

.footer-text {
    font-family: 'Source Code Pro', monospace;
    font-weight: 400;
    font-size: 0.85rem;
    color: #8B7B5E;
    letter-spacing: 0.02em;
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 960px) {
    .hex-grid {
        grid-template-columns: repeat(4, 120px);
        gap: 4px 4px;
    }

    .hex-cell {
        width: 120px;
        height: 139px;
    }

    .hex-cell:nth-child(n+5):nth-child(-n+8) {
        transform: translateX(63px);
    }

    .hex-cell:nth-child(n+5):nth-child(-n+8):hover {
        animation: shake 200ms ease;
        transform: translateX(63px);
    }

    .hex-cell:nth-child(n+7):nth-child(-n+12) {
        transform: none;
    }

    .hex-cell:nth-child(n+9):nth-child(-n+12) {
        transform: none;
    }

    .hex-cell:nth-child(n+13):nth-child(-n+18) {
        transform: none;
    }

    .hex-cell:nth-child(n+5) {
        margin-top: -32px;
    }
}

@media (max-width: 600px) {
    .hex-grid {
        grid-template-columns: repeat(3, 100px);
        gap: 4px 4px;
    }

    .hex-cell {
        width: 100px;
        height: 116px;
    }

    .hex-cell:nth-child(n+4):nth-child(-n+6) {
        transform: translateX(53px);
    }

    .hex-cell:nth-child(n+4):nth-child(-n+6):hover {
        animation: shake 200ms ease;
        transform: translateX(53px);
    }

    .hex-cell:nth-child(n+5):nth-child(-n+8) {
        transform: none;
    }

    .hex-cell:nth-child(n+7):nth-child(-n+12) {
        transform: none;
    }

    .hex-cell:nth-child(n+4) {
        margin-top: -26px;
    }

    .title {
        font-size: clamp(3rem, 15vw, 6rem);
    }

    .hero-content {
        padding-top: 20vh;
    }
}
