/* =============== RESET & ROOT =============== */

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --bg: #050711;
    --bg-panel: #0b1020;
    --bg-panel-alt: #0f172a;
    --accent: #4ade80;
    --accent-soft: rgba(74, 222, 128, 0.15);
    --accent-strong: #22c55e;
    --danger: #f97373;
    --text-main: #e5e7eb;
    --text-muted: #9ca3af;
    --border-subtle: #1f2937;
    --font-mono: "JetBrains Mono", "Fira Code", Consolas, monospace;
    --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --pp: #a065d5;
}

/* =============== GLOBAL BODY + PLANE SILHOUETTE =============== */

body {
    background: radial-gradient(circle at top, #111827 0, #020617 55%, #000 100%);
    color: var(--text-main);
    font-family: var(--font-sans);
    min-height: 100vh;
    display: flex;
    align-items: stretch;
    justify-content: center;
    padding: 16px;
    overflow-x: hidden;
}

/* Subtle plane silhouette behind entire page */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    background:
        radial-gradient(circle at center,
            rgba(255,255,255,0.03) 0%,
            transparent 70%
        ),
        url("data:image/svg+xml;utf8,\
        <svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 200'>\
          <path d='M100 10 L120 80 L190 90 L120 100 L100 190 L80 100 L10 90 L80 80 Z'\
                fill=\"white\" opacity=\"0.08\"/>\
        </svg>") no-repeat center center;
    background-size: 55%;
    filter: blur(2px) grayscale(100%) contrast(60%) brightness(40%);
    pointer-events: none;
    z-index: -1;
}

/* =============== MISSION CONTROL FRAME =============== */

.frame {
    width: 100%;
    max-width: 1200px;
    min-height: 90vh;
    border-radius: 18px;
    border: 1px solid #111827;
    background:
        radial-gradient(circle at 0 0, rgba(56, 189, 248, 0.12), transparent 55%),
        radial-gradient(circle at 100% 100%, rgba(74, 222, 128, 0.12), transparent 55%),
        linear-gradient(135deg, #020617, #020617 40%, #020617 100%);
    box-shadow:
        0 0 0 1px rgba(15, 23, 42, 0.9),
        0 24px 80px rgba(0, 0, 0, 0.9);
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    overflow: hidden;
    position: relative;
}

/* =============== SIDEBAR =============== */

.sidebar {
    background: radial-gradient(circle at top, #020617 0, #020617 40%, #020617 100%);
    border-right: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    padding: 16px 14px;
    gap: 16px;
}

/* Logo block */

.logo-block {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 10px;
    border: 1px solid rgba(148, 163, 184, 0.25);
    background: radial-gradient(circle at 0 0, rgba(148, 163, 184, 0.18), transparent 60%);
    position: relative;
    overflow: hidden;
}

.logo-orbit {
    width: 32px;
    height: 32px;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.6);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-orbit::before {
    content: "";
    position: absolute;
    width: 52px;
    height: 52px;
    border-radius: 999px;
    border: 1px dashed rgba(148, 163, 184, 0.35);
    opacity: 0.7;
}

.logo-dot {
    width: 9px;
    height: 9px;
    border-radius: 999px;
    background: var(--accent);
    box-shadow: 0 0 12px rgba(74, 222, 128, 0.9);
}

.logo-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.logo-title {
    font-size: 13px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #e5e7eb;
}

.logo-sub {
    font-size: 11px;
    color: var(--text-muted);
}

/* Nav block */

.nav-block {
    border-radius: 12px;
    border: 1px solid var(--border-subtle);
    background: radial-gradient(circle at top, rgba(15, 23, 42, 0.9), #020617);
    padding: 10px;
    display: flex;
    flex-direction: column;
    height: 190px;
    gap: 6px;
    overflow-y: scroll;
}

.nav-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.nav-button {
    width: 100%;
    border-radius: 9px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--text-muted);
    font-size: 13px;
    padding: 7px 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    transition: 0.18s ease;
    font-family: var(--font-mono);
}

.nav-button span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.nav-button small {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    opacity: 0.7;
}

.nav-button:hover {
    background: rgba(15, 23, 42, 0.9);
    border-color: rgba(148, 163, 184, 0.4);
    color: #e5e7eb;
}

.nav-button.active {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.18), rgba(15, 23, 42, 0.9));
    border-color: rgba(34, 197, 94, 0.7);
    color: #e5e7eb;
    box-shadow: 0 0 18px rgba(34, 197, 94, 0.35);
}

