/* ============================================================
   HERO 2026 — "code becomes product"
   Scroll-scrubbed 3D assembly: the flagship app builds itself
   from code tiles; sibling apps fan in from depth.
   No libraries. Transforms + opacity only.
   ============================================================ */

.h26 {
    position: relative;
    /* tall track: the inner viewport is sticky while scroll scrubs the scene */
    height: 300vh;
}
.h26-sticky {
    position: sticky;
    top: 0;
    height: 100vh;
    overflow: clip;
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
    align-items: center;
    gap: 24px;
    padding: 96px 5vw 40px;
}

/* sticky fix: the legacy bundle sets main{overflow-x:hidden;overflow-y:auto},
   which turns <main> into the scrollport and kills position:sticky.
   html/body already clip horizontal overflow, so visible is safe here. */
main:has(.h26) {
    overflow: visible !important;
}

/* ---------- backdrop: perspective dot-field + aurora ---------- */
.h26-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    background:
        radial-gradient(58% 44% at 74% 60%, rgba(200, 42, 239, 0.16), transparent 70%),
        radial-gradient(40% 34% at 18% 22%, rgba(52, 211, 153, 0.07), transparent 70%),
        var(--accent-color-4, #0E0E0E);
}
.h26-bg::before {
    content: "";
    position: absolute;
    inset: -40% -10%;
    background-image: radial-gradient(rgba(255, 255, 255, 0.13) 1px, transparent 1.4px);
    background-size: 26px 26px;
    transform: perspective(700px) rotateX(58deg) translateY(calc(var(--h26p, 0) * -120px));
    mask-image: linear-gradient(to bottom, transparent 4%, #000 38%, #000 72%, transparent 96%);
    -webkit-mask-image: linear-gradient(to bottom, transparent 4%, #000 38%, #000 72%, transparent 96%);
}
[data-theme="light"] .h26-bg {
    background:
        radial-gradient(58% 44% at 74% 60%, rgba(200, 42, 239, 0.10), transparent 70%),
        radial-gradient(40% 34% at 18% 22%, rgba(16, 163, 127, 0.06), transparent 70%),
        #FFFFFF;
}
[data-theme="light"] .h26-bg::before {
    background-image: radial-gradient(rgba(0, 0, 0, 0.16) 1px, transparent 1.4px);
}

/* ---------- copy column ---------- */
.h26-copy {
    position: relative;
    z-index: 3;
    max-width: 620px;
}
.h26-badge {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: var(--font-size-sm);
    color: var(--text-color);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 999px;
    padding: 7px 16px;
    margin-bottom: 26px;
    backdrop-filter: blur(4px);
}
[data-theme="light"] .h26-badge { border-color: rgba(0, 0, 0, 0.14); }
.h26-badge .dot {
    width: 7px; height: 7px; border-radius: 50%;
    background: #34d399;
    box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.22);
    animation: h26pulse 2.4s ease-in-out infinite;
}
@keyframes h26pulse {
    0%, 100% { box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.22); }
    50% { box-shadow: 0 0 0 7px rgba(52, 211, 153, 0.08); }
}

