@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;700;900&family=JetBrains+Mono:wght@400;700&display=swap');

:root {
    --bg: #000;
    --fg: #f0f0f0;
    --accent: #fff;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body,
html {
    background: var(--bg);
    color: var(--fg);
    font-family: 'Outfit', sans-serif;
    overflow-x: hidden;
    height: 100vh;
    width: 100vw;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

#conduit {
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(to right, rgba(255, 255, 255, 0.02) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
    background-size: 60px 60px;
    z-index: 1;
}

#viewport {
    height: 100vh;
    width: 100vw;
    perspective: 800px;
    perspective-origin: 50% 50%;
    overflow: hidden;
    z-index: 10;
    position: relative;
}

#world {
    position: absolute;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    will-change: transform;
}

.layer {
    position: absolute;
    width: 100vw;
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 0 12%;
    backface-visibility: hidden;
    background: rgba(0, 0, 0, 0.98);
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: opacity 0.3s ease;
    will-change: opacity, transform;
}

.mono-hero {
    font-family: 'Outfit', sans-serif;
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 6px;
    text-transform: uppercase;
    color: #ffffff;
    margin-bottom: 25px;
    opacity: 1;
}

.mono {
    font-family: 'JetBrains Mono';
    font-size: 0.75rem;
    font-weight: 400;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: #fff;
    margin-bottom: 20px;
}

h1,
h2 {
    font-size: clamp(2.5rem, 5vw, 4.5rem);
    line-height: 1;
    font-weight: 900;
    letter-spacing: -2px;
    text-transform: uppercase;
}

p {
    font-size: 1.1rem;
    max-width: 850px;
    font-weight: 300;
    color: #e0e0e0;
    margin-top: 20px;
    line-height: 1.6;
}

/* PROTOCOL LIST */
.protocol-list {
    width: 100%;
    max-width: 900px;
    margin-top: 40px;
    border-top: 1px solid #222;
}

.protocol-item {
    display: grid;
    grid-template-columns: 60px 1fr auto;
    align-items: center;
    padding: 22px;
    border-bottom: 1px solid #222;
    transition: 0.4s;
    text-align: left;
}

.protocol-item:hover {
    background: #fff;
    color: #000;
    padding-left: 35px;
}

.p-num {
    font-family: 'JetBrains Mono';
    font-weight: 700;
    opacity: 0.4;
    font-size: 0.8rem;
}

.p-title {
    font-size: 1.4rem;
    font-weight: 900;
    text-transform: uppercase;
}

/* HIGHLIGHT BOX */
.highlight-box {
    background: #fff;
    color: #000;
    padding: 60px;
    width: 100%;
    max-width: 1000px;
    border-radius: 4px;
    text-align: center;
    cursor: pointer;
    transition: transform 0.3s;
}

.highlight-box:hover {
    transform: scale(1.02);
}

.highlight-box h2 {
    color: #000;
    font-size: 3rem;
    margin-bottom: 20px;
}

.highlight-box p {
    color: #111;
    max-width: 100%;
    margin: 0 auto;
    font-weight: 400;
}

/* ENGINE STACK */
.engine-stack-container {
    display: flex;
    justify-content: center;
    align-items: stretch;
    gap: 8px;
    width: 100%;
    max-width: 1300px;
    height: 420px;
    margin-top: 30px;
}