.nav-indicator {
    width: 7px;
    height: 7px;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.5);
}

.nav-button.active .nav-indicator {
    background: var(--accent);
    box-shadow: 0 0 10px rgba(74, 222, 128, 0.9);
}

/* Telemetry block */

.status-block {
    border-radius: 12px;
    border: 1px solid var(--border-subtle);
    background: radial-gradient(circle at top, rgba(15, 23, 42, 0.9), #020617);
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

.status-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
    color: var(--text-muted);
}

.status-pill {
    padding: 2px 8px;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.4);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.status-dot {
    width: 7px;
    height: 7px;
    border-radius: 999px;
    background: var(--accent);
    box-shadow: 0 0 10px rgba(74, 222, 128, 0.9);
}

.status-log {
    margin-top: 4px;
    padding: 8px;
    border-radius: 8px;
    background: #020617;
    border: 1px solid rgba(15, 23, 42, 0.9);
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-muted);
    max-height: 160px;
    overflow: hidden;
    position: relative;
}

.status-log-line {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    opacity: 0.85;
}

.status-log-line span {
    color: var(--accent-strong);
}

.status-log-fade {
    position: absolute;
    inset: auto 0 0 0;
    height: 40px;
    background: linear-gradient(to bottom, transparent, #020617);
    pointer-events: none;
}

.footer-block {
    font-size: 10px;
    color: var(--text-muted);
    opacity: 0.8;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 2px 0;
    border-top: 1px solid rgba(15, 23, 42, 0.9);
    margin-top: 4px;
}

.footer-block code {
    font-family: var(--font-mono);
    font-size: 10px;
    color: rgba(148, 163, 184, 0.9);
}

/* =============== MAIN AREA =============== */

.main {
    position: relative;
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    overflow: hidden;
}

.main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.main-title-block {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.main-eyebrow {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: var(--text-muted);
}

.main-title {
    font-size: 22px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #e5e7eb;
}

.main-subtitle {
    font-size: 12px;
    color: var(--text-muted);
    max-width: 420px;
}

.main-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
    font-size: 11px;
    color: var(--text-muted);
}

.main-meta-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.badge {
    padding: 3px 8px;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.5);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.badge-dot {
    width: 6px;
    height: 6px;
    border-radius: 999px;
    background: var(--accent);
    box-shadow: 0 0 10px rgba(74, 222, 128, 0.9);
}

/* Grid */

.main-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
    gap: 12px;
    flex: 1;
    min-height: 0;
}

.panel {
    border-radius: 14px;
    border: 1px solid var(--border-subtle);
    background: radial-gradient(circle at top, rgba(15, 23, 42, 0.9), #020617);
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    position: relative;
    overflow: hidden;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
    color: var(--text-muted);
}

.panel-title {
    text-transform: uppercase;
    letter-spacing: 0.16em;
    font-size: 11px;
}

.panel-controls {
    display: flex;
    align-items: center;
    gap: 6px;
}

.panel-dot {
    width: 7px;
    height: 7px;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.6);
}

.panel-dot.green {
    background: var(--accent);
    box-shadow: 0 0 10px rgba(74, 222, 128, 0.9);
}

.panel-body {
    font-size: 12px;
    color: var(--text-muted);
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1;
    min-height: 0;
}

/* =============== CREW MANIFEST =============== */

.crew-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
    gap: 10px;
}

.crew-main {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.crew-name {
    font-size: 16px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #e5e7eb;
}

.crew-role {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    color: var(--accent);
}

.crew-bio {
    font-size: 12px;
    color: var(--text-muted);
}

.crew-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 4px;
}

.tag {
    padding: 3px 8px;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.5);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    color: rgba(209, 213, 219, 0.9);
}

.crew-meta {
    border-radius: 10px;
    border: 1px solid rgba(15, 23, 42, 0.9);
    background: #020617;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 11px;
}

.crew-meta-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.crew-meta-label {
    text-transform: uppercase;
    letter-spacing: 0.16em;
    color: var(--text-muted);
    font-size: 10px;
}

.crew-meta-value {
    font-family: var(--font-mono);
    color: #e5e7eb;
}

