/* ==========================================================================
   BIG O, INC. // IPHONE SAFARI FULLY OPTIMIZED STYLESHEET
   100dvh Dynamic Viewport, iOS Touch Fixes, Dual-Split Low-Poly Background
   ========================================================================== */

:root {
    --bg-base: #08111f;
    --bg-surface: rgba(18, 26, 38, 0.85);
    --bg-glass: rgba(14, 22, 32, 0.88);
    
    --text-primary: #ffffff;
    --text-muted: #94a3b8;
    --text-dim: #5c6b73;
    
    --accent-red: #00f0ff;        /* Electric Aqua / Azure */
    --accent-coral: #02c39a;      /* Deep Teal */
    --accent-gold: #00f5d4;       /* Bright Mint Aqua */
    --accent-emerald: #00e676;    /* Neon Emerald */
    --accent-cyan: #00b4d8;       /* Oceanic Azure */
    
    --card-border: rgba(0, 240, 255, 0.18);
    --card-border-hover: rgba(0, 240, 255, 0.65);
    --glow-color: rgba(0, 240, 255, 0.3);
    --glow-bright: rgba(2, 195, 154, 0.45);
    --mesh-shift-x: 0px;
    --mesh-shift-y: 0px;
    --backdrop-tilt-x: 0deg;
    --backdrop-tilt-y: 0deg;
    --sweep-shift-x: 0px;
    --sweep-shift-y: 0px;
    --grid-shift-x: 0px;
    --grid-shift-y: 0px;
    --glow-teal-x: 0px;
    --glow-teal-y: 0px;
    --glow-crimson-x: 0px;
    --glow-crimson-y: 0px;
    --glow-smoke-x: 0px;
    --glow-smoke-y: 0px;
    --signal-x: 50%;
    --signal-y: 50%;
}

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

/* CUSTOM SELECTION COLOR SCHEME */
::selection {
    background: var(--accent-red);
    color: #080b12;
    text-shadow: none;
}

::-moz-selection {
    background: var(--accent-red);
    color: #080b12;
    text-shadow: none;
}

html {
    width: 100%;
    height: 100%;
    height: -webkit-fill-available;
    overflow: hidden;
    background-color: var(--bg-base);
}

body {
    width: 100%;
    height: 100%;
    height: 100vh;
    height: 100dvh;
    height: -webkit-fill-available;
    overflow: hidden;
    background-color: var(--bg-base);
    color: var(--text-primary);
    font-family: 'Space Grotesk', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -webkit-text-size-adjust: 100%;
    
    /* PREVENT TEXT SELECTION ON DOUBLE CLICK & iOS HIGHLIGHTS */
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

a {
    color: inherit;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
}

button {
    font-family: inherit;
    cursor: default;
    border: none;
    outline: none;
    background: none;
    -webkit-tap-highlight-color: transparent;
}

.mono {
    font-family: 'JetBrains Mono', monospace;
}

.shell {
    width: min(1100px, calc(100% - 40px));
    margin-inline: auto;
}

/* Luminous Aurora Orbit Backdrop */
.lowpoly-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background: #0b2542;
    overflow: hidden;
    isolation: isolate;
    perspective: 1200px;
}

.lowpoly-backdrop > svg {
    display: none;
}

.luminous-backdrop-art {
    position: relative;
    z-index: 1;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: translate3d(var(--mesh-shift-x), var(--mesh-shift-y), 0) scale(1.06);
    transform-origin: center;
    transition: transform 180ms linear;
    will-change: transform;
    filter: brightness(1.08) saturate(1.14) contrast(1.02);
    animation: luminousOrbitDrift 22s ease-in-out infinite alternate;
}

/* A slow spectral sweep gives the static facets a sense of depth. */
.lowpoly-backdrop::before {
    content: '';
    position: absolute;
    z-index: 2;
    inset: -35%;
    pointer-events: none;
    background:
        linear-gradient(112deg, transparent 29%, rgba(151, 255, 247, 0.12) 43%, transparent 56%),
        linear-gradient(68deg, transparent 45%, rgba(255, 186, 207, 0.1) 59%, transparent 70%);
    mix-blend-mode: screen;
    animation: spectralSweep 18s ease-in-out infinite alternate;
}

