/* ===========================================================================
   Landing page (templates/main/hub.html)

   A centred hero with a live product demo, the model marquee and a bento grid
   of the four services, each with a small looping illustration. The demo is
   driven by static/js/motion.js (module "demo"); everything else is CSS.
   All loops are transform/opacity only and stop with reduced motion.
   =========================================================================== */

/* ── Centred hero ─────────────────────────────────────────────────────── */
.hero.hero-center { text-align: center; justify-items: center; padding-bottom: clamp(24px, 5vh, 56px); }
.hero-center .hero-main { display: grid; justify-items: center; max-width: 860px; }
.hero-center h1 { font-size: clamp(38px, 6.4vw, 76px); line-height: 1.14; }
.hero-center .sub { margin-inline: auto; max-width: 58ch; }
.hero-center .hero-actions { justify-content: center; }
.hero-center .hero-badge { margin-bottom: 4px; }

/* ── Product demo ─────────────────────────────────────────────────────── */
.demo {
    position: relative;
    width: min(100%, 1040px);
    margin-top: clamp(8px, 2vh, 24px);
    perspective: 1600px;
}
/* A pool of light under the window. */
.demo::before {
    content: '';
    position: absolute;
    inset: 12% 8% -6%;
    z-index: -1;
    border-radius: 50%;
    background: radial-gradient(closest-side, rgb(var(--primary-rgb) / .22), transparent);
    filter: blur(40px);
    pointer-events: none;
}
.demo-window {
    position: relative;
    display: grid;
    grid-template-rows: auto 1fr;
    border-radius: 18px;
    border: 1px solid var(--border-strong);
    background: var(--color-surface);
    box-shadow: 0 50px 100px -30px rgb(0 0 0 / .7), 0 0 0 1px rgb(255 255 255 / .03) inset;
    overflow: hidden;
    text-align: start;
    transform-origin: 50% 0;
}
/* The window lies back a little and straightens as you scroll to it. */
@supports (animation-timeline: view()) {
    .demo-window {
        animation: demo-rise linear both;
        animation-timeline: view();
        animation-range: entry 0% cover 38%;
    }
    @keyframes demo-rise {
        from { transform: rotateX(14deg) scale(.95); opacity: .55; }
        to   { transform: none; opacity: 1; }
    }
}
.demo-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    height: 42px;
    padding: 0 14px;
    border-bottom: 1px solid var(--border-subtle);
    background: rgb(var(--color-text-main-rgb) / .02);
}
.demo-dots { display: flex; gap: 6px; direction: ltr; }
.demo-dots i { width: 10px; height: 10px; border-radius: 50%; background: var(--border-strong); }
.demo-title { flex: 1 1 auto; text-align: center; font-size: 12.5px; color: var(--color-text-muted); }
.demo-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11.5px;
    color: var(--color-text-muted);
}
.demo-status i {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #34D399;
    box-shadow: 0 0 0 3px rgb(52 211 153 / .18);
}

.demo-body { display: grid; grid-template-columns: 220px minmax(0, 1fr); min-height: 420px; }
.demo-side {
    display: grid;
    align-content: start;
    gap: 4px;
    padding: 12px 10px;
    border-inline-end: 1px solid var(--border-subtle);
    background: rgb(var(--color-text-main-rgb) / .015);
}
.demo-new {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 32px;
    margin-bottom: 8px;
    border-radius: 9px;
    background: rgb(var(--primary-rgb));
    color: var(--color-text-on-primary);
    font-size: 12.5px;
    font-weight: 600;
}
.demo-sess {
    display: grid;
    gap: 3px;
    padding: 8px 10px;
    border-radius: 9px;
    font-size: 12.5px;
    color: var(--color-text-main);
}
.demo-sess small { font-size: 10.5px; color: var(--color-text-muted); }
.demo-sess.is-on { background: var(--color-hover-strong); position: relative; }
.demo-sess.is-on::before {
    content: '';
    position: absolute;
    inset-inline-start: 0;
    top: 25%;
    bottom: 25%;
    width: 2.5px;
    border-radius: 3px;
    background: rgb(var(--primary-rgb));
}
.demo-sess .ghost { display: block; height: 7px; border-radius: 4px; background: var(--color-hover-strong); }
.demo-sess .ghost + .ghost { width: 60%; }

