/*
 * Homepage hero only. Linked from partials/home/hero.leaf.
 * Not part of the Tailwind build. Page colours come from the --fk-* tokens;
 * the in-screen app colours are the --hb-* properties on .fk-board, declared
 * once for light and twice for dark (media watch + [data-theme="dark"]).
 *
 * The live board (.fk-board) is four device frames composed as one cluster.
 * The server renders the finished story; /js/hero-board.js loops it by
 * toggling classes and data attributes on .fk-board. Everything that moves
 * moves on transform or opacity. prefers-reduced-motion keeps the finished
 * composition (see the guard at the end of this file).
 */


/* The navbar (.fk-nav) is shared by every public page: see /css/site.css. */

.fk-hero__cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--fk-radius-pill);
    background: var(--fk-surface-inverse);
    color: var(--fk-text-inverse);
    font-weight: 600;
    text-decoration: none;
    transition: transform var(--fk-duration-fast) var(--fk-ease-out);
}

.fk-hero__cta:hover {
    transform: translateY(-1px);
}

.fk-hero__cta:focus-visible,
.fk-hero__docs:focus-visible,
.fk-hero__cue:focus-visible {
    outline: 2px solid var(--fk-focus, var(--fk-primary-text));
    outline-offset: 3px;
}

/* ---------- Hero ---------- */

.fk-hero {
    /* Homepage sections share this rhythm. Declared here because hero.css
       loads after the compiled token sheet. */
    --fk-space-section: clamp(3.5rem, 2.25rem + 3vw, 6rem);
    position: relative;
    overflow: clip;
    color: var(--fk-ink);
    background-color: var(--fk-surface);
}

/* A soft wash at the very top so the glass navbar has something to sit on. */
.fk-hero::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 34rem;
    background: radial-gradient(70% 100% at 50% 0%, var(--fk-surface-alt), transparent 70%);
    pointer-events: none;
}

.fk-hero__stage {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-sizing: border-box;
    width: min(100%, var(--fk-container));
    margin-inline: auto;
    padding: clamp(6rem, 4.5rem + 3vw, 7.25rem) var(--fk-gutter) clamp(3rem, 2rem + 3vw, 5rem);
}

.fk-hero__copy {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 68rem;
    text-align: center;
}

.fk-hero__eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
    padding: 0.35rem 0.85rem;
    border: 1px solid var(--fk-hairline);
    border-radius: var(--fk-radius-pill);
    background: var(--fk-glass-bg);
    color: var(--fk-ink-soft);
    font-size: var(--fk-font-eyebrow);
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.fk-hero__dot {
    width: 0.45rem;
    height: 0.45rem;
    border-radius: 50%;
    background: var(--fk-primary-text);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--fk-primary) 22%, transparent);
}

.fk-hero__title {
    margin: 1.1rem 0 0;
    color: var(--fk-ink);
    font-size: clamp(2.6rem, 1.4rem + 4.6vw, 5.1rem);
    font-weight: 800;
    letter-spacing: -0.045em;
    line-height: 1.02;
    text-wrap: balance;
}

.fk-hero__line,
.fk-hero__accent {
    display: block;
}

.fk-hero__accent {
    color: var(--fk-primary-text);
}

.fk-hero__lead {
    max-width: 40rem;
    margin: 1.25rem auto 0;
    color: var(--fk-ink-soft);
    font-size: clamp(1.0625rem, 0.95rem + 0.45vw, 1.3125rem);
    line-height: 1.45;
    text-wrap: pretty;
}

.fk-hero__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.75rem 1.25rem;
    margin-top: 1.75rem;
}

.fk-hero__cta {
    padding: 0.9rem 1.6rem;
    font-size: 1rem;
    box-shadow: 0 10px 30px -12px rgba(15, 23, 42, 0.45);
}

.fk-hero__docs {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.9rem 0.4rem;
    color: var(--fk-ink);
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
}

.fk-hero__docs svg {
    width: 1rem;
    height: 1rem;
    transition: transform var(--fk-duration-fast) var(--fk-ease-out);
}

.fk-hero__docs:hover svg {
    transform: translateX(3px);
}

/* ---------- Proof row under the board ---------- */

.fk-hero__proof {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    margin-top: clamp(1.5rem, 1rem + 2vw, 3rem);
}

.fk-hero__stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: min(100%, 34rem);
}

.fk-hero__stat {
    min-width: 0;
    padding: 0.15rem 0.75rem;
    text-align: center;
}

.fk-hero__stat + .fk-hero__stat {
    border-inline-start: 1px solid var(--fk-hairline);
}

.fk-hero__stat-value {
    color: var(--fk-ink);
    font-size: clamp(1.4rem, 0.9rem + 1.6vw, 2.25rem);
    font-weight: 800;
    letter-spacing: var(--fk-tracking-tight);
    font-variant-numeric: tabular-nums;
    line-height: 1.1;
}

.fk-hero__stat-label {
    margin-top: 0.2rem;
    color: var(--fk-ink-soft);
    font-size: var(--fk-font-small);
    font-weight: 500;
}

.fk-hero__badges {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.4rem;
    margin-top: 1.4rem;
}

.fk-hero__badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.3rem 0.7rem;
    border: 1px solid var(--fk-hairline);
    border-radius: var(--fk-radius-pill);
    background: var(--fk-glass-bg);
    color: var(--fk-ink-soft);
    font-size: 0.75rem;
    font-weight: 600;
}

