/* === RESET & BASE === */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --abyssal-black: #0a1628;
    --trench-navy: #0f2133;
    --phosphor-teal: #1b6b7a;
    --bio-teal: #00e5c3;
    --pale-teal: #7ecde6;
    --frost-white: #e0e8ec;
    --muted-ice: #c8d6dc;
    --deep-aquamarine: #4db8a4;
    --signal-green: #39ff94;
    --deep-coral: #e85d75;
}

::selection {
    background: rgba(0, 229, 195, 0.25);
    color: #e0e8ec;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 4px;
}
::-webkit-scrollbar-track {
    background: #0a1628;
}
::-webkit-scrollbar-thumb {
    background: #1b6b7a;
    border-radius: 2px;
}

html {
    scroll-behavior: smooth;
    scrollbar-color: #1b6b7a #0a1628;
    scrollbar-width: thin;
}

body {
    background: #0a1628;
    color: #c8d6dc;
    font-family: 'IBM Plex Sans', sans-serif;
    font-weight: 400;
    font-size: clamp(0.95rem, 1.2vw, 1.1rem);
    line-height: 1.75;
    letter-spacing: 0.01em;
    overflow-x: hidden;
}

/* === PARTICLES (Marine Snow) === */
.particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.particle {
    position: absolute;
    width: 2px;
    height: 2px;
    border-radius: 50%;
    background: #1b6b7a;
    animation: drift-up linear infinite;
}

@keyframes drift-up {
    from { transform: translateY(100vh); }
    to { transform: translateY(-20px); }
}

/* === NAV DOTS === */
.nav-dots {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 100;
}

.nav-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 1px solid #1b6b7a;
    background: transparent;
    cursor: pointer;
    transition: all 0.4s ease;
    padding: 0;
}

.nav-dot.active {
    background: #00e5c3;
    border-color: #00e5c3;
    box-shadow: 0 0 12px rgba(0, 229, 195, 0.5);
}

/* === THE BRIDGE === */
.bridge {
    position: relative;
    height: 100vh;
    display: grid;
    grid-template-columns: 35% 40% 25%;
    z-index: 1;
    overflow: hidden;
}

.bridge-left {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 3rem;
}

.logotype {
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    font-size: clamp(4rem, 10vw, 8rem);
    letter-spacing: 0.25em;
    text-transform: uppercase;
    color: #00e5c3;
    text-shadow: 0 0 30px rgba(0, 229, 195, 0.4);
    line-height: 1;
}

.logo-letter {
    display: inline-block;
    opacity: 0;
    transform: scale(0.8);
}

