/* v9 responsive experience: desktop elegance + dedicated mobile interaction */

:root {
    --mobile-safe-bottom: env(safe-area-inset-bottom, 0px);
}

body.mobile-menu-open {
    overflow: hidden;
}

body.mobile-menu-open::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 18;
    background:
        radial-gradient(circle at 86% 16%, rgba(73,216,255,.18), transparent 18rem),
        rgba(0, 4, 13, .72);
    backdrop-filter: blur(12px);
}

.menu-button {
    position: relative;
    align-items: center;
    gap: 8px;
    overflow: hidden;
}

.menu-pie {
    position: relative;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background:
        conic-gradient(from -45deg,
            rgba(73,216,255,1) 0deg 92deg,
            rgba(154,72,255,.95) 92deg 188deg,
            rgba(255,255,255,.22) 188deg 360deg);
    box-shadow: 0 0 22px rgba(73,216,255,.28);
    transition: transform .28s ease, box-shadow .28s ease;
}

.menu-pie::after {
    content: "";
    position: absolute;
    inset: 6px;
    border-radius: inherit;
    background: #071326;
}

.menu-button[aria-expanded="true"] .menu-pie {
    transform: rotate(135deg) scale(1.04);
    box-shadow: 0 0 30px rgba(154,72,255,.34);
}

@media (hover: none), (pointer: coarse) {
    .product-card:hover,
    .card:hover,
    .stats-strip article:hover,
    .team-card-rich:hover,
    .team-card-pro:hover,
    .button:hover,
    .site-nav > a:hover {
        transform: none !important;
    }

    .hero-visual img,
    .product-card,
    .card,
    .hero-visual,
    .team-card-rich,
    .team-card-pro {
        transition-duration: .22s;
    }
}

@media (max-width: 1120px) {
    .site-header {
        top: 10px;
        width: min(100% - 24px, var(--content-wide));
        min-height: 66px;
        padding: 9px 10px;
        align-items: center;
        border-radius: 34px;
    }

    .menu-button {
        display: inline-flex !important;
        min-width: 46px;
        min-height: 46px;
        padding: 0 13px;
        justify-content: center;
        background: rgba(255,255,255,.075);
        border-color: rgba(181,212,255,.24);
        z-index: 23;
    }

    .menu-text {
        font-size: .82rem;
        font-weight: 900;
        letter-spacing: .03em;
    }

    .site-nav {
        display: grid;
        position: fixed;
        z-index: 22;
        top: auto;
        left: 50%;
        right: auto;
        bottom: calc(16px + var(--mobile-safe-bottom));
        width: min(520px, calc(100% - 24px));
        transform: translate(-50%, 24px) scale(.96);
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        padding: 14px;
        gap: 8px;
        border-radius: 30px;
        border: 1px solid rgba(181,212,255,.22);
        background:
            linear-gradient(180deg, rgba(8,18,36,.96), rgba(4,10,23,.96));
        box-shadow: 0 34px 120px rgba(0,0,0,.56), inset 0 1px 0 rgba(255,255,255,.08);
        backdrop-filter: blur(22px) saturate(125%);
        transition: transform .28s cubic-bezier(.2,.8,.2,1), opacity .22s ease, visibility .22s ease;
    }

    .site-nav.is-open {
        display: grid;
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        transform: translate(-50%, 0) scale(1);
    }

    .site-nav > a,
    .site-nav .nav-cta {
        min-height: 50px;
        padding: 13px 15px;
        border-radius: 18px;
        background: rgba(255,255,255,.045);
        border: 1px solid rgba(255,255,255,.06);
        font-size: .98rem;
        display: flex;
        align-items: center;
        justify-content: space-between;
    }

    .site-nav > a::after {
        content: "›";
        color: rgba(255,255,255,.55);
        font-size: 1.25rem;
        line-height: 1;
    }

    .site-nav .nav-cta {
        justify-content: center;
        margin-top: 4px;
    }

    .site-nav .nav-cta::after {
        content: none;
    }

    .site-nav .language-switcher {
        width: 100%;
        justify-content: center;
        margin: 2px 0;
        padding: 5px;
        border-radius: 18px;
    }

    .site-nav .language-link {
        flex: 1;
        justify-content: center;
        min-height: 42px;
        border-radius: 14px;
    }
}