.fk-hero__badge svg {
    width: 0.95rem;
    height: 0.95rem;
}

/* ==========================================================================
   Live board
   ========================================================================== */

.fk-board {
    /* Trailmate, the fictional demo app, has its own accent. */
    --hb-accent: #0f766e;
    --hb-accent-soft: rgba(15, 118, 110, 0.12);
    --hb-on-accent: #ffffff;
    --hb-touch: rgba(100, 116, 139, 0.32);
    --hb-pending-fg: #475569;
    --hb-pending-bg: rgba(100, 116, 139, 0.14);
    --hb-approved-fg: #1d4ed8;
    --hb-approved-bg: rgba(37, 99, 235, 0.12);
    --hb-progress-fg: #c2410c;
    --hb-progress-bg: rgba(234, 88, 12, 0.13);
    --hb-testflight-fg: #0e7490;
    --hb-testflight-bg: rgba(6, 182, 212, 0.15);
    --hb-glow-a: rgba(247, 165, 13, 0.34);
    --hb-glow-b: rgba(45, 212, 191, 0.2);
    --hb-glow-c: rgba(232, 93, 4, 0.2);
    --hb-floor: rgba(15, 23, 42, 0.16);
    --hb-banner-bg: rgba(255, 255, 255, 0.985);
    --hb-key: #ffffff;
    --hb-keys-bg: #d4d7dd;
    --hb-scroll: 0;
    position: relative;
    z-index: 1;
    width: min(100%, 70rem);
    margin-top: clamp(2.25rem, 1.5rem + 2vw, 3.5rem);
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .fk-board {
        --hb-accent: #2dd4bf;
        --hb-accent-soft: rgba(45, 212, 191, 0.16);
        --hb-on-accent: #042f2e;
        --hb-touch: rgba(203, 213, 225, 0.3);
        --hb-pending-fg: #cbd5e1;
        --hb-pending-bg: rgba(148, 163, 184, 0.18);
        --hb-approved-fg: #93c5fd;
        --hb-approved-bg: rgba(59, 130, 246, 0.22);
        --hb-progress-fg: #fdba74;
        --hb-progress-bg: rgba(249, 115, 22, 0.2);
        --hb-testflight-fg: #67e8f9;
        --hb-testflight-bg: rgba(6, 182, 212, 0.2);
        --hb-glow-a: rgba(247, 165, 13, 0.2);
        --hb-glow-b: rgba(56, 189, 248, 0.14);
        --hb-glow-c: rgba(232, 93, 4, 0.12);
        --hb-floor: rgba(0, 0, 0, 0.5);
        --hb-banner-bg: rgba(30, 41, 59, 0.985);
        --hb-key: #475063;
        --hb-keys-bg: #262d3b;
    }
}

[data-theme="dark"] .fk-board {
    --hb-accent: #2dd4bf;
    --hb-accent-soft: rgba(45, 212, 191, 0.16);
    --hb-on-accent: #042f2e;
    --hb-touch: rgba(203, 213, 225, 0.3);
    --hb-pending-fg: #cbd5e1;
    --hb-pending-bg: rgba(148, 163, 184, 0.18);
    --hb-approved-fg: #93c5fd;
    --hb-approved-bg: rgba(59, 130, 246, 0.22);
    --hb-progress-fg: #fdba74;
    --hb-progress-bg: rgba(249, 115, 22, 0.2);
    --hb-testflight-fg: #67e8f9;
    --hb-testflight-bg: rgba(6, 182, 212, 0.2);
    --hb-glow-a: rgba(247, 165, 13, 0.2);
    --hb-glow-b: rgba(56, 189, 248, 0.14);
    --hb-glow-c: rgba(232, 93, 4, 0.12);
    --hb-floor: rgba(0, 0, 0, 0.5);
    --hb-banner-bg: rgba(30, 41, 59, 0.985);
    --hb-key: #475063;
    --hb-keys-bg: #262d3b;
}

.fk-board__glow {
    position: absolute;
    inset: -14% -12% -10%;
    z-index: 0;
    background:
        radial-gradient(42% 50% at 52% 50%, var(--hb-glow-a), transparent 70%),
        radial-gradient(32% 44% at 20% 42%, var(--hb-glow-b), transparent 70%),
        radial-gradient(30% 42% at 84% 60%, var(--hb-glow-c), transparent 70%);
    pointer-events: none;
}

/* The stage reserves the cluster's full height up front (no layout shift)
   and is the container every device position is measured against. */
.fk-board__stage {
    position: relative;
    z-index: 1;
    container-type: inline-size;
    aspect-ratio: 100 / 51;
    /* The cluster leans back a little and stands up as the page scrolls. */
    transform: perspective(2600px) rotateX(max(0deg, calc(8deg - var(--hb-scroll) * 0.02deg)));
    transform-origin: 50% 100%;
}

/* Contact shadow under the whole cluster. */
.fk-board__stage::after {
    content: "";
    position: absolute;
    inset-inline: 6%;
    bottom: -3%;
    height: 9%;
    z-index: -1;
    border-radius: 50%;
    background: radial-gradient(closest-side, var(--hb-floor), transparent);
}

.fk-board__device {
    position: absolute;
    --hb-depth: 0;
    translate: 0 calc(var(--hb-scroll) * var(--hb-depth) * -1px);
}

