/* The home page only (templates/landing.html links it): the pixel hero, the
   use-case tabs and their mocks, sections sized to the screen. Kept out of
   style.css so no other page waits on it; the phone-width tweaks for these
   sections still sit in style.css's responsive blocks. */

/* ------------------------------------------------------------------ */
/* Home page: each section fills the screen                            */
/* ------------------------------------------------------------------ */

/* Wider on big screens (the bar, every section and the footer share it, so
   their edges line up), never narrower than the rest of the site. */
.page-landing { --max-width: clamp(1200px, 86vw, 1440px); }

/* Each section is at least one screen tall below the sticky bar, content
   centred in it. svh keeps phones from jumping as their toolbars hide. */
.page-landing .hero--pixel,
.page-landing .usecases,
.page-landing .dex-intro,
.page-landing .faq-section {
    min-height: calc(100vh - 64px);
    min-height: calc(100svh - 64px);
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.page-landing .usecases-inner,
.page-landing .dex-intro-inner,
.page-landing .faq-inner { width: 100%; }

/* Scale up with the screen: bigger type and mock cards on large displays. */
.page-landing .usecase-heading { font-size: clamp(1.6rem, 2.2vw, 2.2rem); }
.page-landing .usecase-body { font-size: clamp(1rem, 1.05vw, 1.15rem); max-width: 480px; }
.page-landing .uc-card,
.page-landing .mock-card { max-width: clamp(420px, 32vw, 500px); }
/* Switching tabs keeps the section's height, so nothing below jumps. */
.page-landing .usecase-panel { min-height: 400px; }
.page-landing .usecases-title { margin-bottom: clamp(2rem, 4vh, 3rem); }
.page-landing .usecase-tabs { margin-bottom: clamp(2rem, 5vh, 3.5rem); }
.page-landing .faq-title { font-size: clamp(1.9rem, 2.6vw, 2.8rem); }
.faq-lede { color: var(--ink-muted); font-size: 0.95rem; margin: -0.5rem 0 1.25rem; }
.faq-lede a { color: var(--accent); font-weight: 600; }

/* Type that grows with the screen's width and height. */
.page-landing .hero-center { max-width: min(1100px, 100%); }
.page-landing .hero--pixel .hero-title { font-size: clamp(2.4rem, min(6.4vw, 9.5vh), 6.4rem); }
/* Short screens (small laptops): tighter panels so a tab still fits. */
@media (max-height: 760px) and (min-width: 901px) {
    .page-landing .usecase-panel { min-height: 340px; }
    .page-landing .usecases { padding-top: 2.5rem; padding-bottom: 2.5rem; }
}
.page-landing .hero--pixel .hero-subtitle {
    font-size: clamp(1.05rem, 0.9vw + 0.35rem, 1.4rem);
    max-width: 640px;
    margin-bottom: clamp(2rem, 4vh, 3rem);
}
.page-landing .usecases-title { font-size: clamp(1.7rem, 2.6vw, 3rem); }
.page-landing .dex-intro-body { font-size: clamp(1rem, 1vw, 1.15rem); }

/* Questions: heading beside the list on wide screens. */
@media (min-width: 1100px) {
    .page-landing .faq-inner {
        max-width: var(--max-width);
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
        gap: 4rem;
        align-items: start;
    }
}

/* Big, tall screens: the head, cards and buttons step up as a whole, so
   the sections don't sit small in the middle of a large display. Whole
   steps for the head keep its pixels crisp (5px per grid unit). */
@media (min-width: 1600px) and (min-height: 860px) {
    .page-landing .hero-head { width: 120px; height: 80px; margin-bottom: 2.5rem; }
    .page-landing .hero-actions,
    .page-landing .usecase-tabs { zoom: 1.12; }
    .page-landing .mock-card,
    .page-landing .uc-card,
    .page-landing .dex-agent { zoom: 1.12; }
    .page-landing .usecase-panel { min-height: 480px; }
    .page-landing .faq-item > summary { font-size: 1.1rem; padding-top: 1.25rem; padding-bottom: 1.25rem; }
    .page-landing .faq-answer > p { font-size: 1.02rem; }
}

/* ------------------------------------------------------------------ */
/* Pixel hero                                                          */
/* ------------------------------------------------------------------ */

/* Full-bleed band: the canvas spans the window, the copy stays centred. */
.hero.hero--pixel {
    position: relative;
    max-width: none;
    padding: 5.5rem 1.5rem 5rem;
    overflow: hidden;
    isolation: isolate;
    border-bottom: 1px solid var(--border);
}
.hero-pixels {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
}
.hero-center {
    max-width: 720px;
    margin: 0 auto;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.hero--pixel .hero-title { font-size: clamp(2.6rem, 6.4vw, 4.6rem); margin-bottom: 1.25rem; }
/* The second line in outline, as a counterweight to the solid first. Solid
   green where text-stroke isn't supported. */
@supports ((-webkit-text-stroke: 1px black)) {
    .hero--pixel .hero-title em {
        color: transparent;
        -webkit-text-stroke: 2px var(--accent);
        paint-order: stroke fill;
    }
}
.hero--pixel .hero-subtitle { max-width: 520px; margin-left: auto; margin-right: auto; }
.hero--pixel .hero-actions { justify-content: center; }

/* The brand head, 12px per grid pixel. Each pixel flies in from its own
   offset (set inline from the template), then the eyes blink now and then. */
.hero-head {
    width: 96px;
    height: 64px;
    margin-bottom: 2rem;
    overflow: visible;
}
.hero-head-px { fill: var(--accent); }
.hero-head-eyes { fill: var(--ink); transform-origin: 0 12px; transform-box: view-box; }
@media (prefers-reduced-motion: no-preference) {
    .hero-head-px {
        animation: hero-px-in 0.7s cubic-bezier(.2, .8, .2, 1) both;
        animation-delay: var(--d, 0ms);
    }
    .hero-head-eyes { animation: hero-eyes-in 0.3s 0.9s both, hero-blink 5s 2s infinite; }
}
@keyframes hero-px-in {
    from { transform: translate(var(--dx), var(--dy)); opacity: 0; }
    to   { transform: none; opacity: 1; }
}
@keyframes hero-eyes-in { from { opacity: 0; } to { opacity: 1; } }
/* Click: the right eye winks (landing.html's script). */
.hero-head { cursor: pointer; }
.hero-head-eye--r { transform-origin: 0 12px; transform-box: view-box; }
@media (prefers-reduced-motion: no-preference) {
    .hero-head.is-winking .hero-head-eye--r { animation: hero-wink 0.45s ease-in-out; }
}
@keyframes hero-wink {
    0%, 100% { transform: scaleY(1); }
    30%, 65% { transform: scaleY(0.1); }
}
/* Idle for a while: asleep, eyes shut into the navbar mark's 1-unit dashes
   (y 12–13), no blinking until something wakes it. */
.hero-head.is-asleep .hero-head-eyes {
    animation: none;
    opacity: 1;
    transform: scaleY(0.5);
    transform-origin: 0 13px;
}
@keyframes hero-blink {
    0%, 94%, 100% { transform: scaleY(1); }
    97%           { transform: scaleY(0.1); }
}

/* ------------------------------------------------------------------ */
/* Use cases (tabs, each with a mock of the real screen)               */
/* ------------------------------------------------------------------ */

.usecases { padding: 4.5rem 2rem; }
.usecases-inner { max-width: var(--max-width); margin: 0 auto; }
.usecases-title {
    font-size: clamp(1.7rem, 3.4vw, 2.4rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.15;
    color: var(--ink);
    text-align: center;
    margin-bottom: 2rem;
}
.usecases-title em { font-style: normal; color: var(--accent); }

.usecase-tabs {
    display: flex;
    justify-content: center;
    gap: 0.25rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: 2.5rem;
    overflow-x: auto;
    scrollbar-width: none;
}
.usecase-tabs[hidden] { display: none; }
.usecase-tab {
    background: none;
    border: 0;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    padding: 0.8rem 1.1rem;
    font: inherit;
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--ink-muted);
    cursor: pointer;
    white-space: nowrap;
    transition: color 0.15s, border-color 0.15s;
}
.usecase-tab:hover { color: var(--ink); }
.usecase-tab[aria-selected="true"] { color: var(--accent); border-bottom-color: var(--accent); }

/* Auto-rotation: the active tab's line fills up, then the next tab opens
   (the script listens for this animation ending). */
.usecases { --uc-interval: 6s; }
.usecase-tab { position: relative; }
.usecases--rotating .usecase-tab[aria-selected="true"] {
    border-bottom-color: color-mix(in srgb, var(--accent) 25%, transparent);
}
.usecases--rotating .usecase-tab[aria-selected="true"]::after {
    content: '';
    position: absolute;
    left: 0; right: 0; bottom: -1px;
    height: 2px;
    background: var(--accent);
    transform-origin: left center;
    animation: uc-progress var(--uc-interval) linear forwards;
}
/* Paused (by the script) while off screen, in a hidden browser tab, or
   with the cursor or keyboard focus on the tab buttons. As specific as the
   rule above, which sets the animation shorthand, and later, so it wins. */
.usecases--rotating.usecases--paused .usecase-tab[aria-selected="true"]::after { animation-play-state: paused; }
@keyframes uc-progress { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.usecase-tab:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; border-radius: 4px; }

.usecase-panel {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}
.usecase-panel[hidden] { display: none; }
.usecase-panel > * { min-width: 0; }
/* Without JS the panels stack, one after another. */
.usecases:not(.usecases--tabbed) .usecase-panel + .usecase-panel { margin-top: 3.5rem; }
.usecases--tabbed .usecase-panel { animation: uc-in 0.25s ease both; }
@media (prefers-reduced-motion: reduce) { .usecases--tabbed .usecase-panel { animation: none; } }
/* As tabs, every panel sits in the same grid cell: the hidden ones keep
   their size (just invisible), so the area is always as tall as the
   tallest tab and switching never moves the page, at any window size.
   !important beats the global [hidden] rule in style.css. */
.usecases--tabbed .usecases-inner { display: grid; grid-template-columns: minmax(0, 1fr); }
.usecases--tabbed .usecase-panel { grid-row: 3; grid-column: 1; }
.usecases--tabbed .usecase-panel[hidden] {
    display: grid !important;
    visibility: hidden;
    pointer-events: none;
    animation: none;
}
@keyframes uc-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.usecase-heading {
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--ink);
    margin-bottom: 0.8rem;
}
.usecase-body { font-size: 1rem; line-height: 1.75; color: var(--ink-muted); max-width: 440px; }
.usecase-visual { display: flex; justify-content: center; }

/* Left column: the heading and three short points. */
.usecase-points { list-style: none; margin: 1.5rem 0 0; padding: 0; display: grid; gap: 0.7rem; }
.usecase-points li {
    display: flex; align-items: center; gap: 0.65rem;
    color: var(--ink-soft); font-size: clamp(0.92rem, 0.9vw, 1.02rem);
}
.usecase-points svg {
    flex-shrink: 0; color: var(--accent);
    width: 22px; height: 22px; padding: 4px;
    border-radius: 6px; background: var(--accent-light);
}

/* Right column: the mock card on a lit stage, a live pixel field around
   it, and one note floating over the card. */
.usecase-stage {
    position: relative;
    width: 100%;
    max-width: 600px;
    display: flex; justify-content: center; align-items: center;
    padding: clamp(2rem, 4vw, 3.25rem) clamp(1.25rem, 3vw, 2.5rem);
    border: 1px solid var(--border);
    border-radius: 24px;
    background:
        radial-gradient(ellipse at 70% 20%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 60%),
        var(--paper-warm);
    isolation: isolate;
}
/* The dots are the hero's own pixel field (landing_pixels.js): they shimmer
   and shake under the pointer, and keep clear of the card and its notes. */
.usecase-stage > .hero-pixels { border-radius: inherit; }
.usecase-stage .mock-card,
.usecase-stage .uc-card { position: relative; }

.uc-float {
    position: absolute;
    z-index: 2;
    display: inline-flex; align-items: center; gap: 0.55rem;
    padding: 0.55rem 0.85rem 0.55rem 0.55rem;
    background: var(--paper-card);
    border: 1px solid var(--border);
    border-radius: 999px;
    box-shadow: var(--shadow-lg);
    font-size: 0.82rem; font-weight: 600; color: var(--ink);
    white-space: nowrap;
}
.uc-float--top    { top: 0.9rem; left: -0.75rem; }
.uc-float--bottom { bottom: 0.9rem; right: -0.75rem; }
/* Category icons inline in a note, tinted like the card's legend. */
.uc-inline-icon { display: inline-flex; vertical-align: -0.2em; margin: 0 0.2em 0 0.05em; }
.uc-inline-icon svg { width: 1.05em; height: 1.05em; }
.uc-plus { color: var(--ink-faint); margin: 0 0.15em; font-weight: 500; }
/* Wallet tab: one movement at a time, cross-fading in place. */
.uc-moves { display: grid; padding-left: 0.95rem; }
.uc-move {
    grid-area: 1 / 1;
    display: inline-flex; align-items: center; gap: 0.4rem;
    opacity: 0; transform: translateY(4px);
    transition: opacity 0.35s, transform 0.35s;
}
.uc-move.is-on { opacity: 1; transform: none; }
.uc-move-amt { font-variant-numeric: tabular-nums; }
.uc-move-amt--in  { color: var(--accent); }
.uc-move-amt--out { color: var(--danger); }
.uc-move-acct { color: var(--ink-faint); font-weight: 500; }
#uc-wallet .usecase-stage { padding-top: clamp(3.25rem, 5vw, 4rem); }
/* Balance Split tab: the Balances page's tabs and rows, on a card. */
.bal-demo {
    position: relative;
    width: 100%;
    max-width: 440px;
    background: var(--paper-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 1.1rem;
}
.bal-demo .bal-tabs { margin: 0 0 0.6rem; grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 0.6rem; }
.bal-demo .friend-list { margin: 0; }
/* The two lists sit in one grid cell, the hidden one invisible but still
   taking room, so the card is always as tall as the longer list and doesn't
   jump when you switch between "You owe" and "You are owed". */
.bal-demo .bal-panels { display: grid; }
.bal-demo .bal-panels > .friend-list { grid-area: 1 / 1; align-self: start; }
.bal-demo .is-hidden { visibility: hidden; }
#uc-wallet .dw-panel { width: 100%; max-width: 320px; }   /* about the dashboard column: the card plus a rim of leather */
/* The home page's wallet in green leather (the dashboard's stays neutral):
   the same variables the widget is built on, set darker behind and lighter
   on the pocket, with light text and stitching to read on it. */
#uc-wallet .dw-panel {
    --dw-back-c: #1d4a34;
    --dw-front-c: #24593f;
    --dw-text: #f1f7f3;
    --dw-text-soft: rgba(241, 247, 243, 0.72);
    --dw-stitch: rgba(241, 247, 243, 0.28);
    --dw-mark: rgba(241, 247, 243, 0.42);
    --dw-mark-hover: rgba(241, 247, 243, 0.7);
    --dw-mark-edge: 0 -1px 0 rgba(0, 0, 0, .35);
    --dw-pocket-shadow: 0 -6px 14px rgba(0, 0, 0, .3);
    border-color: #173b2a;
}
#uc-wallet .dw-tag--in b   { color: #9fe3bf; }
#uc-wallet .dw-tag--owed b { color: #ffb3a7; }

/* A longer note (My Spending's suggestion) may wrap on narrow stages. */
.uc-float--wrap { white-space: normal; max-width: min(580px, calc(100% + 0.75rem)); line-height: 1.35; }
.uc-float-icon {
    display: inline-flex; align-items: center; justify-content: center;
    width: 24px; height: 24px; border-radius: 50%;
    background: var(--accent); color: #fff;
}
@media (prefers-reduced-motion: no-preference) {
    .usecases--tabbed .usecase-panel:not([hidden]) .uc-float {
        animation: uc-float-in 0.5s 0.25s cubic-bezier(.2, .8, .2, 1) both,
                   uc-bob 4s 0.8s ease-in-out infinite;
    }
}
@keyframes uc-float-in { from { opacity: 0; transform: translateY(10px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes uc-bob { 50% { transform: translateY(-4px); } }

/* The small mock cards (split, log, wallet), styled like .mock-card. */
.uc-card {
    background: var(--paper-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow-lg);
}
.uc-card-head { display: flex; align-items: center; gap: 0.8rem; margin-bottom: 1.1rem; }
.uc-cat {
    display: inline-flex; align-items: center; justify-content: center;
    width: 38px; height: 38px; border-radius: 10px;
    background: var(--accent-light); color: var(--accent);
}
.uc-card-title { font-weight: 700; color: var(--ink); }
.uc-card-sub { font-size: 0.8rem; color: var(--ink-faint); }
.uc-card-amount { margin-left: auto; font-weight: 800; font-size: 1.25rem; color: var(--ink); font-variant-numeric: tabular-nums; }
.uc-rows { list-style: none; margin: 0; padding: 0; }
.uc-row {
    display: grid;
    grid-template-columns: 32px 1fr auto auto;
    align-items: center;
    gap: 0.75rem;
    padding: 0.7rem 0;
    border-top: 1px solid var(--border-soft);
    font-size: 0.9rem;
}
.uc-avatar {
    width: 32px; height: 32px; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--accent-light); color: var(--accent);
    font-weight: 700; font-size: 0.8rem;
}
.uc-avatar--sq { border-radius: 8px; }
.uc-name { color: var(--ink); font-weight: 600; }
.uc-note { color: var(--ink-faint); font-size: 0.8rem; }
.uc-note--owes { color: var(--accent); }
.uc-val { font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; text-align: right; min-width: 4.5em; }
.uc-val--neg { color: var(--danger); }
.uc-card-foot { display: flex; justify-content: flex-end; padding-top: 0.9rem; border-top: 1px solid var(--border-soft); }
.uc-total {
    display: flex; justify-content: space-between; align-items: baseline;
    padding-top: 0.9rem; border-top: 1px solid var(--border);
    color: var(--ink-muted); font-size: 0.9rem;
}
.uc-total strong { color: var(--ink); font-size: 1.3rem; font-variant-numeric: tabular-nums; }

.uc-label { font-size: 0.72rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-faint); margin: 0.9rem 0 0.35rem; }
.uc-label:first-child { margin-top: 0; }
.uc-field {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.6rem 0.8rem;
    color: var(--ink);
    font-size: 0.92rem;
    background: var(--paper);
}
.uc-caret {
    display: inline-block; width: 1.5px; height: 1em; margin-left: 2px;
    background: var(--accent); vertical-align: -0.15em;
}
@media (prefers-reduced-motion: no-preference) {
    .uc-caret { animation: uc-caret 1.1s steps(1) infinite; }
}
@keyframes uc-caret { 50% { opacity: 0; } }
.uc-split2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
.uc-chips { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.uc-chip {
    display: inline-flex; align-items: center;
    padding: 0.35rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: 0.8rem; font-weight: 600;
    color: var(--ink-muted);
}
.uc-chip--on { background: var(--accent); border-color: var(--accent); color: #fff; }
.uc-receipt { display: flex; align-items: center; gap: 0.4rem; margin-top: 1rem; font-size: 0.82rem; color: var(--ink-muted); }
.uc-save {
    display: block; margin-top: 1.1rem; padding: 0.7rem;
    border-radius: var(--radius-sm);
    background: var(--accent); color: #fff;
    text-align: center; font-weight: 700; font-size: 0.9rem;
}

/* Expense Log tab: the add-expense form card, filled in, a bit tighter
   than the real page. The values are text in the input boxes (not inputs),
   so nothing here can be typed into or submitted. */
.log-demo { width: 100%; max-width: 460px; padding: 2rem 1.5rem 1.25rem; text-align: left; }
.log-demo .expense-form-grid { gap: 0 1rem; }
.log-demo .form-group { margin-bottom: 1rem; }
.log-demo-value { display: flex; align-items: center; min-height: 42px; color: var(--ink); cursor: default; }
.log-demo .cselect-input { border: 0; background: none; padding: 0; color: var(--ink); font: inherit; }
/* The category box matches the text inputs beside it. */
.log-demo .cselect-trigger { min-height: 0; height: var(--log-field-h, 48px); box-sizing: border-box; }
.log-demo .form-input.log-demo-value { height: var(--log-field-h, 48px); box-sizing: border-box; }
.log-demo-receipt { margin-top: 0; margin-bottom: 0 !important; }
.log-demo .receipt-attach { cursor: default; }
.log-demo .receipt-attach-icon { margin-top: -8px; }
.log-demo .receipt-chip-thumb--file { font-size: 0.6rem; }

/* Narrower screens. Here, after the rules above, so they win. */
@media (max-width: 900px) {
    .usecase-panel { grid-template-columns: 1fr; gap: 2rem; text-align: center; }
    .usecase-body { margin: 0 auto; }
    .usecase-tabs { justify-content: flex-start; }
    .usecase-visual { text-align: left; }
    .usecase-points { justify-items: center; }
}

@media (max-width: 600px) {
    .hero.hero--pixel { padding: 3.5rem 1rem 3rem; }
    .hero-head { width: 72px; height: 48px; margin-bottom: 1.5rem; }
    .usecases { padding: 3rem 1rem; }
    .uc-card { padding: 1.15rem; }
    .page-landing .usecase-panel { min-height: 0; }
    .uc-float--top { left: 0.5rem; top: 0.5rem; }
    .uc-float--bottom { right: 0.5rem; bottom: 0.5rem; }
    .uc-float--wrap { max-width: calc(100% - 1rem); }
    .usecase-stage { padding: 3.25rem 0.75rem; }
    .uc-float { font-size: 0.75rem; }
    .page-landing .uc-card, .page-landing .mock-card { max-width: 100%; }
    .usecase-tab { padding: 0.75rem 0.55rem; font-size: 0.82rem; }
}


/* ------------------------------------------------------------------ */
/* Meet Dex: the dashboard's ask bar, playing itself                   */
/* ------------------------------------------------------------------ */
/* Built from the bar's own pieces (.dex-quote, .dex-top-bar, .cc-insight
   in style.css), so it looks like the real thing; only what differs is
   here. Played by static/js/landing_dex_agent.js. */

/* The bar across the top of the section, full width as on the dashboard,
   and the words about it underneath. */
.dex-intro-visual { display: block; }
/* The section's badge heads it, above the bar. Room under it for Dex's
   cloud, which rises over the bar's right end. */
.dex-intro-badge { text-align: center; margin-bottom: 1.25rem; }
/* The section's name in square pixels, like the brand head: no pill, just
   Dex's green. 5px per grid pixel (39×5) so every edge is crisp; 4px on
   phones. */
.dex-badge { display: inline-flex; margin: 0; color: var(--accent); }
.dex-badge-pixels { display: block; width: 195px; height: 25px; }
@media (max-width: 600px) {
    .dex-badge-pixels { width: 156px; height: 20px; }
}

/* The headline, under the badge and over the bar: one line where it fits,
   centred, with the promise in Dex's green over the hero's square-pixel
   underline (.hero-dex), so the section answers the page's first line. */
.page-landing .dex-intro-title {
    max-width: none;
    margin: 0 auto clamp(1.5rem, 3vh, 2.25rem);
    text-align: center;
    font-size: clamp(1.9rem, 3.3vw, 3.4rem);
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -0.035em;
    text-wrap: balance;
}
/* At body size a tenth of the font rounds to a single pixel, too fine to
   read: the story link holds 2px squares instead. */
.dex-story-link .pixel-word { --px: 2px; }
.dex-intro-title-accent {
    color: var(--accent);
    white-space: nowrap;
    padding-bottom: 0.14em;
    background-image: linear-gradient(90deg, var(--accent) 3px, transparent 3px);
    background-size: 5px 3px;
    background-repeat: space no-repeat;
    background-position: 0 100%;
}
.dex-agent { width: 100%; text-align: left; }
.dex-agent-stage { position: relative; }

.dex-intro-text {
    max-width: 760px;
    margin: clamp(2.5rem, 6vh, 4rem) auto 0;
    text-align: center;
}
.dex-intro-text .dex-intro-body { max-width: 620px; margin-left: auto; margin-right: auto; }

/* The cloud, right-aligned above Dex as on the dashboard. It only ever
   holds the dots or a step (never the day's quote), and is one line tall
   whichever, so it can come and go without moving the bar. */
.dex-agent-head { display: flex; justify-content: flex-end; }
.dex-agent-cloud.dex-quote--steps {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 2.6rem;
}

.dex-agent-bar { margin-bottom: 0; }
.dex-agent-stage.is-typing .dex-agent-bar { border-color: var(--accent); box-shadow: var(--shadow-md); }

/* The input, drawn: what's typed, a caret while typing, or the
   placeholder when empty. One line; the end stays in view as it grows. */
.dex-agent-input {
    display: flex;
    align-items: center;
    overflow: hidden;
    white-space: nowrap;
    line-height: 1.5;
    cursor: default;
}
.dex-agent-typed { flex: none; }
.dex-agent-input.is-empty .dex-agent-typed { display: none; }
.dex-agent-placeholder { display: none; color: var(--ink-faint); }
.dex-agent-input.is-empty .dex-agent-placeholder { display: inline; }
.dex-agent-caret {
    display: none;
    flex: none;
    width: 1.5px;
    height: 1.15em;
    margin: 0 1px;
    background: var(--accent);
    animation: dexCaret 1s steps(1) infinite;
}
.dex-agent-stage.is-typing .dex-agent-caret { display: inline-block; }
@keyframes dexCaret { 50% { opacity: 0; } }

.dex-agent-bar .dex-top-bar-send { cursor: default; }
.dex-agent-stage.is-sending .dex-top-bar-send {
    background: var(--accent-hover);
    transform: scale(0.92);
    box-shadow: 0 0 0 4px var(--accent-light);
}
.dex-agent-stage.is-sending .dex-top-bar-send svg { transform: translate(3px, -3px) rotate(-8deg); }

/* The strip keeps its height whatever it says: one line, two on a phone. */
.dex-agent-strip .cc-insight-text { min-height: calc(1.5em * var(--cc-lines)); }
.dex-agent-strip--idle .cc-insight-text { color: var(--ink-muted); }
.dex-agent-strip.cc-insight--reveal .dex-agent-answer { animation: ccReveal 0.4s ease both; }

/* The jobs: pick one, or let them run. */
.dex-agent-jobs {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1.25rem;
}
.dex-agent-job {
    font: inherit;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--ink-soft);
    background: var(--paper-card);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 0.45rem 1rem;
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.dex-agent-job:hover { color: var(--accent); border-color: var(--accent); }
.dex-agent-job.is-active { color: var(--accent); border-color: var(--accent); background: var(--accent-light); }
.dex-agent-job:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

@media (max-width: 600px) {
    .dex-agent-head { display: block; }
}

@media (prefers-reduced-motion: reduce) {
    .dex-agent-cloud { transition: none; }
    .dex-agent-caret { animation: none; }
    .dex-agent-strip.cc-insight--reveal .dex-agent-answer { animation: none; }
}


/* ------------------------------------------------------------------ */
/* Contact page, in the home page's dress                              */
/* ------------------------------------------------------------------ */
/* templates/contact.html loads this sheet for the pixel band (.hero--pixel)
   and the outlined headline; what's its own is here. */
.contact-hero { border-bottom: 0; padding-bottom: 5.5rem; }
.contact-hero .contact-center { max-width: 680px; }
.contact-hero .hero-title { font-size: clamp(2.4rem, 5.4vw, 4.2rem); margin-bottom: 1rem; }
.contact-hero .hero-subtitle { margin-bottom: clamp(2rem, 4vh, 2.75rem); }

/* The form reads left to right inside the centred band, raised off the
   field like the home page's cards. */
.contact-hero .contact-card {
    width: 100%;
    text-align: left;
    box-shadow: var(--shadow-lg);
}

@media (max-width: 600px) {
    .contact-hero { padding: 3.5rem 1rem 3.5rem; }
}


/* ------------------------------------------------------------------ */
/* About page, in the home page's dress                                */
/* ------------------------------------------------------------------ */
/* templates/about.html: the title in the pixel band, the story below. */
.about-hero { padding: 5rem 1.5rem 4.25rem; }
/* The brand head over the title, 8px per grid pixel so it stays crisp. */
.about-mark { display: inline-flex; margin-bottom: 1.5rem; }
.about-mark .brand-mark { width: 72px; height: 48px; }
.about-hero .hero-title { font-size: clamp(2.4rem, 5.4vw, 4.2rem); margin-bottom: 1rem; }
.about-hero .hero-subtitle { margin-bottom: 0; }

.about-story { max-width: 680px; margin: 0 auto; padding: 3.5rem 1.5rem 4.5rem; }
.about-story .dex-story-body { margin-top: 0; font-size: 1.05rem; }
.about-link { color: var(--accent); font-weight: 600; }
.about-link:hover { color: var(--accent-hover); text-decoration: underline; }
.about-actions { justify-content: center; margin-top: 2.25rem; }

@media (max-width: 600px) {
    .about-hero { padding: 3.5rem 1rem 3rem; }
    .about-story { padding: 2.5rem 1rem 3.5rem; }
}


/* ------------------------------------------------------------------ */
/* Phones: what the responsive sweep (360-430px) caught                */
/* ------------------------------------------------------------------ */
@media (max-width: 430px) {
    /* All four use-case tabs on one row, spread edge to edge, rather than
       the last one cut off at the screen's edge. The strip still scrolls
       if a narrower screen can't fit them. */
    .usecase-tabs { justify-content: space-between; gap: 0; }
    .usecase-tab { padding: 0.75rem 0.3rem; font-size: 0.78rem; }

    /* Meet Dex's headline as two whole phrases, one a line. */
    .dex-intro-title-accent { display: table; margin: 0.1em auto 0; }

    /* The four jobs on one row. */
    .dex-agent-jobs { gap: 0.4rem; }
    .dex-agent-job { padding: 0.4rem 0.75rem; font-size: 0.78rem; }
}

/* Once Dex has the question, the bar shows it from the start, trimmed with
   an ellipsis, rather than scrolled to its end with the start cut off. */
.dex-agent-stage:not(.is-typing) .dex-agent-typed {
    flex: 0 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