@media (max-width: 760px) {
    body {
        background:
            radial-gradient(circle at 20% -8%, rgba(42,125,255,.26), transparent 22rem),
            radial-gradient(circle at 90% 16%, rgba(154,72,255,.14), transparent 20rem),
            linear-gradient(180deg, var(--bg), var(--bg-deep) 74%);
    }

    body::before {
        background-size: 48px 48px;
        opacity: .66;
    }

    main {
        width: min(100% - 24px, var(--max-width));
    }

    .site-header,
    .site-footer {
        width: min(100% - 20px, var(--max-width));
    }

    .brand-official {
        max-width: calc(100vw - 96px);
        padding: 7px 10px 7px 8px;
    }

    .brand-copy strong {
        font-size: .9rem;
    }

    .brand-mark {
        width: 34px !important;
        height: 34px !important;
    }

    .menu-text {
        display: none;
    }

    .hero {
        min-height: auto;
        padding: 42px 0 20px;
        grid-template-columns: 1fr;
        gap: 26px;
    }

    .hero-logo-lockup {
        margin-bottom: 18px;
        width: fit-content;
    }

    h1 {
        font-size: clamp(2.18rem, 10.5vw, 3.25rem) !important;
        line-height: 1.02;
        max-width: 12.5ch;
    }

    h2 {
        font-size: clamp(1.42rem, 5.6vw, 2rem);
    }

    h3 {
        font-size: clamp(1.02rem, 4.5vw, 1.2rem);
    }

    p,
    .hero-lead,
    .page-hero p {
        font-size: .98rem;
        line-height: 1.62;
    }

    .eyebrow {
        font-size: .68rem;
        line-height: 1.25;
    }

    .hero-actions {
        display: grid;
        grid-template-columns: 1fr;
        gap: 10px;
        margin-top: 24px;
    }

    .button {
        min-height: 50px;
        width: 100%;
        padding: 13px 16px;
    }

    .hero-visual::before {
        inset: -12px;
        filter: blur(12px);
    }

    .hero-visual::after {
        display: none;
    }

    .hero-visual img {
        border-radius: 22px;
        transform: none !important;
        max-height: 360px;
        object-fit: cover;
    }

    .hero-glass-card {
        position: relative;
        left: auto;
        right: auto;
        bottom: auto;
        margin-top: -18px;
        border-radius: 18px;
    }

    .section {
        margin-top: 50px;
    }

    .stats-strip {
        grid-template-columns: 1fr 1fr !important;
        gap: 10px;
    }

    .stats-strip article {
        padding: 16px;
        min-height: 116px;
    }

    .stats-strip strong {
        font-size: clamp(1.5rem, 8vw, 2.15rem);
    }

    .stats-strip span {
        font-size: .84rem;
    }

    .problem-section,
    .ecosystem,
    .contact-panel,
    .story-narrative,
    .chain-section {
        border-radius: 22px;
        padding: 21px;
    }

    .product-duo,
    .grid-two,
    .ecosystem,
    .cards.three,
    .cards.four {
        grid-template-columns: 1fr !important;
    }

    .product-card {
        grid-template-columns: 1fr !important;
        min-height: 0;
        padding: 21px;
        border-radius: 23px;
    }

    .product-card h3 {
        font-size: clamp(1.45rem, 7vw, 2.05rem);
    }

    .product-card img {
        max-height: 220px;
        align-self: auto;
    }

    .story-long-copy {
        columns: 1;
    }

    .story-timeline-wide,
    .story-timeline {
        display: flex !important;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        padding: 2px 4px 12px;
        margin-left: -4px;
        margin-right: -4px;
        -webkit-overflow-scrolling: touch;
    }

    .story-timeline-wide article,
    .story-timeline article,
    .timeline-card {
        min-width: min(82vw, 330px);
        scroll-snap-align: start;
    }

    .team-grid-pro,
    .team-grid-rich,
    .team-grid {
        grid-template-columns: 1fr !important;
        gap: 14px;
    }

    .team-card-rich,
    .team-card-pro {
        min-height: 0;
        display: grid;
        grid-template-columns: 82px 1fr;
        align-items: start;
        gap: 14px;
        padding: 15px;
        overflow: hidden;
        border-radius: 22px;
    }

    .team-portrait-wrap {
        justify-content: flex-start;
        grid-row: span 2;
    }

    .team-card-rich img,
    .team-card img,
    .team-card-pro img {
        width: 72px !important;
        height: 72px !important;
        filter: grayscale(.25);
    }

    .team-card-copy {
        gap: 5px;
    }

    .team-card-copy p {
        font-size: .9rem;
        line-height: 1.48;
    }

    .team-detail-panel {
        position: static !important;
        width: auto !important;
        grid-column: 1 / -1;
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        transform: none !important;
        max-height: 0;
        overflow: hidden;
        transition: max-height .34s ease, margin-top .34s ease;
    }

    .team-card-pro.is-expanded .team-detail-panel,
    .team-card-rich.is-expanded .team-detail-panel {
        max-height: 560px;
        margin-top: 2px;
    }

    .team-detail-panel-inner {
        padding: 15px;
        border-radius: 18px;
        box-shadow: none;
    }

    .interaction-hint::after {
        content: " Tap a profile to open details.";
    }

    .partner-logos {
        grid-template-columns: repeat(2, 1fr);
    }

    .partner-logos img {
        height: 70px;
    }

    .site-footer {
        margin-top: 56px;
        padding: 20px;
        border-radius: 24px;
    }

    .footer-brand .brand-copy small {
        display: none;
    }
}

