:root {
    --primary: #00d4ff;
    --bg-dark: #000000;
    --text-light: #f4f4f4;
    --glass: rgba(255, 255, 255, 0.1);
}

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

html, body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-light);
    overflow-x: hidden;
    line-height: 1.6;
    user-select: none;
    -webkit-user-select: none;
    -ms-user-select: none;
    -webkit-touch-callout: none;
}

img {
    max-width: 100%;
    height: auto;
    user-select: none;
    -webkit-user-drag: none;
    -webkit-touch-callout: none;
    pointer-events: none;
}

html.is-loading,
body.is-loading {
    overflow: hidden;
    height: 100%;
}

.site-loader {
    position: fixed;
    inset: 0;
    background: #000000;
    display: grid;
    place-items: center;
    z-index: 1200;
    opacity: 1;
    transition: opacity 0.6s ease-in-out;
    pointer-events: all;
    user-select: none;
}

.site-loader.is-fading {
    opacity: 0;
    pointer-events: none;
}

.loader-stack {
    position: relative;
    width: 100%;
    height: 100%;
}

.loader-text {
    position: absolute;
    top: 50%;
    left: 50%;
    display: inline-flex;
    gap: 0.2rem;
    font-size: clamp(0.6rem, 2.4vw, 1.4rem);
    letter-spacing: 0.5rem;
    text-transform: uppercase;
    color: #ffffff;
    font-weight: 700;
    transform: translate(-50%, -50%);
}

.loader-letter {
    display: inline-block;
    animation: loader-bounce 4s ease-in-out infinite;
    animation-delay: calc(var(--i) * 0.5s);
}

/* Video Background */
.video-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

#bg-media {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center bottom;
    display: block;
}

.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(circle, rgba(0,0,0,0.04) 0%, rgba(0,0,0,0.2) 100%),
        linear-gradient(to bottom, rgba(0,0,0,0) 82%, rgba(0,0,0,0.45) 94%, rgba(0,0,0,0.8) 100%);
    z-index: 1;
}

/* Navigation */
nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2rem 10%;
    position: fixed;
    width: 100%;
    z-index: 100;
}

.logo {
    font-weight: 700;
    font-size: 1.6rem;
    letter-spacing: 6px;
    text-transform: uppercase;
    position: relative;
}

.logo span {
    color: var(--primary);
    font-weight: 300;
}

nav ul {
    display: flex;
    list-style: none;
    align-items: center;
}

nav ul li {
    margin-left: 2rem;
}

nav a {
    text-decoration: none;
    color: white;
    font-size: 0.9rem;
    text-transform: uppercase;
    transition: 0.3s;
}

.nav-link {
    background: transparent;
    border: none;
    color: white;
    font-size: 0.9rem;
    font-family: inherit;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    cursor: pointer;
    padding: 0;
    transition: 0.3s;
}

.nav-link:hover,
.nav-link:focus-visible {
    color: var(--primary);
}

.nav-btn {
    background: var(--primary);
    padding: 0.6rem 1.5rem;
    border-radius: 50px;
    color: black !important;
    font-weight: 700;
}

/* Hero Section */
.hero {
    height: 100vh;
    display: flex;
    align-items: center;
    padding: 0 10%;
    position: relative;
    overflow: hidden;
}

.hero::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 30vh;
    background: linear-gradient(to bottom, rgba(0,0,0,0) 0%, rgba(0,0,0,0.4) 55%, rgba(0,0,0,1) 100%);
    pointer-events: none;
    z-index: 2;
}

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

.hero-content h1 {
    font-size: 4rem;
    margin-bottom: 1rem;
    line-height: 1.1;
    position: relative;
    z-index: 2;
}

.hero-content p {
    max-width: 600px;
    font-size: 1.2rem;
    margin-bottom: 2rem;
    opacity: 0.8;
    position: relative;
    z-index: 2;
}

/* Glass Cards */
.glass-section {
    padding: 100px 10%;
    background-color: var(--bg-dark);
}

.phase-section {
    padding: 120px 10% 120px;
}