/* =============== SYSTEMS STATUS (SKILLS) =============== */

.systems-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.system-card {
    border-radius: 9px;
    border: 1px solid rgba(15, 23, 42, 0.9);
    background: #020617;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 11px;
}

.system-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-muted);
}

.system-name {
    text-transform: uppercase;
    letter-spacing: 0.16em;
    font-size: 10px;
}

.system-bar {
    position: relative;
    height: 6px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.9);
    overflow: hidden;
}

.system-bar-fill {
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(90deg, rgba(34, 197, 94, 0.1), var(--accent));
    transform-origin: left;
    transform: scaleX(0);
    transition: transform 0.8s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.system-bar-fill.active {
    transform: scaleX(var(--level, 0.8));
}

.system-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--text-muted);
}

/* =============== PAYLOAD BAY (PROJECTS) =============== */

.payload-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 11px;
}

.payload-item {
    border-radius: 9px;
    border: 1px solid rgba(15, 23, 42, 0.9);
    background: #020617;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    cursor: pointer;
    transition: 0.18s ease;
}

.payload-item:hover {
    border-color: rgba(148, 163, 184, 0.6);
    background: radial-gradient(circle at top left, rgba(34, 197, 94, 0.12), #020617);
}

.payload-title {
    font-size: 12px;
    color: #e5e7eb;
}

.payload-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-muted);
    font-size: 10px;
}

.payload-tags {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.payload-tag {
    padding: 2px 6px;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.5);
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 0.16em;
}

/* =============== LAUNCH WINDOW (CONTACT) =============== */

.launch-panel {
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 11px;
}

.launch-row {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 6px;
}

.launch-row label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-muted);
}

.launch-row input,
.launch-row textarea {
    background: #020617;
    border-radius: 8px;
    border: 1px solid rgba(31, 41, 55, 0.9);
    padding: 6px 8px;
    color: #e5e7eb;
    font-size: 12px;
    font-family: var(--font-sans);
    outline: none;
}

.launch-row input:focus,
.launch-row textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 1px rgba(34, 197, 94, 0.4);
}

.launch-button {
    margin-top: 10px;
    padding: 7px 12px;
    border-radius: 999px;
    border: 1px solid rgba(34, 197, 94, 0.7);
    background: radial-gradient(circle at top, rgba(34, 197, 94, 0.18), #020617);
    color: #e5e7eb;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-family: var(--font-mono);
    transition: 0.18s ease;
}

.launch-button:hover {
    box-shadow: 0 0 20px rgba(34, 197, 94, 0.5);
    transform: translateY(-1px);
}

.launch-indicator {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: var(--accent);
    box-shadow: 0 0 10px rgba(74, 222, 128, 0.9);
}

.launch-log {
    margin-top: 4px;
    padding: 6px 8px;
    border-radius: 8px;
    background: #020617;
    border: 1px dashed rgba(148, 163, 184, 0.5);
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--text-muted);
    min-height: 40px;
}

/* =============== ORBITAL DECOR =============== */

.orbital-overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: 0.4;
    mix-blend-mode: screen;
}

.orbit-ring {
    position: absolute;
    border-radius: 999px;
    border: 1px dashed rgba(148, 163, 184, 0.25);
}

.orbit-ring.one {
    width: 420px;
    height: 420px;
    top: -120px;
    right: -80px;
}

.orbit-ring.two {
    width: 260px;
    height: 260px;
    bottom: -80px;
    left: 40%;
}

.orbit-dot {
    position: absolute;
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: var(--accent);
    box-shadow: 0 0 12px rgba(74, 222, 128, 0.9);
}

.orbit-dot.one {
    top: -4px;
    right: 50%;
}

.orbit-dot.two {
    bottom: -4px;
    left: 50%;
}

/* =============== CERTIFICATE WHEEL =============== */

.cert-container {
    position: relative;
    width: 70vw;
    height: 70vw;
    max-width: 600px;
    max-height: 600px;
    min-width: 300px;
    min-height: 300px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 auto;
}

.wheel {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
}

/* === CERTIFICATE WHEEL INSIDE MISSION-CONTROL PANEL === */

#panel-archive #certificates {
    width: 100%;
    height: 100%;
    padding: 0;
   
    overflow: hidden;
    position: relative;
}

