:root {
    color-scheme: dark;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: #0d100e;
    color: #f1f4ec;
    --graphite-950: #0d100e;
    --graphite-900: #111512;
    --graphite-800: #171a18;
    --bio-lime: #b7e36b;
    --bio-muted: #789465;
    --message-blue: #8ac9ff;
}

/* Cursor policy: the animated viewport is not itself an interactive control.
   Only genuine controls opt back into the hand cursor. */
html,
body,
body * {
    cursor: default !important;
}

a[href],
a[href] *,
button:not(.capacitor-button),
button:not(.capacitor-button) *,
[role="button"]:not(.capacitor-button),
[role="button"]:not(.capacitor-button) * {
    cursor: pointer !important;
}

*, *::before, *::after { box-sizing: border-box; }

html {
    min-width: 280px;
    min-height: 100%;
    background: var(--graphite-950);
    -webkit-text-size-adjust: 100%;
}

body {
    min-width: 280px;
    min-height: 100%;
    margin: 0;
    overflow-x: clip;
    background: var(--graphite-950);
}

.board-stage {
    position: relative;
    display: grid;
    width: 100%;
    min-height: 100vh;
    min-height: 100svh;
    overflow: hidden;
    isolation: isolate;
    background-color: var(--graphite-900);
    background-image: url("../assets/motherboard-road-extended.png");
    background-repeat: no-repeat;
    background-position: 50% 50%;
    background-size: cover;
    cursor: default;
}

#energy-layer,
.board-shade {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

#traffic-guides {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
}

#energy-layer {
    z-index: 1;
    display: block;
}

#fountain-3d-host {
    position: absolute;
    z-index: 5;
    display: none;
    pointer-events: none;
    overflow: hidden;
    visibility: visible;
    opacity: 1;
}

/* The landing page is a single fixed viewport. Animation overlays must never
   change document dimensions or alter the original cover composition. */
