/* ============================================================
   AELITHON — COMPONENTS  (premium template)
   Layout language: immersive, editorial, kinetic. A live WebGL
   layer (js/three-scene.js) renders behind everything; the CSS
   .backdrop below is the graceful fallback if WebGL is absent.
   ============================================================ */

/* ------------------------------------------------------------
   AMBIENT BACKDROP — fallback for the WebGL canvas
   ------------------------------------------------------------ */
.backdrop {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
    background:
        radial-gradient(60% 45% at 12% 8%, color-mix(in oklab, var(--accent) 20%, transparent) 0%, transparent 60%),
        radial-gradient(50% 40% at 88% 6%, color-mix(in oklab, var(--accent-2) 16%, transparent) 0%, transparent 55%),
        radial-gradient(48% 44% at 50% 40%, color-mix(in oklab, #8A5BD8 12%, transparent) 0%, transparent 60%),
        radial-gradient(55% 50% at 80% 92%, color-mix(in oklab, var(--accent) 12%, transparent) 0%, transparent 60%),
        var(--bg);
    transition: background-color var(--dur) var(--ease);
}

/* page content sits above the WebGL + grain layers */
.page { position: relative; z-index: 2; }

/* ============================================================
   NAVIGATION
   ============================================================ */
.nav {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 100;
    height: var(--nav-h);
    display: flex;
    align-items: center;
    transition: background-color var(--dur-fast) var(--ease),
                border-color var(--dur-fast), backdrop-filter var(--dur-fast);
    border-bottom: 1px solid transparent;
}
.nav.is-scrolled {
    background: var(--bg-glass);
    backdrop-filter: blur(16px) saturate(140%);
    border-bottom-color: var(--border);
}
.nav-inner {
    width: 100%;
    max-width: var(--maxw);
    margin-inline: auto;
    padding-inline: clamp(1.25rem, 4vw, 2.5rem);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--sp-5);
}

/* Brand */
.brand { display: inline-flex; align-items: center; gap: 0.6rem; }
.brand-mark { width: 28px; height: 28px; flex: none; filter: drop-shadow(0 4px 14px var(--glow)); }
.brand-name {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 1.35rem;
    letter-spacing: -0.02em;
    color: var(--text);
}

/* Links */
.nav-links { display: flex; align-items: center; gap: clamp(0.5rem, 2vw, 1.75rem); }
.nav-links a {
    position: relative;
    font-size: var(--fs-300);
    font-weight: 500;
    color: var(--text-muted);
    padding: 0.4rem 0.2rem;
    transition: color var(--dur-fast);
}
.nav-links a::after {
    content: "";
    position: absolute;
    left: 0; right: 100%; bottom: -2px;
    height: 2px; border-radius: 2px;
    background: var(--gradient);
    transition: right var(--dur-fast) var(--ease);
}
.nav-links a:hover,
.nav-links a.is-active { color: var(--text); }
.nav-links a:hover::after,
.nav-links a.is-active::after { right: 0; }

.nav-actions { display: flex; align-items: center; gap: 0.75rem; }

/* Theme toggle */
.theme-toggle {
    width: 42px; height: 42px;
    display: inline-grid;
    place-items: center;
    border-radius: var(--r-pill);
    border: 1px solid var(--border);
    color: var(--text);
    background: var(--bg-glass);
    transition: border-color var(--dur-fast), color var(--dur-fast), transform var(--dur-fast) var(--ease);
}
.theme-toggle:hover { border-color: var(--accent); color: var(--accent); transform: rotate(-12deg); }
.theme-toggle svg { width: 20px; height: 20px; }
.theme-toggle .icon-sun  { display: none; }
.theme-toggle .icon-moon { display: block; }
[data-theme="light"] .theme-toggle .icon-sun  { display: block; }
[data-theme="light"] .theme-toggle .icon-moon { display: none; }

/* sound toggle reuses the round icon-button look (off by default) */
.sound-toggle:hover { transform: none; }
.sound-toggle .icon-sound-on  { display: none; }
.sound-toggle .icon-sound-off { display: block; }
.sound-on .sound-toggle .icon-sound-on  { display: block; }
.sound-on .sound-toggle .icon-sound-off { display: none; }

/* Hamburger (mobile) */
.hamburger { display: none; width: 42px; height: 42px; place-items: center; border-radius: var(--r-pill); border: 1px solid var(--border); color: var(--text); }
.hamburger span { position: relative; width: 18px; height: 2px; background: currentColor; border-radius: 2px; transition: transform var(--dur-fast), opacity var(--dur-fast); }
.hamburger span::before, .hamburger span::after { content: ""; position: absolute; left: 0; width: 18px; height: 2px; background: currentColor; border-radius: 2px; transition: transform var(--dur-fast); }
.hamburger span::before { top: -6px; }
.hamburger span::after  { top: 6px; }

/* ============================================================
   HERO  — full-bleed, centered, kinetic, WebGL orb behind
   ============================================================ */
.hero {
    position: relative;
    min-height: 100svh;
    display: grid;
    align-items: center;
    text-align: center;
    padding-top: calc(var(--nav-h) + 2rem);
    padding-bottom: var(--sp-9);
}
.hero-inner {
    max-width: 980px;
    margin-inline: auto;
}
.hero .eyebrow {
    justify-content: center;
    padding: 0.5rem 1rem 0.5rem 0.85rem;
    border: 1px solid var(--border);
    border-radius: var(--r-pill);
    background: var(--bg-glass);
    backdrop-filter: blur(8px);
}
.hero h1 {
    font-size: var(--fs-900);
    margin-top: var(--sp-5);
    letter-spacing: -0.04em;
    line-height: 1.02;
}
.hero h1 .line { display: block; }
.hero .lead {
    margin: var(--sp-5) auto 0;
    max-width: 52ch;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: var(--sp-4); margin-top: var(--sp-7); justify-content: center; }

/* trust strip */
.trust { display: flex; flex-wrap: wrap; gap: var(--sp-6) var(--sp-8); margin-top: var(--sp-8); align-items: center; justify-content: center; }
.trust-stat .num { font-family: var(--font-display); font-size: var(--fs-700); font-weight: 600; }
.trust-stat .lbl { font-size: var(--fs-200); letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-faint); }