/* This layer is positioned by JS and flashes beneath the clicked signal. */
.lowpoly-backdrop::after {
    content: '';
    position: absolute;
    z-index: 3;
    inset: 0;
    pointer-events: none;
    background: radial-gradient(circle at var(--signal-x) var(--signal-y), rgba(255, 255, 255, 0.2) 0, rgba(0, 240, 255, 0.1) 7%, rgba(255, 61, 85, 0.055) 16%, transparent 31%);
    mix-blend-mode: screen;
    opacity: 0;
}

.lowpoly-backdrop.signal-impact::after {
    animation: signalFacetFlash 680ms cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes luminousOrbitDrift {
    0% { transform: translate3d(calc(-1.2% + var(--mesh-shift-x)), calc(-0.7% + var(--mesh-shift-y)), 0) scale(1.06); }
    100% { transform: translate3d(calc(1.2% + var(--mesh-shift-x)), calc(0.7% + var(--mesh-shift-y)), 0) scale(1.09); }
}

@keyframes spectralSweep {
    0% { transform: translate3d(calc(-7% + var(--sweep-shift-x)), calc(-3% + var(--sweep-shift-y)), 0) rotate(-2deg); opacity: 0.55; }
    100% { transform: translate3d(calc(7% + var(--sweep-shift-x)), calc(3% + var(--sweep-shift-y)), 0) rotate(2deg); opacity: 1; }
}

@keyframes signalFacetFlash {
    0% { opacity: 0; transform: scale(0.82); }
    16% { opacity: 1; }
    100% { opacity: 0; transform: scale(1.18); }
}

/* Ambient Volumetric Lighting Orbs */
.ambient-glow {
    position: fixed;
    border-radius: 50%;
    filter: blur(140px);
    z-index: 2;
    pointer-events: none;
    opacity: 0.58;
    animation: orbDrift 16s ease-in-out infinite alternate;
}

.orb-teal {
    top: -120px;
    left: -120px;
    background: radial-gradient(circle, rgba(106, 255, 244, 0.34) 0%, rgba(0, 209, 232, 0.17) 50%, transparent 80%);
    width: 700px;
    height: 700px;
    --orb-shift-x: var(--glow-teal-x);
    --orb-shift-y: var(--glow-teal-y);
}

.orb-crimson {
    top: -100px;
    right: -100px;
    background: radial-gradient(circle, rgba(255, 156, 185, 0.32) 0%, rgba(255, 100, 119, 0.18) 50%, transparent 80%);
    width: 700px;
    height: 700px;
    --orb-shift-x: var(--glow-crimson-x);
    --orb-shift-y: var(--glow-crimson-y);
    animation-delay: -6s;
    animation-duration: 20s;
}

.orb-smoke {
    bottom: -150px;
    left: 25%;
    background: radial-gradient(circle, rgba(109, 87, 214, 0.28) 0%, rgba(22, 39, 80, 0.36) 70%, transparent 100%);
    width: 900px;
    height: 500px;
    --orb-shift-x: var(--glow-smoke-x);
    --orb-shift-y: var(--glow-smoke-y);
    animation-delay: -11s;
    animation-duration: 24s;
}

@keyframes orbDrift {
    0% { transform: translate3d(calc(-2% + var(--orb-shift-x)), calc(-1% + var(--orb-shift-y)), 0) scale(0.96); opacity: 0.68; }
    100% { transform: translate3d(calc(3% + var(--orb-shift-x)), calc(2% + var(--orb-shift-y)), 0) scale(1.08); opacity: 0.92; }
}

#particle-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    z-index: 3;
    opacity: 0.82;
    pointer-events: auto;
    touch-action: none;
    cursor: default;
}

