/* =========================================================================
   home.css — the public homepage only (index.php, body.hm).

   The dashboard design system is flat on purpose. This one marketing page is
   allowed a little more: a soft accent glow, a dotted backdrop, a mascot and
   motion. Rules that keep it light on old and slow devices:
     - every animation moves only transform or opacity
     - no backdrop-filter, no filter: blur(), no canvas, no WebGL, no images
     - looping animations pause while their section is off screen
       ([data-hm-anim].is-paused, set by assets/js/home.js)
     - prefers-reduced-motion switches all of it off (app.css does the
       global part, home.js skips the demo loop and shows its end state)
   Colors come from the accent tokens, so a picked accent theme recolors
   the page, mascot included.
   ========================================================================= */

.hm {
    --hm-max: 1120px;
    --hm-line: rgba(255, 255, 255, 0.08);
    --hm-line-strong: rgba(255, 255, 255, 0.14);
    --hm-panel: #0e0e11;
    --hm-panel-2: #141418;
    --hm-ease: cubic-bezier(0.22, 1, 0.36, 1);
    --hm-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
    /* Mascot shades. Plain values first: a browser without color-mix() keeps these. */
    --hm-m-light: #86efac;
    --hm-m-mid: var(--accent-hover);
    --hm-m-deep: #14532d;
    --hm-m-leg: #166534;
    --hm-glow: rgba(34, 197, 94, 0.16);
}