.engine-blade {
    flex: 1;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid #222;
    padding: 30px 20px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    text-align: left;
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.blade-tag {
    position: absolute;
    top: 30px;
    left: 20px;
    font-family: 'JetBrains Mono';
    font-size: 0.55rem;
    transform: rotate(-90deg) translateX(-100%);
    transform-origin: left top;
    white-space: nowrap;
    color: #888;
}

.engine-blade h4 {
    font-size: 1rem;
    font-weight: 900;
    text-transform: uppercase;
    margin-bottom: 10px;
    color: #fff;
}

.blade-body {
    font-size: 0.85rem;
    color: #d1d1d1;
    line-height: 1.4;
    opacity: 0;
    transform: translateY(15px);
    transition: 0.4s;
    font-weight: 400;
}

.engine-blade:hover {
    flex: 4;
    background: #fff;
}

.engine-blade:hover .blade-tag,
.engine-blade:hover h4 {
    color: #000;
}

.engine-blade:hover .blade-body {
    opacity: 1;
    transform: translateY(0);
    color: #000;
}

/* EMBASSY */
.embassy-dashboard {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    width: 100%;
    max-width: 1200px;
    margin-top: 30px;
}

.embassy-node {
    border: 1px solid #222;
    padding: 22px;
    text-align: left;
    transition: 0.3s;
    background: #000;
}

.node-tag {
    font-family: 'JetBrains Mono';
    font-size: 0.55rem;
    color: #aaa;
    margin-bottom: 10px;
    border: 1px solid #222;
    display: inline-block;
    padding: 2px 6px;
}

.node-title {
    font-size: 0.9rem;
    font-weight: 900;
    text-transform: uppercase;
    margin-bottom: 8px;
    color: #fff;
}

.node-body {
    font-size: 0.8rem;
    color: #d1d1d1;
    line-height: 1.4;
    font-weight: 400;
}

/* IMPACT */
.impact-container {
    display: grid;
    grid-template-columns: 350px 1fr;
    width: 100%;
    max-width: 1200px;
    height: 500px;
    margin-top: 40px;
    border: 1px solid #333;
    text-align: left;
}

.impact-nav {
    border-right: 1px solid #333;
    display: flex;
    flex-direction: column;
}

.impact-nav-item {
    flex: 1;
    padding: 20px 30px;
    border-bottom: 1px solid #222;
    display: flex;
    align-items: center;
    font-family: 'JetBrains Mono';
    font-size: 0.7rem;
    color: #999;
    cursor: pointer;
    transition: 0.3s;
    text-transform: uppercase;
    font-weight: 700;
}

.impact-nav-item.active {
    background: #fff;
    color: #000;
}

.impact-content-area {
    padding: 60px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: linear-gradient(45deg, #000 0%, #050505 100%);
}

.impact-display-title {
    font-size: 0.7rem;
    font-family: 'JetBrains Mono';
    color: #fff;
    margin-bottom: 20px;
    border-left: 2px solid #fff;
    padding-left: 15px;
    letter-spacing: 4px;
    display: none;
}

.impact-display-value {
    font-size: 3.5rem;
    font-weight: 900;
    line-height: 1.1;
    text-transform: uppercase;
    letter-spacing: -2px;
}

/* TEAMS */
.teams-terminal {
    width: 100%;
    max-width: 1100px;
    margin-top: 40px;
    border: 1px solid #222;
}

.team-row {
    display: grid;
    grid-template-columns: 180px 1fr;
    border-bottom: 1px solid #222;
    transition: 0.3s;
}

.unit-id {
    font-family: 'JetBrains Mono';
    font-weight: 700;
    padding: 22px;
    border-right: 1px solid #222;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
}

.unit-desc {
    padding: 22px;
    text-align: left;
    font-size: 1rem;
    color: #e0e0e0;
    font-weight: 400;
}

/* RESOURCES */
.resource-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-top: 40px;
    width: 100%;
}

.book-card {
    background: #000;
    border: 1px solid #333;
    padding: 40px 20px;
    text-align: center;
}

.book-num {
    font-family: 'JetBrains Mono';
    color: #666;
    font-size: 3rem;
    font-weight: 900;
    line-height: 1;
    margin-bottom: 20px;
}

.book-title {
    font-size: 1.5rem;
    font-weight: 900;
    text-transform: uppercase;
    margin-bottom: 10px;
    color: #fff;
}

.book-sub {
    font-size: 0.9rem;
    color: #aaa;
    font-family: 'JetBrains Mono';
    font-weight: 400;
}

/* CONTACT */
.contact-portal {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 50px;
    text-align: left;
    width: 100%;
    max-width: 1000px;
}

.portal-info h3 {
    font-size: 3rem;
    font-weight: 900;
    text-transform: uppercase;
    margin-bottom: 15px;
    letter-spacing: -2px;
    color: #fff;
}

.portal-fields {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.field-group {
    position: relative;
    border-bottom: 1px solid #444;
}

.field-label {
    font-family: 'JetBrains Mono';
    font-size: 0.6rem;
    color: #aaa;
    text-transform: uppercase;
    padding-top: 8px;
    font-weight: 700;
}

.portal-fields input {
    background: none;
    border: none;
    padding: 12px 0;
    color: #fff;
    font-size: 1rem;
    width: 100%;
    outline: none;
}

.portal-btn {
    background: #fff;
    color: #000;
    border: none;
    padding: 20px;
    font-family: 'JetBrains Mono';
    font-weight: 900;
    cursor: pointer;
    text-transform: uppercase;
    margin-top: 15px;
    transition: 0.3s;
}

/* UI ELEMENTS */
#rail {
    position: fixed;
    right: 40px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 18px;
    align-items: flex-end;
}

.rail-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #444;
    cursor: pointer;
    transition: 0.3s;
    position: relative;
}

.rail-dot.active {
    background: #fff;
    transform: scale(1.5);
}

.rail-label {
    position: absolute;
    right: 20px;
    top: -5px;
    color: #fff;
    font-family: 'JetBrains Mono';
    font-size: 0.6rem;
    opacity: 0;
    transition: 0.3s;
    white-space: nowrap;
    pointer-events: none;
    font-weight: 700;
}