.mesh-grid-overlay {
    position: fixed;
    inset: 0;
    z-index: 4;
    pointer-events: none;
    background-image:
        radial-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, transparent 49.8%, rgba(255, 255, 255, 0.012) 50%, transparent 50.2%),
        radial-gradient(ellipse at center, transparent 18%, rgba(2, 12, 30, 0.08) 62%, rgba(2, 10, 28, 0.28) 100%);
    background-size: 32px 32px, 192px 100%, 100% 100%;
    mask-image: radial-gradient(ellipse at center, black 20%, rgba(0, 0, 0, 0.72) 58%, transparent 100%);
    transform: translate3d(var(--grid-shift-x), var(--grid-shift-y), 0) scale(1.02);
    transform-origin: center;
    transition: transform 180ms linear;
    will-change: transform;
    animation: gridDrift 28s linear infinite;
}

@keyframes gridDrift {
    to { background-position: 32px 32px, 192px 0; }
}

@media (prefers-reduced-motion: reduce) {
    .lowpoly-backdrop::before,
    .luminous-backdrop-art,
    .ambient-glow,
    .mesh-grid-overlay {
        animation: none !important;
    }

    .luminous-backdrop-art {
        transform: scale(1.04);
        transition: none;
    }
}

/* Side Navigation Arrows */
.side-nav {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    z-index: 80;
    width: 55px;
    height: 100px;
    background: rgba(14, 22, 32, 0.75);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--card-border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    cursor: default;
    -webkit-tap-highlight-color: transparent;
}

.side-nav-prev {
    left: 0;
    border-radius: 0 16px 16px 0;
    border-left: none;
}

.side-nav-next {
    right: 0;
    border-radius: 16px 0 0 16px;
    border-right: none;
}

.side-nav:hover, .side-nav:active {
    width: 70px;
    background: var(--accent-red);
    color: #080b12;
    box-shadow: 0 0 35px var(--accent-red);
}

.nav-arrow {
    font-size: 2.5rem;
    font-weight: 300;
    line-height: 1;
    pointer-events: none;
}

.nav-label-pop {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    padding: 6px 12px;
    background: rgba(14, 22, 32, 0.95);
    backdrop-filter: blur(16px);
    border: 1px solid var(--card-border);
    border-radius: 6px;
    color: var(--accent-red);
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease;
}

.side-nav-prev .nav-label-pop { left: 75px; }
.side-nav-next .nav-label-pop { right: 75px; }

.side-nav:hover .nav-label-pop {
    opacity: 1;
}

/* Spatial Viewport & Slides */
.spatial-viewport {
    position: relative;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    perspective: 1400px;
    perspective-origin: 50% 50%;
    overflow: hidden;
    z-index: 10;
    cursor: default;
}

.spatial-deck {
    position: relative;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    transition: transform 0.85s cubic-bezier(0.16, 1, 0.3, 1);
}

.spatial-slide {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transform-style: preserve-3d;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    transition: transform 0.85s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.85s ease;
    overflow: hidden;
    padding: 0;
}

.spatial-slide.active {
    opacity: 1;
    pointer-events: auto;
    transform: translate3d(0, 0, 0) rotateY(0deg) scale(1);
    z-index: 20;
}

.spatial-slide.prev-slide {
    opacity: 0;
    pointer-events: none;
    transform: translate3d(-100vw, 0, -300px) rotateY(25deg) scale(0.85);
    z-index: 10;
}

.spatial-slide.next-slide {
    opacity: 0;
    pointer-events: none;
    transform: translate3d(100vw, 0, -300px) rotateY(-25deg) scale(0.85);
    z-index: 10;
}

/* Minimal Brand Hero (Home Slide) */
.home-minimal-content {
    align-items: center;
    justify-content: center;
    text-align: center;
    height: 100%;
    min-height: 100dvh;
    cursor: default;
}

.minimal-brand-hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    cursor: default;
}