@supports (color: color-mix(in srgb, red, blue)) {
    .hm {
        --hm-m-light: color-mix(in srgb, var(--accent-hover) 55%, #ffffff);
        --hm-m-deep: color-mix(in srgb, var(--accent-active) 55%, #000000);
        --hm-m-leg: color-mix(in srgb, var(--accent-active) 78%, #000000);
        --hm-glow: color-mix(in srgb, var(--accent-hover) 18%, transparent);
    }
}

.hm-shell {
    overflow: hidden;
    overflow: clip;
}

/* Dotted backdrop that fades out below the hero, plus one accent glow. Painted once, never animated. */
.hm-backdrop {
    position: absolute;
    inset: 0 0 auto 0;
    height: 900px;
    pointer-events: none;
    background:
        radial-gradient(ellipse 60% 46% at 50% 0%, var(--hm-glow), transparent 70%),
        radial-gradient(circle at 1px 1px, rgba(255, 255, 255, 0.09) 1px, transparent 0) 0 0 / 26px 26px;
    -webkit-mask-image: radial-gradient(ellipse 78% 70% at 50% 0%, #000 35%, transparent 78%);
    mask-image: radial-gradient(ellipse 78% 70% at 50% 0%, #000 35%, transparent 78%);
}

.hm .container {
    position: relative;
}

.hm .public-nav {
    position: relative;
    z-index: 3;
}

/* ---- Buttons: a touch larger than the dashboard's ---- */
.hm-btn {
    padding: 12px 20px;
    font-size: var(--text-base);
    border-radius: 12px;
    transition: transform 160ms var(--hm-ease), background-color 160ms, border-color 160ms;
}

.hm-btn:hover {
    transform: translateY(-1px);
}

.hm-btn:active {
    transform: translateY(0) scale(0.98);
}

/* =========================================================================
   Hero
   ========================================================================= */
.hm-hero {
    position: relative;
    text-align: center;
    max-width: 880px;
    margin: 0 auto;
    padding: 210px 0 var(--space-10);
}

.hm-hero__eyebrow,
.hm-hero__title,
.hm-hero__sub,
.hm-hero__actions,
.hm-hero__facts {
    animation: hm-rise 700ms var(--hm-ease) both;
}

.hm-hero__title { animation-delay: 60ms; }
.hm-hero__sub { animation-delay: 120ms; }
.hm-hero .hm-hero__actions { animation-delay: 180ms; }
.hm-hero__facts { animation-delay: 240ms; }

@keyframes hm-rise {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: none; }
}

.hm-hero__title {
    font-size: clamp(2.35rem, 6.4vw, 4.5rem);
    line-height: 1.02;
    font-weight: 700;
    letter-spacing: -0.045em;
    margin: 0 auto var(--space-5);
    max-width: 16ch;
    text-wrap: balance;
}

.hm-hero__sub {
    font-size: clamp(1rem, 1.6vw, 1.1875rem);
    line-height: 1.6;
    max-width: 600px;
    margin: 0 auto var(--space-8);
    color: var(--text-secondary);
    text-wrap: pretty;
}

.hm-hero__actions {
    display: flex;
    gap: var(--space-3);
    justify-content: center;
    flex-wrap: wrap;
}

.hm-hero__facts {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--space-2) var(--space-5);
    margin: var(--space-6) 0 0;
    padding: 0;
    font-size: var(--text-sm);
    color: var(--text-tertiary);
}

.hm-hero__facts li {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
}

.hm-hero__facts li::before {
    content: "";
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--accent-text);
}

/* =========================================================================
   Mascot
   The body, legs, face and expressions are in mascot.css (shared with the
   customer dashboard). Below: only where it hangs on this page.
   ========================================================================= */
.hm-mascot--hero {
    position: absolute;
    top: 0;
    left: 50%;
    width: 176px;
    margin-left: -88px;
    z-index: 2;
    animation: hm-drop 1100ms var(--hm-spring) both;
}

/* Only the ball itself takes clicks, so the nav above stays usable. */
.hm-mascot--hero .hm-mascot__bob {
    pointer-events: auto;
    cursor: pointer;
}

@keyframes hm-drop {
    from { transform: translateY(-115%); }
    to { transform: none; }
}

/* Hello: the front right leg waves once after the drop, then joins the others. */
.hm-mascot--hero .hm-mascot__leg--0.hm-mascot__leg--r {
    animation: hm-wave 1500ms ease-in-out 1300ms 1, hm-leg 1.9s ease-in-out 2800ms infinite alternate;
}

@media (hover: hover) and (pointer: fine) {
    .hm-mascot--hero .hm-mascot__bob {
        cursor: grab;
    }

    .hm-mascot--hero.is-pulled .hm-mascot__bob {
        cursor: grabbing;
    }
}

/* Off screen: stop every loop in the section. */
.is-paused,
.is-paused * {
    animation-play-state: paused !important;
}

/* =========================================================================
   Product demo
   ========================================================================= */
.hm-demo-wrap {
    max-width: 1000px;
    margin: var(--space-8) auto 0;
    animation: hm-rise 900ms var(--hm-ease) 320ms both;
}

.hm-demo {
    position: relative;
    border: 1px solid var(--hm-line-strong);
    border-radius: 22px;
    background: var(--hm-panel);
    box-shadow: 0 50px 120px -60px var(--hm-glow), 0 0 0 6px rgba(255, 255, 255, 0.02);
    overflow: hidden;
    contain: layout paint;
}

.hm-demo__bar {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: 12px 16px;
    border-bottom: 1px solid var(--hm-line);
    font-size: var(--text-xs);
    color: var(--text-tertiary);
}

.hm-demo__dots {
    display: inline-flex;
    gap: 6px;
}

.hm-demo__dots i {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.14);
}

.hm-demo__where {
    font-weight: 600;
    color: var(--text-secondary);
}

.hm-demo__tag {
    margin-left: auto;
    padding: 4px 10px;
    border: 1px solid var(--hm-line-strong);
    border-radius: 999px;
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.02em;
    color: var(--text-secondary);
    white-space: nowrap;
}

.hm-demo__body {
    padding: 18px;
    display: grid;
    gap: 14px;
    transition: opacity 380ms ease;
}

.hm-demo.is-fading .hm-demo__body {
    opacity: 0;
}

.hm-demo__tiles {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
}

.hm-tile {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 14px 16px;
    border: 1px solid var(--hm-line);
    border-radius: 14px;
    background: var(--hm-panel-2);
    min-width: 0;
}

.hm-tile__label {
    font-size: var(--text-xs);
    color: var(--text-tertiary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hm-tile__value {
    font-size: clamp(1.25rem, 3.4vw, 1.875rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.1;
    color: var(--text-primary);
    transform-origin: left center;
}

.hm-tile__value.is-tick {
    animation: hm-tick 320ms var(--hm-ease);
}

@keyframes hm-tick {
    0% { transform: translateY(5px); opacity: 0.4; }
    100% { transform: none; opacity: 1; }
}

.hm-demo__panes {
    display: grid;
    grid-template-columns: 1fr 1.15fr;
    gap: 14px;
}

.hm-pane {
    position: relative;
    border: 1px solid var(--hm-line);
    border-radius: 14px;
    background: var(--hm-panel-2);
    padding: 14px 16px 16px;
    min-width: 0;
    overflow: hidden;
}

.hm-pane__head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--space-3);
    margin-bottom: 12px;
}

.hm-pane__title {
    font-size: var(--text-base);
    font-weight: 600;
    color: var(--text-primary);
}

.hm-pane__meta,
.hm-pane__count {
    font-size: var(--text-xs);
    color: var(--text-tertiary);
    white-space: nowrap;
}

.hm-editor {
    list-style: none;
    counter-reset: hm-line;
    margin: 0;
    padding: 10px 12px;
    border: 1px solid var(--hm-line);
    border-radius: 10px;
    background: #0a0a0c;
    font-family: var(--font-mono);
    font-size: 12px;
    line-height: 26px;
    transition: opacity 300ms ease;
}

.hm-demo.is-sent .hm-editor {
    opacity: 0.4;
}

.hm-editor__line {
    counter-increment: hm-line;
    display: flex;
    gap: 12px;
    height: 26px;
    color: var(--text-secondary);
    transition: opacity 140ms linear, transform 220ms var(--hm-ease);
}

/* Hidden start states apply only once home.js runs the loop (html.hm-js). */
.hm-js .hm-editor__line:not(.is-on) {
    opacity: 0;
    transform: translateX(-8px);
}

.hm-editor__line::before {
    content: counter(hm-line);
    width: 1ch;
    color: var(--text-disabled);
}

.hm-editor__line span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.hm-pane__foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    margin-top: 12px;
}

.hm-fakebtn {
    display: inline-flex;
    align-items: center;
    padding: 8px 14px;
    border-radius: 10px;
    background: var(--btn-primary);
    color: var(--text-on-accent);
    font-size: var(--text-sm);
    font-weight: 600;
    white-space: nowrap;
    transition: transform 140ms var(--hm-ease), opacity 200ms;
}

.hm-fakebtn.is-press {
    transform: scale(0.93);
}

.hm-demo.is-sent .hm-fakebtn {
    opacity: 0.45;
}

.hm-progress {
    height: 4px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.07);
    overflow: hidden;
    margin-bottom: 10px;
}