.demo-chat { display: flex; flex-direction: column; gap: 12px; padding: 18px 22px 16px; min-width: 0; }
.demo-msg.user {
    align-self: flex-end;
    max-width: 78%;
    padding: 9px 14px;
    border-radius: 16px;
    border-end-end-radius: 5px;
    background: var(--color-hover-strong);
    font-size: 14px;
    line-height: 1.8;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity .35s var(--ease), transform .45s var(--ease);
}
[dir="rtl"] .demo-msg.user { align-self: flex-end; }
.demo-msg.user.is-in { opacity: 1; transform: none; }

.demo-think {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 12.5px;
    color: var(--color-text-muted);
    opacity: 0;
    height: 0;
    overflow: hidden;
    transition: opacity .25s ease, height .25s ease;
}
.demo-think.is-in { opacity: 1; height: 20px; }
.demo-think i {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: rgb(var(--primary-rgb));
    animation: demo-wave 1s ease-in-out infinite;
}
.demo-think i:nth-child(2) { animation-delay: .15s; }
.demo-think i:nth-child(3) { animation-delay: .3s; }
@keyframes demo-wave { 0%, 60%, 100% { transform: translateY(0); opacity: .45; } 30% { transform: translateY(-4px); opacity: 1; } }

.demo-steps { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.demo-steps li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 10px;
    border: 1px solid var(--border-subtle);
    background: var(--color-bg-dark);
    font-size: 13px;
    color: var(--color-text-muted);
    opacity: 0;
    transform: translateY(6px);
    transition: opacity .3s var(--ease), transform .4s var(--ease), border-color .3s ease;
}
.demo-steps li.is-in { opacity: 1; transform: none; }
.demo-steps li code {
    font-family: 'Roboto Mono', ui-monospace, monospace;
    font-size: 12px;
    color: var(--color-text-main);
    direction: ltr;
    unicode-bidi: isolate;
}
.demo-steps .ico {
    display: grid;
    place-items: center;
    width: 24px;
    height: 24px;
    flex: 0 0 auto;
    border-radius: 7px;
    background: var(--color-hover-strong);
    color: rgb(var(--primary-ink-rgb));
}
.demo-steps .ico svg { width: 13px; height: 13px; }
.demo-steps .st { margin-inline-start: auto; width: 16px; height: 16px; flex: 0 0 auto; position: relative; }
.demo-steps .st::before {
    content: '';
    position: absolute;
    inset: 1px;
    border-radius: 50%;
    border: 2px solid rgb(var(--primary-rgb) / .25);
    border-top-color: rgb(var(--primary-rgb));
    animation: shell-spin .8s linear infinite;
}
.demo-steps li.is-done { border-color: rgb(52 211 153 / .25); }
.demo-steps li.is-done .st::before {
    border: 0;
    animation: none;
    background: #34D399;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / 14px no-repeat;
            mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / 14px no-repeat;
}

.demo-reply {
    min-height: 3.6em;
    margin: 2px 0 0;
    font-size: 14.5px;
    line-height: 1.95;
    color: var(--color-text-main);
    opacity: 0;
    transition: opacity .3s ease;
}
.demo-reply.is-in { opacity: 1; }
.demo-reply.is-in:not(.is-done)::after {
    content: '';
    display: inline-block;
    width: 2px;
    height: 1.05em;
    margin-inline-start: 3px;
    vertical-align: -.15em;
    background: rgb(var(--primary-rgb));
    animation: caret 1s steps(2) infinite;
}
@keyframes caret { 50% { opacity: 0; } }