.minimal-hero-title {
    font-family: 'Syne', sans-serif;
    font-size: clamp(2.8rem, 6.5vw, 5.2rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    color: #ffffff;
    line-height: 1;
    text-shadow: 0 0 35px rgba(0, 240, 255, 0.25), 0 10px 40px rgba(0, 0, 0, 0.9);
}

.hero-tagline {
    font-family: 'JetBrains Mono', monospace;
    font-size: clamp(0.85rem, 1.8vw, 1.2rem);
    font-weight: 700;
    color: var(--accent-red);
    letter-spacing: 0.08em;
    margin-top: 4px;
    text-shadow: 0 0 20px rgba(0, 240, 255, 0.45);
}

/* Contact Form Layout */
.minimal-dispatch {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 50px;
    align-items: center;
    width: 100%;
}

.dispatch-info h2 {
    font-family: 'Syne', sans-serif;
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 800;
    color: #ffffff;
    margin-bottom: 20px;
    text-shadow: 0 0 20px rgba(0, 240, 255, 0.15);
}

.eyebrow {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.18em;
    color: var(--accent-red);
    margin-bottom: 8px;
    display: block;
    text-shadow: 0 0 12px rgba(0, 240, 255, 0.35);
}

.contact-details {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.detail-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--accent-red);
    letter-spacing: 0.12em;
}

.detail-val {
    font-size: 1.1rem;
    font-weight: 600;
    color: #ffffff;
}

.dispatch-form-card {
    padding: 36px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 20px;
}

.form-group label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 0.1em;
}

.form-input {
    width: 100%;
    padding: 14px 18px;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.45);
    border: 1px solid var(--card-border);
    color: #ffffff;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.95rem;
    outline: none;
    transition: all 0.2s ease;
    user-select: text;
    -webkit-user-select: text;
}

.form-input:focus {
    border-color: var(--accent-red);
    box-shadow: 0 0 18px var(--glow-color);
    background: rgba(0, 0, 0, 0.6);
}

.form-textarea {
    height: 110px;
    resize: none;
}

.form-error {
    display: none;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.68rem;
    color: var(--accent-red);
    margin-top: 4px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 28px;
    border-radius: 12px;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.92rem;
    font-weight: 700;
    transition: all 0.25s ease;
}

.btn-primary {
    background: var(--accent-red);
    color: #080b12;
    box-shadow: 0 4px 18px rgba(0, 240, 255, 0.35);
}

.btn-primary:hover {
    box-shadow: 0 0 25px var(--accent-red);
    transform: translateY(-2px);
}

.btn-block {
    width: 100%;
}

.dispatch-success {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px;
    border-radius: 12px;
    background: rgba(2, 195, 154, 0.15);
    border: 1px solid var(--accent-coral);
    color: var(--accent-coral);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    font-weight: 800;
    margin-top: 16px;
}

/* Projects Side Page */
.minimal-heading {
    margin-bottom: 36px;
}

.minimal-heading h2 {
    font-family: 'Syne', sans-serif;
    font-size: clamp(2.5rem, 5vw, 4.2rem);
    font-weight: 800;
    line-height: 1;
    color: #ffffff;
    text-shadow: 0 0 20px rgba(0, 240, 255, 0.15);
}

.portal-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
}

.glass-card {
    background: var(--bg-surface);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    padding: clamp(16px, 2.5vw, 26px);
    transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    transform-style: preserve-3d;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 220px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow: hidden !important;
}

.portal-card:hover {
    border-color: var(--card-border-hover);
    box-shadow: 0 20px 50px var(--glow-color);
    transform: translateY(-6px) scale(1.02);
}