html,
body {
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.board-stage {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    min-height: 0;
}

.hero-copy {
    height: 100%;
    min-height: 0;
}

.language-selector {
    position: absolute;
    z-index: 4;
    top: clamp(1rem, 3vw, 2rem);
    left: clamp(1rem, 3vw, 2.25rem);
    display: flex;
    align-items: center;
    gap: .38rem;
    padding: .48rem .68rem;
    border: 1px solid rgba(241, 244, 236, .16);
    border-radius: 999px;
    color: rgba(241, 244, 236, .38);
    background: rgba(8, 11, 9, .42);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.language-selector button {
    appearance: none;
    padding: 0;
    border: 0;
    color: rgba(241, 244, 236, .58);
    background: none;
    font: inherit;
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .1em;
    cursor: pointer;
    transition: color 160ms ease, text-shadow 160ms ease;
}

.language-selector button:hover,
.language-selector button[aria-pressed="true"] {
    color: var(--bio-lime);
    text-shadow: 0 0 12px rgba(183, 227, 107, .3);
}

.language-selector button:focus-visible {
    outline: 2px solid var(--message-blue);
    outline-offset: 4px;
    border-radius: 2px;
}

#fountain-3d-host canvas {
    width: 100%;
    height: 100%;
    display: block;
}

.board-shade {
    z-index: 2;
    pointer-events: none;
    background:
        linear-gradient(90deg, rgba(8, 11, 9, .86) 0%, rgba(8, 11, 9, .60) 28%, rgba(8, 11, 9, .12) 58%, transparent 82%),
        linear-gradient(180deg, rgba(8, 10, 9, .18), transparent 42%, rgba(8, 10, 9, .28));
}

.hero-copy {
    position: relative;
    z-index: 3;
    display: flex;
    align-items: center;
    width: min(55rem, 65%);
    min-width: 0;
    min-height: 100vh;
    min-height: 100svh;
    padding: 0 0 0 clamp(4rem, 7vw, 7rem);
    pointer-events: none;
}

.copy-panel {
    position: relative;
    isolation: isolate;
    container-type: inline-size;
    width: min(100%, 42rem);
    min-width: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

.hero-copy::before {
    position: absolute;
    z-index: -1;
    top: 0;
    bottom: 0;
    left: 0;
    width: min(100%, 48rem);
    content: "";
    pointer-events: none;
    background: linear-gradient(90deg, rgba(7, 10, 8, .70) 0%, rgba(7, 10, 8, .58) 42%, rgba(7, 10, 8, .28) 72%, transparent 100%);
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: .65rem;
    margin-bottom: clamp(.75rem, 2vw, 1.15rem);
    color: var(--bio-lime);
    font-size: clamp(.65rem, .8vw, .78rem);
    font-weight: 700;
    letter-spacing: .15em;
    text-transform: uppercase;
}

.eyebrow::before {
    width: clamp(1.25rem, 2.3vw, 1.8rem);
    height: 1px;
    content: "";
    flex: 0 0 auto;
    background: currentColor;
}

h1 {
    max-width: 100%;
    margin: 0;
    overflow-wrap: normal;
    color: #f1f4ec;
    font-size: clamp(4rem, 5.6vw, 6.5rem);
    font-weight: 520;
    letter-spacing: -.062em;
    line-height: .94;
    text-wrap: balance;
}

p {
    max-width: 38rem;
    margin: clamp(1rem, 2.5vw, 1.65rem) 0 0;
    color: rgba(241, 244, 236, .72);
    font-size: clamp(.95rem, 1.25vw, 1.15rem);
    line-height: 1.65;
    text-wrap: pretty;
}

/* Compact desktop and tablet landscape */
@media (max-width: 1100px) {
    .board-stage { background-position: 56% 50%; }
    .hero-copy {
        width: min(48rem, 74%);
        padding: clamp(2rem, 6vw, 5rem);
    }
    .copy-panel { width: min(100%, 38rem); }
    h1 { font-size: clamp(3rem, 6.4vw, 4.5rem); }
}

/* Portrait tablets */
@media (max-width: 820px) and (orientation: portrait) {
    .board-stage { background-position: 61% 50%; }
    .board-shade {
        background:
            linear-gradient(180deg, rgba(8, 11, 9, .84) 0%, rgba(8, 11, 9, .58) 44%, rgba(8, 11, 9, .08) 74%),
            linear-gradient(90deg, rgba(8, 10, 9, .25), transparent 75%);
    }
    .hero-copy {
        align-items: flex-start;
        width: 100%;
        padding: clamp(4.5rem, 10vh, 7.5rem) clamp(1.5rem, 6vw, 3rem) 7rem;
    }
    .copy-panel { width: min(100%, 37rem); }
}

/* Phones: recompose rather than shrink the desktop panel */
@media (max-width: 600px) {
    .board-stage {
        min-height: 100vh;
        min-height: 100svh;
    }
    /* Keep the left-side mining chips in the portrait crop. */
    .board-stage { background-position: 44% 50%; }
    .board-shade {
        background:
            linear-gradient(180deg, rgba(8, 11, 9, .90) 0%, rgba(8, 11, 9, .62) 42%, rgba(8, 11, 9, .08) 70%),
            linear-gradient(90deg, rgba(8, 10, 9, .16), transparent);
    }
    .hero-copy {
        align-items: flex-start;
        width: 100%;
        min-height: 100vh;
        min-height: 100svh;
        padding: clamp(3.5rem, 9vh, 5.5rem) clamp(1rem, 5vw, 1.5rem) 5rem;
    }
    .copy-panel {
        width: 100%;
        padding: 0;
        border-radius: 0;
        background: transparent;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }
    .eyebrow {
        margin-bottom: .75rem;
        font-size: clamp(.62rem, 2.6vw, .72rem);
    }
    h1 {
        font-size: clamp(2rem, 10.8cqi, 3.25rem);
        letter-spacing: -.052em;
        line-height: .96;
    }
    p {
        max-width: 32rem;
        margin-top: 1rem;
        font-size: clamp(.88rem, 3.6vw, 1rem);
        line-height: 1.52;
    }
}

/* Keep the motherboard at its original brightness. Darkness is confined to
   the gradient immediately behind the copy rather than covering the screen. */
.board-shade {
    background: transparent !important;
}

@media (max-width: 600px) {
    .hero-copy::before {
        width: 100%;
        background: linear-gradient(90deg, rgba(7, 10, 8, .72) 0%, rgba(7, 10, 8, .54) 55%, rgba(7, 10, 8, .18) 82%, transparent 100%);
    }
}

/* Very narrow phones */
@media (max-width: 360px) {
    .hero-copy { padding-inline: .75rem; }
    .copy-panel { padding: 0; }
    h1 { font-size: clamp(1.9rem, 10.5cqi, 2.6rem); }
    p { font-size: .86rem; }
}

/* Short screens and landscape phones */
@media (max-height: 620px) and (orientation: landscape) {
    .board-stage { background-position: 55% 50%; }
    .board-shade {
        background: linear-gradient(90deg, rgba(8, 11, 9, .88), rgba(8, 11, 9, .55) 45%, transparent 78%);
    }
    .hero-copy {
        align-items: center;
        width: min(44rem, 72%);
        min-height: 100vh;
        min-height: 100svh;
        padding: 1.25rem clamp(2rem, 6vw, 4rem);
    }
    .copy-panel {
        width: min(100%, 35rem);
        padding: 0;
        background: transparent;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }
    .eyebrow { margin-bottom: .5rem; }
    h1 { font-size: clamp(2rem, 8cqi, 3.7rem); }
    p {
        margin-top: .75rem;
        font-size: clamp(.82rem, 1.7vw, .95rem);
        line-height: 1.42;
    }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        scroll-behavior: auto !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
}