#panel-archive .cert-container {
    width: 100%;
    height: 300px;        /* fits inside panel */
    max-height: 350px;
    min-height: 200px;
    z-index: 10 !important;
    top: 7%;
    position: relative;
}

#panel-archive .wheel {
    top: 50%;
    left: 50%;
    width: 360px;         /* fixed size for consistency */
    height: 360px;
    z-index: 10 !important;
    transform: translate(-50%, -50%);
}

#panel-archive .image-item {
    width: 32px !important;
    height: 32px !important;
}

#panel-archive .preview-box {
    width: 180px;
    height: 160px;
    top:56%;
    left: 50%;
    transform: translate(-50%, -50%);
}



.image-item {
    position: absolute;
    width: 6vw;
    height: 6vw;
    max-width: 35px;
    max-height: 35px;
    min-width: 20px;
    min-height: 20px;
    cursor: pointer;
    box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.4);
    transition: transform 0.25s ease, z-index 0.25s ease;
    border-radius: 6px;
    transform-origin: center;
}

.image-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: rotate(calc(-1 * var(--wheel-rotation, 0deg)));
}

.image-item:hover {
    transform: scale(1.6);
    z-index: 2000;
}

.preview-box {
    position: absolute;
    top: calc(50% + 44px);
    left: calc(50% - 4px);
    width: 40vw;
    height: 32vw;
    max-width: 330px;
    max-height: 300px;
    min-width: 200px;
    min-height: 160px;
    transform: translate(-50%, -50%);
    background: #1a1a1a;
    border-radius: 16px;
    box-shadow: 0 0 25px rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    z-index: 1000;
    border: 2px solid var(--pp);
}

.preview-box img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* =============== WORK EXPERIENCE 3D WALL =============== */

#workexpCarousel {
    width: 100%;
    height: 100%;
    position: absolute;
    transform-style: preserve-3d;
    transition: transform 0.8s ease;
}

.carousel-container {
    perspective: 2000px;
    width: 80%;
    height: 60vh;
    position: relative;
    margin: 0 auto;
    overflow: visible;
}

.carousel {
    width: 100%;
    height: 100%;
    position: absolute;
    transform-style: preserve-3d;
    transition: transform 0.8s ease;
}

.carousel-item {
    position: absolute;
    transform-style: preserve-3d;
    cursor: pointer;
    transition: transform 0.5s ease, opacity 0.4s ease, filter 0.4s ease;
    z-index: 5;
}

.carousel-item img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 12px;
}

.carousel-item.landscape {
    width: 260px;
    height: 170px;
    left: calc(50% - 130px);
    top: calc(50% - 85px);
}

.carousel-item.portrait {
    width: 170px;
    height: 260px;
    left: calc(50% - 85px);
    top: calc(50% - 130px);
}

.carousel-item.dimmed {
    opacity: 0.1;
    filter: blur(6px);
}

.carousel-item.active {
    opacity: 1;
    filter: none;
}

/* Spotlight */

#spotlight {
    position: fixed;
    width: 700px;
    height: 700px;
    background: radial-gradient(circle, rgba(227, 199, 199, 0.45), transparent 70%);
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
    z-index: 100;
}

/* Traced border */

#countdownRing {
    position: fixed;
    pointer-events: none;
    opacity: 0;
    z-index: 200;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

#countdownRing svg {
    width: 100%;
    height: 100%;
}

#countdownRing rect {
    fill: none;
    stroke: var(--pp);
    stroke-width: 6px;
    stroke-linecap: round;
}

/* =============== DNA SECTION =============== */

#dna-section {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 300px;
    overflow: hidden;
    background-color: #000;
    border-radius: 10px;
}

#dnaCanvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

/* Skill circles */

.skill-circle {
    position: absolute;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 16px;
    font-weight: 600;
    color: white;
    z-index: 2;
    pointer-events: none;
    text-align: center;
}

/* === DNA HELIX INSIDE MISSION-CONTROL PANEL === */

#panel-genetics #dna-section {
    height: 360px;
    width: 100%;
    overflow: hidden;
    position: relative;
    border-radius: 10px;
}

#panel-genetics #dnaCanvas {
    width: 100% !important;
    height: 100% !important;
}

#panel-genetics .skill-circle {
    transform: scale(0.7);
    transform-origin: center;
}

