/* ============================================
   gabs.boo — HUD Overlay Dark Technical Theme
   ============================================ */

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

html {
    scroll-behavior: smooth;
}

body {
    background-color: #0B0E14;
    color: #C8D6E5;
    font-family: 'Nunito Sans', sans-serif;
    font-weight: 400;
    font-size: 17px;
    line-height: 1.7;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* --- Background Pattern Layer (Parallax 0.15x) --- */
.bg-pattern {
    position: fixed;
    top: -20%;
    left: -10%;
    width: 120%;
    height: 140%;
    z-index: 0;
    pointer-events: none;
    background-image:
        /* Hand-drawn triangles & chevrons at very low opacity */
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120' viewBox='0 0 120 120'%3E%3Cpath d='M 20 45 L 30 25 L 40 45' fill='none' stroke='%235A6B7C' stroke-width='0.8' opacity='0.04'/%3E%3Cpath d='M 70 35 L 80 25 L 70 15' fill='none' stroke='%235A6B7C' stroke-width='0.7' opacity='0.035'/%3E%3Cpath d='M 50 90 L 60 70 L 70 90' fill='none' stroke='%235A6B7C' stroke-width='0.8' opacity='0.04'/%3E%3Cpath d='M 95 80 L 105 70 L 95 60' fill='none' stroke='%235A6B7C' stroke-width='0.7' opacity='0.035'/%3E%3Cpath d='M 10 100 L 15 90 L 20 100' fill='none' stroke='%2300F0FF' stroke-width='0.5' opacity='0.025'/%3E%3C/svg%3E");
    background-repeat: repeat;
    background-size: 120px 120px;
    will-change: transform;
}

/* --- HUD Frame (Fixed Overlay) --- */
.hud-frame {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 100;
    pointer-events: none;
}

/* Viewport border inset 24px */
.hud-border {
    position: absolute;
    top: 24px;
    left: 24px;
    right: 24px;
    bottom: 24px;
    border: 1px solid rgba(0, 240, 255, 0.4);
    pointer-events: none;
}

/* Corner brackets */
.hud-corner {
    position: absolute;
    width: 48px;
    height: 48px;
    z-index: 101;
    overflow: visible;
    will-change: transform;
}

.hud-corner--tl {
    top: 12px;
    left: 12px;
}

.hud-corner--tr {
    top: 12px;
    right: 12px;
}

.hud-corner--bl {
    bottom: 12px;
    left: 12px;
}

.hud-corner--br {
    bottom: 12px;
    right: 12px;
}

.hud-corner-path {
    stroke-dasharray: 200;
    stroke-dashoffset: 0;
    transition: stroke 0.4s ease;
}

.hud-corner-path.redrawing {
    animation: cornerRedraw 0.8s cubic-bezier(0.65, 0, 0.35, 1) forwards;
}

@keyframes cornerRedraw {
    0% { stroke-dashoffset: 200; opacity: 0.3; }
    30% { opacity: 1; }
    100% { stroke-dashoffset: 0; opacity: 1; }
}

/* Top edge strip */
.hud-top-strip {
    position: absolute;
    top: 24px;
    left: 48px;
    right: 100px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    pointer-events: none;
}

.hud-top-strip__domain {
    font-family: 'Nunito', sans-serif;
    font-weight: 700;
    font-size: 13px;
    color: #FFFFFF;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.hud-top-strip__status {
    display: flex;
    gap: 20px;
    align-items: center;
}

.hud-coord {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
    font-size: 11px;
    color: #00F0FF;
    letter-spacing: 0.05em;
}

.hud-sys-status {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 500;
    font-size: 11px;
    color: #5A6B7C;
    letter-spacing: 0.05em;
}

/* Bottom edge strip */
.hud-bottom-strip {
    position: absolute;
    bottom: 24px;
    left: 48px;
    right: 100px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    pointer-events: none;
}

.hud-progress-line {
    width: 60%;
    height: 4px;
}

#hud-progress-path {
    stroke-dasharray: 1200;
    stroke-dashoffset: 1200;
    transition: stroke-dashoffset 0.3s ease-out;
}

.hud-section-label {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
    font-size: 11px;
    color: #5A6B7C;
    letter-spacing: 0.05em;
}