.demo-file {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    align-self: flex-start;
    padding: 8px 12px 8px 10px;
    border-radius: 12px;
    border: 1px solid var(--border-subtle);
    background: var(--color-bg-dark);
    font-size: 12.5px;
    opacity: 0;
    transform: translateY(6px) scale(.98);
    transition: opacity .35s var(--ease), transform .45s var(--ease);
}
[data-demo].is-done .demo-file { opacity: 1; transform: none; }
.demo-file .thumb {
    width: 42px;
    height: 30px;
    border-radius: 6px;
    background:
        linear-gradient(to top, rgb(var(--primary-rgb) / .9) 0 38%, transparent 38%) 6px 100% / 6px 100% no-repeat,
        linear-gradient(to top, rgb(var(--primary-rgb) / .7) 0 60%, transparent 60%) 15px 100% / 6px 100% no-repeat,
        linear-gradient(to top, rgb(var(--primary-rgb)) 0 85%, transparent 85%) 24px 100% / 6px 100% no-repeat,
        var(--color-hover-strong);
}
.demo-file b { display: block; font-family: 'Roboto Mono', monospace; font-size: 12px; direction: ltr; }
.demo-file small { color: var(--color-text-muted); font-size: 11px; }

.demo-input {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: auto;
    padding: 6px 6px 6px 12px;
    padding-inline: 14px 6px;
    border-radius: 14px;
    border: 1px solid var(--border-strong);
    background: var(--field-bg);
    min-height: 44px;
}
.demo-input [data-demo-input] { font-size: 14px; color: var(--color-text-main); white-space: nowrap; overflow: hidden; }
.demo-input [data-demo-input]:empty::before { content: attr(data-placeholder); color: var(--color-text-muted); }
.demo-input .caret {
    width: 2px;
    height: 18px;
    margin-inline-start: -6px;
    background: rgb(var(--primary-rgb));
    animation: caret 1s steps(2) infinite;
}
.demo-input .send {
    margin-inline-start: auto;
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: 9px;
    background: rgb(var(--primary-rgb));
    color: var(--color-text-on-primary);
    transition: transform .2s var(--ease);
}
.demo-input .send svg { width: 15px; height: 15px; }
[dir="rtl"] .demo-input .send svg { transform: scaleX(-1); }
.demo-input:has(.is-sent) .send { transform: scale(.88); }

