/* ==========================================================================
   Umbrella Group Co. — Main Stylesheet
   Version: 1.0.0
   ========================================================================== */

/* ==========================================================================
   1. DESIGN TOKENS & CSS CUSTOM PROPERTIES
   ========================================================================== */
:root {
    --bg-void: #030303;
    --text-primary: #ffffff;
    --text-secondary: #aaaaaa;
    --accent-gold: #ffc843;
    --font-display: 'Orbitron', sans-serif;
    --font-sub: 'Rajdhani', sans-serif;
    --font-body: 'Inter', sans-serif;
    --font-tech: 'Space Mono', monospace;
}

/* ==========================================================================
   2. BASE / RESET
   ========================================================================== */
html,
body {
    margin: 0;
    padding: 0;
    background: var(--bg-void);
    color: var(--text-primary);
    font-family: var(--font-body);
    overflow-x: hidden;
    overscroll-behavior: none;
    height: 500vh;
}

::-webkit-scrollbar {
    display: none;
}

::selection {
    background: rgba(255, 200, 67, 0.3);
    color: #fff;
}

/* ==========================================================================
   3. WEBGL CANVAS
   ========================================================================== */
#webgl-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 0;
    pointer-events: none;
}

/* ==========================================================================
   4. CYBER FRAME (Decorative Border)
   ========================================================================== */
.cyber-frame {
    position: fixed;
    top: 20px;
    left: 20px;
    right: 20px;
    bottom: 20px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 20px;
    pointer-events: none;
    z-index: 20;
    contain: strict;
}

.cyber-frame::before {
    content: '';
    position: absolute;
    top: -1px;
    left: 10%;
    right: 10%;
    height: 2px;
    background: var(--bg-void);
}

.cyber-frame::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 20%;
    right: 20%;
    height: 2px;
    background: var(--bg-void);
}

.cyber-corner {
    position: absolute;
    width: 30px;
    height: 3px;
    background: rgba(255, 255, 255, 0.8);
}

.corner-tl {
    top: -1px;
    left: 40px;
}

.corner-tr {
    top: -1px;
    right: 40px;
}

.corner-bl {
    bottom: -1px;
    left: 40px;
}

.corner-br {
    bottom: -1px;
    right: 40px;
}

/* ==========================================================================
   5. NAVIGATION
   ========================================================================== */
.top-nav {
    position: fixed;
    top: 40px;
    left: 60px;
    right: 60px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 30;
    pointer-events: none;
    /* Let children handle events */
}

.pill-btn {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    padding: 10px 24px;
    border-radius: 40px;
    font-family: var(--font-body);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    cursor: pointer;
    transition: background 0.3s;
    text-decoration: none;
    display: inline-block;
    pointer-events: auto;
}

.pill-btn.solid {
    background: white;
    color: black;
    font-weight: 600;
}

.pill-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.pill-btn.solid:hover {
    background: #e0e0e0;
}

.logo-mark {
    height: 90px;
    width: auto;
    pointer-events: auto;
    object-fit: contain;
    filter: brightness(0) invert(1);
}

/* ==========================================================================
   6. MENU DROPDOWN
   ========================================================================== */
.menu-dropdown {
    position: fixed;
    top: 110px;
    left: 60px;
    background: rgba(5, 5, 5, 0.8);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    opacity: 0;
    visibility: hidden;
    z-index: 100;
    pointer-events: auto;
}

.menu-item {
    font-family: var(--font-tech);
    color: white;
    text-decoration: none;
    font-size: 0.8rem;
    letter-spacing: 0.1em;
    cursor: pointer;
    transition: color 0.3s;
    text-transform: uppercase;
}

.menu-item:hover {
    color: var(--accent-gold);
}

/* ==========================================================================
   7. HUD FOOTER
   ========================================================================== */
.hud-footer {
    position: fixed;
    bottom: 40px;
    left: 60px;
    right: 60px;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    z-index: 30;
    pointer-events: none;
    font-family: var(--font-tech);
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.4);
    letter-spacing: 0.1em;
}

/* ==========================================================================
   8. CONTENT NODES (Cinematic Sections)
   ========================================================================== */
.ui-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 10;
    pointer-events: none;
    contain: layout style;
}

