/* ============================================
   PMT.MOE - Coastal Operations Network
   Graffiti x HUD | Bento-Box Layout
   ============================================ */

:root {
    --deep-ocean: #0d2b3e;
    --tidal-dark: #163a4a;
    --seafoam-signal: #4ecdc4;
    --coral-flare: #ff6b6b;
    --sunburst-tag: #ffe66d;
    --salt-spray: #c8e6ec;
    --storm-gray: #5a7d8a;
    --foam-white: #e8f4f8;

    --hud-glow-duration: 2s;
    --reticle-spin: 8s;
    --sweep-duration: 4s;
    --bracket-pulse: 2s;
    --magnetic-spring: 0.15s;
    --stagger-base: 60ms;
    --scan-line-sweep: 300ms;

    --ease-mechanical: cubic-bezier(0.25, 0.46, 0.45, 0.94);
    --ease-organic: cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

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

html {
    scroll-behavior: smooth;
}

body {
    background: linear-gradient(135deg, #0d2b3e, #163a4a, #1a4a5c);
    color: var(--salt-spray);
    font-family: 'Space Mono', monospace;
    font-size: clamp(0.9rem, 1.2vw, 1.05rem);
    line-height: 1.75;
    letter-spacing: 0.01em;
    overflow-x: hidden;
    min-height: 100vh;
}

/* ============================================
   Boot Sequence
   ============================================ */

#boot-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #000000;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

#boot-line {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 80vw;
    height: 1px;
    background: var(--seafoam-signal);
    transform: translate(-50%, -50%) scaleX(0);
    transform-origin: center;
    transition: none;
}

#boot-reticle {
    position: absolute;
    opacity: 0;
}

#boot-reticle svg {
    animation: none;
}

.boot-corner {
    position: absolute;
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.65rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--seafoam-signal);
    opacity: 0;
    white-space: nowrap;
}

#boot-corner-tl { top: 20px; left: 20px; }
#boot-corner-tr { top: 20px; right: 20px; text-align: right; }
#boot-corner-bl { bottom: 20px; left: 20px; }
#boot-corner-br { bottom: 20px; right: 20px; text-align: right; }

#boot-title {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    opacity: 0;
}

.boot-pmt {
    font-family: 'Bungee', cursive;
    font-size: clamp(5rem, 15vw, 12rem);
    color: var(--coral-flare);
    text-shadow: 0 0 30px rgba(255, 107, 107, 0.3), 0 0 60px rgba(255, 107, 107, 0.1);
    clip-path: inset(0 100% 0 0);
}

.boot-moe {
    font-family: 'Bungee', cursive;
    font-size: clamp(2.5rem, 7.5vw, 6rem);
    color: var(--sunburst-tag);
    text-shadow: 0 0 30px rgba(255, 230, 109, 0.3), 0 0 60px rgba(255, 230, 109, 0.1);
    transform: rotate(-1.5deg);
    display: inline-block;
    clip-path: inset(0 100% 0 0);
}

.boot-pmt.reveal,
.boot-moe.reveal {
    clip-path: inset(0 0% 0 0);
    transition: clip-path 0.6s var(--ease-organic);
}

/* ============================================
   Persistent HUD Corners
   ============================================ */

.hud-corner {
    position: fixed;
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.7rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--seafoam-signal);
    opacity: 0;
    z-index: 100;
    pointer-events: none;
    white-space: nowrap;
}

#hud-corner-tl { top: 20px; left: 20px; }
#hud-corner-tr { top: 20px; right: 20px; text-align: right; }
#hud-corner-bl { bottom: 20px; left: 20px; }
#hud-corner-br { bottom: 20px; right: 20px; text-align: right; }

/* ============================================
   Scan Line Effect
   ============================================ */

#scan-line {
    position: fixed;
    top: -10px;
    left: 0;
    width: 100%;
    height: 10px;
    background: rgba(78, 205, 196, 0.08);
    z-index: 9000;
    pointer-events: none;
    opacity: 0;
}

#scan-line.active {
    opacity: 1;
    animation: scanSweep var(--scan-line-sweep) linear forwards;
}

@keyframes scanSweep {
    0% { top: -10px; }
    100% { top: 100vh; }
}

/* ============================================
   Scroll Container
   ============================================ */

#scroll-container {
    height: 100vh;
    overflow-y: auto;
    scroll-snap-type: y mandatory;
    opacity: 0;
}

#scroll-container.visible {
    opacity: 1;
    transition: opacity 0.5s ease;
}

/* ============================================
   Bento Panel
   ============================================ */

.bento-panel {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    grid-template-rows: repeat(4, 1fr);
    gap: 8px;
    height: 90vh;
    padding: 8px;
    scroll-snap-align: start;
    position: relative;
}

/* ============================================
   Bento Cells - General
   ============================================ */