.phase-section .container {
    max-width: 1200px;
    margin: 0 auto;
}

.phase-section h2 {
    text-align: center;
    margin-bottom: 4rem;
    letter-spacing: 1px;
}

.phase-timeline {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 3.6rem;
    padding: 1.2rem 0;
}

.phase-line {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 2px;
    transform: translateX(-50%);
    background: #2a2a2a;
    pointer-events: none;
    z-index: 2;
}

.phase-dot {
    position: absolute;
    left: 50%;
    top: 0;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #ffffff;
    box-shadow: 0 0 18px rgba(255, 255, 255, 0.6);
    transform: translate(-50%, -50%);
    z-index: 3;
}

.phase-step {
    color: #3a3a3a;
    transition: color 0.35s ease;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 120px minmax(0, 1fr);
    align-items: center;
    position: relative;
    z-index: 1;
}

.phase-step.left .phase-card {
    grid-column: 1 / 2;
    justify-self: end;
    text-align: left;
}

.phase-step.left .phase-visual {
    grid-column: 3 / 4;
    justify-self: stretch;
}

.phase-step.right .phase-card {
    grid-column: 3 / 4;
    justify-self: start;
    text-align: left;
}

.phase-step.right .phase-visual {
    grid-column: 1 / 2;
    justify-self: stretch;
}

.phase-card {
    grid-row: 1;
    max-width: 760px;
    width: 100%;
    background: rgba(8, 8, 10, 0.6);
    backdrop-filter: blur(24px);
    padding: 3.2rem;
    border-radius: 28px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.6);
    transition: border-color 0.35s ease, box-shadow 0.35s ease;
    align-self: center;
}

.phase-step.is-active {
    color: #ffffff;
}

.phase-step.is-active .phase-card {
    border-color: rgba(255, 255, 255, 0.08);
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.6);
}

.phase-card h3 {
    font-size: 1.2rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.phase-card p {
    margin-top: 0.8rem;
    line-height: 1.6;
}

.phase-card p:first-of-type {
    margin-top: 0.6rem;
}

.phase-lead {
    font-size: 1.02rem;
}

.phase-label {
    display: inline-block;
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.7px;
    margin-right: 0.35rem;
}

.phase-visual {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    grid-row: 1;
    align-self: center;
}

.phase-image {
    width: min(100%, 294px);
    height: auto;
    display: block;
    opacity: 0.35;
    filter: brightness(0.65) drop-shadow(0 18px 40px rgba(0, 0, 0, 0.45));
    transition: opacity 0.35s ease, filter 0.35s ease;
}

.phase-step.is-active .phase-image {
    opacity: 0.95;
    filter: brightness(1) drop-shadow(0 18px 40px rgba(0, 0, 0, 0.45));
}

.diagram-section {
    padding: 110px 10% 120px;
}

.diagram-section h2 {
    text-align: center;
    margin-bottom: 6rem;
    letter-spacing: 1px;
}

.diagram-section .container {
    max-width: 1200px;
    margin: 0 auto;
}

.diagram-frame {
    display: flex;
    justify-content: center;
}

.diagram-image {
    width: min(96vw, 1400px);
    height: auto;
    opacity: 0.96;
    filter: drop-shadow(0 24px 50px rgba(0, 0, 0, 0.45));
}

.diagram-note {
    text-align: center;
    margin-top: 1.6rem;
    font-size: 0.75rem;
    font-weight: 100;
    letter-spacing: 1px;
    text-transform: uppercase;
    opacity: 0.6;
}

.flight-section h2 {
    margin-bottom: 2.5rem;
    text-align: center;
}

.flight-layout {
    display: grid;
    grid-template-columns: minmax(220px, 280px) 1fr;
    gap: 4.6rem;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    max-width: 1300px;
}

.flight-nav-stack {
    display: flex;
    flex-direction: column;
    gap: 2.6rem;
}

.flight-nav {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 1.6rem;
    --dot-size: 16px;
    --line-width: 2px;
}

.flight-nav::before {
    content: "";
    position: absolute;
    left: calc(var(--dot-size) / 2 - var(--line-width) / 2);
    top: 0.4rem;
    bottom: 0.4rem;
    width: var(--line-width);
    background: #2a2a2a;
    z-index: 0;
}

.flight-step {
    background: transparent;
    border: none;
    color: #3a3a3a;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.2rem 0;
    text-align: left;
    letter-spacing: 0.8px;
    transition: color 0.3s ease;
    position: relative;
    z-index: 1;
}

.flight-step .step-dot {
    width: var(--dot-size);
    height: var(--dot-size);
    border-radius: 50%;
    border: none;
    background: #2a2a2a;
    transition: 0.3s ease;
    flex: 0 0 var(--dot-size);
    position: relative;
    z-index: 1;
}

.flight-step .step-title {
    font-size: 0.95rem;
    text-transform: uppercase;
}

.flight-step:hover .step-title,
.flight-step:focus-visible .step-title {
    color: inherit;
}

.flight-step.active .step-dot {
    background: #ffffff;
    box-shadow: 0 0 16px rgba(255, 255, 255, 0.45);
}

.flight-step.active .step-title {
    color: #ffffff;
}

.flight-step:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 6px;
    border-radius: 999px;
}