.hm-progress i {
    display: block;
    height: 100%;
    width: 100%;
    background: var(--accent-text);
    transform-origin: left center;
    transition: transform 380ms var(--hm-ease);
}

/* Shown only while the loop is between "URLs typed" and "batch submitted". */
.hm-pane__empty {
    position: absolute;
    left: 0;
    right: 0;
    top: 52%;
    text-align: center;
    font-size: var(--text-xs);
    color: var(--text-disabled);
    opacity: 0;
    transition: opacity 200ms linear;
}

.hm-js .hm-demo:not(.is-sent) .hm-pane__empty {
    opacity: 1;
}

.hm-rows {
    list-style: none;
    margin: 0;
    padding: 0;
}

.hm-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    height: 32px;
    border-top: 1px solid var(--hm-line);
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-secondary);
    transition: opacity 180ms linear, transform 280ms var(--hm-ease);
}

.hm-js .hm-row:not(.is-on) {
    opacity: 0;
    transform: translateY(8px);
}

.hm-row:first-child {
    border-top: 0;
}

.hm-row__url {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.hm-status {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 2px 9px;
    border-radius: 6px;
    font-family: var(--font-body);
    font-size: 11px;
    font-weight: 600;
    background: var(--status-info-bg);
    color: var(--status-info);
}

.hm-status::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

.hm-status.is-processing::before {
    animation: hm-pulse 700ms ease-in-out infinite alternate;
}

@keyframes hm-pulse {
    from { opacity: 0.25; transform: scale(0.7); }
    to { opacity: 1; transform: scale(1); }
}

.hm-status.is-success {
    background: var(--status-success-bg);
    color: var(--status-success);
}

.hm-status.is-failed {
    background: var(--status-danger-bg);
    color: var(--status-danger);
}

.hm-status.is-pop {
    animation: hm-pop 360ms var(--hm-spring);
}

@keyframes hm-pop {
    0% { transform: scale(0.8); }
    100% { transform: scale(1); }
}

.hm-toast {
    position: absolute;
    left: 16px;
    right: 16px;
    bottom: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 12px;
    border: 1px solid var(--accent-border);
    border-radius: 10px;
    background: #0d1a12;
    color: var(--accent-text);
    font-size: var(--text-xs);
    font-weight: 600;
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 200ms linear, transform 320ms var(--hm-spring);
}

.hm-toast .material-symbols-rounded {
    font-size: 16px;
}

.hm-toast.is-on {
    opacity: 1;
    transform: none;
}

.hm-pane--batch {
    padding-bottom: 62px; /* room for the toast, so it never covers a row */
}

.hm-demo__caption {
    margin: var(--space-4) auto 0;
    max-width: 640px;
    text-align: center;
    font-size: var(--text-xs);
    color: var(--text-tertiary);
}

/* ---- Demo, second pass: it reads as a small app being used -------------
   A three-step bar that fills as the loop plays, an app rail, a pointer
   that presses Submit, lines that leave the box as rows arrive, a "-5" /
   "+1" chip on the balance, and a light that runs along the top edge.
   Still transform and opacity only. */
.hm-demo-wrap {
    animation: hm-demo-in 1100ms var(--hm-ease) 320ms both;
    transform-origin: 50% 0;
}

@keyframes hm-demo-in {
    from { opacity: 0; transform: perspective(1400px) translateY(36px) rotateX(10deg) scale(0.97); }
    to { opacity: 1; transform: perspective(1400px) translateY(0) rotateX(0) scale(1); }
}

/* A light that travels along the top edge of the window. */
.hm-demo__beam {
    position: absolute;
    top: 0;
    left: 0;
    width: 34%;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent-hover), transparent);
    animation: hm-beam 5.5s linear infinite;
    z-index: 2;
}

@keyframes hm-beam {
    from { transform: translateX(-100%); }
    to { transform: translateX(400%); }
}