/* glow puck behind the headline so text stays readable over the orb */
.hero-inner::before {
    content: "";
    position: absolute;
    left: 50%; top: 46%;
    width: min(760px, 92vw); height: min(760px, 92vw);
    transform: translate(-50%, -50%);
    background: radial-gradient(circle, color-mix(in oklab, var(--bg) 55%, transparent) 0%, transparent 62%);
    z-index: -1;
    pointer-events: none;
}

/* hero headline typewriter — glyphs are wrapped + revealed by js/intro.js
   after the brand intro finishes (independent of scroll). */
.hero h1[data-typewriter] .char { opacity: 0; }
.hero h1[data-typewriter].is-typing .char.on,
.hero h1[data-typewriter].is-typed .char { opacity: 1; }
.type-caret {
    /* zero real width so sliding the caret between glyphs never changes the
       line's length (which used to make the last word wrap to a new line and
       jump back). The visible bar is drawn by ::after, which is positioned and
       so takes no layout space. */
    display: inline-block;
    width: 0; min-width: 0; margin: 0; position: relative;
}
.type-caret::after {
    content: "";
    position: absolute; left: 0; top: 0.12em;
    width: 0.06em; min-width: 2px; height: 0.9em;
    background: var(--accent); border-radius: 2px;
    animation: caretBlink 0.9s steps(1) infinite;
}
.hero h1[data-typewriter].is-typed .type-caret { display: none; }
@keyframes caretBlink { 0%, 49% { opacity: 1; } 50%, 100% { opacity: 0; } }

/* ============================================================
   BRAND INTRO  (quick reveal on load)
   The animation is CSS-driven so the overlay still dismisses with
   JS off; js/intro.js listens for it to finish, then starts typing
   the hero headline. Logo + wordmark match the site exactly.
   ============================================================ */
.intro {
    position: fixed; inset: 0; z-index: 200;
    display: grid; place-content: center; justify-items: center; gap: var(--sp-4);
    background: var(--bg);
    animation: introOut 0.7s var(--ease) 1.65s forwards;
}
.intro.is-done { display: none; }
.intro-logo {
    display: inline-flex; align-items: center; gap: 0.7rem;
    opacity: 0; animation: introIn 0.7s var(--ease) 0.15s forwards;
}
.intro-mark {
    width: clamp(42px, 8vw, 58px); height: clamp(42px, 8vw, 58px);
    filter: drop-shadow(0 10px 30px color-mix(in oklab, var(--accent) 35%, transparent));
}
.intro-name {
    font-family: var(--font-display); font-weight: 600;
    font-size: clamp(2.1rem, 8vw, 3.6rem); letter-spacing: -0.03em; color: var(--text);
}
.intro-sweep {
    width: 0; height: 2px; border-radius: 2px; background: var(--gradient);
    animation: introSweep 0.9s var(--ease) 0.5s forwards;
}
@keyframes introIn {
    from { opacity: 0; transform: translateY(16px) scale(0.96); filter: blur(8px); }
    to   { opacity: 1; transform: none; filter: blur(0); }
}
@keyframes introSweep {
    from { width: 0; opacity: 0; }
    40%  { opacity: 1; }
    to   { width: min(220px, 58vw); opacity: 0.85; }
}
@keyframes introOut { to { opacity: 0; visibility: hidden; transform: translateY(-1.5%); } }
@media (prefers-reduced-motion: reduce) {
    .intro { animation: introOut 0.3s linear 0.5s forwards; }
    .intro-logo { animation: none; opacity: 1; }
    .intro-sweep { animation: none; width: min(220px, 58vw); opacity: 0.85; }
}

/* ============================================================
   MARQUEE  (single 3D drum band)
   One band of keywords travelling on a tilted, perspective stage
   for depth. The track holds two identical halves and animates to
   -50%, so the loop is perfectly seamless. Pauses on hover; freezes
   for reduced-motion.
   ============================================================ */
.marquee {
    position: relative;
    overflow: hidden;
    padding-block: clamp(var(--sp-5), 5vw, var(--sp-7));
    border-block: 1px solid var(--border);
    perspective: 720px;                     /* gives the band real depth */
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 9%, #000 91%, transparent);
            mask-image: linear-gradient(90deg, transparent, #000 9%, #000 91%, transparent);
}
.marquee-3d {
    transform-style: preserve-3d;
    transform: rotateX(18deg);              /* subtle drum tilt for depth */
}
.marquee-track {
    display: flex;
    gap: var(--sp-7);
    width: max-content;
    will-change: transform;
    animation: marquee 24s linear infinite;
}
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee-item {
    display: inline-flex; align-items: center; gap: var(--sp-7);
    font-family: var(--font-display);
    font-size: var(--fs-600);
    font-weight: 600;
    color: var(--text-faint);
    letter-spacing: -0.01em;
    white-space: nowrap;
}
.marquee-item .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--gradient); flex: none; }
@keyframes marquee { to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .marquee-track { animation: none; } }
/* On phones the 3D drum-tilt lets the big tilted text spill above the band and
   bump into the section above. Flatten it there so it stays inside its own strip. */