.cinematic-node {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 85vw;
    max-width: 900px;
    text-align: center;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    will-change: transform, opacity, filter;
    backface-visibility: hidden;
    contain: layout style;
}

.clickable-node {
    cursor: pointer;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.clickable-node:hover {
    border-color: rgba(255, 200, 67, 0.8) !important;
    box-shadow: 0 0 30px rgba(255, 200, 67, 0.1) !important;
}

/* ==========================================================================
   9. TYPOGRAPHY
   ========================================================================== */
.label-text {
    font-family: var(--font-tech);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.3em;
    color: var(--accent-gold);
    display: block;
    margin-bottom: 1.5rem;
}

.display-text {
    font-family: var(--font-display);
    font-size: clamp(3rem, 7vw, 7rem);
    line-height: 1.1;
    letter-spacing: 0.05em;
    margin: 0 0 1.5rem 0;
    background: linear-gradient(180deg, #ffffff 0%, rgba(255, 255, 255, 0.6) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.headline-text {
    font-family: var(--font-sub);
    font-size: clamp(2rem, 5vw, 4rem);
    line-height: 1.1;
    font-weight: 300;
    margin: 0 0 1.5rem 0;
    letter-spacing: 0.1em;
}

.body-text {
    font-family: var(--font-body);
    font-size: clamp(1rem, 2vw, 1.25rem);
    line-height: 1.8;
    color: var(--text-secondary);
    font-weight: 300;
    max-width: 700px;
    margin: 0 auto;
}

/* ==========================================================================
   10. GLASS PANELS
   ========================================================================== */
.glass-panel {
    background: rgba(10, 10, 10, 0.4);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 24px;
    padding: 4rem;
    text-align: left;
    border-top-color: rgba(255, 200, 67, 0.3);
}

.glass-panel .body-text {
    margin-left: 0;
    max-width: 600px;
}

/* ==========================================================================
   11. ARCHITECTURE NODE OVERRIDES
   ========================================================================== */
#node-arch-1 {
    max-width: 800px;
    transform: translate(-70%, -50%);
}

#node-arch-2 {
    max-width: 800px;
    transform: translate(-30%, -50%);
    text-align: right;
}

#node-arch-2 .body-text {
    margin-right: 0;
    margin-left: auto;
}

#node-arch-2 .label-text {
    text-align: right;
}

/* ==========================================================================
   12. CONTACT
   ========================================================================== */
.contact-email {
    font-family: var(--font-tech);
    color: var(--accent-gold);
    text-decoration: none;
    font-size: 1.1rem;
    display: inline-block;
    padding: 10px 20px;
    border: 1px solid rgba(255, 200, 67, 0.3);
    border-radius: 8px;
    transition: background 0.3s, color 0.3s;
}

.contact-email:hover {
    background: rgba(255, 200, 67, 0.1);
}

/* ==========================================================================
   13. DETAIL / CONTACT OVERLAY
   ========================================================================== */
.detail-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(3, 3, 3, 0.97);
    backdrop-filter: blur(30px);
    z-index: 200;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    content-visibility: auto;
    contain: layout style paint;
}

.close-btn {
    position: absolute;
    top: 40px;
    right: 60px;
    background: none;
    border: none;
    color: white;
    font-family: var(--font-tech);
    font-size: 1rem;
    letter-spacing: 0.2em;
    cursor: pointer;
    padding: 10px;
    z-index: 201;
    transition: color 0.3s;
}

.close-btn:hover {
    color: var(--accent-gold);
}

.overlay-content {
    max-width: 800px;
    padding: 40px;
    text-align: center;
    transform: scale(0.95);
    opacity: 0;
}

.overlay-title {
    font-family: var(--font-sub);
    font-size: 3rem;
    margin-bottom: 2rem;
    color: #fff;
}

.overlay-desc {
    font-size: 1.25rem;
    line-height: 1.8;
    color: #ccc;
    margin-bottom: 3rem;
    text-align: left;
}

.tech-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
    text-align: left;
}

.tech-spec {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 20px;
    border-radius: 12px;
    transition: background 0.3s, border-color 0.3s;
}

.tech-spec:hover {
    background: rgba(255, 200, 67, 0.05);
    border-color: rgba(255, 200, 67, 0.3);
}

.tech-spec-label {
    font-family: var(--font-tech);
    color: var(--accent-gold);
    font-size: 0.75rem;
    display: block;
    margin-bottom: 10px;
}