/* ================= FULLSCREEN ROCKET INTRO ================= */

 #rocketIntro {
    position: fixed;
    inset: 0;
    background: black;
    z-index: 999999;
    overflow: hidden;
    overflow-y: hidden;
}

/* Starfield */
#introStars {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

/* Countdown */
#introCountdown {
    position: absolute;
    top: 40px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 90px;
    font-weight: 900;
    color: white;
    text-shadow: 0 0 25px white;
    z-index: 20;
}

/* Rocket */
#introRocketWrapper {
    position: absolute;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    width: 180px;
    height: 340px;
    z-index: 10;
    display: flex;
    justify-content: center;
    align-items: center;

}

#introRocket {
    width: 150%;
    height: 100%;
    align-self:center;
    bottom: -50%;
    animation: introShake 0.15s infinite alternate ease-in-out;
}

@keyframes introShake {
    0% {
        transform: translateX(-3px);
    }

    100% {
        transform: translateX(3px);
    }
}

/* Ground smoke (wide, low, spreading) */
.smokeGround {
    position: absolute;
    bottom: 0;
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    filter: blur(12px);
    animation: groundSpread 4s linear forwards;
}

@keyframes groundSpread {
    0% {
        transform: translate(0, 0) scale(1);
        opacity: 0.9;
    }

    100% {
        transform: translate(var(--dx), var(--dy)) scale(6);
        opacity: 0;
    }
}

/* Triangular plume following rocket */
.plumeParticle {
    position: absolute;
    width: 30px;
    height: 30px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    filter: blur(10px);
    animation: plumeRise 2s linear forwards;
}

@keyframes plumeRise {
    0% {
        transform: translate(var(--px), 0) scale(1);
        opacity: 0.9;
    }

    100% {
        transform: translate(var(--px), -200px) scale(2.5);
        opacity: 0;
    }
}

/* Fire blast */
.fireBlast {
    position: absolute;
    bottom: -20px;
    left: 50%;
    width: 50px;
    height: 150px;
    transform: translateX(-50%);
    background: radial-gradient(circle, rgba(255, 200, 0, 1), rgba(255, 80, 0, 0.6), rgba(255, 0, 0, 0));
    filter: blur(8px);
    opacity: 0;
    animation: fireBlastAnim 5s ease-out forwards;
}

@keyframes fireBlastAnim {
    0% {
        opacity: 0;
        transform: translateX(-50%) scaleY(0.2);
    }

    40% {
        opacity: 1;
        transform: translateX(-50%) scaleY(1.6);
    }

    100% {
        opacity: 0;
        transform: translateX(-50%) scaleY(0.4);
    }
}

/* Liftoff */
.introLiftoff {
    animation: introLiftoff 4s ease-in forwards;
}

@keyframes introLiftoff {
    0% {
        transform: translateX(-50%) translateY(0);
    }

    100% {
        transform: translateX(-50%) translateY(-180vh);
    }
}

/* Fade out intro */
#rocketIntro.fadeOut {
    animation: introFadeOut 1.5s ease forwards;
}

@keyframes introFadeOut {
    to {
        opacity: 0;
        visibility: hidden;
    }
}

/* ============================================================
   PLANE DELIVERY CINEMATIC OVERLAY
   ============================================================ */

#planeDropOverlay {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    background: linear-gradient(to bottom, #87ceeb, #b0e0ff 40%, #87ceeb);
    display: none;
    overflow: hidden;
    pointer-events: none;
    z-index: 999999; /* ABOVE ALL UI */
    opacity: 0;
    transition: opacity 0.6s ease;
}

#planeDropOverlay.active {
    display: block;
    opacity: 1;
}

/* ---------------- SKY ELEMENTS ---------------- */

#clouds {
    position: absolute;
    top: 40px;
    width: 100%;
    height: 140px;
    pointer-events: none;
    z-index: 1000000;
    animation: floatClouds 4s ease-in-out infinite;
}