@media (max-width: 760px) {
    .marquee { perspective: none; margin-block: var(--sp-2); }
    .marquee-3d { transform: none; }
    .marquee-item { font-size: var(--fs-500); }
}

/* ============================================================
   3D TILT  (pointer-driven depth on cards/panels)
   The rotation itself is applied inline by js/motion.js; here we
   just enable a 3D context + give inner accents something to pop.
   ============================================================ */
.bento-tile, .mini-card, .journal-card, .showcase, .metrics, .contact-panel {
    transform-style: preserve-3d;
}
.is-tilt { will-change: transform; }
.is-tilt .tile-icon,
.is-tilt .more-icon,
.is-tilt .app-badge,
.is-tilt .journal-tag { transform: translateZ(28px); }
.is-tilt .phone-wrap { transform: translateZ(40px); }
@media (hover: none), (prefers-reduced-motion: reduce) {
    .is-tilt .tile-icon, .is-tilt .more-icon, .is-tilt .app-badge,
    .is-tilt .journal-tag, .is-tilt .phone-wrap { transform: none; }
}

/* ============================================================
   SECTION HEADINGS
   ============================================================ */
.section-head { max-width: var(--maxw-narrow); margin-bottom: var(--sp-8); }
.section-head.center { margin-inline: auto; text-align: center; }
.section-head.center .eyebrow { justify-content: center; }
.section-head h2 { font-size: var(--fs-800); margin-top: var(--sp-3); }
.section-head p { margin-top: var(--sp-4); font-size: var(--fs-500); }

/* ============================================================
   MANIFESTO  (editorial statement, word reveal)
   ============================================================ */
.manifesto-text {
    font-family: var(--font-display);
    font-weight: 500;
    font-size: clamp(1.7rem, 3.4vw + 0.6rem, 3.2rem);
    line-height: 1.18;
    letter-spacing: -0.025em;
    max-width: 20ch;
}
.manifesto-text .gradient-text { font-weight: 600; }
.manifesto-aside {
    align-self: end;
    max-width: 44ch;
}
.manifesto-aside p + p { margin-top: var(--sp-4); }
.manifesto-grid {
    display: grid;
    grid-template-columns: 1.3fr 0.7fr;
    gap: clamp(2rem, 5vw, 4rem);
    align-items: start;
}

/* ============================================================
   BENTO  (values / why-us)
   ============================================================ */
.bento {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-auto-rows: auto;
    gap: clamp(0.85rem, 1.6vw, 1.25rem);
    margin-top: var(--sp-8);
}
.bento-tile {
    position: relative;
    padding: clamp(1.15rem, 2vw, 1.6rem);
    border-radius: var(--r-lg);
    background: var(--bg-elev);
    border: 1px solid var(--border);
    overflow: hidden;
    transition: transform var(--dur-fast) var(--ease), border-color var(--dur-fast), box-shadow var(--dur-fast);
    display: flex; flex-direction: column; justify-content: flex-start; gap: var(--sp-3);
    min-height: 0;
}
.bento-tile::before {
    content: ""; position: absolute; inset: 0;
    background: var(--gradient-soft); opacity: 0; transition: opacity var(--dur-fast);
}
.bento-tile:hover { transform: translateY(-5px); border-color: var(--border-strong); box-shadow: var(--shadow-md); }
.bento-tile:hover::before { opacity: 1; }
.bento-tile > * { position: relative; }
.tile-icon {
    width: 46px; height: 46px; display: grid; place-items: center;
    border-radius: var(--r-md); border: 1px solid var(--border);
    background: var(--gradient-soft); color: var(--accent);
    font-size: 1.5rem;
}
.tile-icon svg { width: 24px; height: 24px; }
.bento-tile h3 { font-size: var(--fs-600); }
.bento-tile p { font-size: var(--fs-300); }
/* the feature tile is a full-width banner on its own row, with the three
   standard tiles in a neat row beneath it (keeps it sized to its content) */
.bento-tile.is-feature {
    grid-column: 1 / -1;
    background: var(--gradient);
    color: var(--on-accent);
    justify-content: flex-end;
}
.bento-tile.is-feature::before { display: none; }
.bento-tile.is-feature h3 { font-size: var(--fs-800); color: var(--on-accent); }
.bento-tile.is-feature p { color: var(--on-accent); opacity: 0.86; font-size: var(--fs-500); max-width: 30ch; }
.bento-tile.is-feature .tile-kicker {
    font-size: var(--fs-200); letter-spacing: 0.16em; text-transform: uppercase; font-weight: 700;
    color: var(--on-accent); opacity: 0.8;
}

/* ============================================================
   PRODUCT SHOWCASE  (Aqua hero panel with phone mockup)
   ============================================================ */
.showcase {
    display: grid;
    grid-template-columns: 1fr 0.92fr;
    gap: clamp(2rem, 5vw, 4.5rem);
    align-items: center;
    padding: clamp(1.75rem, 4vw, 3.5rem);
    border-radius: var(--r-xl);
    border: 1px solid var(--border);
    background: var(--bg-elev);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    position: relative;
}
.showcase::after {
    content: ""; position: absolute; inset: 0;
    background: radial-gradient(70% 60% at 85% 10%, var(--glow), transparent 60%);
    opacity: 0.5; pointer-events: none;
}
.showcase > * { position: relative; }
.showcase .app-badge { margin-bottom: var(--sp-4); }
.showcase h3 { font-size: var(--fs-800); }
.showcase .app-tagline { margin-top: var(--sp-2); color: var(--accent); font-weight: 600; font-size: var(--fs-500); }
.showcase .app-description { margin-top: var(--sp-4); font-size: var(--fs-400); max-width: 46ch; }
.app-badge {
    display: inline-flex; align-items: center; gap: 0.45rem;
    font-size: var(--fs-200); font-weight: 600; letter-spacing: 0.04em;
    padding: 0.35rem 0.8rem; border-radius: var(--r-pill);
    border: 1px solid var(--border);
}
.app-badge-live { color: var(--accent); }
.app-badge-lab  { color: var(--accent-2); }