.tech-spec-val {
    font-size: 0.95rem;
    line-height: 1.5;
    color: #ddd;
}

.overlay-stagger,
.contact-stagger {
    opacity: 0;
    transform: translateY(30px);
}

/* ==========================================================================
   14. RESPONSIVE — TABLET PORTRAIT & SMALL LAPTOPS (≤ 1024px)
   ========================================================================== */
@media (max-width: 1024px) {
    .glass-panel {
        padding: clamp(1.5rem, 4vw, 2.5rem);
    }

    .top-nav {
        top: 30px;
        left: 30px;
        right: 30px;
    }

    .hud-footer {
        bottom: 30px;
        left: 30px;
        right: 30px;
    }

    .menu-dropdown {
        top: 100px;
        left: 30px;
    }

    .tech-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .overlay-content {
        max-width: 90%;
    }

    #node-arch-1,
    #node-arch-2 {
        max-width: 650px;
    }
}

/* ==========================================================================
   15. RESPONSIVE — TABLET LANDSCAPE
   ========================================================================== */
@media (min-width: 769px) and (max-width: 1024px) and (orientation: landscape) {
    .top-nav {
        top: 20px;
        left: 24px;
        right: 24px;
    }

    .hud-footer {
        bottom: 16px;
        left: 24px;
        right: 24px;
        font-size: 0.65rem;
    }

    .cyber-frame {
        top: 10px;
        left: 10px;
        right: 10px;
        bottom: 10px;
    }

    .display-text {
        font-size: clamp(2rem, 5vw, 3.5rem);
    }

    .headline-text {
        font-size: clamp(1.5rem, 3.5vw, 2.5rem);
    }

    .glass-panel {
        padding: clamp(1.25rem, 3vw, 2rem);
    }

    #node-arch-1,
    #node-arch-2 {
        max-width: 500px;
    }

    .logo-mark {
        height: 60px;
    }
}

/* ==========================================================================
   16. RESPONSIVE — MOBILE PORTRAIT (≤ 768px)
   ========================================================================== */