@media (max-width: 420px) {
    .stats-strip {
        grid-template-columns: 1fr !important;
    }

    .hero-logo-lockup span,
    .auth-brand small {
        display: none;
    }

    .site-nav {
        width: calc(100% - 16px);
        bottom: calc(10px + var(--mobile-safe-bottom));
        border-radius: 24px;
    }
}

/* Dashboard mobile adaptation */
@media (max-width: 780px) {
    .dashboard-page {
        display: block !important;
        min-height: 100vh;
    }

    .sidebar {
        position: sticky !important;
        top: 0;
        z-index: 40;
        min-height: auto !important;
        padding: 12px !important;
        border-right: 0 !important;
        border-bottom: 1px solid var(--line);
        background: rgba(2,7,17,.92) !important;
        backdrop-filter: blur(18px);
    }

    .sidebar .brand-dashboard {
        width: fit-content;
    }

    .sidebar-nav {
        display: flex !important;
        gap: 8px;
        overflow-x: auto;
        padding-bottom: 4px;
        -webkit-overflow-scrolling: touch;
    }

    .sidebar-nav a {
        flex: 0 0 auto;
        white-space: nowrap;
        min-height: 42px;
    }

    .dashboard-main {
        padding: 18px 12px 28px !important;
    }

    .dashboard-topbar,
    .orion-hero,
    .dashboard-section-title,
    .admin-hero-panel {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 14px;
    }

    .dashboard-topbar h1 {
        font-size: clamp(2rem, 10vw, 2.7rem) !important;
    }

    .user-pill {
        width: 100%;
        overflow-wrap: anywhere;
        justify-content: flex-start;
    }

    .admin-users-layout {
        grid-template-columns: 1fr !important;
    }

    .admin-form-panel {
        position: relative !important;
        top: auto !important;
    }

    .admin-user-card {
        padding: 16px;
    }

    .user-card-grid {
        grid-template-columns: 1fr !important;
    }

    .user-actions {
        grid-template-columns: 1fr !important;
    }

    .button-small,
    .danger-button {
        width: 100%;
    }

    .reset-link-panel {
        grid-template-columns: 1fr !important;
        padding: 14px;
    }

    .reset-link-box {
        overflow-wrap: anywhere;
    }
}

/* Touch-first auth */
@media (max-width: 700px) {
    .auth-topline,
    .auth-modal-stage {
        width: min(100% - 22px, 1180px) !important;
    }

    .auth-topline {
        margin-top: 12px;
    }

    .auth-modal-stage {
        min-height: calc(100vh - 78px);
        padding: 24px 0 42px;
    }

    .auth-card,
    .auth-modal-card {
        padding: 22px !important;
        border-radius: 24px;
    }

    .auth-card h1 {
        font-size: clamp(1.9rem, 10vw, 2.45rem) !important;
    }

    .auth-fields {
        gap: 18px;
    }

    .auth-card input,
    .login-modal-card input {
        min-height: 52px;
        font-size: 16px;
    }
}
