/* alelade — product page. Dark "Pro" style: black, large type, light
   behind the screens. Every animation respects prefers-reduced-motion. */

:root {
    --bg: #000;
    --surface: #0b0b0d;
    --card: #111114;
    --line: rgba(255, 255, 255, 0.09);
    --text: #f5f5f7;
    --muted: #86868b;
    --soft: #a1a1a6;
    --violet: #a493ff;
    --blue: #5aa7ff;
    --pink: #ff7eb6;
    --amber: #ffb35c;
    --green: #39d98a;
    --grad: linear-gradient(90deg, var(--violet), var(--blue) 45%, var(--pink));
    --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
    --radius: 22px;
    --nav: 52px;
    color-scheme: dark;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--nav) + 12px); }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
    font-size: 17px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }

code, kbd, .mono { font-family: "JetBrains Mono", ui-monospace, monospace; }

.wrap { width: min(1120px, 100% - 40px); margin: 0 auto; }

/* --- navigation -------------------------------------------------------------- */
.nav {
    position: fixed;
    inset: 0 0 auto 0;
    height: var(--nav);
    z-index: 50;
    background: rgba(0, 0, 0, 0.62);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    backdrop-filter: saturate(180%) blur(20px);
    border-bottom: 1px solid var(--line);
}
.nav .wrap { height: 100%; display: flex; align-items: center; gap: 28px; }
.nav .logo {
    font-weight: 800;
    font-size: 19px;
    letter-spacing: -0.03em;
    background: var(--grad);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.nav .links { display: flex; gap: 22px; font-size: 13px; color: var(--soft); }
.nav .links a { transition: color 0.2s; }
.nav .links a:hover, .nav .links a.on { color: var(--text); }
.nav .right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.badge {
    font-size: 12px;
    color: var(--soft);
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 3px 10px;
    white-space: nowrap;
}
.badge i { color: var(--green); font-style: normal; margin-right: 4px; }
.lang {
    display: inline-flex;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 2px;
}
.lang button {
    font: inherit;
    font-size: 12px;
    font-weight: 600;
    color: var(--muted);
    background: none;
    border: 0;
    border-radius: 999px;
    padding: 3px 10px;
    cursor: pointer;
}
.lang button[aria-pressed="true"] { color: #000; background: var(--text); }

/* --- type ------------------------------------------------------------------- */
.eyebrow {
    font-size: 15px;
    font-weight: 600;
    color: var(--muted);
    margin: 0 0 10px;
}
.gradient-text {
    background: var(--grad);
    background-size: 200% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: sheen 9s ease-in-out infinite alternate;
}
@keyframes sheen { to { background-position: 100% 0; } }

h2 {
    font-size: clamp(36px, 6vw, 72px);
    line-height: 1.04;
    letter-spacing: -0.035em;
    font-weight: 800;
    margin: 0 0 18px;
}
.lead {
    font-size: clamp(18px, 2.1vw, 23px);
    line-height: 1.45;
    color: var(--soft);
    max-width: 760px;
    margin: 0;
}
.lead b { color: var(--text); font-weight: 600; }
section { padding: 140px 0 40px; position: relative; }
.center { text-align: center; }
.center .lead { margin: 0 auto; }

kbd {
    display: inline-block;
    font-size: 0.82em;
    line-height: 1.5;
    padding: 0 7px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-bottom-width: 2px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.06);
    color: var(--text);
}

/* --- reveal on scroll ---------------------------------------------------------- */
.reveal {
    opacity: 0;
    transform: translateY(42px);
    filter: blur(6px);
    transition: opacity 1s var(--ease), transform 1s var(--ease), filter 1s var(--ease);
    transition-delay: var(--d, 0s);
}
.reveal.in { opacity: 1; transform: none; filter: none; }

/* --- devices (screenshots) -------------------------------------------------------- */
.device {
    position: relative;
    border-radius: 16px;
    background: #1b1c1f;
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 40px 120px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(0, 0, 0, 0.6);
    overflow: hidden;
}
.device .bar {
    display: flex;
    align-items: center;
    gap: 7px;
    height: 34px;
    padding: 0 14px;
    background: #121214;
    border-bottom: 1px solid var(--line);
    font-size: 12px;
    color: var(--muted);
}
.device .bar i { width: 11px; height: 11px; border-radius: 50%; background: #3a3a3f; }
.device .bar span { margin-left: 8px; font-family: "JetBrains Mono", monospace; }
.screen { position: relative; aspect-ratio: 990 / 646; background: var(--screen, #1b1c1f); }
.layer {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--screen, #1b1c1f);
    opacity: 0;
    transition: opacity 0.6s var(--ease);
}
.layer.on { opacity: 1; }
.shot svg { display: block; width: 100%; height: auto; }
.term text { font-family: "JetBrains Mono", ui-monospace, monospace; font-size: 15px; white-space: pre; }

.glow-wrap { position: relative; }
.glow-wrap::before {
    content: "";
    position: absolute;
    inset: 8% 6% -6%;
    background: radial-gradient(closest-side, var(--glow, rgba(110, 120, 255, 0.55)), transparent);
    filter: blur(70px);
    opacity: 0.75;
    z-index: -1;
    transition: background 0.8s var(--ease);
    animation: breathe 7s ease-in-out infinite alternate;
}
@keyframes breathe { from { opacity: 0.5; transform: scale(0.96); } to { opacity: 0.85; transform: scale(1.04); } }

/* --- hero ------------------------------------------------------------------------ */
.hero { padding: calc(var(--nav) + 90px) 0 60px; text-align: center; overflow: hidden; }
.wordmark {
    display: inline-flex;
    align-items: center;
    font-size: clamp(64px, 15vw, 168px);
    line-height: 1;
    font-weight: 800;
    letter-spacing: -0.06em;
    margin: 6px 0 22px;
}
.wordmark .caret {
    width: 0.09em;
    height: 0.82em;
    margin-left: 0.06em;
    border-radius: 3px;
    background: var(--blue);
    box-shadow: 0 0 24px rgba(90, 167, 255, 0.8);
    animation: blink 1.1s step-end infinite;
}
@keyframes blink { 50% { opacity: 0; } }
.headline {
    font-size: clamp(28px, 4.4vw, 52px);
    line-height: 1.08;
    letter-spacing: -0.03em;
    font-weight: 700;
    margin: 0 0 16px;
}
.hero .lead { margin: 0 auto 34px; }
.cta { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 17px;
    font-weight: 600;
    border-radius: 999px;
    padding: 12px 24px;
    transition: transform 0.2s var(--ease), background 0.2s;
}
.btn:hover { transform: scale(1.03); }
.btn.primary { background: var(--text); color: #000; }
.btn.ghost { color: var(--blue); }
.btn.ghost:hover { text-decoration: underline; }
.hero-stage { margin: 80px auto 0; width: min(1080px, 100% - 32px); perspective: 1600px; }
.hero-stage .device {
    transform-origin: 50% 0;
    transform: rotateX(var(--tilt, 0deg)) scale(var(--grow, 1));
    will-change: transform;
}

/* --- story (sticky) -------------------------------------------------------------- */
.story-grid { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: 64px; margin-top: 70px; }
.step { min-height: 72vh; display: flex; flex-direction: column; justify-content: center; opacity: 0.28; transition: opacity 0.5s var(--ease); }
.step.on { opacity: 1; }
.step .n { font-family: "JetBrains Mono", monospace; font-size: 13px; color: var(--violet); margin-bottom: 12px; }
.step h3 { font-size: clamp(26px, 3vw, 38px); letter-spacing: -0.025em; line-height: 1.1; margin: 0 0 14px; }
.step p { color: var(--soft); font-size: 19px; margin: 0; }
.step .mobile-shot { display: none; }
/* The screen takes the whole right half of the window: full bleed to the
   right edge, as tall as the window below the nav. Its screenshots are
   made at a matching size (96x50), so nothing is letterboxed. */
.story-grid, .split.bleed {
    width: 100vw;
    margin-left: calc(50% - 50vw);
    grid-template-columns: 1fr 1fr;
    gap: 0;
}
/* The text fills the left half the same way: a slim margin, type that
   grows with the window. */
.story-steps, .split.bleed > :first-child {
    padding-left: clamp(24px, 6vw, 120px);
    padding-right: clamp(32px, 5vw, 96px);
}
.story-steps .step .n { font-size: clamp(13px, 1.1vw, 17px); margin-bottom: 18px; }
.story-steps .step h3 { font-size: clamp(34px, 4.2vw, 76px); line-height: 1.04; letter-spacing: -0.035em; margin-bottom: 22px; }
.story-steps .step p { font-size: clamp(19px, 1.75vw, 30px); line-height: 1.42; }
.split.bleed h2 { font-size: clamp(40px, 5.4vw, 96px); }
.split.bleed .lead { font-size: clamp(19px, 1.75vw, 30px); max-width: none; }
.split.bleed .eyebrow { font-size: clamp(15px, 1.2vw, 20px); }
.split.bleed .steps3 { gap: clamp(20px, 2vw, 34px); margin-top: clamp(28px, 3vw, 52px); }
.split.bleed .steps3 li { grid-template-columns: clamp(34px, 2.8vw, 48px) 1fr; gap: clamp(14px, 1.3vw, 22px); }
.split.bleed .steps3 .dot { width: clamp(34px, 2.8vw, 48px); height: clamp(34px, 2.8vw, 48px); font-size: clamp(14px, 1.1vw, 19px); }
.split.bleed .steps3 b { font-size: clamp(18px, 1.55vw, 27px); }
.split.bleed .steps3 span { font-size: clamp(15px, 1.25vw, 21px); }
.story-screen, .split.bleed > :last-child { padding-right: 20px; }
.story-screen .sticky { position: sticky; top: calc(var(--nav) + 20px); height: calc(100vh - var(--nav) - 40px); }
/* app.js sizes these screens to the screenshot variant closest to the room
   they have, so the terminal fills its frame; what is left over stays
   outside the frame. Screens hug the right edge. */
.story-screen .sticky, .split.bleed > :last-child { display: flex; align-items: center; justify-content: flex-end; }
.story-screen .device { height: 100%; width: 100%; }
.split.bleed .device { height: min(880px, calc(100vh - var(--nav) - 40px)); width: 100%; }
.device.fill { display: flex; flex-direction: column; }
.device.fill .screen { flex: 1; min-height: 0; aspect-ratio: auto; }
.device.fill .shot svg { width: 100%; height: 100%; }

/* --- orchestra flow ------------------------------------------------------------- */
.flow {
    display: grid;
    grid-template-columns: 1fr 40px 1fr 40px 1.2fr 40px 1fr;
    align-items: center;
    margin: 70px 0 28px;
}
.node {
    position: relative;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 20px 18px;
    text-align: left;
    transition: border-color 0.5s, box-shadow 0.5s;
}
.node .k { font-family: "JetBrains Mono", monospace; font-size: 12px; color: var(--muted); }
.node b { display: block; font-size: 20px; letter-spacing: -0.02em; margin: 4px 0 6px; }
.node small { color: var(--soft); font-size: 14px; line-height: 1.4; display: block; }
.workers { display: grid; gap: 10px; }
.worker {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 10px 14px;
    font-size: 14px;
}
.worker .tier { font-family: "JetBrains Mono", monospace; font-size: 12px; color: var(--muted); }
.worker .state { font-family: "JetBrains Mono", monospace; font-size: 12px; }
.wire { height: 2px; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.18), transparent); position: relative; overflow: hidden; }
.wire::after {
    content: "";
    position: absolute;
    inset: 0;
    width: 40%;
    background: linear-gradient(90deg, transparent, var(--blue), transparent);
    transform: translateX(-120%);
}
.flow.in .wire::after { animation: pulse 2.4s var(--ease) infinite; animation-delay: calc(var(--i) * 0.5s); }
@keyframes pulse { to { transform: translateX(320%); } }
.flow.in .node, .flow.in .worker { animation: light 6s ease-in-out infinite; animation-delay: calc(var(--i) * 0.6s); }
@keyframes light {
    0%, 70%, 100% { border-color: var(--line); box-shadow: none; }
    12%, 30% { border-color: rgba(90, 167, 255, 0.7); box-shadow: 0 0 36px rgba(90, 167, 255, 0.25); }
}
/* A rejected task climbs to a stronger model. */
.escalate .state { transition: color 0.3s; }
.flow.in .escalate .state::after { content: ""; animation: verdict 6s steps(1) infinite; }
@keyframes verdict {
    0% { content: "running"; color: var(--muted); }
    35% { content: "rejected"; }
    55% { content: "→ strong"; }
    80% { content: "✓ approved"; }
}
.facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.fact { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; }
.fact b { display: block; font-size: 19px; letter-spacing: -0.02em; margin-bottom: 6px; }
.fact p { margin: 0; color: var(--soft); font-size: 15px; }

/* --- playground ----------------------------------------------------------------- */
.play-stage { margin-top: 60px; outline: none; }
/* Screen and keys fit one laptop screen together. */
.play-stage > .glow-wrap { max-width: min(860px, 100%); margin: 0 auto; }
#theme-glow { max-width: min(960px, 100%); margin: 0 auto; }
.play-stage:focus-visible .device { box-shadow: 0 0 0 2px var(--blue), 0 40px 120px rgba(0, 0, 0, 0.7); }
.keys { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 28px; }
.key {
    font: inherit;
    font-size: 14px;
    color: var(--soft);
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 10px 14px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: transform 0.15s var(--ease), border-color 0.2s, color 0.2s;
}
.key:hover { color: var(--text); border-color: rgba(255, 255, 255, 0.25); }
.key.hit { transform: scale(0.94); border-color: var(--blue); color: var(--text); }
.key kbd { font-size: 12px; }
.play-status {
    text-align: center;
    min-height: 1.5em;
    margin: 18px 0 0;
    color: var(--soft);
    font-size: 15px;
}
.play-status .mono { color: var(--text); }
.hint { text-align: center; color: var(--muted); font-size: 14px; margin-top: 10px; }

/* --- split sections ------------------------------------------------------------- */
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 64px; align-items: center; margin-top: 60px; }
.steps3 { list-style: none; padding: 0; margin: 28px 0 0; display: grid; gap: 20px; }
.steps3 li { display: grid; grid-template-columns: 34px 1fr; gap: 14px; }
.steps3 .dot {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 14px;
    font-weight: 700;
    background: rgba(90, 167, 255, 0.14);
    color: var(--blue);
}
.steps3 b { display: block; font-size: 18px; letter-spacing: -0.015em; }
.steps3 span { color: var(--soft); font-size: 15px; }

/* --- control cards ---------------------------------------------------------------- */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 40px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; }
.card .ic { font-family: "JetBrains Mono", monospace; font-size: 20px; color: var(--green); margin-bottom: 14px; }
.card b { display: block; font-size: 19px; letter-spacing: -0.02em; margin-bottom: 6px; }
.card p { margin: 0; color: var(--soft); font-size: 15px; }
.card.wide { grid-column: span 2; }

/* --- themes ---------------------------------------------------------------------- */
.chips { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin: 44px 0 34px; }
.chip {
    font: inherit;
    font-size: 15px;
    font-weight: 600;
    color: var(--soft);
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 9px 16px;
    display: inline-flex;
    align-items: center;
    gap: 9px;
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s, background 0.2s;
}
.chip i { width: 12px; height: 12px; border-radius: 50%; background: var(--c); box-shadow: 0 0 10px var(--c); }
.chip[aria-pressed="true"] { color: var(--text); border-color: rgba(255, 255, 255, 0.4); background: #1a1a1e; }
.theme-note { text-align: center; color: var(--soft); margin: 26px auto 0; max-width: 640px; min-height: 3em; }
pre.code {
    margin: 36px auto 0;
    max-width: 640px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 20px 22px;
    overflow-x: auto;
    font-size: 14px;
    line-height: 1.7;
    color: var(--soft);
}
pre.code .k { color: var(--blue); }
pre.code .s { color: var(--amber); }

/* --- bento ----------------------------------------------------------------------- */
.bento { display: grid; grid-template-columns: repeat(6, 1fr); gap: 16px; margin-top: 60px; }
.tile {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 30px;
    overflow: hidden;
    position: relative;
    min-height: 220px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}
.tile h3 { font-size: 24px; letter-spacing: -0.025em; line-height: 1.15; margin: 0 0 8px; }
.tile p { margin: 0; color: var(--soft); font-size: 15px; }
.tile .art { font-family: "JetBrains Mono", monospace; font-size: 14px; color: var(--muted); margin-top: 22px; line-height: 1.7; }
.tile .big { font-size: clamp(40px, 5vw, 64px); font-weight: 800; letter-spacing: -0.04em; line-height: 1; }
.t3 { grid-column: span 3; }
.t2 { grid-column: span 2; }
.t4 { grid-column: span 4; }

/* --- footer ------------------------------------------------------------------------ */
.closing { text-align: center; padding: 160px 0 90px; }
.closing h2 { margin-bottom: 14px; }
.closing .lead { margin: 0 auto; }
footer { border-top: 1px solid var(--line); padding: 26px 0 40px; color: var(--muted); font-size: 13px; }
footer .wrap { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
footer a:hover { color: var(--text); }

/* --- small screens ---------------------------------------------------------------- */
@media (max-width: 960px) {
    .nav .links { display: none; }
    .story-grid { grid-template-columns: 1fr; gap: 0; margin-top: 40px; width: auto; margin-left: 0; }
    .story-steps, .split.bleed > :first-child { padding: 0; }
    .story-steps .step h3 { font-size: clamp(26px, 6vw, 38px); }
    .story-steps .step p { font-size: 17px; }
    .split.bleed > :last-child { padding: 0; }
    .split.bleed { width: auto; margin-left: 0; grid-template-columns: 1fr; gap: 36px; }
    .split.bleed .device { height: auto; width: 100% !important; }
    .split.bleed > :last-child { display: block; }
    .split.bleed .device.fill .screen { aspect-ratio: 864 / 950; }
    .story-screen { display: none; }
    .step { min-height: auto; opacity: 1; padding: 34px 0; }
    .step .mobile-shot { display: block; margin-top: 24px; }
    .flow { grid-template-columns: 1fr; gap: 0; }
    .wire { width: 2px; height: 34px; margin: 0 auto; background: linear-gradient(transparent, rgba(255, 255, 255, 0.2), transparent); }
    .wire::after { display: none; }
    .facts, .cards { grid-template-columns: 1fr; }
    .card.wide { grid-column: auto; }
    .split { grid-template-columns: 1fr; gap: 36px; }
    .bento { grid-template-columns: 1fr; }
    .t2, .t3, .t4 { grid-column: auto; }
    section { padding-top: 100px; }
}
@media (max-width: 520px) {
    body { font-size: 16px; }
    .nav .badge { display: none; }
    .device .bar span { display: none; }
    .key span { display: none; }
}

/* --- reduced motion ------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .reveal { opacity: 1; transform: none; filter: none; transition: none; }
    .gradient-text, .glow-wrap::before, .wordmark .caret { animation: none; }
    .flow.in .wire::after, .flow.in .node, .flow.in .worker { animation: none; }
    .flow.in .escalate .state::after { animation: none; content: "✓ approved"; }
    .layer, .step { transition: none; }
    .hero-stage .device { transform: none; }
}

/* --- story: one step per scroll gesture (desktop) ------------------------------ */
/* The pin is five screens tall; its stage stays put while the steps go by.
   app.js turns one wheel gesture into one step (no CSS snapping: it would
   hold the page at the last step). */
.story-markers { display: none; }
.story-dots { display: none; }
@media (min-width: 961px) and (prefers-reduced-motion: no-preference) {
    .story-pin { position: relative; height: 500vh; margin-top: 40px; }
    .story-markers { display: block; }
    .story-markers .marker { position: absolute; left: 0; width: 1px; height: 100vh; }
    .story-pin .story-grid {
        position: sticky;
        top: var(--nav);
        height: calc(100vh - var(--nav));
        margin-top: 0;
        padding: 20px 0;
    }
    .story-pin .story-steps {
        --pl: clamp(24px, 6vw, 120px);
        --pr: clamp(32px, 5vw, 96px);
        position: relative;
    }
    .story-pin .step {
        position: absolute;
        top: 0;
        bottom: 0;
        left: var(--pl);
        right: var(--pr);
        min-height: 0;
        opacity: 0;
        transform: translateY(80px);
        filter: blur(6px);
        pointer-events: none;
        transition: opacity 0.75s var(--ease), transform 0.9s var(--ease), filter 0.75s var(--ease);
    }
    .story-pin .step.past { transform: translateY(-80px); }
    .story-pin .step.on { opacity: 1; transform: none; filter: none; pointer-events: auto; transition-delay: 0.12s; }
    .story-pin .story-screen .sticky { position: static; height: 100%; }
    .story-pin .layer { transform: scale(1.025); transition: opacity 0.7s var(--ease), transform 1s var(--ease); }
    .story-pin .layer.on { transform: none; }
    .story-dots {
        display: flex;
        gap: 10px;
        position: absolute;
        left: var(--pl);
        bottom: 34px;
    }
    .story-dots button {
        width: 8px;
        height: 8px;
        padding: 0;
        border: 0;
        border-radius: 999px;
        background: rgba(255, 255, 255, 0.28);
        cursor: pointer;
        transition: width 0.4s var(--ease), background 0.4s;
    }
    .story-dots button.on { width: 28px; background: var(--text); }
}