.app-features { margin-top: var(--sp-5); display: grid; gap: var(--sp-3); }
.app-features li { position: relative; padding-left: 1.6rem; font-size: var(--fs-300); color: var(--text-muted); }
.app-features li::before { content: ""; position: absolute; left: 0; top: 0.55em; width: 8px; height: 8px; border-radius: 50%; background: var(--gradient); }

/* store buttons */
.store-btns { display: flex; flex-wrap: wrap; gap: var(--sp-4); margin-top: var(--sp-6); }
.store-btn {
    display: inline-flex; align-items: center; gap: 0.7rem;
    padding: 0.7rem 1.15rem; border-radius: var(--r-md);
    border: 1px solid var(--border-strong);
    background: var(--bg-elev-2);
    color: var(--text);
    transition: transform var(--dur-fast) var(--ease), border-color var(--dur-fast), box-shadow var(--dur-fast);
}
.store-btn svg { width: 26px; height: 26px; flex: none; }
.store-btn span { display: block; font-size: 0.66rem; letter-spacing: 0.04em; color: var(--text-muted); text-transform: uppercase; }
.store-btn strong { display: block; font-size: var(--fs-400); font-weight: 700; }
.store-btn-play:hover { transform: translateY(-2px); border-color: var(--accent); box-shadow: var(--shadow-glow); }
.store-btn-disabled { position: relative; opacity: 0.55; cursor: not-allowed; }
.soon-tag {
    position: absolute; top: -8px; right: -8px;
    font-size: 0.6rem !important; letter-spacing: 0.06em;
    background: var(--spark); color: #fff !important;
    padding: 2px 7px; border-radius: var(--r-pill);
    text-transform: uppercase; font-weight: 700;
}

/* phone mockup */
.phone-wrap { display: grid; place-items: center; }
.phone {
    position: relative;
    width: min(290px, 78%);
    aspect-ratio: 9 / 19;
    border-radius: 38px;
    padding: 12px;
    background: linear-gradient(160deg, color-mix(in oklab, var(--text) 14%, var(--bg-elev-2)), var(--bg-elev-2));
    border: 1px solid var(--border-strong);
    box-shadow: 0 40px 110px -30px var(--glow), var(--shadow-md);
    animation: floatY 7s var(--ease-in-out) infinite alternate;
}
.phone::before { /* notch */
    content: ""; position: absolute; top: 16px; left: 50%; transform: translateX(-50%);
    width: 96px; height: 20px; border-radius: var(--r-pill); background: rgba(0,0,0,0.55); z-index: 3;
}
.phone-screen {
    position: relative; height: 100%; border-radius: 28px; overflow: hidden;
    background:
        radial-gradient(120% 70% at 50% 0%, color-mix(in oklab, var(--accent) 60%, transparent), transparent 60%),
        linear-gradient(180deg, color-mix(in oklab, var(--accent) 22%, var(--bg)) 0%, var(--bg) 60%);
    display: grid; align-content: start; gap: 14px; padding: 56px 18px 18px;
}
.phone-ring {
    justify-self: center; width: 132px; height: 132px; border-radius: 50%;
    display: grid; place-items: center; color: var(--on-accent);
    background: conic-gradient(var(--accent) 0% 68%, color-mix(in oklab, var(--text) 12%, transparent) 68% 100%);
    box-shadow: 0 12px 40px -10px var(--glow);
}
.phone-ring > div {
    width: 104px; height: 104px; border-radius: 50%; background: var(--bg-elev);
    display: grid; place-items: center; text-align: center;
}
.phone-ring b { font-family: var(--font-display); font-size: 1.6rem; color: var(--text); display: block; line-height: 1; }
.phone-ring small { font-size: 0.62rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-faint); }
.phone-row {
    display: flex; align-items: center; gap: 10px;
    padding: 11px 13px; border-radius: var(--r-md);
    background: var(--bg-glass); backdrop-filter: blur(6px);
    border: 1px solid var(--border);
    font-size: var(--fs-200); color: var(--text);
}
.phone-row .pill { margin-left: auto; font-size: 0.62rem; padding: 2px 8px; border-radius: var(--r-pill); background: var(--gradient-soft); color: var(--accent); font-weight: 700; }
.phone-bar { height: 8px; border-radius: var(--r-pill); background: color-mix(in oklab, var(--text) 10%, transparent); overflow: hidden; }
.phone-bar span { display: block; height: 100%; width: 68%; background: var(--gradient); border-radius: var(--r-pill); }

@keyframes floatY { from { transform: translateY(-10px); } to { transform: translateY(10px); } }