.bento-cell {
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(78, 205, 196, 0.15);
    border-radius: 4px;
    transition: border-color var(--magnetic-spring) ease, transform var(--magnetic-spring) ease;
    opacity: 0;
    transform: translateY(10px);
}

.bento-cell.visible {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.4s ease, transform 0.4s ease, border-color var(--magnetic-spring) ease;
}

.bento-cell.flash-border {
    border-color: var(--seafoam-signal);
}

/* ============================================
   Anchor Cell
   ============================================ */

.anchor-cell {
    background: var(--deep-ocean);
    display: flex;
    align-items: center;
    justify-content: center;
}

.reticle-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0.15;
    pointer-events: none;
}

.reticle-overlay.small {
    width: 60%;
    height: 60%;
}

.reticle-overlay.small svg {
    width: 100%;
    height: 100%;
}

.rotating-reticle {
    animation: reticleSpin var(--reticle-spin) linear infinite;
}

@keyframes reticleSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.anchor-content {
    position: relative;
    z-index: 2;
    padding: 2rem;
}

/* ============================================
   Typography
   ============================================ */

.hero-heading {
    font-family: 'Share Tech Mono', monospace;
    font-weight: 400;
    font-size: clamp(2.2rem, 6vw, 5rem);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--foam-white);
    text-shadow: 0 0 8px rgba(78, 205, 196, 0.4);
    line-height: 1.1;
    margin-bottom: 1rem;
}

.section-heading {
    font-family: 'Share Tech Mono', monospace;
    font-weight: 400;
    font-size: clamp(1.4rem, 3vw, 2.4rem);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--foam-white);
    text-shadow: 0 0 8px rgba(78, 205, 196, 0.4);
    margin-bottom: 0.75rem;
    position: relative;
}

.section-heading::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 40px;
    height: 1px;
    background: var(--coral-flare);
}

.hero-sub {
    font-family: 'Space Mono', monospace;
    font-weight: 400;
    font-size: clamp(0.85rem, 1.1vw, 1rem);
    color: var(--salt-spray);
    line-height: 1.75;
    max-width: 500px;
}

/* Graffiti Titles */
.graffiti-title {
    font-family: 'Bungee', cursive;
    font-weight: 400;
    font-size: clamp(2rem, 5vw, 4.5rem);
    letter-spacing: 0.02em;
    color: var(--coral-flare);
    text-shadow: 0 0 30px rgba(255, 107, 107, 0.3), 0 0 60px rgba(255, 107, 107, 0.1);
    transform: rotate(-1deg);
    display: inline-block;
    position: relative;
}

.graffiti-title::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 10%;
    width: 1px;
    height: 0;
    background: var(--coral-flare);
}

.graffiti-title.drip::after {
    height: var(--drip-height, 30px);
    transition: height 0.6s ease;
}

.graffiti-alt {
    color: var(--sunburst-tag);
    text-shadow: 0 0 30px rgba(255, 230, 109, 0.3), 0 0 60px rgba(255, 230, 109, 0.1);
    transform: rotate(1.5deg);
}

.graffiti-alt::after {
    background: var(--sunburst-tag);
}

/* ============================================
   Tag Cell
   ============================================ */