/* Floating detail cards around the window (desktop). */
.demo-float {
    position: absolute;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 14px;
    border: 1px solid var(--border-strong);
    background: var(--color-raised-translucent);
    backdrop-filter: blur(14px) saturate(160%);
    -webkit-backdrop-filter: blur(14px) saturate(160%);
    box-shadow: var(--shadow-lg);
    font-size: 12.5px;
    color: var(--color-text-main);
    text-align: start;
    animation: float-y 6s ease-in-out infinite;
}
.demo-float small { display: block; color: var(--color-text-muted); font-size: 11px; }
.demo-float .fi {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border-radius: 9px;
    background: rgb(var(--primary-rgb) / .14);
    color: rgb(var(--primary-ink-rgb));
}
.demo-float .fi svg { width: 16px; height: 16px; }
.demo-float.f1 { top: 16%; inset-inline-end: -84px; }
.demo-float.f2 { bottom: 12%; inset-inline-start: -84px; animation-delay: -3s; }
.demo-float .eq { display: flex; align-items: center; gap: 2px; height: 16px; }
.demo-float .eq i {
    width: 3px;
    height: 100%;
    border-radius: 2px;
    background: rgb(var(--primary-rgb));
    transform-origin: center;
    animation: eq-b 1s ease-in-out infinite;
}
.demo-float .eq i:nth-child(2) { animation-delay: -.2s; }
.demo-float .eq i:nth-child(3) { animation-delay: -.45s; }
.demo-float .eq i:nth-child(4) { animation-delay: -.7s; }
.demo-float .eq i:nth-child(5) { animation-delay: -.3s; }
@keyframes eq-b { 0%, 100% { transform: scaleY(.3); } 50% { transform: scaleY(1); } }
@keyframes float-y { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@media (max-width: 1260px) { .demo-float { display: none; } }

@media (max-width: 760px) {
    .demo-body { grid-template-columns: 1fr; min-height: 380px; }
    .demo-side { display: none; }
    .demo-chat { padding: 14px; }
    .demo-steps li { font-size: 12px; }
}

:root[data-theme="light"] .demo-window { box-shadow: 0 40px 80px -30px rgb(14 17 22 / .3); }
:root[data-theme="light"] .demo::before { background: radial-gradient(closest-side, rgb(var(--primary-rgb) / .14), transparent); }
:root[data-theme="light"] .demo-steps li,
:root[data-theme="light"] .demo-file { background: #F7F8FA; }

/* ── Model marquee ────────────────────────────────────────────────────── */
.models {
    max-width: 1200px;
    margin: 0 auto;
    padding: clamp(20px, 4vh, 40px) clamp(18px, 5vw, 56px) clamp(36px, 7vh, 72px);
    text-align: center;
}
.models-t { font-size: 13.5px; color: var(--color-text-muted); margin-bottom: 18px; }
.marquee {
    overflow: hidden;
    -webkit-mask-image: linear-gradient(to right, transparent, #000 12%, #000 88%, transparent);
            mask-image: linear-gradient(to right, transparent, #000 12%, #000 88%, transparent);
}
.marquee-track {
    display: flex;
    gap: 10px;
    width: max-content;
    animation: marquee 48s linear infinite;
}
.marquee:hover .marquee-track { animation-play-state: paused; }
@keyframes marquee { to { transform: translateX(50%); } }
[dir="ltr"] .marquee-track { animation-name: marquee-ltr; }
@keyframes marquee-ltr { to { transform: translateX(-50%); } }
.model-chip {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 7px 14px 7px 8px;
    padding-inline: 8px 14px;
    border-radius: 12px;
    border: 1px solid var(--border-subtle);
    background: var(--color-surface);
    font-size: 13.5px;
    font-weight: 500;
    color: var(--color-text-main);
    white-space: nowrap;
    direction: ltr;
}
.model-chip img {
    width: 24px;
    height: 24px;
    border-radius: 7px;
    object-fit: contain;
    background: #fff;
    padding: 2px;
}
.model-chip small { color: var(--color-text-muted); font-weight: 400; font-size: 11.5px; }

/* ── Bento services grid ──────────────────────────────────────────────── */
.bento {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}
.bento-card {
    position: relative;
    display: grid;
    grid-template-rows: auto auto 1fr;
    gap: 8px;
    min-height: 300px;
    padding: 24px;
    border-radius: 20px;
    border: 1px solid var(--border-subtle);
    background: var(--color-surface);
    overflow: hidden;
    color: var(--color-text-main);
}
.bento-card.wide { grid-column: span 2; }
.bento-card img.lockup { height: 22px; width: auto; justify-self: start; margin-bottom: 6px; }
.bento-card h3 { font-size: 18px; font-weight: 700; line-height: 1.5; }
.bento-card p { font-size: 14px; line-height: 1.85; color: var(--color-text-muted); max-width: 46ch; }
.bento-card .go-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    color: rgb(var(--primary-ink-rgb));
}
.bento-card .go-link svg { width: 14px; height: 14px; transition: transform .25s var(--ease); }
[dir="rtl"] .bento-card .go-link svg { transform: scaleX(-1); }
.bento-card:hover .go-link svg { transform: translateX(3px); }
[dir="rtl"] .bento-card:hover .go-link svg { transform: scaleX(-1) translateX(3px); }
.bento-vis { position: relative; align-self: end; margin-top: 14px; min-height: 120px; }
.bento-card.b-agents  { --primary-rgb: 34 211 238;  --primary-ink-rgb: 34 211 238; }
.bento-card.b-imagine { --primary-rgb: 214 120 255; --primary-ink-rgb: 214 120 255; }
.bento-card.b-storage { --primary-rgb: 250 204 21;  --primary-ink-rgb: 250 204 21; }
.bento-card.b-edits   { --primary-rgb: 255 138 76;  --primary-ink-rgb: 255 138 76; }
:root[data-theme="light"] .bento-card.b-agents  { --primary-rgb: 8 112 140;  --primary-ink-rgb: 8 112 140; }
:root[data-theme="light"] .bento-card.b-imagine { --primary-rgb: 134 46 190; --primary-ink-rgb: 134 46 190; }
:root[data-theme="light"] .bento-card.b-storage { --primary-rgb: 202 138 4;  --primary-ink-rgb: 133 90 0; }
:root[data-theme="light"] .bento-card.b-edits   { --primary-rgb: 194 65 12;  --primary-ink-rgb: 194 65 12; }
/* Each card glows faintly in its own colour from one corner. */
.bento-card::before {
    content: '';
    position: absolute;
    inset: auto -20% -40% auto;
    width: 70%;
    aspect-ratio: 1;
    border-radius: 50%;
    background: radial-gradient(closest-side, rgb(var(--primary-rgb) / .12), transparent);
    pointer-events: none;
    transition: transform .6s var(--ease), opacity .4s ease;
}
[dir="rtl"] .bento-card::before { inset: auto auto -40% -20%; }
.bento-card:hover::before { transform: scale(1.25); }

/* Agents: a terminal that runs a task. */
.term {
    border-radius: 12px;
    border: 1px solid var(--border-subtle);
    background: var(--color-bg-dark);
    padding: 12px 14px;
    font-family: 'Roboto Mono', ui-monospace, monospace;
    font-size: 12px;
    line-height: 1.9;
    direction: ltr;
    text-align: left;
    color: var(--color-text-muted);
}
.term p { margin: 0; white-space: nowrap; overflow: hidden; opacity: 0; animation: term-line 7s steps(1) infinite; }
.term p:nth-child(1) { animation-delay: 0s; }
.term p:nth-child(2) { animation-delay: .9s; }
.term p:nth-child(3) { animation-delay: 1.8s; }
.term p:nth-child(4) { animation-delay: 2.7s; }
.term b { color: rgb(var(--primary-ink-rgb)); font-weight: 500; }
.term .ok { color: #34D399; }
@keyframes term-line { 0% { opacity: 0; } 2%, 88% { opacity: 1; } 100% { opacity: 0; } }
.term .cursor { display: inline-block; width: 7px; height: 13px; vertical-align: -2px; background: rgb(var(--primary-rgb)); animation: caret 1s steps(2) infinite; }

/* Imagine: tiles render from noise into artwork. */
.tiles-gen { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.tiles-gen i {
    position: relative;
    aspect-ratio: 1;
    border-radius: 12px;
    overflow: hidden;
    background: var(--color-hover-strong);
}
.tiles-gen i::before {
    content: '';
    position: absolute;
    inset: 0;
    opacity: 0;
    animation: art-in 6s var(--ease) infinite;
}
.tiles-gen i:nth-child(1)::before { background: radial-gradient(circle at 30% 30%, #FDE68A, transparent 45%), linear-gradient(160deg, #F472B6, #7C3AED 70%); }
.tiles-gen i:nth-child(2)::before { background: radial-gradient(circle at 70% 25%, #FFF, transparent 25%), linear-gradient(200deg, #22D3EE, #1E3A8A 75%); animation-delay: .5s; }
.tiles-gen i:nth-child(3)::before { background: radial-gradient(ellipse at 50% 110%, #F97316, transparent 60%), linear-gradient(180deg, #312E81, #DB2777); animation-delay: 1s; }
.tiles-gen i::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(100deg, transparent 30%, rgb(255 255 255 / .12) 50%, transparent 70%);
    animation: tile-scan 1.2s linear infinite;
}
@keyframes art-in { 0%, 25% { opacity: 0; filter: blur(14px); transform: scale(1.1); } 40%, 88% { opacity: 1; filter: blur(0); transform: none; } 100% { opacity: 0; } }
@keyframes tile-scan { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
.gen-prompt {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    padding: 8px 10px;
    border-radius: 10px;
    border: 1px solid var(--border-subtle);
    background: var(--color-bg-dark);
    font-size: 12px;
    color: var(--color-text-muted);
}
.gen-prompt b { margin-inline-start: auto; font-size: 11px; color: rgb(var(--primary-ink-rgb)); font-weight: 600; }

/* Storage: files uploading. */
.files-up { display: grid; gap: 8px; }
.files-up div {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 6px 10px;
    padding: 9px 12px;
    border-radius: 11px;
    border: 1px solid var(--border-subtle);
    background: var(--color-bg-dark);
    font-size: 12px;
}
.files-up .fic { width: 22px; height: 22px; border-radius: 6px; background: rgb(var(--primary-rgb) / .18); grid-row: span 2; }
.files-up b { font-family: 'Roboto Mono', monospace; font-weight: 500; font-size: 11.5px; direction: ltr; text-align: start; }
.files-up small { color: var(--color-text-muted); font-size: 11px; }
.files-up .bar { grid-column: 2 / 4; margin: 0; height: 3px; }
.files-up .bar i { width: 100%; transform-origin: right; transform: scaleX(0); animation: up-fill 5s var(--ease) infinite; }
[dir="ltr"] .files-up .bar i { transform-origin: left; }
.files-up div:nth-child(2) .bar i { animation-delay: .6s; }
.files-up div:nth-child(3) .bar i { animation-delay: 1.2s; }
@keyframes up-fill { 0% { transform: scaleX(0); } 55%, 90% { transform: scaleX(1); } 100% { transform: scaleX(1); opacity: 0; } }

/* Edits: a timeline with a moving playhead. */
.timeline { position: relative; display: grid; gap: 8px; padding: 12px; border-radius: 12px; border: 1px solid var(--border-subtle); background: var(--color-bg-dark); direction: ltr; }
.timeline .track { display: flex; gap: 6px; height: 22px; }
.timeline .clip { border-radius: 6px; background: rgb(var(--primary-rgb) / .55); }
.timeline .clip.alt { background: rgb(var(--color-text-main-rgb) / .14); }
.timeline .clip.soft { background: rgb(var(--primary-rgb) / .28); }
.timeline .wave {
    height: 22px;
    background:
        repeating-linear-gradient(90deg, rgb(var(--primary-rgb) / .6) 0 2px, transparent 2px 5px);
    -webkit-mask: radial-gradient(ellipse 50% 60% at 30% 50%, #000 40%, transparent 70%), radial-gradient(ellipse 40% 50% at 75% 50%, #000 40%, transparent 70%);
            mask: radial-gradient(ellipse 50% 60% at 30% 50%, #000 40%, transparent 70%), radial-gradient(ellipse 40% 50% at 75% 50%, #000 40%, transparent 70%);
    border-radius: 6px;
}
.timeline .head {
    position: absolute;
    top: 6px;
    bottom: 6px;
    left: 12px;
    width: 2px;
    border-radius: 2px;
    background: #fff;
    box-shadow: 0 0 0 1px rgb(0 0 0 / .2);
    animation: playhead 6s linear infinite;
}
.timeline .head::before { content: ''; position: absolute; top: -5px; left: -4px; width: 10px; height: 8px; border-radius: 3px; background: #fff; }
@keyframes playhead { from { left: 12px; } to { left: calc(100% - 14px); } }
:root[data-theme="light"] .timeline .head,
:root[data-theme="light"] .timeline .head::before { background: #0E1116; }

@media (max-width: 900px) {
    .bento { grid-template-columns: 1fr; }
    .bento-card.wide { grid-column: auto; }
}
:root[data-theme="light"] .bento-card { box-shadow: var(--shadow-xs); }
:root[data-theme="light"] :is(.term, .gen-prompt, .files-up div, .timeline) { background: #F7F8FA; }

/* Loops only run once the grid is on screen. */
.bento:not(.is-in) :is(.term p, .files-up .bar i, .timeline .head) { animation-play-state: paused; }
.bento:not(.is-in) .tiles-gen i::before { animation-play-state: paused; }

@media (prefers-reduced-motion: reduce) {
    .marquee-track { animation: none; flex-wrap: wrap; justify-content: center; width: auto; }
    .marquee { -webkit-mask-image: none; mask-image: none; }
    .term p { animation: none; opacity: 1; }
    .tiles-gen i::before { animation: none; opacity: 1; }
    .tiles-gen i::after, .timeline .head, .demo-float, .files-up .bar i { animation: none; }
    .files-up .bar i { transform: scaleX(.8); }
    .demo-window { animation: none !important; }
}