.h26-title {
    margin: 0 0 20px;
    font-weight: var(--font-weight-bold);
    letter-spacing: -0.035em;
    line-height: 1.02;
    font-size: clamp(2.5rem, 5.8vw, 4.6rem);
    color: var(--text-color-2);
}
.h26-title .h26-line { display: block; overflow: hidden; }
.h26-title .h26-word {
    display: inline-block;
    transform: translateY(calc((1 - var(--h26in, 0)) * 110%));
    transition: transform 0.9s cubic-bezier(0.19, 1, 0.22, 1);
    transition-delay: var(--d, 0s);
}
.h26-title em {
    font-style: normal;
    background: linear-gradient(100deg, var(--accent-color) 10%, #7ab8ff 55%, #34d399 95%);
    background-size: 220% 100%;
    background-position: calc((1 - var(--h26p, 0)) * 100%) 0;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.h26-sub {
    color: var(--text-color);
    font-size: clamp(1.02rem, 1.35vw, 1.18rem);
    max-width: 52ch;
    margin: 0 0 30px;
}
.h26-ctas { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; margin-bottom: 34px; }
.h26-ctas .btn-accent { padding: 14px 28px; border-radius: 999px; }
.h26-more {
    color: var(--text-color-2);
    font-weight: var(--font-weight-semibold);
    text-decoration: none;
    border-bottom: 1px solid var(--accent-color);
    padding-bottom: 2px;
}
.h26-more:hover { color: var(--accent-color); }

/* live ticker under CTAs: honest, verifiable facts */
.h26-facts {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 26px;
    color: var(--text-color);
    font-size: var(--font-size-sm);
}
.h26-facts b { color: var(--text-color-2); font-weight: var(--font-weight-semibold); }

/* scroll hint */
.h26-hint {
    position: absolute;
    left: 50%;
    bottom: 20px;
    transform: translateX(-50%);
    z-index: 3;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-color);
    font-size: 12px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    opacity: calc(1 - var(--h26p, 0) * 2.4);
}
.h26-hint .h26-wheel {
    width: 20px; height: 32px;
    border: 1.5px solid currentColor;
    border-radius: 12px;
    position: relative;
}
.h26-hint .h26-wheel::after {
    content: "";
    position: absolute;
    left: 50%; top: 6px;
    width: 3px; height: 7px;
    margin-left: -1.5px;
    border-radius: 3px;
    background: currentColor;
    animation: h26wheel 1.6s ease-in-out infinite;
}
@keyframes h26wheel {
    0% { transform: translateY(0); opacity: 1; }
    70% { transform: translateY(9px); opacity: 0; }
    100% { transform: translateY(0); opacity: 0; }
}

/* ---------- 3D stage ---------- */
.h26-stage {
    position: relative;
    z-index: 2;
    height: min(74vh, 720px);
    perspective: 1300px;
    transform-style: preserve-3d;
}
.h26-scene {
    position: absolute;
    inset: 0;
    transform-style: preserve-3d;
    transform: rotateY(calc(var(--px, 0) * 7deg)) rotateX(calc(var(--py, 0) * -5deg));
    transition: transform 0.12s linear;
}

.h26-phone {
    --w: min(30vh, 252px);
    position: absolute;
    width: var(--w);
    aspect-ratio: 1290 / 2796;
    left: 50%;
    top: 50%;
    margin: 0;
    transform-style: preserve-3d;
    border-radius: calc(var(--w) * 0.115);
}
.h26-shell {
    position: absolute;
    inset: 0;
    border-radius: inherit;
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: #101014;
    box-shadow:
        0 40px 80px rgba(0, 0, 0, 0.5),
        inset 0 0 0 4px #000,
        inset 0 0 0 5px rgba(255, 255, 255, 0.08);
    overflow: hidden;
}
[data-theme="light"] .h26-shell {
    box-shadow: 0 30px 70px rgba(20, 8, 30, 0.28), inset 0 0 0 4px #000, inset 0 0 0 5px rgba(255,255,255,0.08);
}
.h26-shell img {
    position: absolute;
    inset: 4px;
    width: calc(100% - 8px);
    height: calc(100% - 8px);
    object-fit: cover;
    border-radius: calc(var(--w) * 0.09);
}
/* dynamic island nub */
.h26-shell::after {
    content: "";
    position: absolute;
    top: calc(var(--w) * 0.055);
    left: 50%;
    transform: translateX(-50%);
    width: calc(var(--w) * 0.32);
    height: calc(var(--w) * 0.038);
    border-radius: 999px;
    background: #000;
    z-index: 3;
}

/* hero phone: tile assembly */
.h26-p1 {
    transform:
        translate(-50%, -50%)
        translate3d(calc(var(--h26p1x, 0) * 1px), calc(var(--h26p1y, 0) * 1px), calc(var(--h26p1z, 0) * 1px))
        rotateY(calc(var(--h26p1ry, 24) * 1deg))
        rotateX(calc(var(--h26p1rx, 6) * 1deg));
    z-index: 4;
}
.h26-tiles {
    position: absolute;
    inset: 4px;
    border-radius: calc(var(--w) * 0.09);
    overflow: hidden;
    transform-style: preserve-3d;
    z-index: 2;
    pointer-events: none;
}
.h26-tile {
    position: absolute;
    transform-style: preserve-3d;
    transform: rotateY(calc((1 - var(--f, 0)) * -180deg));
    will-change: transform;
}
.h26-tile .h26-face {
    position: absolute;
    inset: 0;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}
/* code face (shown pre-assembly, i.e. the BACK while unflipped) */
.h26-tile .h26-code {
    transform: rotateY(180deg);
    display: flex;
    align-items: center;
    justify-content: center;
    background: #0B0B10;
    border: 0.5px solid rgba(200, 42, 239, 0.18);
    color: rgba(200, 42, 239, 0.85);
    font-family: "SF Mono", ui-monospace, Menlo, monospace;
    font-size: calc(var(--w) * 0.05);
}
.h26-tile .h26-code.alt { color: rgba(122, 184, 255, 0.8); }
.h26-tile .h26-code.alt2 { color: rgba(52, 211, 153, 0.75); }
/* screenshot face: one shared image, sliced via background-position */
.h26-tile .h26-img {
    background-image: var(--shot);
    background-size: var(--cols-w) var(--rows-h);
    background-position: var(--bx) var(--by);
}

/* side phones: fly in from depth */
.h26-side {
    z-index: 3;
    transform:
        translate(-50%, -50%)
        translate3d(calc(var(--sx, 0) * 1px), calc(var(--sy, 0) * 1px), calc(var(--sz, -500) * 1px))
        rotateY(calc(var(--sry, 30) * 1deg));
    opacity: var(--so, 0);
}

/* captions */
.h26-cap {
    position: absolute;
    left: 50%;
    bottom: calc(-1 * var(--w) * 0.19);
    transform: translateX(-50%) translateY(calc((1 - var(--capin, 0)) * 12px));
    opacity: var(--capin, 0);
    transition: opacity 0.5s ease, transform 0.5s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    color: var(--text-color);
    font-size: 12.5px;
}
.h26-cap img { width: 18px; height: 18px; border-radius: 5px; }
.h26-cap .h26-live {
    color: #34d399;
    font-weight: 700;
    letter-spacing: 0.08em;
    font-size: 10.5px;
    border: 1px solid rgba(52, 211, 153, 0.4);
    border-radius: 999px;
    padding: 2.5px 8px;
    background: rgba(16, 185, 129, 0.12);
}

/* the depth phone (zoomi) hides behind the hero phone on desktop — no caption */
@media (min-width: 901px) {
    .h26-side[data-app="zoomi"] .h26-cap { display: none; }
}

/* progress rail */
.h26-rail {
    position: absolute;
    right: max(2vw, 14px);
    top: 50%;
    transform: translateY(-50%);
    z-index: 3;
    width: 2px;
    height: 120px;
    background: rgba(255, 255, 255, 0.12);
    border-radius: 2px;
}
[data-theme="light"] .h26-rail { background: rgba(0, 0, 0, 0.12); }
.h26-rail::after {
    content: "";
    position: absolute;
    left: 0; top: 0;
    width: 100%;
    height: calc(var(--h26p, 0) * 100%);
    background: linear-gradient(var(--accent-color), #7ab8ff);
    border-radius: 2px;
}

/* ---------- mobile & fallbacks ---------- */
@media (max-width: 900px) {
    .h26 { height: auto; }
    .h26-sticky {
        position: relative;
        height: auto;
        grid-template-columns: minmax(0, 1fr);
        padding: 108px 20px 34px;
        gap: 8px;
    }
    .h26-stage { min-width: 0; max-width: 100%; }
    .h26-scene { width: 100%; }
    .h26-copy, .h26-sub { max-width: 100%; }
    .h26-hint, .h26-rail { display: none; }
    .h26-stage {
        perspective: 900px;
        height: auto;
        margin-top: 26px;
    }
    /* phones become a swipeable snap row of framed shots */
    .h26-scene {
        position: relative;
        transform: none !important;
        display: flex;
        gap: 14px;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        padding: 8px 4px 30px;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    .h26-scene::-webkit-scrollbar { display: none; }
    .h26-phone, .h26-p1, .h26-side {
        --w: 62vw;
        position: relative;
        left: auto; top: auto;
        transform: none !important;
        opacity: 1 !important;
        flex: 0 0 var(--w);
        scroll-snap-align: center;
        margin-bottom: calc(var(--w) * 0.16);
    }
    .h26-tiles { display: none; }   /* mobile shows the plain screenshot */
    .h26-p1 .h26-shell img { display: block; }
    .h26-cap { opacity: 1; transform: translateX(-50%); bottom: calc(-1 * var(--w) * 0.115); }
    .h26-title .h26-word { transform: none; }
}

/* no-JS / reduced-motion: fully assembled static scene */
@media (prefers-reduced-motion: reduce) {
    .h26 { height: auto; }
    .h26-sticky { position: relative; height: auto; }
    .h26-title .h26-word { transform: none !important; }
    .h26-tile { transform: none !important; }
    .h26-side { opacity: 1 !important; }
    .h26-hint { display: none; }
}
.h26.h26-nojs .h26-title .h26-word { transform: none; }
.h26.h26-nojs .h26-tiles { display: none; }
.h26.h26-nojs .h26-side { opacity: 1; }