/* secondary product tiles */
.product-secondary {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: clamp(1rem, 2vw, 1.5rem);
    margin-top: clamp(1rem, 2vw, 1.5rem);
}
.mini-card {
    position: relative;
    padding: clamp(1.4rem, 2.5vw, 2rem);
    border-radius: var(--r-lg);
    background: var(--bg-elev);
    border: 1px solid var(--border);
    overflow: hidden;
    transition: transform var(--dur-fast) var(--ease), border-color var(--dur-fast), box-shadow var(--dur-fast);
}
.mini-card:hover { transform: translateY(-5px); border-color: var(--border-strong); box-shadow: var(--shadow-md); }
.mini-card h3 { font-size: var(--fs-700); margin-top: var(--sp-4); }
.mini-card .app-tagline { margin-top: var(--sp-2); color: var(--accent); font-weight: 600; font-size: var(--fs-400); }
.mini-card p { margin-top: var(--sp-3); font-size: var(--fs-300); }
.mini-icon { width: 56px; height: 56px; }
.app-cta { display: inline-block; margin-top: var(--sp-5); font-weight: 600; color: var(--accent-2); transition: opacity var(--dur-fast); }
.app-cta:hover { opacity: 0.8; }
.coming-tags { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: var(--sp-5); }
.coming-tags span { font-size: var(--fs-200); font-weight: 600; padding: 0.35rem 0.8rem; border-radius: var(--r-pill); border: 1px solid var(--border); color: var(--text-muted); }
.more-icon { font-size: 2.4rem; line-height: 1; color: var(--accent); font-weight: 300; }

/* when only one secondary card remains, let it span the full width */
.product-secondary-single { grid-template-columns: 1fr; }

/* ============================================================
   APP CAROUSEL  (auto-advancing showcase of apps)
   Each slide is a full-width .showcase box (size unchanged).
   Slides are added/removed straight in index.html — the JS in
   js/products.js rebuilds the dots and wraps the arrows for you.
   ============================================================ */
/* side gutters so the prev/next arrows can sit OUTSIDE the slide box */
.app-carousel { position: relative; padding-inline: clamp(0px, 6vw, 72px); }
.app-viewport {
    display: flex;
    gap: clamp(1rem, 2vw, 1.5rem);
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    border-radius: var(--r-xl);
    -ms-overflow-style: none;   /* hide scrollbar (IE/Edge) */
    scrollbar-width: none;      /* hide scrollbar (Firefox) */
}
.app-viewport::-webkit-scrollbar { display: none; }   /* hide scrollbar (Chrome/Safari) */
.app-viewport > .showcase {
    flex: 0 0 100%;             /* one full box per view → size never changes */
    scroll-snap-align: center;
    min-width: 0;
}

/* prev / next arrows */
.app-nav {
    position: absolute; top: 50%; transform: translateY(-50%); z-index: 4;
    width: 46px; height: 46px; display: grid; place-items: center;
    border-radius: var(--r-pill); border: 1px solid var(--border-strong);
    background: var(--bg-glass); backdrop-filter: blur(10px);
    color: var(--text); cursor: pointer;
    box-shadow: 0 10px 22px -10px rgba(0, 0, 0, 0.5), 0 4px 10px -6px rgba(0, 0, 0, 0.35);
    transition: border-color var(--dur-fast), color var(--dur-fast), transform var(--dur-fast) var(--ease), box-shadow var(--dur-fast);
}
.app-nav:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-50%) scale(1.06); box-shadow: 0 14px 26px -10px rgba(0, 0, 0, 0.55), 0 5px 12px -6px rgba(0, 0, 0, 0.4); }
.app-nav svg { width: 22px; height: 22px; }
/* sit in the outer gutters, just outside the box */
.app-prev { left: 0; }
.app-next { right: 0; }

/* dots */
.app-dots { display: flex; justify-content: center; gap: 0.5rem; margin-top: var(--sp-5); }
.app-dots button {
    width: 9px; height: 9px; border-radius: 50%; padding: 0; cursor: pointer;
    border: none; background: var(--border-strong);
    transition: background var(--dur-fast), transform var(--dur-fast) var(--ease);
}
.app-dots button.on { background: var(--gradient); transform: scale(1.4); }

/* "coming soon" showcase variant — same box, lab styling */
.showcase-soon .app-description { color: var(--text-muted); }
.app-cta-ghost {
    display: inline-flex; align-items: center; gap: 0.4rem;
    margin-top: var(--sp-6); padding: 0.7rem 1.15rem;
    border-radius: var(--r-md); border: 1px solid var(--border-strong);
    color: var(--text); font-weight: 600;
    transition: border-color var(--dur-fast), color var(--dur-fast), transform var(--dur-fast) var(--ease);
}
.app-cta-ghost:hover { border-color: var(--accent-2); color: var(--accent-2); transform: translateY(-2px); opacity: 1; }

/* lab phone screen (locked / coming-soon) */
.phone-soon .phone-screen {
    background:
        radial-gradient(120% 70% at 50% 0%, color-mix(in oklab, var(--accent-2) 42%, transparent), transparent 60%),
        linear-gradient(180deg, color-mix(in oklab, var(--accent-2) 15%, var(--bg)) 0%, var(--bg) 60%);
    place-content: center; gap: 16px; text-align: center; padding: 28px 22px;
}
.phone-soon .soon-lock {
    width: 64px; height: 64px; justify-self: center; display: grid; place-items: center;
    border-radius: 50%; color: var(--accent-2);
    border: 1px solid var(--border-strong); background: var(--bg-glass);
}
.phone-soon .soon-lock svg { width: 28px; height: 28px; }
.phone-soon .soon-title { font-family: var(--font-display); font-size: 1.2rem; color: var(--text); }
.phone-soon .soon-sub { font-size: 0.62rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-faint); }
.phone-soon .soon-skel { width: 100%; display: grid; gap: 9px; margin-top: 4px; }
.phone-soon .soon-skel i {
    height: 10px; border-radius: var(--r-pill);
    background: linear-gradient(90deg, var(--border) 25%, color-mix(in oklab, var(--accent-2) 30%, var(--border)) 50%, var(--border) 75%);
    background-size: 200% 100%; animation: skelShimmer 1.8s linear infinite;
}
.phone-soon .soon-skel i:nth-child(2) { width: 80%; justify-self: center; }
.phone-soon .soon-skel i:nth-child(3) { width: 60%; justify-self: center; }
@keyframes skelShimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