.flight-content {
    display: grid;
    grid-template-columns: minmax(220px, 320px) minmax(420px, 1fr);
    gap: 1.1rem;
    align-items: center;
}

@media (min-width: 901px) {
    .flight-content {
        gap: 2rem;
    }
}

.flight-text {
    transition: opacity 0.4s ease, transform 0.4s ease;
    will-change: opacity, transform;
    text-align: left;
    opacity: 0;
}

.flight-text.is-hidden {
    opacity: 0;
    transform: translateY(12px);
}

.typing-cursor {
    display: inline-block;
    margin-left: 4px;
    animation: cursor-blink 0.9s steps(2, start) infinite;
}

.typing-cursor.is-idle {
    animation-play-state: paused;
    opacity: 0;
}

.flight-context {
    font-size: 1.15rem;
    line-height: 1.6;
    color: #ffffff;
    max-width: 520px;
}

.flight-plot {
    width: 100%;
    max-width: 680px;
    margin: 0 auto;
    display: flex;
    justify-content: center;
}

.flight-canvas {
    display: block;
    width: 100%;
    height: auto;
    margin: 0 auto;
    opacity: 0;
    transition: opacity 0.35s ease;
}

.flight-canvas.is-visible {
    opacity: 1;
}

.flight-text.is-visible {
    opacity: 1;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.card {
    background: var(--glass);
    backdrop-filter: blur(10px);
    padding: 2rem;
    border-radius: 20px;
    border: 1px solid rgba(255,255,255,0.1);
    transition: 0.4s;
}

.card:hover {
    transform: translateY(-10px);
    border-color: var(--primary);
}

/* Collaboration Form */
.collab-section {
    padding: 100px 10%;
    display: flex;
    justify-content: center;
    background-color: var(--bg-dark);
}

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.72);
    display: grid;
    place-items: center;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.25s ease;
    will-change: opacity;
    z-index: 300;
    padding: 2rem;
}

.modal-overlay.is-visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.modal {
    width: min(92vw, 760px);
    background: rgba(8, 8, 10, 0.6);
    -webkit-backdrop-filter: blur(24px);
    backdrop-filter: blur(24px);
    border-radius: 28px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.6);
    padding: 3rem;
    position: relative;
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.25s ease, transform 0.25s ease;
    will-change: transform, opacity;
}

.modal-overlay.is-visible .modal {
    opacity: 1;
    transform: translateY(0);
}

.modal-header h3 {
    font-size: 1.4rem;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.modal-kicker {
    font-size: 0.8rem;
    letter-spacing: 0.2rem;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 0.8rem;
}

.modal-body {
    margin-top: 1.6rem;
    display: grid;
    gap: 1rem;
    line-height: 1.7;
    color: rgba(255, 255, 255, 0.85);
}

.modal-close {
    position: absolute;
    top: 1.4rem;
    right: 1.4rem;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(0, 0, 0, 0.35);
    color: #ffffff;
    font-size: 1.3rem;
    cursor: pointer;
}

.update-meta {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.85rem;
    letter-spacing: 0.2rem;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.75);
}