/* Steps: each one has a hairline that fills while its part of the loop runs. */
.hm-demo__steps {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    border-bottom: 1px solid var(--hm-line);
}

.hm-dstep {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 16px;
    border-left: 1px solid var(--hm-line);
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--text-disabled);
    white-space: nowrap;
    overflow: hidden;
    transition: color 240ms;
}

.hm-dstep:first-child {
    border-left: 0;
}

.hm-dstep b {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border: 1px solid var(--hm-line-strong);
    border-radius: 50%;
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 500;
    transition: background-color 240ms, border-color 240ms, color 240ms;
}

.hm-dstep i {
    position: absolute;
    left: 0;
    right: 0;
    bottom: -1px;
    height: 2px;
    background: var(--accent-text);
    transform: scaleX(0);
    transform-origin: left center;
}

.hm-dstep.is-active,
.hm-dstep.is-done {
    color: var(--text-primary);
}

.hm-dstep.is-active b,
.hm-dstep.is-done b {
    border-color: var(--accent-border);
    color: var(--accent-text);
}

.hm-dstep.is-done b {
    background: var(--btn-primary);
    border-color: var(--btn-primary);
    color: var(--text-on-accent);
}

.hm-dstep.is-active i {
    transform: scaleX(1);
    transition: transform var(--hm-step-ms, 1000ms) linear;
}

.hm-dstep.is-done i {
    transform: scaleX(1);
}

/* App rail + main column. */
.hm-demo__body {
    grid-template-columns: 44px minmax(0, 1fr);
    align-items: start;
}

.hm-demo__main {
    display: grid;
    gap: 14px;
    min-width: 0;
}

.hm-demo__rail {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 6px 0;
}

.hm-demo__rail .material-symbols-rounded {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    font-size: 19px;
    color: var(--text-disabled);
}

.hm-demo__rail .is-active {
    background: var(--accent-soft);
    color: var(--accent-text);
}

/* Tiles: a chip that floats off the balance, a ring while URLs are processing. */
.hm-tile {
    position: relative;
}

.hm-tile__delta {
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 2px 8px;
    border-radius: 6px;
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 500;
    opacity: 0;
}

.hm-tile__delta.is-neg {
    background: var(--status-warning-bg);
    color: var(--status-warning);
}

.hm-tile__delta.is-pos {
    background: var(--accent-soft);
    color: var(--accent-text);
}

.hm-tile__delta.is-show {
    animation: hm-delta 1500ms var(--hm-ease) both;
}

@keyframes hm-delta {
    0% { opacity: 0; transform: translateY(8px) scale(0.9); }
    18% { opacity: 1; transform: none; }
    75% { opacity: 1; transform: none; }
    100% { opacity: 0; transform: translateY(-8px); }
}

.hm-tile__ring {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 16px;
    height: 16px;
    border: 2px solid var(--status-info-bg);
    border-top-color: var(--status-info);
    border-radius: 50%;
    opacity: 0;
    transition: opacity 200ms;
}

.hm-tile--busy.is-busy .hm-tile__ring {
    opacity: 1;
    animation: hm-spin 800ms linear infinite;
}

@keyframes hm-spin {
    to { transform: rotate(360deg); }
}

/* Editor: a caret on the line being typed, and lines that leave to the right once submitted. */
.hm-editor__line.is-caret span::after {
    content: "";
    display: inline-block;
    width: 6px;
    height: 13px;
    margin-left: 3px;
    vertical-align: -2px;
    background: var(--accent-text);
    animation: hm-caret 700ms steps(1) infinite;
}

@keyframes hm-caret {
    50% { opacity: 0; }
}

.hm-demo.is-sent .hm-editor {
    opacity: 1;
}

.hm-js .hm-editor__line.is-on.is-flown {
    opacity: 0.22;
    transform: translateX(14px);
    transition: opacity 260ms linear, transform 420ms var(--hm-ease);
}

/* The button gives off one ring when it is pressed. */
.hm-fakebtn {
    position: relative;
}

.hm-fakebtn::after {
    content: "";
    position: absolute;
    inset: 0;
    border: 2px solid var(--accent-hover);
    border-radius: inherit;
    opacity: 0;
}

.hm-fakebtn.is-ring::after {
    animation: hm-ring 620ms var(--hm-ease);
}

@keyframes hm-ring {
    from { opacity: 0.9; transform: scale(1); }
    to { opacity: 0; transform: scale(1.45, 1.9); }
}

/* Status badges: a spinning ring while processing, then a tick or a cross. */
.hm-status::before {
    width: 9px;
    height: 9px;
    background: none;
    border: 1.5px solid currentColor;
    border-radius: 50%;
    box-sizing: border-box;
}

.hm-status.is-processing::before {
    border-right-color: transparent;
    animation: hm-spin 700ms linear infinite;
}

.hm-status.is-success::before,
.hm-status.is-failed::before {
    width: auto;
    height: auto;
    border: 0;
    font-size: 11px;
    line-height: 1;
}