@media (max-width: 720px) {
    /* keep the prev/next arrows on phones too (swipe + dots alone weren't
       obvious enough); tuck them to the edges and keep them thumb-sized */
    .app-nav { width: 44px; height: 44px; }
    .app-prev { left: 6px; }
    .app-next { right: 6px; }
}
@media (prefers-reduced-motion: reduce) {
    .app-viewport { scroll-behavior: auto; }
    .phone-soon .soon-skel i { animation: none; }
}

/* ============================================================
   PROCESS  (animated stepper)
   ============================================================ */
.process-track { position: relative; margin-top: var(--sp-8); }
.process-line { position: absolute; left: 0; right: 0; top: 13px; height: 2px; background: var(--border); border-radius: 2px; overflow: hidden; }
.process-line-fill { display: block; height: 100%; width: 100%; background: var(--gradient); border-radius: 2px; transform: scaleX(var(--p, 0.02)); transform-origin: left; transition: transform 0.1s linear; }
.process-steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--sp-6); }
.process-step { position: relative; padding-top: var(--sp-7); }
.process-dot {
    position: absolute; top: 6px; left: 0;
    width: 16px; height: 16px; border-radius: 50%;
    background: var(--bg); border: 3px solid var(--accent);
    box-shadow: 0 0 0 4px color-mix(in oklab, var(--accent) 18%, transparent);
}
.process-num { font-family: var(--font-display); font-size: var(--fs-300); color: var(--accent); font-weight: 600; }
.process-step h3 { font-size: var(--fs-600); margin-top: var(--sp-2); }
.process-step p { margin-top: var(--sp-3); font-size: var(--fs-300); }

/* ============================================================
   METRICS BAND  (animated counters on a panel)
   ============================================================ */
.metrics {
    border-radius: var(--r-xl);
    border: 1px solid var(--border);
    background: var(--bg-elev);
    padding: clamp(2rem, 5vw, 3.5rem);
    overflow: hidden;
    position: relative;
}
.metrics::before { content: ""; position: absolute; inset: 0; background: var(--gradient-soft); opacity: 0.5; pointer-events: none; }
.metrics > * { position: relative; }
.metrics-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--sp-6); text-align: center; margin-top: var(--sp-6); }
.metric-num { display: block; font-family: var(--font-display); font-weight: 600; font-size: clamp(2.6rem, 5vw, 4rem); line-height: 1; }
.metric-num.gradient-text { background: var(--gradient); -webkit-background-clip: text; background-clip: text; color: transparent; }
.metric-label { display: block; margin-top: var(--sp-3); font-size: var(--fs-300); color: var(--text-muted); letter-spacing: 0.04em; }

/* ============================================================
   JOURNAL  (blog)
   ============================================================ */
.journal-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
    gap: clamp(1rem, 2vw, 1.5rem);
}
.journal-card {
    display: flex; flex-direction: column;
    padding: var(--sp-6);
    border-radius: var(--r-lg);
    background: var(--bg-elev);
    border: 1px solid var(--border);
    transition: transform var(--dur-fast) var(--ease), border-color var(--dur-fast), box-shadow var(--dur-fast);
}
.journal-card:hover { transform: translateY(-6px); border-color: var(--border-strong); box-shadow: var(--shadow-md); }
.journal-tag {
    align-self: flex-start;
    font-size: var(--fs-200); font-weight: 600; letter-spacing: 0.06em;
    padding: 0.3rem 0.75rem; border-radius: var(--r-pill);
    background: var(--gradient-soft); color: var(--accent);
    text-transform: uppercase;
}
.journal-card h3 { font-size: var(--fs-600); margin-top: var(--sp-4); }
.journal-card > p { margin-top: var(--sp-3); font-size: var(--fs-300); flex: 1; }
.journal-meta { display: flex; align-items: center; justify-content: space-between; margin-top: var(--sp-5); font-size: var(--fs-200); color: var(--text-faint); }
.journal-meta a { color: var(--accent); font-weight: 600; }
.journal-meta a:hover { opacity: 0.8; }

/* ============================================================
   CONTACT  (CTA panel + form)
   ============================================================ */
.contact-panel {
    display: grid;
    grid-template-columns: 0.9fr 1.1fr;
    gap: clamp(2rem, 5vw, 4rem);
    align-items: start;
    padding: clamp(1.75rem, 4vw, 3.5rem);
    border-radius: var(--r-xl);
    border: 1px solid var(--border);
    background: var(--bg-elev);
    box-shadow: var(--shadow-md);
}
.contact-item { display: flex; gap: var(--sp-4); align-items: center; margin-bottom: var(--sp-5); }
.contact-icon { flex: none; width: 46px; height: 46px; display: grid; place-items: center; border-radius: var(--r-md); background: var(--gradient-soft); border: 1px solid var(--border); font-size: 1.3rem; }
.contact-item h4 { font-size: var(--fs-400); }
.contact-item p { margin-top: 2px; font-size: var(--fs-300); }
.contact-social { display: flex; gap: 0.6rem; margin-top: var(--sp-6); }
.social-btn {
    width: 44px; height: 44px; display: grid; place-items: center;
    border-radius: var(--r-pill); border: 1px solid var(--border);
    background: var(--bg-elev-2); color: var(--text); font-weight: 700;
    transition: transform var(--dur-fast) var(--ease), border-color var(--dur-fast), color var(--dur-fast);
}
.social-btn:hover { transform: translateY(-3px); border-color: var(--accent); color: var(--accent); }