.rail-dot:hover .rail-label {
    opacity: 1;
    right: 25px;
}

#hud {
    position: fixed;
    top: 0px;
    left: 60px;
    width: auto;
    z-index: 2000;
    pointer-events: none;
    color: #fff;
}

/* SIDE PANELS */
.side-panel {
    position: fixed;
    top: 0;
    right: -100%;
    width: 50vw;
    height: 100vh;
    background: #000;
    z-index: 5000;
    transition: right 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    border-left: 1px solid #333;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

.side-panel.active {
    right: 0;
}

.panel-close {
    position: absolute;
    top: 30px;
    left: 30px;
    font-family: 'JetBrains Mono';
    color: #fff;
    cursor: pointer;
    border: 1px solid #333;
    padding: 10px 20px;
    text-transform: uppercase;
    font-size: 0.7rem;
}

#mobile-nav {
    display: none;
}

#mandate-panel img {
    height: 520px;
}

.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #333;
    color: #fff;
    padding: 14px 20px;
    border-radius: 6px;
    font-size: 14px;
    opacity: 0;
    transform: translateY(-20px);
    transition: all 0.3s ease;
    z-index: 9999;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

.toast.success {
    background: #28a745;
}

.toast.error {
    background: #dc3545;
}

#hud {
    display: none;
}

#mobile-nav {
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 3000;
    /* background: rgba(0, 0, 0, 0.92); */
    backdrop-filter: blur(8px);
    /* border-bottom: 1px solid #222; */
    padding: 14px 24px;
    font-weight: 900;
    font-size: 1.2rem;
    letter-spacing: -1px;
    color: #fff;
    font-family: 'Outfit', sans-serif;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#mobile-nav img {
    height: 90px !important;
}

.logo-title {
    font-size: 28px;
}

@media (max-width: 1024px) {
    /* #mobile-nav {
        display: block;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 3000;
        background: rgba(0, 0, 0, 0.92);
        backdrop-filter: blur(8px);
        border-bottom: 1px solid #222;
        padding: 14px 24px;
        font-weight: 900;
        font-size: 1.2rem;
        letter-spacing: -1px;
        color: #fff;
        font-family: 'Outfit', sans-serif;
         display: flex;
        justify-content: space-between;
        align-items: center;
    } */
}