.hm-status.is-success::before { content: "\2713"; }
.hm-status.is-failed::before { content: "\2715"; }

/* A row lights up once as its result lands. */
.hm-row {
    position: relative;
}

.hm-row::after {
    content: "";
    position: absolute;
    inset: 0 -16px;
    background: linear-gradient(90deg, transparent, var(--accent-soft), transparent);
    opacity: 0;
    pointer-events: none;
}

.hm-row[data-final="failed"]::after {
    background: linear-gradient(90deg, transparent, var(--status-danger-bg), transparent);
}

.hm-row.is-landed::after {
    animation: hm-sweep 700ms ease-out;
}

@keyframes hm-sweep {
    0% { opacity: 0; transform: translateX(-40%); }
    30% { opacity: 1; }
    100% { opacity: 0; transform: translateX(40%); }
}

/* The pointer. home.js places it with a transform. */
.hm-cursor {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 3;
    opacity: 0;
    pointer-events: none;
    transition: transform 520ms cubic-bezier(0.5, 0, 0.2, 1), opacity 200ms linear;
    will-change: transform;
}

.hm-cursor.is-on {
    opacity: 1;
}

.hm-cursor.is-down path {
    transform: scale(0.86);
    transform-origin: 5px 3px;
}

@media (max-width: 760px) {
    .hm-demo__body {
        grid-template-columns: minmax(0, 1fr);
    }

    .hm-demo__rail {
        display: none;
    }

    .hm-demo__main {
        gap: 10px;
    }

    .hm-dstep {
        padding: 10px 10px;
        gap: 6px;
        font-size: 11px;
    }
}

@media (max-width: 520px) {
    /* The ring and the chip drop to the number's row, clear of the wrapped label. */
    .hm-tile__ring,
    .hm-tile__delta {
        top: auto;
        bottom: 12px;
        right: 10px;
    }

    /* Numbers only for the two steps that are not running. */
    .hm-dstep {
        justify-content: center;
        font-size: 0;
    }

    .hm-dstep b {
        font-size: 10px;
    }

    .hm-dstep.is-active {
        font-size: 11px;
    }

    .hm-demo__steps {
        display: flex;
    }

    .hm-dstep {
        flex: 0 0 44px;
    }

    .hm-dstep.is-active {
        flex: 1 1 auto;
        justify-content: flex-start;
    }
}

/* =========================================================================
   Facts band
   ========================================================================= */
.hm-facts {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    max-width: var(--hm-max);
    margin: var(--space-16) auto 0;
    border-top: 1px solid var(--hm-line);
    border-bottom: 1px solid var(--hm-line);
}

.hm-fact {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: var(--space-8) var(--space-6);
    border-left: 1px solid var(--hm-line);
}

.hm-fact:first-child {
    border-left: 0;
    padding-left: 0;
}

.hm-fact__num {
    font-size: clamp(2.25rem, 5vw, 3.5rem);
    font-weight: 700;
    letter-spacing: -0.05em;
    line-height: 1;
    color: var(--text-primary);
}

.hm-fact__label {
    font-size: var(--text-sm);
    color: var(--text-tertiary);
    max-width: 22ch;
}

/* =========================================================================
   Sections, headings, cards
   ========================================================================= */
.hm-section {
    max-width: var(--hm-max);
    margin: 0 auto;
    padding: clamp(64px, 9vw, 120px) 0 0;
}

.hm-head {
    max-width: 680px;
    margin-bottom: var(--space-10);
}

.hm-head h2,
.hm-api__copy h2,
.hm-cta__card h2 {
    font-size: clamp(1.75rem, 3.8vw, 2.75rem);
    line-height: 1.08;
    font-weight: 700;
    letter-spacing: -0.04em;
    margin: 0 0 var(--space-4);
    text-wrap: balance;
}

.hm-head p,
.hm-api__copy > p {
    font-size: var(--text-lg);
    line-height: 1.6;
    color: var(--text-secondary);
    margin: 0 0 var(--space-3);
    text-wrap: pretty;
}

.hm-head p:last-child {
    margin-bottom: 0;
}

.hm-kicker {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-bottom: var(--space-4);
    font-family: var(--font-mono);
    font-size: 12px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--accent-text);
}

.hm-kicker::before {
    content: "";
    width: 18px;
    height: 1px;
    background: currentColor;
}

.hm-grid {
    display: grid;
    gap: 14px;
}

.hm-grid--features,
.hm-grid--who {
    grid-template-columns: repeat(4, 1fr);
}

.hm-card {
    --sx: 50%;
    --sy: 0%;
    position: relative;
    padding: var(--space-6);
    border: 1px solid var(--hm-line);
    border-radius: 18px;
    background: var(--hm-panel);
    overflow: hidden;
    transition: border-color 200ms, transform 300ms var(--hm-ease);
}