.tag-cell {
    background: var(--tidal-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    background-image: radial-gradient(circle at 20% 30%, rgba(78, 205, 196, 0.04) 1px, transparent 1px),
                      radial-gradient(circle at 70% 60%, rgba(78, 205, 196, 0.04) 1px, transparent 1px),
                      radial-gradient(circle at 45% 80%, rgba(78, 205, 196, 0.04) 1px, transparent 1px);
}

.tag-text {
    clip-path: inset(0 100% 0 0);
    transition: clip-path 0.4s var(--ease-organic);
}

.tag-text.revealed {
    clip-path: inset(0 0% 0 0);
}

/* ============================================
   Radar Cell
   ============================================ */

.radar-cell {
    background: var(--deep-ocean);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.radar-canvas {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
}

/* ============================================
   Data Strip
   ============================================ */

.data-strip {
    background: rgba(13, 43, 62, 0.9);
    display: flex;
    align-items: center;
    overflow: hidden;
    border-left: none;
    border-right: none;
}

.telemetry-scroll {
    white-space: nowrap;
    display: flex;
    align-items: center;
    width: 100%;
    overflow: hidden;
}

.telemetry-text {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.7rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--seafoam-signal);
    opacity: 0.7;
    display: inline-block;
    animation: scrollTelemetry 20s linear infinite;
    padding-right: 50px;
}

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

.data-strip .telemetry-scroll.vertical {
    flex-direction: column;
    white-space: normal;
    padding: 0.5rem;
}

.data-strip .telemetry-scroll.vertical .telemetry-text {
    animation: none;
    font-size: 0.6rem;
    white-space: normal;
    line-height: 1.6;
}

/* ============================================
   Photo Cell
   ============================================ */

.photo-cell {
    position: relative;
    overflow: hidden;
}

.photo-placeholder {
    width: 100%;
    height: 100%;
    position: relative;
    filter: saturate(0.7) brightness(0.85) contrast(1.1);
}

.coastal-photo {
    background: linear-gradient(135deg, #0a3d5c 0%, #0d2b3e 30%, #163a4a 60%, #1a4a5c 100%);
    background-image:
        radial-gradient(ellipse at 30% 70%, rgba(78, 205, 196, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 70% 30%, rgba(22, 58, 74, 0.8) 0%, transparent 60%),
        linear-gradient(180deg, #163a4a 0%, #0d2b3e 40%, #0a2030 70%, #163a4a 100%);
}

.coastal-photo-2 {
    background: linear-gradient(180deg, #1a4a5c 0%, #0d2b3e 50%, #163a4a 100%);
    background-image:
        radial-gradient(ellipse at 50% 80%, rgba(78, 205, 196, 0.1) 0%, transparent 40%),
        radial-gradient(ellipse at 20% 20%, rgba(22, 58, 74, 0.6) 0%, transparent 50%),
        linear-gradient(135deg, #0d2b3e 0%, #1a4a5c 50%, #0d2b3e 100%);
}

.urban-photo {
    background: linear-gradient(180deg, #0d2b3e 0%, #163a4a 100%);
    background-image:
        repeating-linear-gradient(90deg, rgba(78, 205, 196, 0.03) 0px, rgba(78, 205, 196, 0.03) 1px, transparent 1px, transparent 40px),
        repeating-linear-gradient(0deg, rgba(78, 205, 196, 0.02) 0px, rgba(78, 205, 196, 0.02) 1px, transparent 1px, transparent 60px),
        radial-gradient(ellipse at 40% 50%, rgba(255, 107, 107, 0.05) 0%, transparent 50%),
        linear-gradient(135deg, #163a4a 0%, #0d2b3e 50%, #1a4a5c 100%);
}

.photo-placeholder::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(13, 43, 62, 0.2);
    mix-blend-mode: overlay;
}

/* Scan Lines on photos */
.scan-lines {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        0deg,
        transparent 50%,
        rgba(78, 205, 196, 0.03) 50%
    );
    background-size: 100% 4px;
    pointer-events: none;
    z-index: 2;
}

/* HUD Brackets */
.hud-bracket {
    position: absolute;
    width: 20px;
    height: 20px;
    border-color: var(--coral-flare);
    border-style: solid;
    border-width: 0;
    z-index: 3;
    opacity: 0.5;
    animation: bracketPulse var(--bracket-pulse) ease-in-out infinite;
    transition: transform 0.4s var(--ease-mechanical);
}

.hud-bracket.tl {
    top: 10px;
    left: 10px;
    border-top-width: 2px;
    border-left-width: 2px;
}

.hud-bracket.tr {
    top: 10px;
    right: 10px;
    border-top-width: 2px;
    border-right-width: 2px;
}

.hud-bracket.bl {
    bottom: 10px;
    left: 10px;
    border-bottom-width: 2px;
    border-left-width: 2px;
}

.hud-bracket.br {
    bottom: 10px;
    right: 10px;
    border-bottom-width: 2px;
    border-right-width: 2px;
}

.hud-bracket.locked {
    transform: translate(0, 0);
}

.hud-bracket.tl.spread { transform: translate(-10px, -10px); }
.hud-bracket.tr.spread { transform: translate(10px, -10px); }
.hud-bracket.bl.spread { transform: translate(-10px, 10px); }
.hud-bracket.br.spread { transform: translate(10px, 10px); }

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

/* Crosshair */
.crosshair {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 30px;
    height: 30px;
    transform: translate(-50%, -50%);
    z-index: 3;
}

.crosshair::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 1px;
    background: var(--coral-flare);
    opacity: 0.5;
}

.crosshair::after {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    width: 1px;
    height: 100%;
    background: var(--coral-flare);
    opacity: 0.5;
}

/* Coordinate Stamps */
.coord-stamp {
    position: absolute;
    bottom: 8px;
    right: 8px;
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.65rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--seafoam-signal);
    opacity: 0.5;
    z-index: 4;
}

/* ============================================
   Info Cell
   ============================================ */

.info-cell {
    background: var(--tidal-dark);
    padding: 1.5rem;
    border-left: 3px solid var(--seafoam-signal);
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.info-arrow {
    position: absolute;
    top: 12px;
    left: -3px;
    width: 0;
    height: 0;
    border-left: 6px solid var(--seafoam-signal);
    border-top: 5px solid transparent;
    border-bottom: 5px solid transparent;
}

.info-cell p {
    font-size: clamp(0.8rem, 1vw, 0.95rem);
    color: var(--salt-spray);
    line-height: 1.75;
}

/* ============================================
   Range Finder
   ============================================ */

.range-finder {
    margin: 0.75rem 0;
    width: 100%;
    max-width: 250px;
}

.range-bar {
    width: 100%;
    height: 4px;
    background: rgba(78, 205, 196, 0.15);
    position: relative;
    border-left: 2px solid var(--seafoam-signal);
    border-right: 2px solid var(--seafoam-signal);
}

.range-indicator {
    position: absolute;
    top: -3px;
    left: 0;
    width: 10px;
    height: 10px;
    background: var(--seafoam-signal);
    animation: rangeSlide 3s ease-in-out infinite;
}

@keyframes rangeSlide {
    0%, 100% { left: 0; }
    50% { left: calc(100% - 10px); }
}

/* ============================================
   Sticker Badges
   ============================================ */

.sticker-badge {
    position: absolute;
    bottom: 12px;
    right: 12px;
    background: var(--sunburst-tag);
    color: #0d2b3e;
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: 4px 10px;
    border-radius: 4px;
    line-height: 1;
}

/* ============================================
   Radial Navigation
   ============================================ */

#radial-nav {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 1000;
}

#nav-pip {
    width: 50px;
    height: 50px;
    cursor: pointer;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

#nav-section-num {
    position: absolute;
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.6rem;
    color: var(--seafoam-signal);
    letter-spacing: 0.1em;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
}

#nav-pip svg circle {
    transition: stroke 0.2s ease;
}

#nav-pip:hover svg circle:first-child {
    stroke: var(--foam-white);
}

#nav-menu {
    position: absolute;
    bottom: 55px;
    right: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

#nav-menu.hidden {
    opacity: 0;
    pointer-events: none;
    transform: translateY(10px);
}