@media (max-width: 768px) {

    /* --- Navigation (horizontal compact, safe inset) --- */
    .top-nav {
        top: 12px;
        left: 16px;
        right: 16px;
        gap: 8px;
    }

    .logo-mark {
        height: 34px;
    }

    .pill-btn {
        padding: 8px 16px;
        font-size: 0.75rem;
        /* Remove expensive backdrop-filter on mobile */
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        background: rgba(30, 30, 30, 0.85);
    }

    .pill-btn.solid {
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }

    /* --- Footer (left-aligned, native feel) --- */
    .hud-footer {
        bottom: 12px;
        left: 24px;
        right: 24px;
        font-size: 0.6rem;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        gap: 8px;
    }

    /* --- Decorative --- */
    .cyber-frame {
        display: none;
    }

    /* --- Reduce expensive compositing on mobile --- */
    .detail-overlay {
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        background: rgba(3, 3, 3, 0.98);
    }

    .menu-dropdown {
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        background: rgba(5, 5, 5, 0.95);
    }

    .glass-panel {
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        background: rgba(10, 10, 10, 0.75);
    }

    /* --- Menu (full-width card) --- */
    .menu-dropdown {
        top: 64px;
        left: 16px;
        right: 16px;
        border-radius: 16px;
        padding: 16px 20px;
        gap: 12px;
    }

    .menu-item {
        font-size: 0.85rem;
        padding: 12px 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    }

    .menu-item:last-child {
        border-bottom: none;
    }

    /* ==============================================
       MOBILE-NATIVE CONTENT LAYOUT
       Left-aligned hierarchy, generous margins,
       content that breathes instead of cramming.
       ============================================== */

    .cinematic-node {
        width: auto;
        max-width: none;
        left: 0;
        right: 0;
        transform: translate(0, -50%);
        padding-left: 24px;
        padding-right: 24px;
        box-sizing: border-box;
        text-align: left;
    }

    /* --- Hero: top-biased position, left-aligned, room for crystal --- */
    #node-hero {
        top: 48%;
        text-align: left;
    }

    #node-hero .label-text {
        text-align: left;
    }

    #node-hero .body-text {
        margin-left: 0;
        margin-right: 0;
        max-width: 100%;
    }

    /* --- Typography: sized for handheld reading --- */
    .display-text {
        font-size: clamp(2rem, 8vw, 2.8rem);
        margin-bottom: 1rem;
        line-height: 1.15;
    }

    .headline-text {
        font-size: clamp(1.4rem, 5.5vw, 1.9rem);
        margin-bottom: 0.75rem;
        line-height: 1.2;
    }

    .body-text {
        font-size: 0.92rem;
        line-height: 1.7;
        max-width: 100%;
        margin-left: 0;
        margin-right: 0;
    }

    .label-text {
        font-size: 0.68rem;
        letter-spacing: 0.2em;
        margin-bottom: 1rem;
    }

    /* --- Glass panels: inset cards with breathing room --- */
    .glass-panel {
        padding: clamp(1.5rem, 5vw, 2rem);
        border-radius: 20px;
        margin-left: 0;
        margin-right: 0;
    }

    .glass-panel .body-text {
        max-width: 100%;
    }

    /* --- Arch nodes: left-aligned card layout, not centered --- */
    #node-arch-1,
    #node-arch-2 {
        max-width: none;
        text-align: left !important;
    }

    #node-arch-1 .label-text,
    #node-arch-2 .label-text {
        text-align: left;
    }

    #node-arch-2 .body-text {
        margin-left: 0;
        margin-right: 0;
    }

    /* --- Ethos section --- */
    #node-ethos {
        text-align: left;
    }

    #node-ethos .body-text {
        margin-left: 0;
    }

    /* --- Contact node --- */
    #node-contact {
        text-align: left;
    }

    #node-contact .display-text {
        font-size: clamp(2rem, 8vw, 2.8rem) !important;
        margin-bottom: 1.25rem !important;
    }

    #node-contact .pill-btn {
        font-size: 0.85rem !important;
        padding: 14px 32px !important;
    }

    /* --- Overlays (scrollable, mobile-native) --- */
    .detail-overlay {
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        padding: 0;
        align-items: flex-start;
        box-sizing: border-box;
    }

    .overlay-content {
        max-width: 100%;
        width: 100%;
        padding: 72px 24px 40px;
        box-sizing: border-box;
        text-align: left;
    }

    .close-btn {
        position: fixed;
        top: 14px;
        right: 16px;
        font-size: 0.7rem;
        padding: 10px 14px;
        z-index: 210;
        background: rgba(3, 3, 3, 0.85);
        backdrop-filter: blur(8px);
        border-radius: 10px;
    }

    .overlay-title {
        font-size: clamp(1.6rem, 6vw, 2.2rem);
        margin-bottom: 1rem;
        text-align: left;
    }

    .overlay-desc {
        font-size: 0.92rem;
        line-height: 1.7;
        margin-bottom: 1.75rem;
        text-align: left;
    }

    .tech-grid {
        gap: 0.75rem;
        grid-template-columns: 1fr;
    }

    .tech-spec {
        padding: 18px 20px;
        border-radius: 14px;
    }

    .tech-spec-label {
        margin-bottom: 8px;
        font-size: 0.62rem;
    }

    .tech-spec-val {
        font-size: 0.88rem;
        line-height: 1.6;
    }

    /* Contact overlay */
    #contact-overlay .overlay-title {
        font-size: clamp(1.6rem, 6vw, 2.2rem) !important;
        text-align: left;
    }

    #contact-overlay .overlay-desc {
        text-align: left !important;
    }
}

/* ==========================================================================
   17. RESPONSIVE — LANDSCAPE ON SMALL DEVICES
   ========================================================================== */