.logo-letter.revealed {
    opacity: 1;
    transform: scale(1);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

@keyframes glow-pulse {
    0%, 100% { text-shadow: 0 0 30px rgba(0, 229, 195, 0.3); }
    50% { text-shadow: 0 0 40px rgba(0, 229, 195, 0.5); }
}

.logotype.glow-active {
    animation: glow-pulse 3s ease-in-out infinite;
}

.bridge-tagline {
    font-family: 'Rajdhani', sans-serif;
    font-weight: 600;
    font-size: 1.1rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #7ecde6;
    margin-top: 1.5rem;
    opacity: 0;
    transition: opacity 1s ease 2.5s;
}

.bridge-tagline.visible {
    opacity: 1;
}

.bridge-center {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.constellation-map {
    width: 100%;
    height: 80%;
}

.bridge-right {
    display: flex;
    align-items: center;
    padding: 3rem 2rem;
}

.ships-log {
    border-left: 1px solid #1b6b7a;
    padding-left: 1.5rem;
}

.log-label {
    font-family: 'Space Mono', monospace;
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #4db8a4;
    opacity: 0.8;
    display: block;
    margin-bottom: 1rem;
}

.log-text {
    font-family: 'Space Mono', monospace;
    font-size: 0.9rem;
    color: #c8d6dc;
    line-height: 1.8;
    min-height: 6em;
}

.log-text .cursor {
    display: inline-block;
    width: 8px;
    height: 1.1em;
    background: #00e5c3;
    vertical-align: text-bottom;
    animation: blink-cursor 0.7s step-end infinite;
}

@keyframes blink-cursor {
    50% { opacity: 0; }
}

.log-coordinates {
    margin-top: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.coord {
    font-family: 'Space Mono', monospace;
    font-size: 0.75rem;
    color: #4db8a4;
    opacity: 0.6;
    letter-spacing: 0.05em;
}

/* === SONAR TRANSITIONS === */
.sonar-transition {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 3rem 0;
    position: relative;
    z-index: 1;
}

.sonar-rings {
    width: 200px;
    height: 200px;
}

.sonar-ring {
    fill: none;
    stroke: #1b6b7a;
    stroke-width: 0.5;
    opacity: 0;
    transform-origin: center;
}

.sonar-ring.animate {
    animation: sonar-expand 1s ease-out forwards;
}

@keyframes sonar-expand {
    from { opacity: 0; transform: scale(0); }
    to { opacity: 0.3; transform: scale(1); }
}

/* === SECTION HEADERS === */
.section-header {
    font-family: 'Rajdhani', sans-serif;
    font-weight: 600;
    font-size: clamp(1.8rem, 4vw, 3.5rem);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #7ecde6;
    padding: 2rem 3rem 1rem;
    position: relative;
    z-index: 1;
}

/* === THE OBSERVATORY === */
.observatory {
    position: relative;
    z-index: 1;
    padding: 2rem 3rem 4rem;
}

.modular-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1rem;
}

.mod-block {
    background: #0f2133;
    border: 2px solid #1b6b7a;
    padding: 2rem;
    position: relative;
    overflow: hidden;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s cubic-bezier(0.22, 1, 0.36, 1),
                transform 0.6s cubic-bezier(0.22, 1, 0.36, 1),
                border-color 0.3s ease,
                box-shadow 0.3s ease;
    /* Hull plating texture */
    background-image: radial-gradient(circle, rgba(126, 205, 230, 0.04) 1px, transparent 1px);
    background-size: 4px 4px;
}

.mod-block.visible {
    opacity: 1;
    transform: translateY(0);
}

.mod-block:hover {
    transform: translateY(-6px);
    border-color: #00e5c3;
    box-shadow: 0 8px 32px rgba(0, 229, 195, 0.12);
}

.mod-block.visible:hover {
    transform: translateY(-6px);
}

.mod-large {
    grid-column: span 3;
}

.mod-medium {
    grid-column: span 2;
}

.mod-compact {
    grid-column: span 1;
}

.block-icon {
    margin-bottom: 1.5rem;
}

.project-icon {
    width: 60px;
    height: 60px;
}

.block-title {
    font-family: 'Rajdhani', sans-serif;
    font-weight: 600;
    font-size: 1.5rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #e0e8ec;
    margin-bottom: 0.75rem;
}

.block-desc {
    color: #c8d6dc;
    line-height: 1.75;
    margin-bottom: 1rem;
}

.block-meta {
    font-family: 'Space Mono', monospace;
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #4db8a4;
    opacity: 0.8;
    display: block;
    margin-bottom: 1rem;
}

.block-status {
    font-family: 'Space Mono', monospace;
    font-size: 0.8rem;
    color: #4db8a4;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.status-dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #1b6b7a;
    flex-shrink: 0;
}

.status-dot.active {
    background: #39ff94;
    box-shadow: 0 0 8px rgba(57, 255, 148, 0.5);
    animation: status-flicker 3s ease-in-out infinite;
}

@keyframes status-flicker {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.crew-indicators {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    margin-top: 1rem;
}

.crew-member {
    font-family: 'Space Mono', monospace;
    font-size: 0.8rem;
    color: #c8d6dc;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* === THE ABYSS === */
.abyss {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
}

.abyss-content {
    text-align: center;
}

.abyss-text {
    font-family: 'Space Mono', monospace;
    font-size: 1.2rem;
    color: #4db8a4;
    letter-spacing: 0.05em;
    min-height: 2em;
}

.abyss-text .cursor {
    display: inline-block;
    width: 8px;
    height: 1.1em;
    background: #4db8a4;
    vertical-align: text-bottom;
    animation: blink-cursor 0.7s step-end infinite;
}

.abyss-line {
    height: 1px;
    background: #1b6b7a;
    margin: 2rem auto 0;
    width: 0;
    transition: width 1.5s ease;
}

.abyss-line.expand {
    width: 60vw;
}

/* === SIGNAL ROOM === */
.signal-room {
    position: relative;
    z-index: 1;
    padding: 2rem 3rem 4rem;
}

.signal-grid {
    grid-template-columns: repeat(4, 1fr);
}

.signal-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-field {
    display: flex;
    flex-direction: column;
}

.field-label {
    font-family: 'Space Mono', monospace;
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #4db8a4;
    margin-bottom: 0.5rem;
}

.field-input {
    background: transparent;
    border: none;
    border-bottom: 1px solid #1b6b7a;
    color: #e0e8ec;
    font-family: 'IBM Plex Sans', sans-serif;
    font-size: 1rem;
    padding: 0.75rem 0;
    outline: none;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.field-input:focus {
    border-color: #00e5c3;
    box-shadow: 0 2px 12px rgba(0, 229, 195, 0.15);
}

.field-input::placeholder {
    color: #1b6b7a;
}

.field-textarea {
    resize: vertical;
    min-height: 80px;
    border-bottom: none;
    border: 1px solid #1b6b7a;
    padding: 0.75rem;
}

.field-textarea:focus {
    border-color: #00e5c3;
}

.submit-block {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    cursor: pointer;
    font-family: 'Rajdhani', sans-serif;
    font-weight: 600;
    font-size: 1rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #e0e8ec;
    padding: 1rem 2rem;
    opacity: 1;
    transform: none;
}

.submit-block:hover {
    background: rgba(0, 229, 195, 0.08);
}

.status-panel {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.status-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: 'Space Mono', monospace;
    font-size: 0.8rem;
}

.status-label {
    color: #c8d6dc;
    flex: 1;
}

.status-value {
    color: #4db8a4;
}

/* === FOOTER === */
.footer {
    position: relative;
    z-index: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2rem 3rem;
    border-top: 1px solid #1b6b7a;
}

.footer-text {
    font-family: 'IBM Plex Sans', sans-serif;
    font-size: 0.85rem;
    color: #4db8a4;
    opacity: 0.6;
}

.footer-coords {
    font-family: 'Space Mono', monospace;
    font-size: 0.7rem;
    color: #39ff94;
    letter-spacing: 0.08em;
    opacity: 0.5;
}

/* === CONSTELLATION STARS === */
.constellation-star {
    fill: #00e5c3;
    transform-origin: center;
}

@keyframes bioluminesce {
    0%, 100% { opacity: var(--base-opacity); }
    50% { opacity: calc(var(--base-opacity) + 0.2); }
}

/* === RESPONSIVE === */
@media (max-width: 1024px) {
    .bridge {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr auto;
        height: auto;
        min-height: 100vh;
    }
    .bridge-left { padding: 3rem 2rem 1rem; text-align: center; }
    .bridge-center { min-height: 300px; }
    .bridge-right { padding: 1rem 2rem 3rem; }
    .ships-log { border-left: none; border-top: 1px solid #1b6b7a; padding-left: 0; padding-top: 1.5rem; }
    .modular-grid { grid-template-columns: repeat(2, 1fr); }
    .mod-large { grid-column: span 2; }
    .mod-medium { grid-column: span 2; }
    .mod-compact { grid-column: span 1; }
    .signal-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
    .modular-grid { grid-template-columns: 1fr; }
    .mod-large, .mod-medium, .mod-compact { grid-column: span 1; }
    .signal-grid { grid-template-columns: 1fr; }
    .observatory, .signal-room { padding: 1rem 1.5rem 3rem; }
    .section-header { padding: 1.5rem 1.5rem 0.75rem; }
    .footer { flex-direction: column; gap: 0.5rem; text-align: center; }
}

/* === REDUCED MOTION === */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
    .particle { display: none; }
    .logo-letter { opacity: 1; transform: scale(1); }
    .mod-block { opacity: 1; transform: none; }
}