.cloud {
    position: absolute;
    width: 300px;
    height: 150px;
    background: url('./cloud.png') no-repeat center/contain;
    opacity: 0.8;
  }

  /* Static cloud positions */
  .cloud:nth-child(1) {
    left: 0%;
    top: 35px;
  }

  .cloud:nth-child(2) {
    left: 17%;
    top: -50px;
  }

  .cloud:nth-child(3) {
    left: 34%;
    top: -10px;
  }

  .cloud:nth-child(4) {
    left: 51%;
    top: 20px;
  }

  .cloud:nth-child(5) {
    left: 20%;
    top: 60px;
  }

  .cloud:nth-child(6) {
    left: 68%;
    top: 50px;
  }

  .cloud:nth-child(7) {
    left: 80%;
    top: -15px;
  }

  .cloud:nth-child(8) {
    left: 63%;
    top: -70px;
  }

  .cloud:nth-child(9) {
    left: -40px;
    top: -65px;
  }

  @keyframes floatClouds {

    0%,
    100% {
      transform: translateX(0);
    }

    33% {
      transform: translateX(1vw);
    }

    66% {
      transform: translateX(-1vw);
    }
  }
/* ---------------- GROUND + HOUSE ---------------- */

#grass {
    position: absolute;
    bottom: 0;
    width: 100%;
    height: 120px;
    background: linear-gradient(to top, #2e8b57, #98fb98);
    z-index: 1000000;
}

#house {
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 380px;
    height: 380px;
    transform: translateX(-50%);
    background: url('./house.png') no-repeat center/contain;
    z-index: 1000001;
}

/* ---------------- PLANE ---------------- */

#plane {
    position: absolute;
    top: 40px;
    right: -300px;
    width: 450px;
    height: 240px;
    background: url('./plane.png') no-repeat center/contain;
    z-index: 1000002;
    animation: flyPlane 15s linear forwards;
}

@keyframes flyPlane {
    0%   { right: -300px; transform: translateY(0); }
    20%  { transform: translateY(-10px); }
    40%  { transform: translateY(5px); }
    60%  { transform: translateY(-5px); }
    100% { right: 120vw; transform: translateY(0); }
}

/* ---------------- PARCEL ---------------- */

#parcel {
    position: fixed;
    width: 100px;
    height: 100px;
    background: url('./gift.png') no-repeat center/contain;
    top: 160px;
    right: 150px;
    opacity: 0;
    z-index: 1000003;
}

@keyframes dropParcel {
    0% {
      opacity: 1;
      top: 140px;
      left: 50%;
      right: auto;
      transform: translateX(0);
    }

    100% {
      opacity: 1;
      top: calc(100vh - 120px - 50px);
      left: 51%;
      right: auto;
      transform: translateX(-50%);
    }
}    

/* ---------------- CLOUD FLOAT ---------------- */

/* @keyframes floatClouds {
    0%, 100% { transform: translateX(0); }
    50%      { transform: translateX(-1.5vw); }
} */

/* ---------------- MISSION COMPLETE ---------------- */

#missionComplete {
    position: absolute;
    top: 50%;
    left: 50%;
    right: 50%;
    bottom: 50%;
    align-self: center;
    transform: translate(-50%, -50%) scale(0.7);
    font-size: 64px;
    font-weight: 900;
    color: white;
    text-shadow: 0 0 20px rgba(0,0,0,0.4);
    opacity: 0;
    z-index: 1000005;
    transition: opacity 0.8s ease, transform 0.8s ease;
}

#missionComplete.show {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

/* =============== BASIC RESPONSIVE SCAFFOLD (DETAIL IN PART 4) =============== */

@media (max-width: 900px) {
    .frame {
        grid-template-columns: 1fr;
    }
    .sidebar {
        flex-direction: row;
        align-items: stretch;
        overflow-x: auto;
        padding: 10px;
    }
    .status-block {
        display: none;
    }
}

@media (max-width: 700px) {
    .main-grid {
        grid-template-columns: 1fr;
    }
    .crew-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 520px) {
    body {
        padding: 8px;
    }
    .frame {
        border-radius: 12px;
    }
    .main-header {
        flex-direction: column;
        align-items: flex-start;
    }
    .main-meta {
        align-items: flex-start;
    }
}

#panel-telemetry {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.telemetry-body {
    display: flex;
    flex-direction: column;
    gap: 18px;
    font-size: 12px;
    color: var(--text-muted);
}

.telemetry-heading {
    font-size: 14px;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

.telemetry-block h4 {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-main);
    margin-bottom: 4px;
}

.telemetry-block p {
    font-size: 12px;
    color: var(--text-muted);
}