/* Pointer spotlight. home.js moves --sx / --sy, only on devices with a mouse. */
.hm-card::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(260px circle at var(--sx) var(--sy), var(--hm-glow), transparent 70%);
    opacity: 0;
    transition: opacity 240ms;
    pointer-events: none;
}

.hm-card > * {
    position: relative;
}

.hm-card h3 {
    font-size: 1.0625rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    margin: 0 0 var(--space-2);
}

.hm-card p {
    font-size: var(--text-base);
    line-height: 1.6;
    color: var(--text-secondary);
    margin: 0;
}

.hm-card .hm-card__links {
    margin-top: var(--space-3);
    font-size: var(--text-sm);
}

.hm-card__icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--space-5);
    border: 1px solid var(--hm-line-strong);
    border-radius: 12px;
    color: var(--accent-text);
    background: rgba(255, 255, 255, 0.03);
}

@media (hover: hover) {
    .hm-card:hover {
        border-color: var(--hm-line-strong);
        transform: translateY(-3px);
    }

    .hm-card:hover::before {
        opacity: 1;
    }
}

/* ---- Steps ---- */
.hm-steps {
    position: relative;
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-8);
}

/* The line the steps sit on, and one dot that travels along it. */
.hm-steps::before {
    content: "";
    position: absolute;
    top: 19px;
    left: 20px;
    right: 20px;
    height: 1px;
    background: var(--hm-line-strong);
}

.hm-steps::after {
    content: "";
    position: absolute;
    top: 16px;
    left: 20px;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--accent-text);
    animation: hm-travel 4.5s cubic-bezier(0.65, 0, 0.35, 1) infinite;
}

@keyframes hm-travel {
    0% { transform: translateX(0); opacity: 0; }
    8% { opacity: 1; }
    88% { opacity: 1; }
    100% { transform: translateX(calc(min(var(--hm-max), 100vw - 48px) - 47px)); opacity: 0; }
}

.hm-step {
    position: relative;
}

.hm-step__num {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    margin-bottom: var(--space-5);
    border: 1px solid var(--hm-line-strong);
    border-radius: 50%;
    background: var(--bg-base);
    font-family: var(--font-mono);
    font-size: var(--text-sm);
    color: var(--accent-text);
}

.hm-step h3 {
    font-size: 1.125rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    margin: 0 0 var(--space-2);
}

.hm-step p {
    font-size: var(--text-base);
    line-height: 1.6;
    margin: 0;
    max-width: 34ch;
}

.hm-step .hm-step__link {
    margin-top: var(--space-3);
    font-size: var(--text-sm);
}

/* ---- API ---- */
.hm-api {
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
    gap: clamp(32px, 6vw, 72px);
    align-items: center;
}

.hm-ticks {
    list-style: none;
    margin: var(--space-6) 0 var(--space-8);
    padding: 0;
    display: grid;
    gap: var(--space-3);
    font-size: var(--text-base);
    color: var(--text-secondary);
}

.hm-ticks li {
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
}

.hm-ticks .material-symbols-rounded {
    font-size: 18px;
    line-height: 1.5;
    color: var(--accent-text);
    flex-shrink: 0;
}

.hm-ticks code {
    font-size: 0.92em;
    padding: 1px 6px;
    border: 1px solid var(--hm-line-strong);
    border-radius: 6px;
    color: var(--text-primary);
}

.hm-code {
    border: 1px solid var(--hm-line-strong);
    border-radius: 18px;
    background: var(--hm-panel);
    overflow: hidden;
    min-width: 0;
}

.hm-code__bar {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: 12px 16px;
    border-bottom: 1px solid var(--hm-line);
}

.hm-code__name {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-tertiary);
}

.hm-code__pre {
    margin: 0;
    padding: 16px 18px;
    overflow-x: auto;
    font-size: 12.5px;
    line-height: 1.75;
    color: var(--text-secondary);
    tab-size: 2;
}

.hm-code__pre--out {
    border-top: 1px dashed var(--hm-line-strong);
    background: #0a0a0c;
}