.update-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #f2c94c;
    box-shadow: 0 0 12px rgba(242, 201, 76, 0.8);
}

body.modal-open {
    overflow: hidden;
}

.collab-container {
    background: rgba(8, 8, 10, 0.6);
    backdrop-filter: blur(24px);
    padding: 3.2rem;
    border-radius: 28px;
    max-width: 760px;
    width: 100%;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.6);
}

form {
    margin-top: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.form-error {
    display: none;
    padding: 0.65rem 0.9rem;
    border-radius: 12px;
    border: 1px solid rgba(255, 107, 107, 0.35);
    background: rgba(255, 107, 107, 0.08);
    color: rgba(255, 255, 255, 0.92);
    font-size: 0.85rem;
    letter-spacing: 0.06rem;
    text-transform: uppercase;
}

.form-error.is-visible {
    display: block;
}

.form-success {
    display: none;
    margin-top: 1.4rem;
    text-align: center;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.35s ease, transform 0.35s ease;
}

.form-success.is-visible {
    display: grid;
    gap: 0.6rem;
    justify-items: center;
    opacity: 1;
    transform: translateY(0);
}

.success-icon {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 1.4rem;
    color: #000000;
    background: #ffffff;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.success-text {
    font-size: 0.95rem;
    letter-spacing: 0.6px;
    text-transform: uppercase;
}

.input-group {
    display: flex;
    gap: 1rem;
}

input, select, textarea {
    background: rgba(18, 18, 22, 0.65);
    border: 1px solid rgba(255,255,255,0.14);
    padding: 1rem;
    color: white;
    border-radius: 14px;
    outline: none;
    user-select: text;
    -webkit-user-select: text;
    -ms-user-select: text;
}

input.is-invalid,
select.is-invalid,
textarea.is-invalid {
    border-color: rgba(255, 107, 107, 0.85);
    box-shadow: 0 0 0 1px rgba(255, 107, 107, 0.35);
}

.is-hidden {
    display: none !important;
}

textarea {
    resize: vertical;
    min-height: 80px;
}

.btn, .btn-glow {
    padding: 0.95rem 2.4rem;
    background: linear-gradient(135deg, #ffffff 0%, #d8dbe0 100%);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 999px;
    cursor: pointer;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
    text-decoration: none;
    color: #0a0a0b;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
}

.btn-glow:hover {
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.5);
}

.btn-glow:active {
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
}

/* Animations */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease-out;
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

footer {
    text-align: center;
    padding: 3rem;
    font-size: 0.8rem;
    opacity: 0.5;
    background-color: var(--bg-dark);
}

@media (max-width: 900px) {
    nav {
        padding: 1.6rem 6%;
        flex-wrap: wrap;
        gap: 0.8rem 1.4rem;
    }

    nav ul {
        flex-wrap: wrap;
        justify-content: flex-end;
        gap: 0.75rem 1rem;
    }

    nav ul li {
        margin-left: 0;
    }

    nav a,
    .nav-link {
        font-size: 0.8rem;
        letter-spacing: 0.4px;
    }

    .logo {
        font-size: 1.3rem;
        letter-spacing: 4px;
    }

    .hero {
        padding: 0 8%;
    }

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

    .hero-content h1 {
        font-size: clamp(2.4rem, 7vw, 3.4rem);
    }

    .hero-content p {
        font-size: 1.05rem;
    }

    .flight-layout {
        grid-template-columns: 1fr;
        gap: 3rem;
    }

    .flight-nav-stack {
        gap: 2rem;
    }

    .phase-timeline {
        gap: 2.6rem;
    }

    .phase-line {
        left: 18px;
    }

    .phase-dot {
        left: 50%;
    }

    .phase-step.left,
    .phase-step.right {
        grid-template-columns: 40px minmax(0, 1fr);
    }

    .phase-step.left .phase-card,
    .phase-step.right .phase-card {
        grid-column: 2 / 3;
        justify-self: start;
        text-align: left;
    }

    .phase-step.left .phase-visual,
    .phase-step.right .phase-visual {
        grid-column: 2 / 3;
        justify-self: start;
        margin-top: 1.4rem;
        grid-row: 2;
    }

    .phase-card {
        max-width: 100%;
    }

    .diagram-section {
        padding: 90px 8% 100px;
    }

    .diagram-section h2 {
        margin-bottom: 3.6rem;
    }

    .collab-section {
        padding: 90px 8%;
    }

    .collab-container {
        padding: 2.4rem;
    }

    .modal {
        padding: 2.4rem;
    }

    .flight-nav {
        max-width: 320px;
    }

    .flight-content {
        grid-template-columns: 1fr;
        align-items: start;
    }

    .flight-text,
    .flight-plot {
        text-align: left;
    }

    .flight-context {
        font-size: 1.05rem;
    }
}

@media (max-width: 600px) {
    .modal-overlay {
        padding: 1rem;
    }

    .modal {
        width: 100%;
        max-width: calc(100vw - 2rem);
        margin: 0 auto;
        max-height: calc(100svh - 2rem);
        overflow-y: auto;
    }

    nav {
        padding: 1.2rem 6%;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.6rem;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        background: rgba(0, 0, 0, 0.55);
        -webkit-backdrop-filter: blur(12px);
        backdrop-filter: blur(12px);
    }

    nav ul {
        width: 100%;
        flex-direction: column;
        justify-content: flex-start;
        gap: 0.6rem 0.9rem;
    }

    nav a,
    .nav-link {
        font-size: 0.72rem;
    }

    .hero {
        min-height: 100svh;
        height: auto;
        padding: 33rem 6% 4.5rem;
    }

    .hero-content {
        padding-top: 0;
    }

    .hero-content h1 {
        font-size: clamp(2rem, 9vw, 2.6rem);
    }

    .hero-content p {
        font-size: 0.95rem;
    }

    .phase-line {
        left: 18px;
    }

    .phase-dot {
        left: 50%;
    }

    .phase-step.left,
    .phase-step.right {
        grid-template-columns: 36px minmax(0, 1fr);
    }

    .phase-step.left .phase-visual,
    .phase-step.right .phase-visual {
        grid-row: 2;
    }

    .phase-image {
        width: min(100%, 220px);
    }

    .container,
    .phase-card,
    .collab-container,
    .flight-layout,
    .flight-content,
    .flight-nav-stack,
    .flight-plot {
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }

    .diagram-section {
        padding: 70px 6% 80px;
    }

    .diagram-section h2 {
        margin-bottom: 3rem;
    }

    .diagram-image {
        width: min(92vw, 900px);
    }

    .input-group {
        flex-direction: column;
    }

    .collab-section {
        padding: 80px 6%;
    }

    .collab-container {
        padding: 1.8rem;
    }

    .modal {
        padding: 1.8rem;
    }

    .flight-step .step-title {
        font-size: 0.85rem;
    }

    .flight-nav-stack {
        align-items: center;
    }

    .flight-nav {
        align-items: flex-start;
    }

    .flight-step {
        justify-content: flex-start;
        text-align: left;
    }

    .flight-step .step-title {
        text-align: left;
    }

    .flight-text,
    .flight-desc,
    .flight-context {
        text-align: center;
        margin-left: auto;
        margin-right: auto;
    }

    .phase-section {
        padding: 80px 6%;
    }

    .phase-card {
        padding: 1.2rem;
    }

    .flight-section {
        padding: 80px 4%;
    }

    .flight-context {
        font-size: 1rem;
    }
}

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

@keyframes loader-bounce {
    0%,
    12.5%,
    100% {
        transform: translateY(0);
        opacity: 0.5;
    }
    6.25% {
        transform: translateY(-12px);
        opacity: 1;
    }
}