/* Right edge navigation rail */
.hud-nav-rail {
    position: absolute;
    right: 24px;
    top: 50%;
    transform: translateY(-50%);
    width: 64px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    pointer-events: auto;
}

.hud-nav-diamond {
    width: 20px;
    height: 20px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    pointer-events: auto;
}

.hud-nav-diamond svg {
    width: 20px;
    height: 20px;
}

.hud-nav-diamond svg path {
    stroke: #5A6B7C;
    fill: none;
    transition: stroke 0.3s ease, fill 0.3s ease;
}

.hud-nav-diamond.active svg path {
    stroke: #00F0FF;
    fill: #00F0FF;
}

.hud-nav-diamond:hover svg path {
    stroke: #00F0FF;
}

/* --- Panels Container --- */
.panels-container {
    position: relative;
    z-index: 10;
}

/* --- Individual Panel --- */
.panel {
    position: relative;
    min-height: 100vh;
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 0 32px;
    padding: 96px 88px 72px 88px;
    overflow: hidden;
}

.panel__illustration {
    grid-column: 1 / 6;
    display: flex;
    align-items: center;
    justify-content: center;
    will-change: transform;
}

.panel__content {
    grid-column: 7 / 12;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 20px;
    padding-right: 40px;
}

/* Alternate panel layout: illustration right, content left */
.panel:nth-child(even) .panel__illustration {
    grid-column: 7 / 12;
    grid-row: 1;
    order: 2;
}

.panel:nth-child(even) .panel__content {
    grid-column: 2 / 7;
    grid-row: 1;
    order: 1;
}

/* --- Hand-drawn SVGs --- */
.hand-drawn-svg {
    width: 100%;
    max-width: 440px;
    height: auto;
}

.draw-path {
    stroke-dasharray: var(--path-length, 1000);
    stroke-dashoffset: var(--path-length, 1000);
    transition: none;
}

.draw-path.drawn {
    animation: drawStroke var(--draw-duration, 2s) cubic-bezier(0.65, 0, 0.35, 1) var(--draw-delay, 0s) forwards;
}

@keyframes drawStroke {
    to {
        stroke-dashoffset: 0;
    }
}

/* --- Typography --- */
.panel__title {
    font-family: 'Nunito', sans-serif;
    font-weight: 800;
    font-size: clamp(32px, 4vw, 56px);
    color: #FFFFFF;
    letter-spacing: -0.02em;
    text-shadow: 0 0 12px rgba(0, 240, 255, 0.25);
    line-height: 1.15;
}

.panel__body {
    font-family: 'Nunito Sans', sans-serif;
    font-weight: 400;
    font-size: 17px;
    line-height: 1.7;
    color: #C8D6E5;
    max-width: 480px;
}