.nav-item {
    background: rgba(13, 43, 62, 0.9);
    border: 1px solid rgba(78, 205, 196, 0.3);
    color: var(--seafoam-signal);
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.65rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    padding: 6px 14px;
    cursor: pointer;
    border-radius: 2px;
    transition: background 0.2s ease, transform var(--magnetic-spring) ease, border-color 0.2s ease;
    white-space: nowrap;
}

.nav-item:hover {
    background: rgba(78, 205, 196, 0.15);
    border-color: var(--seafoam-signal);
    color: var(--foam-white);
}

/* ============================================
   Drip Lines on headings
   ============================================ */

.hero-heading::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 15%;
    width: 1.5px;
    height: 0;
    background: var(--coral-flare);
    opacity: 0.6;
}

.hero-heading.drip::after {
    height: 40px;
    transition: height 0.8s ease;
}

.section-heading.drip-yellow::after {
    background: var(--sunburst-tag);
    height: 25px;
    transition: height 0.6s ease;
}

/* ============================================
   Spray-Dot Texture
   ============================================ */

.anchor-cell::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        radial-gradient(circle at 15% 25%, rgba(78, 205, 196, 0.04) 1px, transparent 1px),
        radial-gradient(circle at 45% 15%, rgba(78, 205, 196, 0.04) 1px, transparent 1px),
        radial-gradient(circle at 75% 55%, rgba(78, 205, 196, 0.04) 1px, transparent 1px),
        radial-gradient(circle at 25% 75%, rgba(78, 205, 196, 0.04) 1px, transparent 1px),
        radial-gradient(circle at 85% 85%, rgba(78, 205, 196, 0.04) 1px, transparent 1px),
        radial-gradient(circle at 55% 45%, rgba(78, 205, 196, 0.04) 1px, transparent 1px),
        radial-gradient(circle at 35% 90%, rgba(78, 205, 196, 0.04) 1px, transparent 1px),
        radial-gradient(circle at 90% 20%, rgba(78, 205, 196, 0.04) 1px, transparent 1px);
    pointer-events: none;
    z-index: 1;
}

/* ============================================
   Responsive
   ============================================ */

@media (max-width: 768px) {
    .bento-panel {
        grid-template-columns: repeat(6, 1fr);
        grid-template-rows: auto;
        height: auto;
        min-height: 90vh;
    }

    .bento-cell {
        grid-column: 1 / -1 !important;
        grid-row: auto !important;
        min-height: 120px;
    }

    .anchor-cell {
        min-height: 250px;
    }

    .photo-cell {
        min-height: 200px;
    }

    .radar-cell {
        min-height: 180px;
    }

    .data-strip {
        min-height: 50px;
    }

    .hero-heading {
        font-size: clamp(1.8rem, 8vw, 3rem);
    }

    .hud-corner {
        font-size: 0.5rem;
    }

    #radial-nav {
        bottom: 15px;
        right: 15px;
    }
}