.contact-form { display: grid; gap: var(--sp-4); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-4); }
.contact-form input,
.contact-form select,
.contact-form textarea {
    width: 100%; font: inherit; color: var(--text);
    background: var(--bg-elev-2);
    border: 1px solid var(--border); border-radius: var(--r-md);
    padding: 0.9rem 1.1rem;
    transition: border-color var(--dur-fast), box-shadow var(--dur-fast);
}
.contact-form textarea { resize: vertical; min-height: 130px; }
.contact-form input::placeholder, .contact-form textarea::placeholder { color: var(--text-faint); }
.contact-form input:focus, .contact-form select:focus, .contact-form textarea:focus {
    outline: none; border-color: var(--accent);
    box-shadow: 0 0 0 3px color-mix(in oklab, var(--accent) 22%, transparent);
}
.full-width { width: 100%; }
.form-note { font-size: var(--fs-200); color: var(--text-faint); text-align: center; }

/* ============================================================
   PAGE HERO  (legal pages)
   ============================================================ */
.page-hero { padding-top: calc(var(--nav-h) + clamp(3rem, 8vw, 6rem)); padding-bottom: clamp(2rem, 6vw, 4rem); }
.page-hero h1 { font-size: var(--fs-800); margin-top: var(--sp-4); }
.page-hero p { margin-top: var(--sp-4); font-size: var(--fs-500); max-width: 56ch; }
.badge-soon {
    display: inline-flex; align-items: center; gap: 0.5rem;
    margin-top: var(--sp-6); padding: 0.5rem 1rem; border-radius: var(--r-pill);
    border: 1px solid var(--border); background: var(--bg-elev);
    font-size: var(--fs-200); color: var(--text-muted); letter-spacing: 0.06em;
}
.badge-soon .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 12px var(--glow); }

/* ============================================================
   FOOTER
   ============================================================ */