/* Physical positions: the cluster is a picture, it does not mirror in RTL. */
.fk-board__device--browser {
    left: 3%;
    top: 0;
    width: 45cqi;
    z-index: 1;
    --hb-depth: 0.04;
}

.fk-board__device--mac {
    left: 27cqi;
    top: 5cqi;
    width: 60cqi;
    z-index: 2;
    --hb-depth: 0.08;
}

.fk-board__device--iphone {
    left: 12.5cqi;
    top: 14cqi;
    width: 16.5cqi;
    z-index: 3;
    --hb-depth: 0.16;
}

.fk-board__device--android {
    left: 81.5cqi;
    top: 16.5cqi;
    width: 15.6cqi;
    z-index: 3;
    --hb-depth: 0.13;
}

.fk-board__device .fk-device__body {
    box-shadow:
        0 0 0 0.6cqi var(--fk-device-frame),
        0 0 0 0.9cqi var(--fk-device-frame-edge),
        0 2cqi 4cqi -1cqi rgba(15, 23, 42, 0.18),
        0 8cqi 16cqi -4cqi rgba(15, 23, 42, 0.28);
}

.fk-board__device--android .fk-device__body {
    box-shadow:
        0 0 0 0.5cqi var(--fk-device-frame),
        0 0 0 0.8cqi var(--fk-device-frame-edge),
        0 2cqi 4cqi -1cqi rgba(15, 23, 42, 0.18),
        0 8cqi 16cqi -4cqi rgba(15, 23, 42, 0.28);
}

.fk-board__device--browser .fk-device__body {
    box-shadow:
        0 0 0 1px var(--fk-hairline),
        0 1cqi 2cqi -0.5cqi rgba(15, 23, 42, 0.12),
        0 4cqi 9cqi -2cqi rgba(15, 23, 42, 0.22);
}

.fk-board__device--mac .fk-device__body {
    box-shadow:
        0 0 0 0.35cqi var(--fk-device-frame-edge),
        0 4cqi 9cqi -2cqi rgba(15, 23, 42, 0.26);
}

/* Entrance: CSS only, so it runs before any script and never flashes. */
@media (prefers-reduced-motion: no-preference) {
    .fk-board__device {
        animation: hb-rise 1.2s var(--fk-ease-out) both;
    }

    .fk-board__device--browser { animation-delay: 0.05s; }
    .fk-board__device--mac { animation-delay: 0.12s; }
    .fk-board__device--iphone { animation-delay: 0.24s; }
    .fk-board__device--android { animation-delay: 0.32s; }

    .fk-board__glow {
        animation: hb-fade 1.6s var(--fk-ease-out) both;
    }
}