.hm-c-k { color: var(--accent-text); }
.hm-c-s { color: #e5e7eb; }
.hm-c-p { color: var(--status-info); }
.hm-c-n { color: var(--status-warning); }
.hm-c-m { color: var(--text-disabled); }

/* ---- Acceptable use ---- */
.hm-use.acceptable-use {
    padding-bottom: 0;
}

.hm-use__card.acceptable-use__card {
    max-width: 760px;
    margin: 0;
    padding: var(--space-6) var(--space-8);
    border: 1px solid var(--hm-line);
    border-left: 2px solid var(--accent-text);
    border-radius: 0 18px 18px 0;
    background: var(--hm-panel);
    font-size: var(--text-base);
    line-height: 1.65;
}

/* ---- Trust ticker ---- */
.hm-ticker.trust-strip {
    display: block;
    margin-top: clamp(64px, 9vw, 120px);
    padding: var(--space-5) 0;
    border-top: 1px solid var(--hm-line);
    border-bottom: 1px solid var(--hm-line);
    overflow: hidden;
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
    mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
}

.hm-ticker__track {
    display: flex;
    width: max-content;
    animation: hm-marquee 46s linear infinite;
}

.hm-ticker__group {
    display: flex;
    align-items: center;
    gap: var(--space-10);
    padding-right: var(--space-10);
    white-space: nowrap;
}

@keyframes hm-marquee {
    to { transform: translateX(-50%); }
}

@media (hover: hover) {
    .hm-ticker:hover .hm-ticker__track {
        animation-play-state: paused;
    }
}

.hm-ticker .trust-strip__item .material-symbols-rounded {
    color: var(--accent-text);
}

/* ---- Pricing ---- */
.hm-currency {
    display: flex;
    gap: var(--space-2);
    margin-bottom: var(--space-8);
}

.hm-grid--pricing {
    grid-template-columns: repeat(3, 1fr);
}

.hm-price {
    position: relative;
    padding: var(--space-8) var(--space-6);
    border: 1px solid var(--hm-line);
    border-radius: 18px;
    background: var(--hm-panel);
}

.hm-price--best {
    border-color: var(--accent-border);
    background: linear-gradient(180deg, var(--accent-soft), transparent 60%), var(--hm-panel);
}

.hm-price__badge {
    position: absolute;
    top: 16px;
    right: 16px;
    padding: 3px 9px;
    border-radius: 6px;
    background: var(--btn-primary);
    color: var(--text-on-accent);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.hm-price h3 {
    font-size: var(--text-base);
    font-weight: 600;
    color: var(--text-secondary);
    margin: 0 0 var(--space-5);
}

.hm-price__credits {
    font-size: clamp(1.75rem, 3.4vw, 2.5rem);
    font-weight: 700;
    letter-spacing: -0.04em;
    line-height: 1;
    color: var(--text-primary);
}

.hm-price__credits span {
    font-size: var(--text-base);
    font-weight: 500;
    letter-spacing: 0;
    color: var(--text-tertiary);
}

.hm-price__total {
    margin-top: var(--space-4);
    font-size: var(--text-lg);
    font-weight: 600;
    color: var(--text-primary);
}

.hm-price__per {
    margin-top: 2px;
    font-size: var(--text-sm);
    color: var(--text-tertiary);
}

.hm-center {
    margin-top: var(--space-8);
}

/* ---- FAQ (reuses the shared accordion) ---- */
.hm-faq.faq-list {
    max-width: 820px;
    margin: 0;
    gap: 0;
    border-top: 1px solid var(--hm-line);
}

.hm-faq .faq-item {
    background: none;
    border: 0;
    border-bottom: 1px solid var(--hm-line);
    border-radius: 0;
}

.hm-faq .faq-item__question {
    padding: var(--space-5) 0;
    font-size: 1.0625rem;
    letter-spacing: -0.01em;
}

/* The answer slides open: a grid row that grows from 0fr to 1fr, so the height
   follows the text with no measuring in JavaScript. A browser without animated
   grid rows just opens it at once. */
.hm-faq .faq-item__answer {
    display: grid;
    grid-template-rows: 0fr;
    padding: 0;
    max-width: 68ch;
    opacity: 0;
    visibility: hidden;
    transition: grid-template-rows 380ms var(--hm-ease), opacity 260ms ease, visibility 0s linear 380ms;
}

.hm-faq .faq-item.is-open .faq-item__answer {
    display: grid;
    grid-template-rows: 1fr;
    opacity: 1;
    visibility: visible;
    transition: grid-template-rows 380ms var(--hm-ease), opacity 320ms ease 60ms, visibility 0s;
}

.hm-faq .faq-item__answer p {
    min-height: 0;
    overflow: hidden;
    padding-bottom: 0;
    transition: padding-bottom 380ms var(--hm-ease);
}

.hm-faq .faq-item.is-open .faq-item__answer p {
    padding-bottom: var(--space-5);
}

.hm-faq .faq-item__question {
    transition: color 160ms;
}

.hm-faq .faq-item.is-open .faq-item__question,
.hm-faq .faq-item__question:hover {
    color: var(--accent-text);
}

.hm-faq .faq-item__chevron {
    transition: transform 380ms var(--hm-ease);
}

/* ---- Closing call to action ---- */
.hm-cta {
    position: relative;
    max-width: var(--hm-max);
    margin: clamp(120px, 14vw, 190px) auto var(--space-16);
}

.hm-mascot--cta {
    position: absolute;
    top: -104px;
    right: 9%;
    width: 132px;
    z-index: 0;
    transition: transform 460ms var(--hm-spring);
}

/* Pointer over a button in the card: it pops up to look. */
.hm-mascot--cta.is-happy {
    transform: translateY(-22px);
}

.hm-cta__card {
    position: relative;
    z-index: 1;
    padding: clamp(32px, 6vw, 72px);
    border: 1px solid var(--hm-line-strong);
    border-radius: 28px;
    background:
        radial-gradient(ellipse 70% 90% at 85% 0%, var(--hm-glow), transparent 65%),
        var(--hm-panel);
}

.hm-cta__card h2 {
    max-width: 16ch;
}

.hm-cta__card > p {
    font-size: var(--text-lg);
    line-height: 1.6;
    max-width: 520px;
    margin: 0 0 var(--space-8);
}

.hm-cta .hm-hero__actions {
    justify-content: flex-start;
}

.hm-cta__card > .hm-cta__note {
    margin: var(--space-8) 0 0;
    max-width: 600px;
    font-size: var(--text-xs);
    color: var(--text-tertiary);
}

/* =========================================================================
   Scroll reveal. Only hidden once home.js has run (html.hm-js), so the page
   is complete without JavaScript.
   ========================================================================= */
.hm-js [data-hm-reveal] {
    opacity: 0;
    transform: translateY(22px);
    transition: opacity 600ms ease, transform 800ms var(--hm-ease);
}

.hm-js [data-hm-reveal="1"] { transition-delay: 80ms; }
.hm-js [data-hm-reveal="2"] { transition-delay: 160ms; }
.hm-js [data-hm-reveal="3"] { transition-delay: 240ms; }

.hm-js [data-hm-reveal].is-in {
    opacity: 1;
    transform: none;
}

/* Hovered cards must answer at once, not after the reveal's stagger delay. */
.hm-js .hm-card.is-in {
    transition: border-color 200ms, transform 300ms var(--hm-ease), opacity 600ms ease;
    transition-delay: 0ms;
}

/* =========================================================================
   Smaller screens
   ========================================================================= */
@media (max-width: 1000px) {
    .hm-grid--features,
    .hm-grid--who {
        grid-template-columns: repeat(2, 1fr);
    }

    .hm-api {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 760px) {
    .hm-hero {
        padding-top: 178px;
    }

    .hm-mascot--hero {
        width: 140px;
        margin-left: -70px;
    }

    .hm-demo__body {
        padding: 12px;
        gap: 10px;
    }

    .hm-demo__tiles,
    .hm-demo__panes {
        gap: 10px;
    }

    .hm-demo__panes {
        grid-template-columns: minmax(0, 1fr);
    }

    .hm-tile {
        padding: 10px 12px;
    }

    .hm-demo__where {
        display: none;
    }

    .hm-facts {
        grid-template-columns: repeat(2, 1fr);
    }

    .hm-fact {
        padding: var(--space-6) var(--space-4);
    }

    .hm-fact:nth-child(odd) {
        border-left: 0;
        padding-left: 0;
    }

    .hm-fact:nth-child(n + 3) {
        border-top: 1px solid var(--hm-line);
    }

    .hm-steps {
        grid-template-columns: minmax(0, 1fr);
        gap: var(--space-8);
        padding-left: 0;
    }

    /* The line turns vertical and the travelling dot is dropped. */
    .hm-steps::before {
        top: 20px;
        bottom: 20px;
        left: 20px;
        right: auto;
        width: 1px;
        height: auto;
    }

    .hm-steps::after {
        display: none;
    }

    .hm-step {
        padding-left: 60px;
    }

    .hm-step__num {
        position: absolute;
        left: 0;
        top: 0;
        margin: 0;
    }

    .hm-grid--pricing {
        grid-template-columns: minmax(0, 1fr);
    }

    .hm-use__card.acceptable-use__card {
        padding: var(--space-5);
    }

    .hm-mascot--cta {
        width: 104px;
        top: -82px;
        right: 24px;
    }
}

@media (max-width: 520px) {
    .hm-grid--features,
    .hm-grid--who {
        grid-template-columns: minmax(0, 1fr);
    }

    .hm-hero__actions .hm-btn {
        flex: 1 1 100%;
        justify-content: center;
    }

    .hm-demo__tag {
        font-size: 10px;
    }

    .hm-tile__label {
        font-size: 11px;
        line-height: 1.25;
        min-height: 2.5em;
        white-space: normal;
    }

    .hm-pane__meta {
        display: none;
    }

    .hm-pane--batch .hm-pane__meta {
        display: inline;
    }
}

/* Reduced motion: app.css already stops animations. These undo the hidden start states. */
@media (prefers-reduced-motion: reduce) {
    .hm-ticker__track {
        animation: none;
        width: auto;
        flex-wrap: wrap;
        justify-content: center;
    }

    .hm-ticker__group {
        flex-wrap: wrap;
        justify-content: center;
        white-space: normal;
        gap: var(--space-3) var(--space-6);
        padding: 0 var(--space-6);
    }

    .hm-ticker__group[aria-hidden="true"],
    .hm-steps::after {
        display: none;
    }

    .hm-ticker.trust-strip {
        -webkit-mask-image: none;
        mask-image: none;
    }
}