.footer {
    position: relative; z-index: 2;
    margin-top: var(--sp-9);
    padding-block: var(--sp-8) var(--sp-6);
    border-top: 1px solid var(--border);
    background: var(--bg-elev);
}
.footer-top { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: var(--sp-7) var(--sp-6); }
.footer-brand p { margin-top: var(--sp-4); max-width: 34ch; font-size: var(--fs-300); }
.footer-col h4 { font-family: var(--font-body); font-size: var(--fs-200); letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-faint); margin-bottom: var(--sp-4); }
.footer-col a { display: block; color: var(--text-muted); font-size: var(--fs-300); padding: 0.35rem 0; transition: color var(--dur-fast); }
.footer-col a:hover { color: var(--accent); }
.footer-bottom {
    display: flex; flex-wrap: wrap; gap: var(--sp-4);
    align-items: center; justify-content: space-between;
    margin-top: var(--sp-7); padding-top: var(--sp-5);
    border-top: 1px solid var(--border);
    font-size: var(--fs-200); color: var(--text-faint);
}
.footer-bottom a { color: var(--text-muted); }
.footer-bottom a:hover { color: var(--accent); }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 980px) {
    .manifesto-grid { grid-template-columns: 1fr; }
    .manifesto-aside { align-self: auto; }
    .showcase { grid-template-columns: 1fr; }
    .phone-wrap { order: -1; }
    .contact-panel { grid-template-columns: 1fr; }
    .metrics-grid { grid-template-columns: 1fr 1fr; }
    .footer-top { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 760px) {
    .bento { grid-template-columns: 1fr 1fr; }
    .bento-tile { min-height: 0; }
    .bento-tile.is-feature { grid-column: span 2; grid-row: span 1; }
    .product-secondary { grid-template-columns: 1fr; }

    /* Process turns into a vertical timeline: a rail down the left that
       fills top-to-bottom as you scroll through the four steps. */
    .process-steps { grid-template-columns: 1fr; gap: var(--sp-6); }
    .process-step { padding-top: 0; padding-left: var(--sp-7); }
    .process-dot { top: 3px; }
    .process-line {
        left: 7px; right: auto; top: 8px; bottom: 8px;
        width: 2px; height: auto;
    }
    .process-line-fill { transform: scaleY(var(--p, 0.02)); transform-origin: top; }
}
@media (max-width: 720px) {
    .nav-links {
        position: fixed;
        inset: var(--nav-h) 0 auto 0;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
        padding: var(--sp-5) clamp(1.25rem, 4vw, 2.5rem) var(--sp-6);
        background: var(--bg-glass);
        backdrop-filter: blur(18px) saturate(140%);
        border-bottom: 1px solid var(--border);
        transform: translateY(-12px);
        opacity: 0;
        pointer-events: none;
        transition: transform var(--dur-fast) var(--ease), opacity var(--dur-fast);
    }
    .nav-links a { width: 100%; padding: 0.75rem 0; font-size: var(--fs-500); }
    .nav.is-open .nav-links { transform: translateY(0); opacity: 1; pointer-events: auto; }
    .hamburger { display: grid; }
    /* The "Contact Us" pill is duplicated inside the slide-down menu on mobile,
       so hide it here and tighten the spacing — that frees the room the hamburger
       needs so it's never pushed off the edge / half cut-off. */
    .nav-actions { gap: 0.4rem; }
    .nav-actions .btn-primary { display: none; }
    .nav.is-open .hamburger span { background: transparent; }
    .nav.is-open .hamburger span::before { transform: translateY(6px) rotate(45deg); }
    .nav.is-open .hamburger span::after  { transform: translateY(-6px) rotate(-45deg); }
}
@media (max-width: 560px) {
    .bento { grid-template-columns: 1fr; }
    .bento-tile.is-feature { grid-column: span 1; }
    .process-steps { grid-template-columns: 1fr; }
    .metrics-grid { grid-template-columns: 1fr 1fr; }
    .form-row { grid-template-columns: 1fr; }
    .footer-top { grid-template-columns: 1fr; }

    /* keep the guided-tour pill compact and readable on phones */
    .tour-hud { gap: var(--sp-3); padding: 0.5rem 0.6rem 0.5rem 0.95rem; }
    .tour-hud .tour-label { font-size: var(--fs-200); }
    .tour-hud .tour-dots { display: none; }
}

/* ============================================================
   LEGAL  (privacy / terms / cookies prose)
   ============================================================ */
.legal { padding-top: var(--sp-2); }
.legal .legal-updated {
    display: inline-block; margin-top: var(--sp-3);
    font-size: var(--fs-200); letter-spacing: 0.04em; color: var(--text-faint);
}
.legal-body > * + * { margin-top: var(--sp-4); }
.legal-body h2 {
    font-size: var(--fs-600); margin-top: var(--sp-8);
    padding-top: var(--sp-6); border-top: 1px solid var(--border);
}
.legal-body h2:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.legal-body h3 { font-size: var(--fs-500); margin-top: var(--sp-6); }
.legal-body p, .legal-body li { color: var(--text-muted); line-height: var(--lh-body); }
.legal-body ul { margin-top: var(--sp-3); padding-left: 1.25em; list-style: disc; }
.legal-body li { margin-top: 0.45em; }
.legal-body li::marker { color: var(--accent); }
.legal-body a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.legal-body strong { color: var(--text); }
.legal-toc {
    display: flex; flex-wrap: wrap; gap: var(--sp-2) var(--sp-4);
    margin-top: 0; margin-bottom: var(--sp-7); padding: var(--sp-4) var(--sp-5);
    border: 1px solid var(--border); border-radius: var(--r-md);
    background: var(--bg-glass);
}
.legal-toc a { font-size: var(--fs-300); color: var(--text-muted); }
.legal-toc a:hover { color: var(--accent); }

/* ============================================================
   COOKIE CONSENT  (lightweight, first-party, no tracking)
   ============================================================ */
.consent {
    position: fixed;
    left: 50%; bottom: clamp(1rem, 3vw, 2rem);
    transform: translateX(-50%) translateY(140%);
    z-index: 150;
    width: min(560px, calc(100vw - 2rem));
    padding: var(--sp-5) var(--sp-5) var(--sp-5);
    background: var(--bg-elev);
    border: 1px solid var(--border-strong);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-md);
    opacity: 0; visibility: hidden;
    transition: transform var(--dur) var(--ease), opacity var(--dur), visibility var(--dur);
}
.consent.is-open { transform: translateX(-50%) translateY(0); opacity: 1; visibility: visible; }
.consent h2 { font-size: var(--fs-500); }
.consent p { margin-top: var(--sp-2); font-size: var(--fs-300); color: var(--text-muted); line-height: var(--lh-snug); }
.consent p a { color: var(--accent); text-decoration: underline; }
.consent-actions { display: flex; flex-wrap: wrap; gap: var(--sp-3); margin-top: var(--sp-4); }
.consent-actions .btn { padding: 0.6rem 1.1rem; font-size: var(--fs-300); }
@media (prefers-reduced-motion: reduce) {
    .consent { transition: opacity var(--dur-fast), visibility var(--dur-fast); transform: translateX(-50%) translateY(0); }
}

/* ============================================================
   GUIDED TOUR  HUD  (small "now touring" pill + stop)
   ============================================================ */
.tour-hud {
    position: fixed;
    left: 50%; bottom: clamp(1rem, 3vw, 2rem);
    transform: translateX(-50%) translateY(160%);
    z-index: 140;
    display: inline-flex; align-items: center; gap: var(--sp-4);
    padding: 0.6rem 0.7rem 0.6rem 1.1rem;
    max-width: calc(100vw - 1.5rem);
    background: var(--bg-glass);
    backdrop-filter: blur(16px) saturate(140%);
    border: 1px solid var(--border-strong);
    border-radius: var(--r-pill);
    box-shadow: var(--shadow-md);
    opacity: 0; visibility: hidden;
    transition: transform var(--dur) var(--ease), opacity var(--dur), visibility var(--dur);
}
.tour-hud.is-open { transform: translateX(-50%) translateY(0); opacity: 1; visibility: visible; }
.tour-hud .tour-label { font-size: var(--fs-300); color: var(--text-muted); white-space: nowrap; }
.tour-hud .tour-label strong { color: var(--text); font-family: var(--font-display); font-weight: 600; }
.tour-hud .tour-dots { display: inline-flex; gap: 5px; }
.tour-hud .tour-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--border-strong); transition: background var(--dur-fast); }
.tour-hud .tour-dots i.on { background: var(--gradient); }
.tour-stop {
    display: inline-flex; align-items: center; gap: 0.4rem;
    padding: 0.4rem 0.85rem; border-radius: var(--r-pill);
    background: var(--bg-elev-2); color: var(--text);
    font-size: var(--fs-200); font-weight: 600; letter-spacing: 0.02em;
    border: 1px solid var(--border);
    transition: border-color var(--dur-fast), color var(--dur-fast);
}
.tour-stop:hover { border-color: var(--accent); color: var(--accent); }
