/* ==========================================================================
   FLAVR Studio — shared styles
   Tokens are derived from the logo: the violet "door" mark, outlined
   geometric letters, and the open bottom-right corner of the mark.
   ========================================================================== */

:root {
    --void: #07060c;
    --ink: #110f1b;
    --ink-2: #1a1729;
    --violet: #7f56c9;
    --uv: #b48cff;
    --amber: #ffb23e;
    --bone: #eeeaf6;
    --haze: #b4afc8;
    --line: rgba(180, 140, 255, 0.22);

    --f-display: "Jost", "Futura", "Century Gothic", sans-serif;
    --f-body: "Instrument Sans", "Helvetica Neue", Arial, sans-serif;
    --f-mono: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;

    --notch: clamp(2.25rem, 5vw, 4rem);
    --gutter: 1rem;
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-door: cubic-bezier(0.7, 0, 0.2, 1);
}

*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; font-size: 16px; }
/* On laptop and desktop layouts the whole interface scales with the screen:
   16px at 1440x900, smaller on short laptop screens, larger on big monitors. */
@media (min-width: 901px) {
    html { font-size: clamp(13px, min(1.111vw, 1.778vh), 18px); }
}

body {
    margin: 0;
    background: var(--void);
    color: var(--bone);
    font-family: var(--f-body);
    font-size: 1rem;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

img { max-width: 100%; display: block; }
a { color: inherit; }
button { font: inherit; color: inherit; }

::selection { background: var(--violet); color: #fff; }

:focus-visible {
    outline: 2px solid var(--amber);
    outline-offset: 3px;
}

.sr-only {
    position: absolute !important;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0 0 0 0);
    white-space: nowrap; border: 0;
}

/* ---------- Type ---------- */

.display {
    font-family: var(--f-display);
    font-weight: 500;
    font-size: clamp(2.6rem, 7vw, 6.2rem);
    line-height: 0.95;
    letter-spacing: -0.03em;
    margin: 0;
}

.h2 {
    font-family: var(--f-display);
    font-weight: 500;
    font-size: clamp(1.9rem, 3.6vw, 3.2rem);
    line-height: 1.02;
    letter-spacing: -0.02em;
    margin: 0;
}

.h3 {
    font-family: var(--f-display);
    font-weight: 600;
    font-size: clamp(1.25rem, 1.8vw, 1.6rem);
    line-height: 1.15;
    letter-spacing: -0.01em;
    margin: 0;
}

/* Hollow letters, after the outlined glyphs in the logo. Only the big display
   headline is hollow; smaller headings get solid violet so they stay readable. */
.outline { color: #c6a6ff; }
.display .outline,
.display .outline .ch {
    color: rgba(180, 140, 255, 0.16);
    -webkit-text-stroke: 2px #c6a6ff;
    text-shadow: 0 0 18px rgba(180, 140, 255, 0.18);
}

.dim { color: #b9b3cf; }

.eyebrow {
    font-family: var(--f-mono);
    font-size: 0.8rem;
    font-weight: 500;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #c9a9ff;
    margin: 0 0 1rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}
.eyebrow--amber { color: var(--amber); }

.lede {
    font-size: clamp(1.05rem, 1.4vw, 1.25rem);
    color: #ebe7f5;
    max-width: 34em;
    margin: 1.4rem 0 0;
}

.body { color: #dcd7ea; font-size: 1.04rem; margin: 0.9rem 0 0; max-width: 40em; }

/* Split-text pieces (see ui.js splitText) */
.wd { display: inline-block; white-space: nowrap; }
.ch { display: inline-block; will-change: transform; }

/* ---------- Buttons ---------- */

.btn {
    --h: 3.25rem;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    height: var(--h);
    padding: 0 1.6rem;
    font-family: var(--f-mono);
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    text-decoration: none;
    border: 0;
    cursor: pointer;
    position: relative;
    transition: background-color 0.3s var(--ease-out), color 0.3s var(--ease-out), transform 0.3s var(--ease-out);
    /* Bottom-right corner cut on the mark's diagonal */
    clip-path: polygon(0 0, 100% 0, 100% calc(100% - 0.875rem), calc(100% - 0.875rem) 100%, 0 100%);
}
.btn-solid { background: var(--bone); color: var(--void); }
.btn-solid:hover { background: #fff; }
.btn-amber { background: var(--amber); color: var(--void); }
.btn-amber:hover { background: #ffc566; }
.btn-ghost {
    background: rgba(180, 140, 255, 0.08);
    color: var(--bone);
    box-shadow: inset 0 0 0 1.5px var(--line);
}
.btn-ghost:hover { background: rgba(180, 140, 255, 0.18); }
.btn-sm { --h: 2.625rem; padding: 0 1.1rem; font-size: 0.76rem; }
.btn .arrow { transition: transform 0.3s var(--ease-out); }
.btn:hover .arrow { transform: translateX(0.25rem); }

/* ---------- Bracket frame: the logo's two strokes around a rectangle ----------
   Stroke A = top edge + upper right edge. Stroke B = left edge (starting just
   below the corner) + bottom edge. The bottom-right corner stays open and the
   panel background is cut on the diagonal there, like the mark itself. */

.frame {
    --t: 2px;
    --fc: var(--violet);
    position: relative;
    background: linear-gradient(165deg, rgba(28, 24, 46, 0.9), rgba(12, 10, 20, 0.84));
    clip-path: polygon(0 0, 100% 0, 100% calc(100% - var(--notch)), calc(100% - var(--notch)) 100%, 0 100%);
}
.frame::before,
.frame::after {
    content: "";
    position: absolute;
    pointer-events: none;
    filter: drop-shadow(0 0 4px rgba(180, 140, 255, 0.3));
    transition: clip-path 1s var(--ease-door);
}
.frame::before {
    top: 0; left: 0; right: 0;
    height: calc(100% - var(--notch) - 0.5rem);
    border-top: var(--t) solid var(--fc);
    border-right: var(--t) solid var(--fc);
}
.frame::after {
    left: 0; bottom: 0; top: 0.875rem;
    width: calc(100% - var(--notch) - 0.5rem);
    border-left: var(--t) solid var(--fc);
    border-bottom: var(--t) solid var(--fc);
}
html.is-3d .frame::before,
html.is-3d .frame::after { clip-path: inset(0 100% 100% 0); }
html.is-3d .frame.on::before,
html.is-3d .frame.on::after { clip-path: inset(0 0 0 0); }
html.is-3d .frame.on::after { transition-delay: 0.25s; }

/* ---------- Header ---------- */

.site-head {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 40;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    padding: 1.125rem clamp(1rem, 3vw, 2.5rem);
    pointer-events: none;
}
.site-head > * { pointer-events: auto; }
html:not(.is-3d) .site-head {
    background: rgba(7, 6, 12, 0.82);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* logo.png has wide transparent margins; crop to the artwork */
.brand {
    --s: 6.5rem;
    display: block;
    width: calc(var(--s) * 0.9);
    height: calc(var(--s) * 0.71);
    overflow: hidden;
    flex: none;
}
.brand img {
    width: var(--s);
    height: var(--s);
    max-width: none;
    margin: calc(var(--s) * -0.138) 0 0 calc(var(--s) * -0.05);
}

.site-nav {
    display: flex;
    gap: clamp(1rem, 2.4vw, 2.2rem);
    font-family: var(--f-mono);
    font-size: 0.8rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}
.site-nav a {
    text-decoration: none;
    color: #d6d1e6;
    text-shadow: 0 1px 10px rgba(0, 0, 0, 0.9);
    padding: 0.375rem 0;
    position: relative;
    transition: color 0.25s;
}
.site-nav a:hover,
.site-nav a[aria-current="true"] { color: var(--bone); }
.site-nav a[aria-current="true"]::after {
    content: "";
    position: absolute;
    left: 0; right: 0; bottom: 0;
    height: 2px;
    background: var(--amber);
    box-shadow: 0 0 5px rgba(255, 178, 62, 0.45);
}

/* Showcase link: a glowing word with an orb orbiting it on a tilted ring.
   Sizes are in em so it scales with the nav text (and the big phone menu). */
.site-nav a.nav-showcase {
    color: #fff;
    perspective: 18em;
    transform-style: preserve-3d;
}
.nav-showcase .nav-label {
    position: relative;
    display: inline-block;
    transform: translateZ(0);
    animation: showcase-glow 3.2s ease-in-out infinite;
}
@keyframes showcase-glow {
    0%, 100% { text-shadow: 0 0 0.4em rgba(180, 140, 255, 0.6), 0 0 1.3em rgba(180, 140, 255, 0.28); }
    50%      { text-shadow: 0 0 0.55em rgba(205, 170, 255, 0.95), 0 0 1.8em rgba(180, 140, 255, 0.5); }
}
.nav-orbit {
    position: absolute;
    left: 50%; top: 50%;
    width: calc(100% + 1.6em);
    aspect-ratio: 1;
    transform: translate(-50%, -50%) rotateX(76deg) rotateY(-10deg);
    transform-style: preserve-3d;
    pointer-events: none;
}
.nav-orbit i { position: absolute; display: block; }
.nav-orbit-ring {
    inset: 0;
    border-radius: 50%;
    border: 1px solid rgba(180, 140, 255, 0.3);
}
.nav-orbit-spin {
    position: absolute;
    inset: 0;
    transform-style: preserve-3d;
    animation: showcase-orbit 3.6s linear infinite;
}
/* comet tail: a bright arc that ends at the orb */
.nav-orbit-trail {
    inset: 0;
    border-radius: 50%;
    background: conic-gradient(from 0deg, rgba(180, 140, 255, 0) 0deg 200deg, rgba(190, 155, 255, 0.55) 300deg, rgba(235, 220, 255, 1) 360deg);
    -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 0.16em), #000 calc(100% - 0.12em));
    mask: radial-gradient(farthest-side, transparent calc(100% - 0.16em), #000 calc(100% - 0.12em));
    filter: drop-shadow(0 0 0.15em rgba(180, 140, 255, 0.8));
}
.nav-orbit-orb {
    left: 50%; top: 0;
    width: 0.42em; height: 0.42em;
    margin: -0.21em 0 0 -0.21em;
    border-radius: 50%;
    background: radial-gradient(circle at 40% 40%, #fff, #c9a9ff 45%, rgba(180, 140, 255, 0) 72%);
    box-shadow: 0 0 0.5em 0.1em rgba(180, 140, 255, 0.7);
    /* keep the orb facing the viewer while its ring is tilted and spinning */
    animation: showcase-orb 3.6s linear infinite;
}
@keyframes showcase-orbit { to { transform: rotateZ(360deg); } }
@keyframes showcase-orb {
    from { transform: rotateZ(0deg) rotateY(10deg) rotateX(-76deg); }
    to   { transform: rotateZ(-360deg) rotateY(10deg) rotateX(-76deg); }
}
.site-nav a.nav-showcase:hover .nav-orbit-spin,
.site-nav a.nav-showcase:hover .nav-orbit-orb { animation-duration: 1.8s; }
.site-nav a.nav-showcase:hover .nav-orbit-ring { border-color: rgba(200, 170, 255, 0.55); }
@media (prefers-reduced-motion: reduce) {
    .nav-showcase .nav-label,
    .nav-orbit-spin,
    .nav-orbit-orb { animation: none; }
}

.head-actions { display: flex; align-items: center; gap: 0.75rem; }

.menu-btn {
    display: none;
    width: 2.75rem; height: 2.75rem;
    background: rgba(180, 140, 255, 0.1);
    border: 0;
    cursor: pointer;
    position: relative;
}
.menu-btn span {
    position: absolute;
    left: 0.75rem; right: 0.75rem;
    height: 2px;
    background: var(--bone);
    transition: transform 0.3s var(--ease-out), opacity 0.2s;
}
.menu-btn span:nth-child(1) { top: 1rem; }
.menu-btn span:nth-child(2) { top: 1.625rem; right: 1.125rem; }
.menu-open .menu-btn span:nth-child(1) { transform: translateY(0.3125rem) rotate(45deg); }
.menu-open .menu-btn span:nth-child(2) { transform: translateY(-5px) rotate(-45deg); right: 0.75rem; }

@media (max-width: 900px) {
    .brand { --s: 5.25rem; }
    .menu-btn { display: block; }
    .site-nav {
        position: fixed;
        inset: 0;
        z-index: -1;
        flex-direction: column;
        justify-content: center;
        align-items: flex-start;
        gap: 1.2rem;
        padding: 0 1.75rem;
        background: rgba(7, 6, 12, 0.96);
        font-family: var(--f-display);
        font-size: 2.2rem;
        letter-spacing: -0.01em;
        text-transform: none;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.35s var(--ease-out), visibility 0.35s;
    }
    .site-nav a { color: var(--bone); }
    .menu-open .site-nav { opacity: 1; visibility: visible; }
    /* the menu text is large, so keep the orbit's overhang inside the screen */
    .nav-orbit { width: calc(100% + 0.6em); }
    .head-actions .btn { display: none; }
}

/* ---------- WebGL / CSS3D layers ---------- */

.stage {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    display: block;
    /* The scene handles swipes itself; without this, phones treat a swipe as a
       page scroll and cancel the drag. */
    touch-action: none;
}
.css3d-layer {
    position: fixed !important;
    inset: 0;
    z-index: 2;
    pointer-events: none;
}

/* ---------- Loader ---------- */

.loader { display: none; }
html.is-3d .loader {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: grid;
    place-items: center;
    background: var(--void);
}
.loader-inner { display: grid; justify-items: center; gap: 1.375rem; }
.loader-mark { width: 4.625rem; height: auto; overflow: visible; }
.loader-mark polyline {
    fill: none;
    stroke: var(--uv);
    stroke-width: 26;
    stroke-dasharray: 1000;
    stroke-dashoffset: var(--dash, 1000);
    filter: drop-shadow(0 0 8px rgba(180, 140, 255, 0.45));
    transition: stroke-dashoffset 0.4s linear;
}
.loader-pct {
    font-family: var(--f-mono);
    font-size: 0.8rem;
    letter-spacing: 0.3em;
    color: var(--haze);
}
html.is-3d .loader.is-done { pointer-events: none; }

/* Flash used for page-to-page warps */
.warp-flash {
    position: fixed;
    inset: 0;
    z-index: 150;
    pointer-events: none;
    background: radial-gradient(circle at 50% 50%, #fff, var(--uv) 40%, var(--void) 80%);
    opacity: 0;
}

/* ---------- Shared HUD bits ---------- */

.hud {
    position: fixed;
    z-index: 30;
    font-family: var(--f-mono);
    font-size: 0.78rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #d6d1e6;
    text-shadow: 0 1px 10px rgba(0, 0, 0, 0.95);
}
html:not(.is-3d) .hud,
html:not(.is-3d) .only-3d { display: none !important; }

.scroll-cue {
    display: inline-flex;
    align-items: center;
    gap: 0.7rem;
}
.scroll-cue i {
    width: 0.875rem; height: 1.375rem;
    border: 1.5px solid var(--haze);
    border-radius: 8px;
    position: relative;
}
.scroll-cue i::after {
    content: "";
    position: absolute;
    left: 50%; top: 0.25rem;
    width: 2px; height: 0.3125rem;
    margin-left: -1px;
    background: var(--amber);
    animation: cue 1.6s var(--ease-out) infinite;
}
@keyframes cue {
    0% { transform: translateY(0); opacity: 1; }
    80% { transform: translateY(0.5rem); opacity: 0; }
    100% { opacity: 0; }
}

/* ==========================================================================
   HOME
   ========================================================================== */

/* Fallback / no-WebGL layout: normal scrolling page */
.world { position: relative; z-index: 2; }
html:not(.is-3d) .world { padding: 8.75rem var(--gutter) 3.75rem; }
html:not(.is-3d) .room {
    max-width: 68.75rem;
    margin: 0 auto 4.5rem;
}
html:not(.is-3d) .room .panel { margin: 0 auto; }
html:not(.is-3d) .room#top { min-height: 70vh; display: grid; align-items: center; }
html:not(.is-3d) .rv {
    opacity: 0;
    transform: translateY(1.5rem);
    transition: opacity 0.9s var(--ease-out), transform 0.9s var(--ease-out);
}
html:not(.is-3d) .rv.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
    html:not(.is-3d) .rv { opacity: 1; transform: none; transition: none; }
}

/* 3D mode: the document does not scroll; rooms live in the CSS3D layer */
html.is-3d.home,
html.is-3d.home body { height: 100%; overflow: hidden; overscroll-behavior: none; }

.panel {
    width: min(var(--w, 56.25rem), calc(100vw - 2 * var(--gutter)));
    padding: clamp(1.75rem, 4vw, 3.25rem);
    position: relative;
}
html.is-3d .panel { user-select: text !important; }
.panel--bare {
    background: radial-gradient(ellipse at 40% 50%, rgba(7, 6, 12, 0.72), rgba(7, 6, 12, 0) 70%);
}
.panel.center { text-align: center; }
.panel.center .lede,
.panel.center .body { margin-left: auto; margin-right: auto; }
.panel.center .eyebrow { justify-content: center; }

.tag {
    display: inline-flex;
    flex-direction: column;
    gap: 2px;
    margin: 0 0 1.6rem;
    padding: 0.5rem 0.875rem 0.5rem 1rem;
    font-family: var(--f-mono);
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: var(--uv);
    border-left: 2px solid var(--uv);
    background: linear-gradient(90deg, rgba(180, 140, 255, 0.14), transparent);
}
.tag span:first-child { font-size: 0.82rem; font-weight: 500; color: #fff; }
.tag span:last-child { font-size: 0.74rem; font-weight: 500; color: #c9a9ff; }

.cta-row { display: flex; flex-wrap: wrap; gap: 0.875rem; margin-top: 2.2rem; }

/* Manifesto */
#manifesto .display { font-size: clamp(2.3rem, 5.6vw, 5rem); }
.kicker {
    font-family: var(--f-display);
    font-size: clamp(1.25rem, 2vw, 1.8rem);
    color: var(--amber);
    margin: 1.8rem 0 0;
}

/* Who we are */
.quote {
    margin: 2rem 0 0;
    padding: 1.4rem 0 0;
    border-top: 1px solid var(--line);
}
.quote blockquote {
    margin: 0;
    font-family: var(--f-display);
    font-size: clamp(1.3rem, 2vw, 1.7rem);
    line-height: 1.25;
    font-style: italic;
    color: var(--bone);
}
.quote figcaption {
    margin-top: 0.9rem;
    font-family: var(--f-mono);
    font-size: 0.76rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #c9c4dc;
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 1rem;
}
.quote figcaption strong { color: var(--bone); font-weight: 500; }

/* Mission & vision */
.duo {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: clamp(1.25rem, 3vw, 2.5rem);
}
.duo article { padding-top: 0.2rem; }
.duo article + article { border-left: 1px solid var(--line); padding-left: clamp(20px, 3vw, 40px); }
.duo .h3 { font-size: clamp(1.5rem, 2.4vw, 2.1rem); margin-bottom: 0.4rem; }

/* Services */
.svc-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 2rem; margin-bottom: 1.3rem; }
.svc-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.875rem;
    perspective: 900px;
}
.svc {
    --t: 1.5px;
    --notch: 1.375rem;
    padding: 1rem 1.125rem 1.125rem;
    display: grid;
    grid-template-columns: auto 1fr;
    column-gap: 0.75rem;
    align-items: center;
    align-content: start;
    transform-style: preserve-3d;
    transition: transform 0.5s var(--ease-out), background-color 0.3s;
}
.svc:hover { transform: translateZ(1.75rem) rotateX(4deg); }
.svc:hover::before,
.svc:hover::after { --fc: var(--amber); }
.svc-code {
    font-family: var(--f-display);
    font-size: 1.9rem;
    line-height: 1;
    font-weight: 500;
    color: rgba(180, 140, 255, 0.18);
    -webkit-text-stroke: 1.6px #c6a6ff;
    margin: 0;
    display: block;
}
.svc:hover .svc-code { -webkit-text-stroke-color: var(--amber); }
.svc .h3 { font-size: 1.1rem; margin: 0; line-height: 1.15; }
.svc ul { grid-column: 1 / -1; margin-top: 0.75rem !important; }
#services .panel { padding-top: 2.125rem; padding-bottom: 2.125rem; }
.svc ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
}
.svc li {
    font-size: 0.8rem;
    color: #e2ddef;
}

/* "See it in the showcase": a white button whose frame lights up. Two amber
   lights leave the top-left corner in opposite directions and meet at the cut
   bottom-right corner, where the frame flashes. The frame is an SVG laid over
   the button (built in ui.js) so its glow isn't clipped by the cut corner. */
.cta-glow {
    position: relative;
    display: inline-block;
    flex: none;
}
.btn-showcase {
    color: #fff;
    background: rgba(180, 140, 255, 0.08);
}
.btn-showcase:hover { background: rgba(180, 140, 255, 0.18); }
.cta-frame {
    position: absolute;
    left: 0; top: 0;
    width: 100%; height: 100%;
    overflow: visible;
    pointer-events: none;
}
.cta-frame path { fill: none; }
.cta-frame-base {
    stroke: rgba(255, 255, 255, 0.3);
    stroke-width: 1.5;
    animation: cta-frame-flash 3.4s ease-in-out infinite;
}
.cta-frame-run {
    stroke: #ffb23e;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-dasharray: 22 200;
    stroke-dashoffset: 22;
    opacity: 0;
    filter: drop-shadow(0 0 2px rgba(255, 190, 90, 1)) drop-shadow(0 0 6px rgba(255, 178, 62, 0.7));
    animation: cta-frame-run 3.4s cubic-bezier(0.5, 0, 0.3, 1) infinite;
}
@keyframes cta-frame-run {
    0%       { stroke-dashoffset: 22; opacity: 0; }
    6%       { opacity: 1; }
    62%      { stroke-dashoffset: -78; opacity: 1; }
    74%, 100% { stroke-dashoffset: -78; opacity: 0; }
}
@keyframes cta-frame-flash {
    0%, 56%, 100% { stroke: rgba(255, 255, 255, 0.3); filter: none; }
    66%           { stroke: rgba(255, 214, 150, 0.95); filter: drop-shadow(0 0 4px rgba(255, 178, 62, 0.8)); }
}
@media (prefers-reduced-motion: reduce) {
    .cta-frame-run { display: none; }
    .cta-frame-base { animation: none; }
}

/* Service cards link to the showcase: the title link stretches over the whole
   card, and each tag is its own link to that section, layered above it. */
.svc-link { color: inherit; text-decoration: none; }
.svc-link::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.svc-go {
    display: inline-block;
    margin-left: 0.2em;
    color: var(--amber);
    opacity: 0;
    transform: translateX(-0.3em);
    transition: opacity 0.25s, transform 0.3s var(--ease-out);
}
.svc:hover .svc-go,
.svc:focus-within .svc-go { opacity: 1; transform: none; }
.svc li a {
    position: relative;
    z-index: 2;
    display: inline-block;
    padding: 0.1875rem 0.5rem;
    color: inherit;
    text-decoration: none;
    background: rgba(180, 140, 255, 0.13);
    transition: background-color 0.2s, color 0.2s;
}
.svc li a:hover,
.svc li a:focus-visible { color: #fff; background: rgba(255, 178, 62, 0.28); }
.svc:has(a:focus-visible)::before,
.svc:has(a:focus-visible)::after { --fc: var(--amber); }

/* Contact */
.form { display: grid; gap: 0.75rem; margin-top: 1.4rem; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
.field { position: relative; }
.field input {
    width: 100%;
    height: 3.375rem;
    padding: 1.25rem 0.875rem 0.375rem;
    background: rgba(7, 6, 12, 0.6);
    border: 0;
    box-shadow: inset 0 0 0 1px rgba(180, 140, 255, 0.34);
    color: #fff;
    font: inherit;
    font-size: 0.95rem;
    border-radius: 0;
    transition: box-shadow 0.25s;
}
.field input:focus { outline: none; box-shadow: inset 0 0 0 1.5px var(--uv), 0 0 18px rgba(180, 140, 255, 0.25); }
.field label {
    position: absolute;
    left: 0.875rem; top: 1.0625rem;
    font-size: 0.95rem;
    color: #c9c4dc;
    pointer-events: none;
    transition: transform 0.25s var(--ease-out), font-size 0.25s, color 0.25s;
    transform-origin: left top;
}
.field input:focus + label,
.field input:not(:placeholder-shown) + label {
    transform: translateY(-10px);
    font-size: 0.66rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--uv);
}
.form .btn { width: 100%; margin-top: 0.25rem; }
.form-status {
    min-height: 1.4em;
    margin: 0.25rem 0 0;
    font-size: 0.86rem;
    color: var(--haze);
}
.form-status:empty { display: none; }
.form-status.is-ok { color: var(--amber); }
#pilot .panel { padding: 2.375rem 2.75rem 1.875rem; }
#pilot .h2 { font-size: clamp(1.9rem, 3vw, 2.6rem); }
#pilot .body { margin-top: 0.7rem; }
.foot > span:last-child { flex-basis: 100%; font-size: 0.78rem; color: var(--haze); }
.form-status.is-err { color: #ff8a8a; }

.foot {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--line);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.6rem 1.2rem;
    font-size: 0.84rem;
    color: #c9c4dc;
}
.foot a { color: var(--bone); text-decoration-color: var(--violet); text-underline-offset: 3px; }
.foot .ig {
    display: inline-flex;
    width: 2.25rem; height: 2.25rem;
    align-items: center;
    justify-content: center;
    background: rgba(180, 140, 255, 0.1);
    color: var(--bone);
    transition: background-color 0.25s, color 0.25s;
}
.foot .ig:hover { background: var(--violet); }
.foot .ig svg { width: 1rem; height: 1rem; }

/* Home HUD: door rail, cue */
.rail {
    left: clamp(1rem, 2.4vw, 2.25rem);
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
    margin: 0;
    padding: 0;
    list-style: none;
}
.rail button {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: none;
    border: 0;
    padding: 0.375rem 0;
    cursor: pointer;
    color: var(--haze);
    font: inherit;
    letter-spacing: inherit;
    text-transform: inherit;
}
.rail svg { width: 0.75rem; height: 1.25rem; overflow: visible; flex: none; }
.rail polyline { fill: none; stroke: currentColor; stroke-width: 70; transition: stroke 0.3s; }
.rail span {
    padding: 0.15rem 0.4rem;
    background: rgba(7, 6, 12, 0.88);
    opacity: 0;
    transform: translateX(-6px);
    transition: opacity 0.3s, transform 0.3s var(--ease-out);
    white-space: nowrap;
}
.rail button:hover span,
.rail button:focus-visible span { opacity: 1; transform: none; }
.rail button[aria-current="true"] { color: var(--bone); }
.rail button[aria-current="true"] polyline { stroke: var(--amber); filter: drop-shadow(0 0 3px rgba(255, 178, 62, 0.5)); }


.cue {
    right: clamp(1rem, 2.4vw, 2.25rem);
    bottom: 1.375rem;
    display: flex;
    align-items: center;
    gap: 1.2rem;
}
.cue .count { color: var(--bone); font-variant-numeric: tabular-nums; }
.step-btns { display: none; gap: 0.5rem; }
.step-btns button {
    width: 2.75rem; height: 2.75rem;
    background: rgba(180, 140, 255, 0.12);
    border: 0;
    color: var(--bone);
    cursor: pointer;
    font-size: 1rem;
}

@media (max-width: 900px) {
    .rail { display: none; }
    .cue .scroll-cue { display: none; }
    .step-btns { display: flex; }
    .duo { grid-template-columns: 1fr; }
    .duo article + article { border-left: 0; padding-left: 0; border-top: 1px solid var(--line); padding-top: 1.4rem; }
    .svc-grid { grid-template-columns: 1fr 1fr; }
    .svc-head { flex-direction: column; align-items: flex-start; gap: 0.6rem; }
}
@media (max-width: 560px) {
    .form-row { grid-template-columns: 1fr; }
    #services .panel { padding: 1.375rem 1rem; }
    #services .cta-glow { display: none; }
    #services .h2 { font-size: 1.7rem; }
    .svc-head { margin-bottom: 0.9rem; }
    .svc-grid { gap: 0.5rem; }
    .svc { padding: 0.75rem 0.75rem 0.875rem; --notch: 0.875rem; }
    .svc { display: block; }
    .svc-code { display: none; }
    .svc .h3 { font-size: 0.95rem; line-height: 1.2; }
    .svc ul { margin-top: 0.4rem !important; }
    .svc ul { display: block; }
    .svc li { display: inline; padding: 0; background: none; font-size: 0.78rem; line-height: 1.45; }
    .svc li a { display: inline; padding: 0; background: none; text-decoration: underline; text-decoration-color: rgba(180, 140, 255, 0.4); text-underline-offset: 2px; }
    .svc li + li::before { content: " · "; color: var(--uv); }
    #pilot .panel { padding: 1.5rem 1.125rem; }
    #pilot .h2 { font-size: 1.8rem; }
    #pilot .body { font-size: 0.95rem; }
    .form { gap: 0.625rem; margin-top: 1.2rem; }
    .foot { margin-top: 1.2rem; padding-top: 0.9rem; }
}

/* ==========================================================================
   SHOWCASE
   ========================================================================== */

html.is-3d.showcase,
html.is-3d.showcase body { height: 100%; overflow: hidden; overscroll-behavior: none; }
html.is-3d .sc-stage-cursor { cursor: grab; }
html.is-3d .sc-stage-cursor.is-dragging { cursor: grabbing; }

.sc-head {
    position: relative;
    z-index: 30;
    padding: 9.375rem var(--gutter) 1.875rem;
    max-width: 75rem;
    margin: 0 auto;
}
.sc-head .display { font-size: clamp(2.4rem, 6vw, 5.2rem); }
html.is-3d .sc-head {
    position: fixed;
    left: clamp(1rem, 2.4vw, 2.25rem);
    top: 6.25rem;
    padding: 0;
    margin: 0;
    max-width: 60vw;
    pointer-events: none;
}
html.is-3d .sc-head .display { font-size: clamp(1.7rem, 2.4vw, 2.3rem); }
html.is-3d .sc-head .display .outline,
html.is-3d .sc-head .display .outline .ch { color: var(--uv); -webkit-text-stroke: 0; }
html.is-3d .sc-head .eyebrow { display: none; }
/* The intro paragraph stays in the page for search engines and screen readers */
html.is-3d .sc-head .lede {
    position: absolute; width: 1px; height: 1px; overflow: hidden;
    clip: rect(0 0 0 0); white-space: nowrap; margin: 0;
}

/* Dark bands behind the top titles and the bottom info so text never sits on bright video */
html.is-3d.showcase main::before,
html.is-3d.showcase main::after {
    content: "";
    position: fixed;
    left: 0; right: 0;
    z-index: 5;
    pointer-events: none;
}
html.is-3d.showcase main::before {
    top: 0;
    height: 14.375rem;
    background: linear-gradient(180deg, rgba(7, 6, 12, 0.94) 55%, rgba(7, 6, 12, 0));
}
html.is-3d.showcase main::after {
    bottom: 0;
    height: 13.125rem;
    background: linear-gradient(0deg, rgba(7, 6, 12, 0.96) 58%, rgba(7, 6, 12, 0));
}

.sc-cats {
    left: clamp(1rem, 2.4vw, 2.25rem);
    right: clamp(1rem, 2.4vw, 2.25rem);
    top: 9.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 1.625rem;
    text-transform: none;
    letter-spacing: 0;
}
.sc-cats button {
    display: flex;
    align-items: baseline;
    gap: 0.4375rem;
    padding: 0.375rem 0;
    background: none;
    border: 0;
    cursor: pointer;
    color: #c9c4dc;
    font-family: var(--f-display);
    font-weight: 500;
    font-size: 1.06rem;
    letter-spacing: 0;
    text-transform: none;
    text-align: left;
    white-space: nowrap;
    transition: color 0.25s, box-shadow 0.25s;
}
.sc-cats button:hover { color: #fff; }
.sc-cats button[aria-selected="true"] { color: #fff; box-shadow: inset 0 -2px 0 var(--amber); }
.sc-cats small {
    font-family: var(--f-mono);
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--uv);
    letter-spacing: 0.04em;
}

.sc-bottom {
    left: 50%;
    bottom: 1.125rem;
    transform: translateX(-50%);
    width: min(56.25rem, calc(100vw - 2 * var(--gutter)));
    display: grid;
    gap: 0.75rem;
    justify-items: center;
    text-transform: none;
    letter-spacing: 0;
}
.sc-subs {
    position: relative; /* so button offsets are measured from the strip */
    display: flex;
    gap: 0.375rem;
    flex-wrap: wrap;
    justify-content: center;
}
.sc-subs button {
    padding: 0.5rem 0.8125rem;
    background: rgba(26, 22, 41, 0.92);
    box-shadow: inset 0 0 0 1px rgba(180, 140, 255, 0.28);
    border: 0;
    cursor: pointer;
    color: #ddd8ec;
    font-family: var(--f-mono);
    font-size: 0.74rem;
    font-weight: 500;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    transition: background-color 0.25s, color 0.25s;
}
.sc-subs button:hover { color: #fff; background: rgba(60, 46, 100, 0.95); }
.sc-subs button[aria-current="true"] { color: var(--void); background: var(--bone); box-shadow: none; }

.sc-info {
    display: flex;
    align-items: center;
    gap: 1.2rem;
    width: 100%;
    justify-content: center;
}
.sc-info-text { text-align: center; min-width: 0; }
.sc-sub-label {
    font-family: var(--f-mono);
    font-size: 0.74rem;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #c9a9ff;
}
.sc-title {
    margin: 2px 0 0;
    font-family: var(--f-display);
    font-weight: 500;
    font-size: clamp(1.4rem, 2.4vw, 2.1rem);
    line-height: 1.12;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-shadow: 0 2px 14px rgba(0, 0, 0, 0.9);
}
.sc-count {
    font-family: var(--f-mono);
    font-size: 0.8rem;
    font-weight: 500;
    color: #ddd8ec;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.06em;
    flex: none;
}
.sc-nav-btn {
    width: 2.75rem; height: 2.75rem;
    flex: none;
    background: rgba(26, 22, 41, 0.92);
    box-shadow: inset 0 0 0 1px rgba(180, 140, 255, 0.28);
    border: 0;
    cursor: pointer;
    color: #fff;
    font-size: 1.05rem;
    transition: background-color 0.25s;
}
.sc-nav-btn:hover { background: rgba(60, 46, 100, 0.95); }

.sc-progress {
    display: flex;
    gap: 0.25rem;
    width: min(32.5rem, 100%);
}
.sc-progress span {
    flex: var(--n, 1);
    height: 0.1875rem;
    background: rgba(180, 140, 255, 0.22);
    position: relative;
    overflow: hidden;
}
.sc-progress span i {
    position: absolute;
    inset: 0;
    background: var(--uv);
    transform-origin: left;
    transform: scaleX(var(--p, 0));
    box-shadow: 0 0 4px rgba(180, 140, 255, 0.5);
}

.sc-hint {
    right: clamp(1rem, 2.4vw, 2.25rem);
    top: 6.5rem;
    max-width: 16.25rem;
    margin: 0;
    text-align: right;
    line-height: 1.6;
    color: #d6d1e6;
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.sc-edge {
    left: 50%;
    top: 12.5rem;
    transform: translate(-50%, -10px);
    padding: 0.625rem 1rem;
    background: rgba(7, 6, 12, 0.88);
    box-shadow: inset 0 0 0 1px var(--line);
    color: #fff;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s, transform 0.3s var(--ease-out);
    white-space: nowrap;
}
.sc-edge.is-on { opacity: 1; transform: translate(-50%, 0); }
.sc-edge b { color: var(--amber); font-weight: 500; }
.sc-edge i {
    display: block;
    height: 2px;
    margin-top: 0.5rem;
    background: var(--amber);
    transform-origin: left;
    transform: scaleX(var(--p, 0));
}

@media (max-width: 1100px) {
    .sc-hint { display: none; }
}
@media (max-width: 900px) {
    html.is-3d .sc-head { top: 5.75rem; max-width: 74vw; }
    html.is-3d .sc-head .display { font-size: clamp(1.2rem, 6vw, 1.6rem); white-space: nowrap; }
    html.is-3d.showcase main::before { height: 15.625rem; }
    html.is-3d.showcase main::after { height: 14.375rem; }
    .sc-cats {
        top: 8.5rem;
        left: 0; right: 0;
        flex-wrap: nowrap;
        overflow-x: auto;
        gap: 1.25rem;
        padding: 0 var(--gutter);
        scrollbar-width: none;
    }
    .sc-cats::-webkit-scrollbar { display: none; }
    .sc-cats button { font-size: 1rem; }
    .sc-cats small { display: none; }
    /* scrollable strips fade at their edges so it's clear there's more */
    .sc-cats,
    .sc-subs {
        -webkit-mask-image: linear-gradient(90deg, transparent, #000 0.875rem, #000 calc(100% - 1.75rem), transparent);
        mask-image: linear-gradient(90deg, transparent, #000 0.875rem, #000 calc(100% - 1.75rem), transparent);
    }
    .sc-subs { flex-wrap: nowrap; overflow-x: auto; justify-content: flex-start; max-width: 100%; padding: 0 0.875rem; scrollbar-width: none; }
    .sc-subs::-webkit-scrollbar { display: none; }
    .sc-subs button { white-space: nowrap; flex: none; }
    .sc-edge { top: 11.625rem; }
}
@media (max-width: 600px) {
    .sc-bottom { bottom: 0.75rem; gap: 0.625rem; }
    /* arrows either side of the title, count and Watch centred underneath */
    .sc-info {
        display: grid;
        grid-template-columns: 2.5rem 1fr 1fr 2.5rem;
        grid-template-areas:
            "prev text text next"
            ".    count watch .";
        align-items: center;
        gap: 0.5rem;
    }
    .sc-info [data-step="-1"] { grid-area: prev; }
    .sc-info [data-step="1"] { grid-area: next; }
    .sc-info-text { grid-area: text; }
    .sc-count { grid-area: count; justify-self: end; }
    .sc-watch { grid-area: watch; justify-self: start; }
    .sc-nav-btn { width: 2.5rem; height: 2.5rem; }
    .sc-title { font-size: 1.3rem; }
    .theater { padding: 4rem 0.75rem 1rem; }
    .theater-meta .sc-nav-btn { width: 2.5rem; height: 2.5rem; }
}

/* Theater: full-screen player for the focused item */
.theater {
    position: fixed;
    inset: 0;
    z-index: 120;
    display: grid;
    place-items: center;
    padding: 5rem clamp(1rem, 4vw, 3.75rem) 1.875rem;
    background: rgba(7, 6, 12, 0.86);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}
.theater[hidden] { display: none; }
.theater-box {
    position: relative;
    display: grid;
    gap: 1rem;
    justify-items: center;
    max-width: 100%;
    max-height: 100%;
}
.theater-media {
    position: relative;
    max-width: min(75rem, 100%);
    background: #000;
    clip-path: polygon(0 0, 100% 0, 100% calc(100% - 1.75rem), calc(100% - 1.75rem) 100%, 0 100%);
}
.theater-media img,
.theater-media video {
    display: block;
    max-width: 100%;
    max-height: calc(100vh - 13.125rem);
    max-height: calc(100dvh - 13.125rem);
    width: auto;
    height: auto;
}
.theater-media model-viewer {
    display: block;
    width: min(56.25rem, calc(100vw - 2rem));
    height: calc(100vh - 14.375rem);
    height: calc(100dvh - 14.375rem);
    background: radial-gradient(circle at 50% 40%, #241d3a, #0b0a12 70%);
    --poster-color: transparent;
}
.theater-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    width: 100%;
    justify-content: space-between;
}
.theater-meta .sc-title { white-space: normal; font-size: clamp(1.2rem, 2.2vw, 1.8rem); }
.theater-close {
    position: fixed;
    top: 1.375rem;
    right: clamp(1rem, 2.4vw, 2.25rem);
}
.ar-btn {
    position: absolute;
    left: 1rem;
    bottom: 1rem;
}

/* Fallback (no WebGL): grid of cards */
.sc-fallback { display: none; }
html:not(.is-3d) .sc-fallback {
    display: block;
    max-width: 75rem;
    margin: 0 auto;
    padding: 0 var(--gutter) 5rem;
}
.fb-cat { margin-top: 3.5rem; }
.fb-cat > p { color: var(--haze); margin: 0.4rem 0 1.2rem; }
.fb-sub { font-family: var(--f-mono); font-size: 0.72rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--uv); margin: 1.6rem 0 0.8rem; }
.fb-row { display: flex; flex-wrap: wrap; gap: 1rem; align-items: flex-start; }
.fb-card { --notch: 1.125rem; --t: 1.5px; padding: 0.625rem 0.625rem 0.875rem; }
.fb-card img,
.fb-card video,
.fb-card model-viewer,
.fb-card .fb-soon { display: block; width: 100%; background: #000; }
.fb-card .fb-soon { display: grid; place-items: center; color: var(--haze); font-family: var(--f-mono); font-size: 0.7rem; letter-spacing: 0.14em; text-transform: uppercase; }
.fb-card p { margin: 0.6rem 0 0; font-size: 0.85rem; }

.site-foot {
    position: relative;
    z-index: 2;
    padding: 1.875rem var(--gutter) 2.5rem;
    text-align: center;
    font-size: 0.8rem;
    color: var(--haze);
}
.site-foot a { color: var(--bone); }
html.is-3d.showcase .site-foot { display: none; }