/* --- Annotations --- */
.annotation {
    opacity: 0;
    transform: translateY(15px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.annotation.visible {
    opacity: 1;
    transform: translateY(0);
}

.annotation--primary {
    display: flex;
    align-items: center;
    gap: 10px;
}

.annotation__leader {
    width: 24px;
    height: 2px;
    background: linear-gradient(90deg, rgba(0, 240, 255, 0.6), rgba(0, 240, 255, 0));
    display: inline-block;
    flex-shrink: 0;
}

.annotation__text {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
    font-size: 12px;
    color: #00F0FF;
    letter-spacing: 0.05em;
}

.annotation--hand {
    margin-top: 4px;
}

.caveat-label {
    font-family: 'Caveat', cursive;
    font-weight: 400;
    font-size: 17px;
    color: #FF6B35;
    letter-spacing: 0;
    display: inline-block;
}

.annotation--hand.visible .caveat-label {
    animation: handRotate 0.3s ease forwards;
}

@keyframes handRotate {
    0% { transform: rotate(-4deg); opacity: 0; }
    100% { transform: rotate(-1.5deg); opacity: 1; }
}

.annotation--connector {
    margin-top: 8px;
}

.connector-line {
    width: 160px;
    height: 24px;
}

.connector-path {
    stroke-dasharray: 400;
    stroke-dashoffset: 400;
}

.annotation--connector.visible .connector-path {
    animation: drawStroke 1.2s cubic-bezier(0.65, 0, 0.35, 1) forwards;
}

/* --- Panel background variant (Deep Slate) --- */
.panel--slate {
    background-color: #151A23;
}

/* --- Alert / Warning accent --- */
.panel[data-accent="#FF3B5C"] .panel__title {
    text-shadow: 0 0 12px rgba(255, 59, 92, 0.25);
}

.panel[data-accent="#FF3B5C"] .annotation__leader {
    background: linear-gradient(90deg, rgba(255, 59, 92, 0.6), rgba(255, 59, 92, 0));
}

.panel[data-accent="#FF3B5C"] .annotation__text {
    color: #FF3B5C;
}

/* --- Panel section accent overrides --- */
.panel[data-accent="#FF6B35"] .panel__title {
    text-shadow: 0 0 12px rgba(255, 107, 53, 0.25);
}

.panel[data-accent="#39FF85"] .panel__title {
    text-shadow: 0 0 12px rgba(57, 255, 133, 0.25);
}

.panel[data-accent="#FF6B35"] .annotation__leader {
    background: linear-gradient(90deg, rgba(255, 107, 53, 0.6), rgba(255, 107, 53, 0));
}

.panel[data-accent="#39FF85"] .annotation__leader {
    background: linear-gradient(90deg, rgba(57, 255, 133, 0.6), rgba(57, 255, 133, 0));
}

.panel[data-accent="#FF6B35"] .annotation__text {
    color: #FF6B35;
}

.panel[data-accent="#39FF85"] .annotation__text {
    color: #39FF85;
}

/* --- Zigzag Section Divider (between panels visually) --- */
.panel::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 88px;
    right: 88px;
    height: 1px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='8' viewBox='0 0 40 8'%3E%3Cpath d='M 0 4 L 10 1 L 20 5 L 30 2 L 40 4' fill='none' stroke='%235A6B7C' stroke-width='1' opacity='0.3'/%3E%3C/svg%3E");
    background-repeat: repeat-x;
    background-size: 40px 8px;
    background-position: center;
}

.panel:last-child::after {
    display: none;
}

/* --- Responsive --- */
@media (max-width: 1024px) {
    .panel {
        grid-template-columns: 1fr;
        padding: 96px 48px 72px 48px;
        gap: 40px 0;
    }

    .panel__illustration,
    .panel:nth-child(even) .panel__illustration {
        grid-column: 1 / -1;
        grid-row: auto;
        order: 0;
    }

    .panel__content,
    .panel:nth-child(even) .panel__content {
        grid-column: 1 / -1;
        grid-row: auto;
        order: 1;
        padding-right: 64px;
    }

    .hud-top-strip {
        right: 80px;
    }

    .hud-bottom-strip {
        right: 80px;
    }

    .hud-nav-rail {
        width: 48px;
    }
}

@media (max-width: 640px) {
    .panel {
        padding: 80px 32px 60px 32px;
    }

    .hud-border {
        top: 16px;
        left: 16px;
        right: 16px;
        bottom: 16px;
    }

    .hud-corner--tl { top: 6px; left: 6px; }
    .hud-corner--tr { top: 6px; right: 6px; }
    .hud-corner--bl { bottom: 6px; left: 6px; }
    .hud-corner--br { bottom: 6px; right: 6px; }

    .hud-top-strip {
        left: 32px;
        right: 60px;
    }

    .hud-bottom-strip {
        left: 32px;
        right: 60px;
    }

    .hud-nav-rail {
        width: 36px;
        gap: 12px;
        right: 16px;
    }

    .hud-nav-diamond {
        width: 16px;
        height: 16px;
    }

    .hud-nav-diamond svg {
        width: 16px;
        height: 16px;
    }

    .panel__content {
        padding-right: 36px;
    }

    .hud-top-strip__status {
        display: none;
    }

    .hand-drawn-svg {
        max-width: 320px;
    }
}

/* --- Faint grid lines in empty columns --- */
.panel::before {
    content: '';
    position: absolute;
    top: 96px;
    bottom: 72px;
    right: 88px;
    width: 1px;
    background: repeating-linear-gradient(
        to bottom,
        rgba(90, 107, 124, 0.05) 0px,
        rgba(90, 107, 124, 0.05) 6px,
        transparent 6px,
        transparent 12px
    );
}