@media (max-height: 500px) and (orientation: landscape) {

    /* --- Ultra-compact Navigation --- */
    .top-nav {
        top: 6px;
        left: 10px;
        right: 10px;
        gap: 6px;
    }

    .logo-mark {
        height: 26px;
    }

    .pill-btn {
        padding: 5px 12px;
        font-size: 0.65rem;
    }

    /* --- Ultra-compact Footer --- */
    .hud-footer {
        bottom: 4px;
        left: 10px;
        right: 10px;
        font-size: 0.55rem;
        flex-direction: row;
        gap: 16px;
        align-items: center;
        text-align: left;
    }

    .cyber-frame {
        display: none;
    }

    /* --- Menu (horizontal wrap for landscape) --- */
    .menu-dropdown {
        top: 40px;
        left: 10px;
        right: auto;
        flex-direction: row;
        flex-wrap: wrap;
        gap: 6px;
        padding: 10px 14px;
    }

    .menu-item {
        font-size: 0.7rem;
        padding: 5px 10px;
        border-bottom: none;
    }

    /* --- Content Nodes (fit short viewport) --- */
    .cinematic-node {
        width: auto;
        left: 0;
        right: 0;
        max-width: 700px;
        margin: 0 auto;
        padding-left: 20px;
        padding-right: 20px;
        box-sizing: border-box;
        text-align: left;
        transform: translate(0, -50%);
    }

    .display-text {
        font-size: clamp(1.1rem, 3.5vw, 1.8rem);
        margin-bottom: 0.4rem;
    }

    .headline-text {
        font-size: clamp(0.95rem, 3vw, 1.4rem);
        margin-bottom: 0.4rem;
    }

    .body-text {
        font-size: clamp(0.7rem, 1.6vw, 0.85rem);
        line-height: 1.35;
        max-width: 100%;
        margin-left: 0;
    }

    .label-text {
        font-size: 0.55rem;
        margin-bottom: 0.3rem;
        letter-spacing: 0.15em;
    }

    .glass-panel {
        padding: clamp(0.75rem, 2vw, 1.25rem);
        border-radius: 12px;
    }

    /* Left-align arch nodes in landscape */
    #node-arch-1,
    #node-arch-2 {
        max-width: 600px;
        text-align: left !important;
    }

    #node-arch-1 .label-text,
    #node-arch-2 .label-text {
        text-align: left;
    }

    #node-arch-2 .body-text {
        margin-left: 0;
        margin-right: 0;
    }

    /* Contact node inline overrides */
    #node-contact .display-text {
        font-size: clamp(1.1rem, 3.5vw, 1.6rem) !important;
        margin-bottom: 0.5rem !important;
    }

    #node-contact .pill-btn {
        font-size: 0.75rem !important;
        padding: 8px 20px !important;
    }

    /* --- Overlays (scrollable, compact) --- */
    .detail-overlay {
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        padding: 0;
        align-items: flex-start;
        box-sizing: border-box;
    }

    .overlay-content {
        max-width: 100%;
        width: 100%;
        padding: 44px 16px 16px;
        box-sizing: border-box;
        text-align: left;
    }

    .close-btn {
        position: fixed;
        top: 6px;
        right: 10px;
        font-size: 0.6rem;
        padding: 5px 8px;
        z-index: 210;
        background: rgba(3, 3, 3, 0.85);
        backdrop-filter: blur(8px);
        border-radius: 6px;
    }

    .overlay-title {
        font-size: clamp(1rem, 3vw, 1.5rem);
        margin-bottom: 0.5rem;
        text-align: left;
    }

    .overlay-desc {
        font-size: 0.75rem;
        margin-bottom: 0.75rem;
        line-height: 1.4;
        text-align: left;
    }

    .tech-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }

    .tech-spec {
        padding: 10px;
    }

    .tech-spec-label {
        font-size: 0.55rem;
        margin-bottom: 3px;
    }

    .tech-spec-val {
        font-size: 0.7rem;
        line-height: 1.35;
    }

    /* Contact overlay inline overrides */
    #contact-overlay .overlay-title {
        font-size: clamp(1rem, 3vw, 1.5rem) !important;
    }
}

/* ==========================================================================
   18. RESPONSIVE — VERY SMALL SCREENS (≤ 380px, e.g. iPhone SE)
   ========================================================================== */
@media (max-width: 380px) {
    .pill-btn {
        padding: 6px 10px;
        font-size: 0.68rem;
    }

    .logo-mark {
        height: 28px;
    }

    .top-nav {
        gap: 6px;
    }

    .cinematic-node {
        padding-left: 18px;
        padding-right: 18px;
    }

    .display-text {
        font-size: clamp(1.6rem, 7.5vw, 2.2rem);
    }

    .headline-text {
        font-size: clamp(1.2rem, 5vw, 1.6rem);
    }

    .body-text {
        font-size: 0.85rem;
    }

    .glass-panel {
        padding: 1.25rem;
    }
}