/* Brand Title Row with Larger Inline Logo Next to Title */
.card-brand-title-row {
    display: flex;
    align-items: center;
    gap: clamp(10px, 1.5vw, 16px);
    margin-bottom: 16px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

.card-logo-inline {
    width: clamp(38px, 3.5vw, 48px);
    height: clamp(38px, 3.5vw, 48px);
    border-radius: 10px;
    object-fit: contain;
    box-shadow: 0 0 18px rgba(0, 240, 255, 0.3);
    flex-shrink: 0;
}

.portal-card h3 {
    font-family: 'Syne', sans-serif;
    font-size: clamp(0.95rem, 1.5vw, 1.45rem) !important;
    font-weight: 800;
    margin: 0;
    color: #ffffff;
    line-height: 1.15;
    letter-spacing: -0.02em;
    overflow-wrap: anywhere !important;
    word-break: break-word !important;
    hyphens: auto;
    min-width: 0;
    max-width: 100%;
    flex: 1 1 auto;
}

.card-description {
    font-size: 0.88rem;
    color: var(--text-muted);
    line-height: 1.5;
    margin-bottom: 20px;
    user-select: text;
    -webkit-user-select: text;
}

.portal-actions {
    display: flex;
    flex-wrap: nowrap;
    gap: 6px;
    justify-content: flex-end;
    align-items: center;
    margin-top: auto;
    width: 100%;
}

.card-btn {
    font-family: 'JetBrains Mono', monospace;
    font-size: clamp(0.58rem, 1vw, 0.72rem);
    font-weight: 800;
    padding: 8px clamp(6px, 1vw, 14px);
    border-radius: 8px;
    transition: all 0.2s ease;
    white-space: nowrap;
    text-align: center;
    flex: 0 1 auto;
}

.card-btn-primary {
    background: var(--accent-red);
    color: #080b12;
    box-shadow: 0 4px 15px rgba(0, 240, 255, 0.35);
}

.card-btn-primary:hover {
    box-shadow: 0 0 22px var(--accent-red);
    transform: translateY(-1px);
}

.card-btn-store {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--card-border);
    color: var(--text-primary);
}

.card-btn-store:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: var(--accent-red);
}

@media (max-width: 850px) {
    .minimal-dispatch {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .side-nav {
        width: 48px;
        height: 84px;
    }
}

/* HIDE ALL SCROLLBARS GLOBALLY */
::-webkit-scrollbar {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
}

html, body, .spatial-viewport, .spatial-deck, .spatial-slide {
    -ms-overflow-style: none !important;
    scrollbar-width: none !important;
    overflow: hidden !important;
}

/* CURSOR POINTER ONLY ON CLICKABLE BUTTONS & LINKS */
a, button, input[type="submit"], .btn, .card-btn, .side-nav, .icon-btn, .nav-trigger-btn {
    cursor: pointer !important;
}

html, body, #particle-canvas, .spatial-viewport, .spatial-slide, .home-minimal-content, .minimal-brand-hero, .glass-card, .portal-card, h1, h2, h3, p, label {
    cursor: default !important;
}

/* Keep the secondary desktop pages compact without changing their layout. */
@media (min-width: 851px) {
    #slide-contact > .slide-content,
    #slide-projects > .slide-content {
        transform: scale(0.9);
        transform-origin: center center;
    }
}

/* MOBILE CONTENT SCROLLING
   The document remains fixed for the spatial deck; the active content slide
   becomes the native momentum scroller when its cards exceed the viewport. */
@media (max-width: 850px) {
    .spatial-slide.active:not(#slide-home) {
        display: block;
        overflow-x: hidden !important;
        overflow-y: auto !important;
        overscroll-behavior-x: none;
        overscroll-behavior-y: contain;
        -webkit-overflow-scrolling: touch;
        touch-action: pan-y;
        scrollbar-width: none !important;
    }

    .spatial-slide.active:not(#slide-home) > .slide-content {
        width: min(1100px, calc(100% - 40px));
        min-height: 100%;
        margin-inline: auto;
        padding-top: max(28px, env(safe-area-inset-top));
        padding-bottom: max(52px, env(safe-area-inset-bottom));
    }

    #slide-projects .minimal-heading {
        margin-bottom: 24px;
    }

    #slide-projects .portal-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 20px;
    }

    #slide-projects .portal-card {
        min-height: 0;
    }

    #slide-home.active {
        overflow: hidden !important;
        touch-action: manipulation;
    }
}