@keyframes hb-rise {
    from {
        opacity: 0;
        transform: translate3d(0, 9cqi, 0) scale(0.97);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

@keyframes hb-fade {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ==========================================================================
   In-screen apps. cqi inside a frame resolves against that frame's width.
   ========================================================================== */

.hb-app {
    position: relative;
    box-sizing: border-box;
    height: 100%;
    overflow: hidden;
    color: var(--fk-ink);
    background: var(--fk-surface-alt);
    font-family: -apple-system, BlinkMacSystemFont, "Inter", ui-sans-serif, system-ui, sans-serif;
    line-height: 1.2;
    text-align: start;
    -webkit-font-smoothing: antialiased;
}

.hb-app * {
    box-sizing: border-box;
}

.hb-app p {
    margin: 0;
}

/* Lists hold fixed-height rows in slots; a slot is --hb-pitch tall and a row
   moves between slots with a transform only. The first child is always the
   new request; the others are numbered 0, 1, 2. */
.hb-list {
    --hb-shift: 0;
    position: relative;
    height: calc(var(--hb-pitch) * 4);
}

.hb-list > * {
    --hb-i: 0;
    --hb-slot: calc(var(--hb-i) + var(--hb-shift));
    position: absolute;
    inset-inline: 0;
    top: 0;
    height: calc(var(--hb-pitch) - var(--hb-gap, 0cqi));
    transform: translate3d(0, calc(var(--hb-slot) * var(--hb-pitch)), 0);
    transition:
        transform 0.75s var(--fk-ease-out),
        opacity 0.5s var(--fk-ease-out);
}

.hb-list > :nth-child(3) { --hb-i: 1; }
.hb-list > :nth-child(4) { --hb-i: 2; }

.hb-list > :first-child {
    --hb-slot: 0;
    opacity: 0;
    transform: translate3d(0, 0, 0) scale(0.92);
}

.fk-board.is-local .hb-list--ios,
.fk-board.is-synced .hb-list--web,
.fk-board.is-synced .hb-list--droid {
    --hb-shift: 1;
}

.fk-board.is-local .hb-list--ios > :first-child,
.fk-board.is-synced .hb-list--web > :first-child,
.fk-board.is-synced .hb-list--droid > :first-child,
.fk-board.is-synced .hb-list--mac > :first-child {
    opacity: 1;
    transform: translate3d(0, calc(var(--hb-slot) * var(--hb-pitch)), 0);
}

/* The Mac table is sorted by MRR: the new row enters at the bottom and
   climbs one slot each time its sample MRR passes the row above it.
   Rows at or below its rank step down one slot. */
.fk-board { --hb-rank: 3; }
.fk-board[data-rank="0"] { --hb-rank: 0; }
.fk-board[data-rank="1"] { --hb-rank: 1; }
.fk-board[data-rank="2"] { --hb-rank: 2; }

.hb-list--mac {
    --hb-cut: 3;
}

.fk-board.is-synced .hb-list--mac {
    --hb-cut: var(--hb-rank);
}

.hb-list--mac > * {
    --hb-slot: calc(var(--hb-i) + clamp(0, var(--hb-i) - var(--hb-cut) + 1, 1));
    transition:
        transform 0.7s var(--fk-ease-in-out),
        opacity 0.5s var(--fk-ease-out);
}

.hb-list--mac > :first-child {
    --hb-slot: var(--hb-rank);
    transform: translate3d(0, calc(var(--hb-slot) * var(--hb-pitch)), 0);
}

/* A short highlight when the request lands. */
.hb-list > :first-child::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    box-shadow: 0 0 0 0.6cqi var(--hb-accent), 0 0 3cqi var(--hb-accent-soft);
    opacity: 0;
    transition: opacity 1.2s ease-out;
    pointer-events: none;
}

.fk-board.is-fresh .hb-list > :first-child::after {
    opacity: 0.55;
    transition-duration: 0.3s;
}

/* ---------- Status chips ---------- */

.hb-chip {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    border-radius: var(--fk-radius-pill);
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
}

.hb-chip::before {
    content: "";
    width: 0.55em;
    height: 0.55em;
    margin-inline-end: 0.4em;
    border-radius: 50%;
    background: currentColor;
}

.hb-chip--pending { color: var(--hb-pending-fg); background: var(--hb-pending-bg); }
.hb-chip--approved { color: var(--hb-approved-fg); background: var(--hb-approved-bg); }
.hb-chip--progress { color: var(--hb-progress-fg); background: var(--hb-progress-bg); }
.hb-chip--testflight { color: var(--hb-testflight-fg); background: var(--hb-testflight-bg); }

/* The live chip is four chips stacked in one grid cell; the board's
   data-status picks which one is opaque. A colour change is a cross-fade. */
.hb-chips {
    display: inline-grid;
    width: fit-content;
}

.hb-chips > .hb-chip {
    grid-area: 1 / 1;
    opacity: 0;
    transform: scale(0.86);
    transition:
        opacity 0.45s var(--fk-ease-out),
        transform 0.55s var(--fk-ease-spring);
}

.fk-board[data-status="pending"] .hb-chip--pending,
.fk-board[data-status="approved"] .hb-chip--approved,
.fk-board[data-status="progress"] .hb-chip--progress,
.fk-board[data-status="testflight"] .hb-chip--testflight {
    opacity: 1;
    transform: none;
}

/* ---------- Vote buttons ---------- */

.hb-vote {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    line-height: 1;
}

.hb-vote__caret {
    width: 0;
    height: 0;
    border-inline: 0.55em solid transparent;
    border-bottom: 0.6em solid currentColor;
    margin-bottom: 0.3em;
}

.hb-vote.is-voted {
    color: var(--hb-accent);
}

.hb-vote > span:last-child {
    display: block;
}

/* Logo mark for Trailmate: a peak on the accent tile. */
.hb-logo {
    display: inline-block;
    flex: 0 0 auto;
    width: 1.3em;
    height: 1.3em;
    border-radius: 28%;
    background:
        linear-gradient(to top right, transparent 50%, var(--hb-on-accent) 50.5%) 18% 78% / 40% 46% no-repeat,
        linear-gradient(to top left, transparent 50%, var(--hb-on-accent) 50.5%) 76% 78% / 40% 46% no-repeat,
        var(--hb-accent);
}

/* Touch indicators and pointers (positioned per screen, animated by JS). */
.hb-touch {
    position: absolute;
    z-index: 6;
    top: 50%;
    left: 50%;
    width: 12cqi;
    height: 12cqi;
    margin: -6cqi 0 0 -6cqi;
    border-radius: 50%;
    background: var(--hb-touch);
    box-shadow: 0 0 0 0.5cqi rgba(255, 255, 255, 0.5);
    opacity: 0;
    pointer-events: none;
}

.hb-ios__add,
.hb-sheet__submit,
.hb-vote {
    position: relative;
}

.hb-cursor {
    position: absolute;
    z-index: 6;
    top: 0;
    left: 0;
    width: 2.4cqi;
    opacity: 0;
    pointer-events: none;
    transition:
        transform 0.9s var(--fk-ease-in-out),
        opacity 0.4s ease;
}

.hb-cursor svg {
    display: block;
    width: 100%;
    fill: #0b1220;
    stroke: #ffffff;
    stroke-width: 1.4;
    filter: drop-shadow(0 0.15cqi 0.3cqi rgba(0, 0, 0, 0.35));
}

/* ---------- Status bar (phones) ---------- */

.hb-status {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 13cqi;
    padding: 1.6cqi 8cqi 0;
    font-size: 4.3cqi;
    font-weight: 600;
    letter-spacing: -0.01em;
}

/* Signal bars, wifi-ish dot and battery in one masked strip. */
.hb-status__icons {
    width: 17cqi;
    height: 3.6cqi;
    background: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 68 14'%3E%3Crect x='0' y='9' width='3' height='5' rx='1'/%3E%3Crect x='5' y='6' width='3' height='8' rx='1'/%3E%3Crect x='10' y='3' width='3' height='11' rx='1'/%3E%3Crect x='15' y='0' width='3' height='14' rx='1'/%3E%3Cpath d='M31 3a11 11 0 0 1 9 4l-2 2a8 8 0 0 0-14 0l-2-2a11 11 0 0 1 9-4zm0 5a5 5 0 0 1 4 2l-4 4-4-4a5 5 0 0 1 4-2z'/%3E%3Crect x='44' y='1' width='21' height='12' rx='3.5' fill='none' stroke='black' stroke-width='1.6'/%3E%3Crect x='46.5' y='3.5' width='14' height='7' rx='1.6'/%3E%3Crect x='66' y='5' width='2' height='4' rx='1'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 68 14'%3E%3Crect x='0' y='9' width='3' height='5' rx='1'/%3E%3Crect x='5' y='6' width='3' height='8' rx='1'/%3E%3Crect x='10' y='3' width='3' height='11' rx='1'/%3E%3Crect x='15' y='0' width='3' height='14' rx='1'/%3E%3Cpath d='M31 3a11 11 0 0 1 9 4l-2 2a8 8 0 0 0-14 0l-2-2a11 11 0 0 1 9-4zm0 5a5 5 0 0 1 4 2l-4 4-4-4a5 5 0 0 1 4-2z'/%3E%3Crect x='44' y='1' width='21' height='12' rx='3.5' fill='none' stroke='black' stroke-width='1.6'/%3E%3Crect x='46.5' y='3.5' width='14' height='7' rx='1.6'/%3E%3Crect x='66' y='5' width='2' height='4' rx='1'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* ---------- iPhone: Trailmate with the FeedbackKit list ---------- */

.hb-ios {
    --hb-pitch: 27cqi;
    --hb-gap: 2.6cqi;
    display: flex;
    flex-direction: column;
    padding-bottom: 6cqi;
}

.hb-ios .hb-status {
    padding-inline: 9cqi 7cqi;
}

.hb-ios__nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 2cqi 5cqi 0;
}

.hb-ios__app {
    color: var(--hb-accent);
    font-size: 4.2cqi;
    font-weight: 600;
}

.hb-ios__add {
    position: relative;
    width: 8.4cqi;
    height: 8.4cqi;
    border-radius: 50%;
    background: var(--hb-accent-soft);
}

.hb-ios__add::before,
.hb-ios__add::after {
    content: "";
    position: absolute;
    inset: 50% auto auto 50%;
    width: 3.8cqi;
    height: 0.8cqi;
    margin: -0.4cqi 0 0 -1.9cqi;
    border-radius: 1cqi;
    background: var(--hb-accent);
}

.hb-ios__add::after {
    transform: rotate(90deg);
}

.hb-ios__title {
    padding: 2.4cqi 5cqi 4cqi;
    font-size: 8.6cqi;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.hb-list--ios {
    margin-inline: 4.4cqi;
}

.hb-card {
    display: flex;
    align-items: center;
    gap: 3.2cqi;
    padding: 3cqi 3.6cqi;
    border-radius: 4.4cqi;
    background: var(--fk-surface-raised);
    box-shadow: 0 0.3cqi 1cqi rgba(15, 23, 42, 0.06);
}

.hb-vote--ios {
    flex: 0 0 auto;
    width: 10.5cqi;
    height: 14cqi;
    border-radius: 3cqi;
    background: var(--fk-surface-alt);
    color: var(--fk-ink-soft);
    font-size: 3.9cqi;
}

.hb-vote--ios.is-voted {
    background: var(--hb-accent-soft);
}

.hb-card__body {
    display: flex;
    flex-direction: column;
    gap: 1.2cqi;
    min-width: 0;
}

.hb-card__title,
.hb-tile__title,
.hb-row__title,
.hb-mrow__title {
    overflow: hidden;
    font-weight: 600;
    letter-spacing: -0.01em;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hb-card__title {
    font-size: 4.3cqi;
}

.hb-card__desc,
.hb-tile__desc,
.hb-row__desc {
    overflow: hidden;
    color: var(--fk-ink-soft);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hb-card__desc {
    font-size: 3.4cqi;
}

.hb-ios .hb-chip {
    padding: 1cqi 2.2cqi;
    font-size: 2.9cqi;
}

/* Submit sheet */
.hb-ios::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 3;
    background: rgba(0, 0, 0, 0.32);
    opacity: 0;
    transition: opacity 0.45s ease;
    pointer-events: none;
}

.fk-board.is-sheet .hb-ios::after {
    opacity: 1;
}

.hb-sheet {
    position: absolute;
    inset: 12cqi 0 0;
    z-index: 4;
    display: flex;
    flex-direction: column;
    gap: 3cqi;
    padding: 4cqi 4.4cqi 0;
    border-radius: 6cqi 6cqi 0 0;
    background: var(--fk-surface-alt);
    transform: translate3d(0, 104%, 0);
    transition: transform 0.6s var(--fk-ease-out);
}

.fk-board.is-sheet .hb-sheet {
    transform: none;
}

.hb-sheet__bar {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    margin-bottom: 1.4cqi;
    font-size: 3.9cqi;
}

.hb-sheet__bar > span:first-child {
    color: var(--hb-accent);
}

.hb-sheet__bar strong {
    font-size: 4.2cqi;
    font-weight: 600;
}

.hb-sheet__submit {
    justify-self: end;
    padding: 1.4cqi 3.2cqi;
    border-radius: var(--fk-radius-pill);
    background: var(--hb-accent);
    color: var(--hb-on-accent);
    font-weight: 600;
}

.hb-field {
    display: flex;
    flex-direction: column;
    gap: 1.4cqi;
    padding: 3cqi 3.6cqi;
    border-radius: 3.6cqi;
    background: var(--fk-surface-raised);
}

.hb-field__label {
    color: var(--fk-ink-soft);
    font-size: 3cqi;
    font-weight: 500;
}

.hb-field__value {
    display: flex;
    align-items: center;
    min-height: 5cqi;
    font-size: 4.2cqi;
    font-weight: 500;
    white-space: nowrap;
}

.hb-field--area .hb-field__value {
    align-items: flex-start;
    min-height: 11cqi;
    font-size: 3.7cqi;
    white-space: normal;
}

.hb-caret {
    flex: 0 0 auto;
    width: 0.5cqi;
    height: 5cqi;
    margin-inline-start: 0.3cqi;
    border-radius: 0.3cqi;
    background: var(--hb-accent);
    opacity: 0;
}

.fk-board.is-typing-title [data-hb-caret="title"],
.fk-board.is-typing-desc [data-hb-caret="desc"] {
    opacity: 1;
    animation: hb-blink 1s steps(1) infinite;
}

@keyframes hb-blink {
    50% { opacity: 0; }
}

.hb-field--area [data-hb-type] {
    display: inline;
}

.hb-keys {
    display: grid;
    grid-template-columns: repeat(20, 1fr);
    gap: 2.4cqi 1.4cqi;
    margin: auto -4.4cqi 0;
    padding: 2.6cqi 1.4cqi 9cqi;
    background: var(--hb-keys-bg);
}

.hb-keys > span {
    grid-column: span 2;
    height: 9.6cqi;
    border-radius: 1.4cqi;
    background: var(--hb-key);
    box-shadow: 0 0.35cqi 0 rgba(0, 0, 0, 0.18);
}

.hb-keys > span:nth-child(11) { grid-column: 2 / span 2; }
.hb-keys > span:nth-child(20) { grid-column: 4 / span 2; }

.hb-keys > .hb-keys__space {
    grid-column: 5 / span 12;
}

/* ---------- Android: Trailmate, Material style ---------- */

.hb-droid {
    --hb-pitch: 26.4cqi;
    --hb-gap: 2.4cqi;
    display: flex;
    flex-direction: column;
    background: var(--fk-surface);
    font-family: "Roboto", "Inter", ui-sans-serif, system-ui, sans-serif;
}

.hb-status--droid {
    height: 11cqi;
    padding: 1cqi 7cqi 0;
    font-size: 4cqi;
    font-weight: 500;
}

.hb-status--droid .hb-status__icons {
    width: 15cqi;
}

.hb-droid__bar {
    display: flex;
    flex-direction: column;
    gap: 1cqi;
    padding: 5cqi 6cqi 5cqi;
}

.hb-droid__title {
    font-size: 7.4cqi;
    font-weight: 500;
    letter-spacing: -0.01em;
}

.hb-droid__sub {
    color: var(--fk-ink-soft);
    font-size: 3.6cqi;
}

.hb-list--droid {
    margin-inline: 4cqi;
}

.hb-tile {
    display: flex;
    align-items: center;
    gap: 3cqi;
    padding: 3cqi 3cqi 3cqi 4.2cqi;
    border-radius: 5cqi;
    background: var(--fk-surface-alt);
}

.hb-tile__body {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    gap: 1.3cqi;
    min-width: 0;
}

.hb-tile__title {
    font-size: 4.3cqi;
    font-weight: 500;
}

.hb-tile__desc {
    font-size: 3.3cqi;
}

.hb-droid .hb-chip {
    padding: 1cqi 2.2cqi;
    border-radius: 1.6cqi;
    font-size: 2.9cqi;
}

.hb-vote--droid {
    flex: 0 0 auto;
    width: 11cqi;
    height: 15cqi;
    border-radius: var(--fk-radius-pill);
    background: var(--fk-surface);
    color: var(--fk-ink-soft);
    font-size: 3.7cqi;
}

.hb-vote--droid.is-voted {
    background: var(--hb-accent-soft);
}

.hb-droid__fab {
    position: absolute;
    right: 6cqi;
    bottom: 12cqi;
    width: 15cqi;
    height: 15cqi;
    border-radius: 4.6cqi;
    background: var(--hb-accent);
    box-shadow: 0 1cqi 3cqi rgba(15, 23, 42, 0.25);
}

.hb-droid__fab::before,
.hb-droid__fab::after {
    content: "";
    position: absolute;
    inset: 50% auto auto 50%;
    width: 5.4cqi;
    height: 1cqi;
    margin: -0.5cqi 0 0 -2.7cqi;
    border-radius: 1cqi;
    background: var(--hb-on-accent);
}

.hb-droid__fab::after {
    transform: rotate(90deg);
}

.hb-droid__gesture {
    position: absolute;
    left: 50%;
    bottom: 3cqi;
    width: 30cqi;
    height: 1.2cqi;
    margin-left: -15cqi;
    border-radius: 1cqi;
    background: var(--fk-ink);
    opacity: 0.55;
}

/* ---------- Browser: the web widget on Trailmate's site ---------- */

.hb-web {
    --hb-pitch: 9.4cqi;
    --hb-gap: 1.2cqi;
    background: var(--fk-surface);
    font-family: "Inter", ui-sans-serif, system-ui, sans-serif;
}

.hb-web__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 6.6cqi;
    padding-inline: 4cqi;
    border-bottom: 1px solid var(--fk-hairline);
}

.hb-web__brand {
    display: inline-flex;
    align-items: center;
    gap: 1cqi;
    font-size: 2.2cqi;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.hb-web__nav {
    display: inline-flex;
    gap: 2.6cqi;
    color: var(--fk-ink-soft);
    font-size: 1.7cqi;
    font-weight: 500;
}

.hb-web__nav-on {
    color: var(--fk-ink);
    font-weight: 600;
}

.hb-web__hero {
    padding: 3.6cqi 6cqi 2.6cqi;
}

.hb-web__title {
    font-size: 3.6cqi;
    font-weight: 700;
    letter-spacing: -0.03em;
}

.hb-web__sub {
    margin-top: 0.8cqi !important;
    color: var(--fk-ink-soft);
    font-size: 1.8cqi;
}

.hb-list--web {
    margin-inline: 6cqi;
}

.hb-row {
    display: flex;
    align-items: center;
    gap: 2.4cqi;
    padding: 0 2.4cqi 0 1.6cqi;
    border: 1px solid var(--fk-hairline);
    border-radius: 1.6cqi;
    background: var(--fk-surface);
}

.hb-vote--web {
    flex: 0 0 auto;
    width: 5.6cqi;
    height: 6cqi;
    border: 1px solid var(--fk-hairline);
    border-radius: 1.2cqi;
    color: var(--fk-ink-soft);
    font-size: 1.75cqi;
}

.hb-vote--web.is-voted {
    border-color: transparent;
    background: var(--hb-accent-soft);
}

.hb-row__body {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    gap: 0.7cqi;
    min-width: 0;
}

.hb-row__title {
    font-size: 2cqi;
}

.hb-row__desc {
    font-size: 1.6cqi;
}

.hb-web .hb-chip {
    flex: 0 0 auto;
    padding: 0.7cqi 1.4cqi;
    font-size: 1.45cqi;
}

.hb-web .hb-chips {
    flex: 0 0 auto;
    justify-items: end;
}

/* Pointer rests low on the page, then reaches the new row's vote button. */
.hb-cursor--web {
    transform: translate3d(40cqi, 52cqi, 0);
}

.fk-board.is-web-cursor .hb-cursor--web {
    opacity: 1;
}

.fk-board.is-web-aim .hb-cursor--web {
    transform: translate3d(10.6cqi, 24.4cqi, 0);
}

/* ---------- Mac: the FeedbackKit admin app ---------- */

.hb-mac {
    --hb-pitch: 5.6cqi;
    display: flex;
    flex-direction: column;
    background: var(--fk-surface);
    font-size: 1.5cqi;
}

.hb-mac__menubar {
    display: flex;
    align-items: center;
    gap: 2cqi;
    height: 2.8cqi;
    padding-inline: 2.2cqi;
    background: var(--fk-glass-bg);
    border-bottom: 1px solid var(--fk-hairline);
    font-size: 1.3cqi;
    font-weight: 500;
}

.hb-mac__menu-app {
    font-weight: 700;
}

.hb-mac__clock {
    margin-inline-start: auto;
}

.hb-mac__window {
    display: grid;
    flex: 1 1 auto;
    grid-template-columns: 22% 1fr;
    min-height: 0;
}

.hb-mac__side {
    display: flex;
    flex-direction: column;
    gap: 0.5cqi;
    padding: 1.8cqi 1.4cqi;
    background: var(--fk-surface-alt);
    border-inline-end: 1px solid var(--fk-hairline);
}

.hb-mac__lights {
    width: 1.1cqi;
    height: 1.1cqi;
    margin: 0 0 1.8cqi 0.4cqi;
    border-radius: 50%;
    background: #ff5f57;
    box-shadow: 1.7cqi 0 0 #febc2e, 3.4cqi 0 0 #28c840;
}

.hb-mac__side-head {
    margin-top: 0.8cqi;
    padding-inline: 0.8cqi;
    color: var(--fk-ink-soft);
    font-size: 1.15cqi;
    font-weight: 600;
    opacity: 0.8;
}

.hb-mac__side-item {
    display: flex;
    align-items: center;
    gap: 0.8cqi;
    padding: 0.7cqi 0.8cqi;
    border-radius: 0.8cqi;
    font-size: 1.4cqi;
    font-weight: 500;
}

.hb-mac__side-item--on {
    background: color-mix(in srgb, var(--fk-primary) 18%, transparent);
    font-weight: 600;
}

.hb-mac__main {
    display: flex;
    flex-direction: column;
    min-width: 0;
    padding: 2.2cqi 2.6cqi 1.4cqi;
}

.hb-mac__toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2cqi;
}

.hb-mac__heading {
    display: flex;
    align-items: baseline;
    gap: 1.2cqi;
}

.hb-mac__heading strong {
    font-size: 2.3cqi;
    font-weight: 700;
    letter-spacing: -0.02em;
}

/* The sample-data badge sits right after the heading, left of the
 * notification banner (.hb-banner, top right), so the MRR figures stay
 * visibly labelled in every frame of the loop and in the static state. */
.hb-mac__heading span:not(.hb-mac__sample) {
    color: var(--fk-ink-soft);
    font-size: 1.3cqi;
}

.hb-mac__sample {
    align-self: center;
    padding: 0.5cqi 1.1cqi;
    border: 1px dashed color-mix(in srgb, var(--fk-ink-soft) 55%, transparent);
    border-radius: var(--fk-radius-pill);
    color: var(--fk-ink-soft);
    font-size: 1.15cqi;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.hb-mac__kpis {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.2cqi;
    margin-bottom: 2cqi;
}

.hb-mac__kpi {
    display: flex;
    flex-direction: column;
    gap: 0.6cqi;
    padding: 1.2cqi 1.4cqi;
    border-radius: 1.2cqi;
    background: var(--fk-surface-alt);
    color: var(--fk-ink-soft);
    font-size: 1.15cqi;
    font-weight: 500;
}

.hb-mac__kpi strong {
    color: var(--fk-ink);
    font-size: 2.2cqi;
    font-weight: 700;
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
}

.hb-mac__thead,
.hb-mrow {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 7cqi 7.5cqi 10.5cqi;
    align-items: center;
    column-gap: 1cqi;
    padding-inline: 1.2cqi;
}

.hb-mac__thead {
    padding-block: 0.8cqi;
    color: var(--fk-ink-soft);
    font-size: 1.15cqi;
    font-weight: 600;
    border-bottom: 1px solid var(--fk-hairline);
}

.hb-list--mac {
    margin-top: 0.4cqi;
}

.hb-mrow {
    border-bottom: 1px solid var(--fk-hairline);
    background: var(--fk-surface);
    border-radius: 0.6cqi;
}

.hb-mrow__title {
    font-size: 1.5cqi;
}

.hb-mrow__num {
    font-size: 1.45cqi;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.hb-mac .hb-chip {
    padding: 0.5cqi 1cqi;
    font-size: 1.2cqi;
}

.hb-mac__foot {
    margin-top: auto !important;
    color: var(--fk-ink-soft);
    font-size: 1.1cqi;
    opacity: 0.85;
}

/* Notification banner, top right under the menu bar. */
.hb-banner {
    position: absolute;
    top: 4cqi;
    right: 2cqi;
    z-index: 5;
    display: flex;
    align-items: center;
    gap: 1.3cqi;
    width: 33cqi;
    padding: 1.3cqi 1.6cqi;
    border: 1px solid var(--fk-hairline);
    border-radius: 2cqi;
    background: var(--hb-banner-bg);
    box-shadow: 0 1.2cqi 3.6cqi -0.6cqi rgba(15, 23, 42, 0.32);
    opacity: 0;
    transform: translate3d(0, -130%, 0) scale(0.96);
    transition:
        transform 0.7s var(--fk-ease-spring),
        opacity 0.4s ease;
}

.fk-board.is-banner .hb-banner {
    opacity: 1;
    transform: none;
}

.hb-banner__icon {
    flex: 0 0 auto;
    width: 4.2cqi;
    height: 4.2cqi;
    border-radius: 1cqi;
}

.hb-banner__copy {
    display: flex;
    flex-direction: column;
    gap: 0.5cqi;
    min-width: 0;
}

.hb-banner__app {
    display: flex;
    justify-content: space-between;
    font-size: 1.4cqi;
    font-weight: 700;
}

.hb-banner__app span {
    color: var(--fk-ink-soft);
    font-weight: 500;
}

.hb-banner__text {
    font-size: 1.4cqi;
    white-space: nowrap;
}

/* Admin pointer: rests bottom right, then works the new row's status. */
.hb-cursor--mac {
    width: 1.6cqi;
    transform: translate3d(80cqi, 50cqi, 0);
}

.fk-board.is-mac-cursor .hb-cursor--mac {
    opacity: 1;
}

.fk-board.is-mac-aim .hb-cursor--mac {
    transform: translate3d(72.6cqi, 24.8cqi, 0);
}

/* JS jumps to a state without animating it (first frame, loop reset). */
.fk-board.is-instant *,
.fk-board.is-instant *::before,
.fk-board.is-instant *::after {
    transition: none !important;
}

/* ---------- Narrow screens: a tighter cluster of three ---------- */

@media (max-width: 640px) {
    .fk-hero__actions {
        flex-direction: column;
        gap: 0.25rem;
    }

    .fk-board {
        margin-top: 2.25rem;
    }

    .fk-board__stage {
        aspect-ratio: 100 / 108;
    }

    .fk-board__device--browser {
        display: none;
    }

    .fk-board__device--mac {
        left: 4cqi;
        top: 0;
        width: 92cqi;
    }

    .fk-board__device--iphone {
        left: 4cqi;
        top: 24cqi;
        width: 38cqi;
    }

    .fk-board__device--android {
        left: 59cqi;
        top: 29cqi;
        width: 36.5cqi;
    }

    .fk-hero__stat {
        padding-inline: 0.4rem;
    }

    .fk-hero__stat-label {
        font-size: 0.75rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .fk-board *,
    .fk-board *::before,
    .fk-board *::after {
        transition: none !important;
        animation: none !important;
    }

    .fk-board__device {
        translate: none;
    }

    .fk-board__stage {
        transform: perspective(2600px) rotateX(8deg);
    }

    .fk-hero__cta,
    .fk-hero__docs svg {
        transition: none;
    }
}