/* ── TABLET (≤1024px) ── */
@media (max-width: 1024px) {
    #viewport {
        perspective: 800px;
        perspective-origin: 50% 50%;
        overflow: hidden;
    }

    .logo-title {
        font-size: 22px;
    }

    #world {
        position: absolute;
        width: 100%;
        height: 100%;
        transform-style: preserve-3d;
    }

    .layer {
        position: absolute;
        width: 100vw;
        height: 100vh;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        text-align: center;
        padding: 80px 6% 60px;
        border: none;
        background: rgba(0, 0, 0, 0.98);
    }

    #rail {
        display: flex;
        right: 16px;
        gap: 12px;
    }

    .rail-dot {
        width: 5px;
        height: 5px;
    }

    .rail-label {
        display: none;
    }

    .side-panel {
        width: 100vw;
    }

    #hud {
        left: 20px;
        top: 16px;
    }

    #hud div {
        font-size: 1.3rem;
    }

    h1,
    h2 {
        font-size: clamp(2rem, 8vw, 3.2rem);
        letter-spacing: -1px;
    }

    .protocol-item {
        grid-template-columns: 40px 1fr;
        gap: 8px;
        padding: 18px 12px;
    }

    .p-title {
        font-size: 1.1rem;
    }

    .highlight-box {
        padding: 36px 24px;
    }

    .highlight-box h2 {
        font-size: 2rem;
    }

    .engine-stack-container {
        flex-direction: column;
        height: auto;
        gap: 0;
        max-width: 100%;
    }

    .engine-blade {
        flex: none;
        width: 100%;
        flex-direction: column;
        align-items: flex-start;
        padding: 18px 20px;
        min-height: 60px;
        justify-content: flex-start;
        overflow: hidden;
    }

    .blade-header {
        display: flex;
        align-items: center;
        gap: 16px;
        width: 100%;
    }

    .blade-tag {
        position: static;
        transform: none;
        transform-origin: unset;
        font-size: 0.55rem;
        white-space: nowrap;
        color: #666;
        writing-mode: horizontal-tb;
        min-width: 80px;
        flex-shrink: 0;
    }

    .engine-blade h4 {
        font-size: 0.95rem;
        margin-bottom: 0;
        flex: 1;
    }

    .blade-body {
        opacity: 0;
        max-height: 0;
        overflow: hidden;
        transform: none !important;
        transition: opacity 0.3s, max-height 0.3s;
        font-size: 0.85rem;
        color: #bbb;
        margin-top: 0;
        width: 100%;
    }

    .engine-blade.open {
        background: #fff;
        padding-bottom: 20px;
    }

    .engine-blade.open .blade-tag,
    .engine-blade.open h4 {
        color: #000;
    }

    .engine-blade.open .blade-body {
        opacity: 1 !important;
        max-height: 120px;
        color: #111;
        margin-top: 12px;
    }

    .engine-blade:hover {
        flex: none;
        background: rgba(255, 255, 255, 0.02);
    }

    .engine-blade:hover .blade-tag,
    .engine-blade:hover h4 {
        color: inherit;
    }

    .engine-blade:hover .blade-body {
        opacity: 0;
        max-height: 0;
    }

    .engine-blade.open:hover {
        background: #fff;
    }

    .engine-blade.open:hover .blade-tag,
    .engine-blade.open:hover h4 {
        color: #000;
    }

    .engine-blade.open:hover .blade-body {
        opacity: 1 !important;
        max-height: 120px;
        color: #111;
    }

    .embassy-dashboard {
        grid-template-columns: repeat(2, 1fr);
    }

    .impact-container {
        grid-template-columns: 1fr;
        height: auto;
        max-width: 100%;
    }

    .impact-nav {
        flex-direction: row;
        flex-wrap: wrap;
        border-right: none;
        border-bottom: 1px solid #333;
    }

    .impact-nav-item {
        flex: 1;
        min-width: 80px;
        padding: 12px 10px;
        font-size: 0.6rem;
        justify-content: center;
        text-align: center;
        border-bottom: none;
        border-right: 1px solid #222;
    }

    .impact-nav-item:last-child {
        border-right: none;
    }

    .impact-content-area {
        padding: 32px 24px;
        min-height: 200px;
    }

    .impact-display-value {
        font-size: 2rem;
    }

    .team-row {
        grid-template-columns: 1fr;
    }

    .unit-id {
        border-right: none;
        border-bottom: 1px solid #222;
        justify-content: flex-start;
        padding: 14px 22px 10px;
    }

    .unit-desc {
        padding: 10px 22px 16px;
        font-size: 0.95rem;
    }

    .resource-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .contact-portal {
        grid-template-columns: 1fr;
        gap: 32px;
    }

    .portal-info h3 {
        font-size: 2.2rem;
    }


    #mobile-nav img {
        height: 60px !important;

    }
}

@media (max-width:525px) {


    #mandate-panel img {
        width: 350px;
        height: auto;
    }

    #mobile-nav {
        padding: 0 24px;

    }

    #mobile-nav img {
        height: 55px !important;
        padding-top: 4px;
        padding-bottom: 4px;
    }

    .mobile-line-second {
        display: none;
    }

    .blade-tag {
        display: none;
    }

}

@media (max-width: 402px) {
    .mobile-line {
        display: none;
    }

}

@media (max-width:321px) {
    #mandate-panel img {
        width: 300px;
        height: auto;
    }

    .highlight-box {
        padding: 18px 0;
    }
}

/* ── PHONE (≤600px) ── */
/* @media (max-width: 600px) {
            .layer {
                padding: 90px 5% 50px;
            }

            h1,
            h2 {
                font-size: clamp(1.8rem, 9vw, 2.6rem);
            }

            p {
                font-size: 0.95rem;
            }

            .mono-hero {
                font-size: 0.7rem;
                letter-spacing: 3px;
            }

            .mono {
                font-size: 0.65rem;
                letter-spacing: 2px;
            }

            .protocol-list {
                max-width: 100%;
            }

            .protocol-item {
                grid-template-columns: 36px 1fr;
            }

            .embassy-dashboard {
                grid-template-columns: 1fr;
            }

            .engine-blade {
                padding: 16px 14px;
            }

            .blade-tag {
                min-width: 64px;
                font-size: 0.5rem;
            }

            .resource-grid {
                grid-template-columns: 1fr;
            }

            .impact-nav-item {
                min-width: 60px;
                font-size: 0.55rem;
                padding: 10px 6px;
            }

            .impact-display-value {
                font-size: 1.5rem;
                letter-spacing: -1px;
            }

            .impact-content-area {
                padding: 24px 16px;
            }

            .portal-info h3 {
                font-size: 1.8rem;
            }

            .portal-btn {
                padding: 16px;
                font-size: 0.75rem;
            }

            .highlight-box {
                padding: 28px 16px;
            }

            .highlight-box h2 {
                font-size: 1.5rem;
            }

            .highlight-box p {
                font-size: 0.9rem;
            }

            .teams-terminal {
                max-width: 100%;
            }
        } */