/* ============================================================
   Home hero — four-slide fanned-screenshot carousel
   ------------------------------------------------------------
   Loaded after home.css so it owns the hero outright. Everything
   inside the fan is sized in `em` against `.hero__fan`'s font-size
   of 1cqw, so the whole composition — card widths, overlap, angles,
   radius, shadows, mock-screen type — scales as ONE piece from 360px
   to 1920px instead of re-flowing. Below 900px the stage is 150% of
   the viewport (clipped) which keeps the center card at 78% of the
   screen, exactly as specified.

   Only transform, opacity, filter and clip-path are animated.
   ============================================================ */

.home .hero {
  --hero-bg: var(--neutral-50, var(--neutral-50));
  --hero-surface: var(--white);
  --ink: #0f172a;
  --muted: var(--neutral-600, var(--neutral-600));
  --line: var(--neutral-200, var(--neutral-200));
  --action: var(--brand-navy-700, var(--brand-navy-700));
  --accent: #c2410c;
  --accent-wash: rgba(194, 65, 12, 0.14);
  /* Inked accent for text and small chips, plus the ink that sits on
     the action colour. Both flip in dark mode below. */
  --accent-ink: var(--accent);
  --pill-bg: var(--accent-wash);
  --on-action: var(--white);

  position: relative;
  isolation: isolate;
  overflow: clip;
  /* The hero owns the first screen: it fills the viewport (svh, so a
     phone's URL bar cannot push it past the fold) and centres its
     content in whatever height that is. */
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 100vh;
  min-height: 100svh;
  padding: calc(var(--nav-h-local, 60px) + 28px) 0 clamp(20px, 2.4vw, 40px);
  background: var(--hero-bg);
  color: var(--ink);
}

/* Dark theme: same structure, deeper ground. The site's own toggle
   ([data-theme]) and the OS preference both land here. */
[data-theme="dark"] .hero {
  --hero-bg: #071320;
  --hero-surface: #0c1d2e;
  --ink: var(--neutral-100, var(--neutral-100));
  --muted: #9fb3c8;
  --line: #1e3a52;
  --action: var(--brand-orange-400, var(--brand-orange-400));
  /* Teal at full strength is too dark on a #071320 ground, and white
     on var(--brand-orange-400, var(--brand-orange-400)) measures ~2.6:1. Both are corrected here. */
  --accent-ink: color-mix(in srgb, var(--accent) 42%, var(--white));
  --pill-bg: rgba(255, 255, 255, 0.08);
  --on-action: #1a0d00;
}

@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) .hero {
    --hero-bg: #071320;
    --hero-surface: #0c1d2e;
    --ink: var(--neutral-100, var(--neutral-100));
    --muted: #9fb3c8;
    --line: #1e3a52;
    --action: var(--brand-orange-400, var(--brand-orange-400));
  /* Teal at full strength is too dark on a #071320 ground, and white
     on var(--brand-orange-400, var(--brand-orange-400)) measures ~2.6:1. Both are corrected here. */
  --accent-ink: color-mix(in srgb, var(--accent) 42%, var(--white));
  --pill-bg: rgba(255, 255, 255, 0.08);
  --on-action: #1a0d00;
  }
}

/* --- Ground: two soft meshes, a fading grid, a whisper of noise --- */
.home .hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background:
    radial-gradient(46% 42% at 78% 4%, var(--accent-wash) 0%, transparent 70%),
    radial-gradient(50% 46% at 8% 22%, rgba(127, 176, 224, 0.16) 0%, transparent 72%);
}

.home .hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(to right, rgba(15, 23, 42, 0.055) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(15, 23, 42, 0.055) 1px, transparent 1px);
  background-size: 64px 64px;
  -webkit-mask-image: radial-gradient(72% 62% at 50% 12%, #000 0%, transparent 76%);
  mask-image: radial-gradient(72% 62% at 50% 12%, #000 0%, transparent 76%);
}

/* Dark: the sweep is a white flash on a dark card, so it is halved.
   It must never fall back to the page colour — a solid card-coloured
   layer sliding across the capture reads as a black-out overlay. */
[data-theme="dark"] .fan-card__sweep {
  background: linear-gradient(104deg, transparent 32%, rgba(255, 255, 255, 0.16) 48%, transparent 62%);
}

.fan-card__sweep {
  background: linear-gradient(104deg, transparent 32%, rgba(255, 255, 255, 0.14) 48%, transparent 62%);
}

[data-theme="dark"] .hero::after,
html:not([data-theme="light"]) .hero::after {
  background-image:
    linear-gradient(to right, rgba(226, 232, 240, 0.06) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(226, 232, 240, 0.06) 1px, transparent 1px);
}

.hero__inner {
  position: relative;
  width: min(100% - 40px, 1320px);
  margin-inline: auto;
  text-align: center;
}

/* --- Eyebrow pill ------------------------------------------------ */
.hero__eyebrow {
  display: inline-flex;
  margin: 0 0 0.9rem;
  padding: 0;
}

.hero__pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 36px;
  padding: 0 0.95rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--hero-surface);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--muted);
}

.hero__pill-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  transition: background-color 0.5s ease;
}

/* --- Headline ---------------------------------------------------
   Two masked lines. The mask is what lets the outgoing copy slide up
   and the incoming copy rise without either one escaping its box. */
.hero__title {
  margin: 0 auto;
  max-width: 22ch;
  font-family: var(--md-display-font, "Plus Jakarta Sans"), "Plus Jakarta Sans", var(--font-sans);
  font-size: clamp(2.1rem, 6.2vw + 0.5rem, 4.5rem);
  font-weight: 700;
  line-height: 1.06;
  letter-spacing: -0.02em;
  text-wrap: balance;
  color: var(--ink);
}

.hero__line {
  display: block;
  overflow: clip;
  padding-block: 0.04em;
}

.hero__line-inner {
  display: block;
  will-change: transform, opacity, filter;
}

.hero__accent {
  position: relative;
  color: var(--accent-ink);
  transition: color 0.6s ease;
}

.hero__accent-ch { display: inline-block; }

.hero__underline {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -0.06em;
  height: 0.07em;
  border-radius: 999px;
  background: var(--accent-ink);
  transform: scaleX(0);
  transform-origin: left center;
}

.hero__sub {
  max-width: 54ch;
  margin: 1.15rem auto 0;
  font-family: "Inter", var(--font-sans, system-ui), system-ui, sans-serif;
  font-size: clamp(1.05rem, 0.95rem + 0.45vw, 1.25rem);
  line-height: 1.6;
  color: var(--muted);
}

/* --- Actions ---------------------------------------------------- */
.hero__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 1.2rem;
}

.hero__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 48px;
  padding: 0 1.35rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font-family: "Inter", var(--font-sans, system-ui), system-ui, sans-serif;
  font-size: 0.9375rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition:
    transform 0.18s cubic-bezier(0.16, 1, 0.3, 1),
    box-shadow 0.2s ease,
    background-color 0.2s ease,
    border-color 0.2s ease;
}

.hero__btn--primary {
  background: var(--action);
  color: var(--on-action);
  box-shadow: 0 10px 24px -12px rgba(11, 60, 93, 0.7);
}

.hero__btn--primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 30px -12px var(--accent-wash), 0 0 0 4px var(--accent-wash);
}

.hero__btn--ghost {
  background: var(--hero-surface);
  border-color: var(--line);
  color: var(--ink);
}

.hero__btn--ghost:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
}

.hero__btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.hero__btn svg { transition: transform 0.18s cubic-bezier(0.16, 1, 0.3, 1); }
.hero__btn:hover svg { transform: translateX(3px); }

/* --- Search: fixed across slides -------------------------------- */
.hero__search {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: min(100%, 640px);
  margin: 1.1rem auto 0;
  padding: 0.4rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--hero-surface);
  box-shadow: 0 10px 30px -18px rgba(15, 23, 42, 0.4);
}

.hero__search:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-wash), 0 10px 30px -18px rgba(15, 23, 42, 0.4);
}

.hero__search-field {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  flex: 0 0 auto;
  padding-left: 0.4rem;
}

.hero__search-field svg { color: var(--muted); }

.hero__search select {
  min-height: 44px;
  padding: 0 1.6rem 0 0.25rem;
  border: 0;
  border-right: 1px solid var(--line);
  background: transparent;
  font: inherit;
  font-family: "Inter", var(--font-sans, system-ui), system-ui, sans-serif;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
}

.hero__search select:focus { outline: none; }

.hero__search-input {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 44px;
  padding: 0 0.5rem;
  border: 0;
  background: transparent;
  font: inherit;
  font-family: "Inter", var(--font-sans, system-ui), system-ui, sans-serif;
  font-size: 0.9375rem;
  color: var(--ink);
}

.hero__search-input::placeholder { color: var(--muted); opacity: 0.85; }
.hero__search-input:focus { outline: none; }
.hero__search-input::-webkit-search-cancel-button { -webkit-appearance: none; }

.hero__search-submit {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 44px;
  padding: 0 1.15rem;
  border: 0;
  border-radius: 999px;
  background: var(--action);
  color: var(--on-action);
  font: inherit;
  font-family: "Inter", var(--font-sans, system-ui), system-ui, sans-serif;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s ease, box-shadow 0.2s ease;
}

.hero__search-submit:hover { box-shadow: 0 0 0 4px var(--accent-wash); }

.hero__search-submit:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* --- Tabs + pause ----------------------------------------------- */
.hero__controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 1.15rem;
}

.hero__tabs {
  display: flex;
  align-items: center;
  gap: 0.15rem;
  padding: 0.25rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--hero-surface);
}

.hero__tab {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 38px;
  padding: 0.35rem 0.85rem 0.5rem;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-family: "Inter", var(--font-sans, system-ui), system-ui, sans-serif;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.2s ease, background-color 0.2s ease;
}

.hero__tab:hover { color: var(--ink); }

.hero__tab[aria-selected="true"] {
  color: var(--ink);
  background: var(--accent-wash);
}

/* The compact state shows a per-category icon instead of a plain dot. */
.hero__tab-dot {
  display: none;
}

.hero__tab-dot svg {
  display: block;
  width: 17px;
  height: 17px;
  opacity: 0.7;
  transition: opacity 0.2s ease;
}

.hero__tab:hover .hero__tab-dot svg,
.hero__tab[aria-selected="true"] .hero__tab-dot svg { opacity: 1; }

.hero__tab-progress {
  position: absolute;
  left: 0.85rem;
  right: 0.85rem;
  bottom: 0.22rem;
  height: 2px;
  border-radius: 999px;
  background: var(--accent-ink);
  transform: scaleX(0);
  transform-origin: left center;
}

.hero__tab:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.hero__pause {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--hero-surface);
  color: var(--muted);
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.hero__pause:hover { color: var(--ink); border-color: var(--accent); }

.hero__pause:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.hero__pause .hero__pause-play { display: none; }
.hero__pause[aria-pressed="true"] .hero__pause-play { display: block; }
.hero__pause[aria-pressed="true"] .hero__pause-stop { display: none; }

/* --- Stage ------------------------------------------------------
   `.hero__stage` is the container. `.hero__fan` is one design canvas:
   1em = 1% of the stage width, so every measurement below is a
   percentage of the stage and the fan never re-flows. */
.hero__stagewrap {
  position: relative;
  margin-top: clamp(0.75rem, 1.6vw, 1.4rem);
  overflow: clip;
}

.hero__stage {
  position: relative;
  container-type: inline-size;
  width: min(100% - 40px, 1320px);
  margin-inline: auto;
}

.hero__fan {
  position: relative;
  height: 40em;
  font-size: 1cqw;
  will-change: transform;
}

.hero__glow {
  position: absolute;
  left: 50%;
  top: 46%;
  width: 78%;
  height: 96%;
  transform: translate(-50%, -50%);
  background: radial-gradient(closest-side, var(--accent) 0%, transparent 72%);
  opacity: 0.16;
  filter: blur(24px);
  pointer-events: none;
  z-index: 0;
}

.hero__glow--b { opacity: 0; }

.fan-set {
  position: absolute;
  inset: 0;
  z-index: 1;
}

.fan-card {
  position: absolute;
  bottom: 3em;
  left: calc(50% - 23.5em);
  width: 47em;
  aspect-ratio: 16 / 10;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 1.4em;
  background: var(--hero-surface);
  box-shadow:
    0 0.1em 0.2em rgba(15, 23, 42, 0.06),
    0 1.2em 2.4em -0.8em rgba(15, 23, 42, 0.18),
    0 4em 8em -2.4em rgba(15, 23, 42, 0.28);
  transform-origin: bottom center;
  will-change: transform, opacity, filter;
}

.fan-card--center {
  left: calc(50% - 27em);
  width: 54em;
  bottom: 4em;
  z-index: 3;
}

.fan-card--left { z-index: 1; }
.fan-card--right { z-index: 1; }

/* Hovered card comes forward over the whole fan, so the screen it
   shows is never half-hidden behind its neighbours. */
.fan-card:hover,
.fan-card:focus-within {
  z-index: 9;
}

.fan-card__float {
  display: flex;
  flex-direction: column;
  height: 100%;
  animation: fan-bob 6s ease-in-out infinite;
}

.fan-card--left .fan-card__float { animation-duration: 5.4s; animation-delay: -1.4s; }
.fan-card--right .fan-card__float { animation-duration: 7s; animation-delay: -3.2s; }
.fan-card--center .fan-card__float { animation-duration: 6.2s; animation-delay: -0.6s; }

@keyframes fan-bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-0.35em); }
}

/* The card is a bare frame. The fan shows photographic art, so the fake
   browser bar that used to sit here (traffic dots + URL pill) is gone.
   .fan-card__screen now takes the whole card, which is exactly why the
   art can be generated at the card's own 16:10 instead of being cropped
   under a toolbar. */

.fan-card__screen {
  /* Anchored to the frame (not a flex item) and bleeding 1px past every
     edge: the card's rounded frame clips it, while the bleed hides the
     hairline seam that sub-pixel rounding left along the card's bottom
     edge. `inset` also gives the screen a definite box, so the photo can
     stretch inside it — a percentage-height image resolved to `auto` here
     because the card's height comes from its aspect-ratio. */
  position: absolute;
  inset: -1px;
  overflow: hidden;
  background: var(--hero-bg);
  display: flex;
}

.fan-card__shot {
  /* In flow and stretched by the flex line — never percentage-height. */
  position: relative;
  flex: 1 1 auto;
  align-self: stretch;
  display: block;
  width: 100%;
  min-width: 0;
  min-height: 0;
  object-fit: cover;
  object-position: center top;
  background: var(--hero-bg);
}

.fan-card__sweep {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  background: linear-gradient(104deg, transparent 32%, rgba(255, 255, 255, 0.42) 48%, transparent 62%);
  transform: translateX(-120%);
}

/* --- Mock screens ----------------------------------------------
   Hand-built product UI, not screenshots. All type and spacing is in
   em, so a card at 360px renders exactly the same composition as one
   at 1920px — only smaller. */
.mock {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  gap: 0.85em;
  padding: 1.1em 1.2em 1.3em;
  font-family: "Inter", var(--font-sans, system-ui), system-ui, sans-serif;
  font-size: 1.05em;
  line-height: 1.25;
  color: var(--ink);
}

.m-top {
  display: flex;
  align-items: center;
  gap: 0.7em;
}

.m-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  font-weight: 700;
  font-size: 0.95em;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.m-brand::before {
  content: "";
  width: 0.6em;
  height: 0.6em;
  border-radius: 0.18em;
  background: var(--accent);
}

.m-searchbar {
  flex: 1 1 auto;
  overflow: hidden;
  padding: 0.42em 0.75em;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--hero-surface);
  font-size: 0.78em;
  color: var(--muted);
  white-space: nowrap;
}

.m-avatar {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 1.7em;
  height: 1.7em;
  border-radius: 50%;
  background: var(--pill-bg);
  color: var(--accent-ink);
  font-size: 0.72em;
  font-weight: 700;
}

.m-chips {
  display: flex;
  gap: 0.4em;
  flex-wrap: wrap;
}

.m-chip {
  padding: 0.28em 0.65em;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--hero-surface);
  font-size: 0.72em;
  color: var(--muted);
}

.m-chip--on {
  border-color: var(--accent-ink);
  color: var(--accent-ink);
  background: var(--pill-bg);
}

.m-grid {
  flex: 1 1 auto;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.65em;
  min-height: 0;
}

.m-tile {
  display: flex;
  flex-direction: column;
  gap: 0.28em;
  min-height: 0;
  padding: 0.55em;
  border: 1px solid var(--line);
  border-radius: 0.7em;
  background: var(--hero-surface);
}

.m-thumb {
  flex: 1 1 auto;
  display: grid;
  place-items: center;
  min-height: 2.4em;
  border-radius: 0.45em;
  font-size: 0.78em;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: rgba(15, 23, 42, 0.42);
}

.m-thumb.t0 { background: linear-gradient(135deg, #ffe3cf, #ffb27a); }
.m-thumb.t1 { background: linear-gradient(135deg, #dbeafe, #93c5fd); }
.m-thumb.t2 { background: linear-gradient(135deg, #d1fae5, #6ee7b7); }
.m-thumb.t3 { background: linear-gradient(135deg, #ede9fe, #c4b5fd); }
.m-thumb.t4 { background: linear-gradient(135deg, var(--warning-tint), #fcd34d); }
.m-thumb.t5 { background: linear-gradient(135deg, var(--danger-tint), #fca5a5); }

.m-name {
  overflow: hidden;
  font-size: 0.72em;
  font-weight: 600;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.m-price {
  font-size: 0.75em;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--accent-ink);
}

.m-meta {
  font-size: 0.66em;
  color: var(--muted);
}

.m-secure {
  align-self: flex-start;
  padding: 0.14em 0.5em;
  border-radius: 999px;
  background: var(--pill-bg);
  color: var(--accent-ink);
  font-size: 0.6em;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.m-upload-label {
  margin-top: 0.15em;
  font-size: 0.64em;
  font-weight: 600;
  color: var(--muted);
}

.m-secure-note {
  margin-top: 0.3em;
  font-size: 0.62em;
  line-height: 1.35;
  color: var(--muted);
}

.m-chart { display: flex; flex-direction: column; }
.m-chart svg { flex: 1 1 auto; min-height: 0; }

.m-chart-label {
  display: block;
  margin-bottom: 0.2em;
  font-size: 0.66em;
  font-weight: 700;
  color: var(--muted);
}

.m-room {
  display: flex;
  align-items: center;
  gap: 0.5em;
  margin-top: 0.25em;
}

.m-room .m-thumb {
  flex: 0 0 auto;
  width: 2.2em;
  height: 2.2em;
  min-height: 0;
  border-radius: 0.45em;
}

.m-room strong { display: block; font-size: 0.72em; }
.m-room .m-meta { display: block; }

/* Table rows (catalog, jobs, orders) */
.m-table {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 0.7em;
  background: var(--hero-surface);
}

.m-row {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 0.8fr;
  gap: 0.5em;
  align-items: center;
  padding: 0.5em 0.7em;
  border-bottom: 1px solid var(--line);
  font-size: 0.72em;
}

.m-row:last-child { border-bottom: 0; }

.m-row--head {
  background: var(--hero-bg);
  font-size: 0.68em;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.m-row span:last-child { text-align: right; font-variant-numeric: tabular-nums; }

.m-pill {
  display: inline-block;
  padding: 0.15em 0.5em;
  border-radius: 999px;
  background: var(--pill-bg);
  color: var(--accent-ink);
  font-size: 0.92em;
  font-weight: 600;
}

.m-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.6em;
}

.m-stat {
  padding: 0.55em 0.65em;
  border: 1px solid var(--line);
  border-radius: 0.7em;
  background: var(--hero-surface);
}

.m-stat__k { font-size: 0.64em; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.m-stat__v { display: block; margin-top: 0.2em; font-size: 0.95em; font-weight: 700; font-variant-numeric: tabular-nums; }

.m-chart {
  flex: 1 1 auto;
  padding: 0.5em;
  border: 1px solid var(--line);
  border-radius: 0.7em;
  background: var(--hero-surface);
  min-height: 0;
}

.m-chart svg { display: block; width: 100%; height: 100%; }

/* Form screens */
.m-form {
  flex: 1 1 auto;
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 0.7em;
  min-height: 0;
}

.m-fields {
  display: flex;
  flex-direction: column;
  gap: 0.45em;
  padding: 0.7em;
  border: 1px solid var(--line);
  border-radius: 0.7em;
  background: var(--hero-surface);
  overflow: hidden;
}

.m-field { display: flex; flex-direction: column; gap: 0.22em; }
.m-field span { font-size: 0.66em; font-weight: 600; color: var(--muted); }
.m-field i {
  display: block;
  height: 1.35em;
  border: 1px solid var(--line);
  border-radius: 0.35em;
  background: var(--hero-bg);
}
.m-field--tall i { height: 2.6em; }

.m-upload {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.35em;
}

.m-upload i {
  display: block;
  aspect-ratio: 4 / 3;
  border: 1px dashed var(--line);
  border-radius: 0.4em;
  background:
    linear-gradient(135deg, rgba(148, 163, 184, 0.16), rgba(148, 163, 184, 0.04));
}

.m-summary {
  display: flex;
  flex-direction: column;
  gap: 0.4em;
  padding: 0.7em;
  border: 1px solid var(--line);
  border-radius: 0.7em;
  background: var(--hero-surface);
}

.m-summary h4 { margin: 0; font-size: 0.76em; }
.m-summary-row {
  display: flex;
  justify-content: space-between;
  gap: 0.4em;
  font-size: 0.66em;
  color: var(--muted);
}
.m-summary-row strong { color: var(--ink); font-variant-numeric: tabular-nums; }

.m-cta {
  margin-top: auto;
  display: grid;
  place-items: center;
  min-height: 1.9em;
  border-radius: 0.45em;
  background: var(--action);
  color: var(--on-action);
  font-size: 0.7em;
  font-weight: 600;
}

/* Profile screens */
.m-profile {
  display: flex;
  align-items: center;
  gap: 0.7em;
  padding: 0.7em;
  border: 1px solid var(--line);
  border-radius: 0.7em;
  background: var(--hero-surface);
}

.m-profile__avatar {
  display: grid;
  place-items: center;
  width: 2.6em;
  height: 2.6em;
  border-radius: 50%;
  background: var(--pill-bg);
  color: var(--accent-ink);
  font-size: 0.8em;
  font-weight: 700;
}

.m-profile__meta h4 { margin: 0; font-size: 0.82em; }
.m-profile__meta p { margin: 0.15em 0 0; font-size: 0.66em; color: var(--muted); }

.m-badges { display: flex; gap: 0.3em; margin-top: 0.3em; }

/* Builder screen */
.m-builder {
  flex: 1 1 auto;
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 0.7em;
  min-height: 0;
}

.m-blocks {
  display: flex;
  flex-direction: column;
  gap: 0.35em;
  padding: 0.6em;
  border: 1px solid var(--line);
  border-radius: 0.7em;
  background: var(--hero-surface);
}

.m-block {
  display: flex;
  align-items: center;
  gap: 0.4em;
  padding: 0.4em 0.5em;
  border: 1px solid var(--line);
  border-radius: 0.4em;
  font-size: 0.68em;
  color: var(--muted);
}

.m-block--on { border-color: var(--accent); color: var(--accent); background: var(--accent-wash); }

.m-preview {
  display: flex;
  flex-direction: column;
  gap: 0.4em;
  padding: 0.6em;
  border: 1px solid var(--line);
  border-radius: 0.7em;
  background: var(--hero-surface);
}

.m-preview__hero {
  flex: 0 0 auto;
  height: 2.6em;
  border-radius: 0.45em;
  background: linear-gradient(120deg, var(--accent-wash), rgba(127, 176, 224, 0.28));
}

.m-preview__rows { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.3em; flex: 1 1 auto; }
.m-preview__rows i {
  display: block;
  border-radius: 0.35em;
  background: var(--hero-bg);
  border: 1px solid var(--line);
}

/* --- Bottom fade into the next section --------------------------
   The hero ground is var(--neutral-50, var(--neutral-50)) and the page below it is white, so the
   last stretch of the fade hands over to the page colour instead of
   ending on a band. The first section then starts straight out of the
   hero with no gap. */
.hero__fade {
  position: relative;
  height: 5rem;
  margin-top: -1rem;
  background: linear-gradient(
    180deg,
    var(--hero-bg) 0%,
    var(--hero-bg) 42%,
    var(--home-page-bg, var(--white)) 100%
  );
  pointer-events: none;
}

/* --- The first section under the hero ---------------------------
   It picks up the hero's language rather than restarting the page:
   same eyebrow pill, same display face and weight, same ghost
   button. Scoped with `+`, so no other section is touched. */
.hero + .home-section {
  padding-top: clamp(40px, 5vw, 68px);
  background: var(--home-page-bg, var(--white));
}

/* Every section below the hero uses the hero's own label pill. The
   old uppercase, letterspaced chip read as a second design system
   sitting under a sentence-case hero; now the page reads as one. */
.home-section .home-eyebrow {
  min-height: 32px;
  padding: 0 0.85rem;
  gap: 0.5rem;
  border: 1px solid var(--neutral-200, var(--neutral-200));
  border-radius: 999px;
  background: var(--white);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
  color: var(--neutral-600, var(--neutral-600));
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: none;
}

.home-section .home-eyebrow::before {
  width: 6px;
  height: 6px;
  background: var(--brand-navy-700, var(--brand-navy-700));
  box-shadow: none;
}

/* Display type is the hero's face and weight everywhere; the sizes
   stay whatever home.css already sets per section. */
.home-section :is(.home-display-l, .home-display-m, .home-h2, .home-h3) {
  font-family: var(--md-display-font, "Plus Jakarta Sans"), "Plus Jakarta Sans", var(--font-sans);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.14;
  color: #0f172a;
}

/* The first section is the one that has to hand over from the fan,
   so it gets the tighter lead-in and the hero's own display size. */
.hero + .home-section .home-display-m {
  font-size: clamp(1.55rem, 1rem + 1.8vw, 2.35rem);
}

.home-section .home-btn--outlined {
  min-height: 44px;
  padding: 0 1.15rem;
  border-radius: 999px;
  border: 1px solid var(--neutral-200, var(--neutral-200));
  background: var(--white);
  color: #0f172a;
  font-size: 0.875rem;
  font-weight: 600;
}

.home-section .home-btn--outlined:hover {
  border-color: var(--brand-navy-700, var(--brand-navy-700));
  color: var(--brand-navy-700, var(--brand-navy-700));
}

[data-theme="dark"] .home-section .home-eyebrow {
  background: #0c1d2e;
  border-color: #1e3a52;
  color: #9fb3c8;
}

[data-theme="dark"] .home-section :is(.home-display-l, .home-display-m, .home-h2, .home-h3) {
  color: var(--neutral-100, var(--neutral-100));
}

[data-theme="dark"] .home-section .home-btn--outlined {
  background: #0c1d2e;
  border-color: #1e3a52;
  color: var(--neutral-100, var(--neutral-100));
}

/* --- Responsive ------------------------------------------------- */
@media (max-width: 899px) {
  /* Phone / small-tablet reading order: the headline first, the photos
     straight after it, then the calls to action and the search box.
     The fan is far more persuasive than a button pair, so it sits in the
     first screen instead of below the form. Desktop is untouched — the
     stacked order above 900px and the two-column laptop layout keep the
     copy, actions and search before the fan.

     `justify-items: stretch` (the default) keeps the title and sub boxes
     full width, so their line wrapping is identical to before; only the
     pill and the button row are centred individually. */
  .hero__inner {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "eyebrow"
      "title"
      "sub"
      "stage"
      "actions"
      "search"
      "controls"
      "live";
  }

  .hero__eyebrow { grid-area: eyebrow; justify-self: center; }
  .hero__title { grid-area: title; }
  .hero__sub { grid-area: sub; }
  .hero__stagewrap { grid-area: stage; }
  .hero__actions { grid-area: actions; }
  .hero__search { grid-area: search; }
  .hero__controls { grid-area: controls; }
  .hero__inner > [data-hero-live] { grid-area: live; }

  /* The photos now sit between the copy and the buttons, so the fan's
     own top margin (which used to separate it from the tabs) moves to
     the buttons that follow it, and the fan's bottom margin separates
     it from the actions instead of the page edge. */
  .hero__stagewrap {
    margin-top: 0.9rem;
    margin-bottom: 0.4rem;
  }

  .hero__actions { margin-top: 0.35rem; }

  .hero__title { max-width: 16ch; }

  /* Center card at 78% of the viewport: the stage is one and a half
     screens wide, the wrap lets it bleed edge to edge, and the outer
     cards are cropped symmetrically by the clip. */
  .hero__stagewrap {
    width: 100vw;
    margin-inline: calc(50% - 50vw);
  }

  .hero__stage {
    width: 145%;
    margin-inline: -22.5%;
  }

  .hero__fan { height: 40em; }
}

@media (max-width: 620px) {
  .hero__search {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "field field"
      "input submit";
    gap: 0.35rem;
    border-radius: 1.2rem;
    padding: 0.45rem;
  }

  .hero__search-field {
    grid-area: field;
    padding: 0 0.35rem;
  }

  .hero__search select {
    flex: 1 1 auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding-right: 0.25rem;
  }

  .hero__search-input { grid-area: input; padding: 0 0.65rem; }

  /* home.css's old phone hero turned this button into a 46px square;
     the label here needs its width back. */
  .hero__search-submit {
    grid-area: submit;
    width: 44px;
    min-width: 44px;
    padding: 0;
    justify-content: center;
    white-space: nowrap;
  }

  /* The icon carries the action on a phone; the word is what the
     input needs the room for. */
  .hero__search-submit span { display: none; }

  /* On a phone the inactive tabs collapse to their dots, but the tab
     that is actually counting down keeps its name on screen — a row of
     four anonymous dots does not tell you what the timer is running
     towards. */
  .hero__tab {
    gap: 0.4rem;
    padding: 0.35rem 0.55rem 0.55rem;
    white-space: nowrap;
  }

  .hero__tab-label { display: none; }
  .hero__tab-dot { display: block; }

  .hero__tab[aria-selected="true"] {
    padding-inline: 0.8rem;
    background: var(--accent-wash);
  }

  .hero__tab[aria-selected="true"] .hero__tab-label {
    display: inline;
    font-size: 0.8125rem;
    font-weight: 700;
  }

  .hero__tab[aria-selected="true"] .hero__tab-dot { display: none; }

  .hero__tab-progress {
    left: 0.5rem;
    right: 0.5rem;
    bottom: 0.16rem;
    height: 2.5px;
  }

  .hero__fan { height: 39em; }

  .hero + .home-section .home-display-m {
    font-size: clamp(1.4rem, 5.6vw, 1.85rem);
  }

  .home-section .home-eyebrow { font-size: 0.75rem; }
}

/* --- Laptop compaction ------------------------------------------
   A 1440×900 laptop has room for the copy and the fan side by side,
   not one under the other. Below 940px of viewport height (and above
   1080px of width) the hero becomes two columns: everything you read
   and act on on the left, the whole fan on the right, so the fanned
   cards are in the first screen instead of starting below the fold.
   Tall screens keep the stacked composition. */
@media (min-width: 1080px) and (max-height: 940px) {
  .home .hero {
    padding-top: calc(var(--nav-h-local, 60px) + 20px);
    padding-bottom: 0;
  }

  .hero__inner {
    display: grid;
    grid-template-columns: minmax(0, 0.84fr) minmax(0, 1.16fr);
    grid-template-areas:
      "eyebrow stage"
      "title   stage"
      "sub     stage"
      "actions stage"
      "search  stage"
      "controls stage"
      "live    stage";
    align-items: start;
    align-content: center;
    column-gap: clamp(24px, 3vw, 48px);
    row-gap: 0;
    text-align: left;
  }

  .hero__eyebrow { grid-area: eyebrow; justify-self: start; }

  .hero__title {
    grid-area: title;
    max-width: 18ch;
    margin: 0;
    font-size: clamp(2.35rem, 1.05rem + 2.3vw, 3.45rem);
  }

  .hero__rotator { justify-content: flex-start; }

  .hero__sub {
    grid-area: sub;
    max-width: 46ch;
    margin: 0.85rem 0 0;
  }

  .hero__actions {
    grid-area: actions;
    justify-content: flex-start;
    margin-top: 0.95rem;
  }

  .hero__search {
    grid-area: search;
    width: 100%;
    margin: 0.9rem 0 0;
  }

  .hero__controls {
    grid-area: controls;
    justify-content: flex-start;
    margin-top: 0.85rem;
  }

  /* The copy column is narrow here: the rail must stay on one line,
     so only the active slide keeps its label and the rest go back to
     dots (the same treatment the phone layout uses). */
  .hero__tabs { flex-wrap: nowrap; }

  .hero__tab {
    gap: 0.4rem;
    padding: 0.3rem 0.5rem 0.5rem;
    font-size: 0.78125rem;
    white-space: nowrap;
  }

  .hero__tab-label { display: none; }
  .hero__tab-dot { display: block; }

  .hero__tab[aria-selected="true"] { padding-inline: 0.8rem; }
  .hero__tab[aria-selected="true"] .hero__tab-label { display: inline; }
  .hero__tab[aria-selected="true"] .hero__tab-dot { display: none; }

  .hero__tab-progress { left: 0.5rem; right: 0.5rem; bottom: 0.16rem; }

  .hero__stagewrap {
    grid-area: stage;
    align-self: center;
    margin-top: 0;
    overflow: visible;
  }

  .hero__stage {
    width: 100%;
    margin-inline: 0;
  }

  .hero__fan { height: 40em; }

  /* The fade is measured against the stacked hero; in two columns the
     section below starts where the copy ends. */
  .hero__fade { height: 3rem; margin-top: 0.5rem; }
}

@media (prefers-reduced-motion: reduce) {
  .fan-card__float,
  .hero__pill-dot,
  .hero__accent { animation: none !important; transition: none !important; }

  .fan-card__sweep { display: none; }
}

/* --- Screenshot viewer -----------------------------------------
   Opened by clicking a card: pauses the slideshow and shows the same
   screen full size, with arrows to walk every slide and card. */
html.hero-modal-open { overflow: hidden; }

.hero-modal { position: fixed; inset: 0; z-index: 9000; display: grid; place-items: center; }
.hero-modal[hidden] { display: none; }

.hero-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(7, 19, 32, 0.76);
  backdrop-filter: blur(6px);
}

.hero-modal__dialog {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  width: min(94vw, 1180px);
  max-height: 92vh;
  overflow: hidden;
  border: 1px solid var(--line, var(--neutral-200, var(--neutral-200)));
  border-radius: 18px;
  background: var(--hero-surface, var(--white));
  box-shadow: 0 30px 80px -30px rgba(2, 8, 20, 0.7);
}

.hero-modal__bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px 10px 16px;
  border-bottom: 1px solid var(--line, var(--neutral-200, var(--neutral-200)));
}

.hero-modal__title {
  flex: 1 1 auto;
  font: 600 0.9rem/1.2 "Inter", var(--font-sans, system-ui), system-ui, sans-serif;
  color: var(--ink, #0f172a);
}

.hero-modal__count {
  font: 500 0.78rem/1 "Inter", var(--font-sans, system-ui), system-ui, sans-serif;
  color: var(--muted, var(--neutral-500, var(--neutral-500)));
  font-variant-numeric: tabular-nums;
}

.hero-modal__btn {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line, var(--neutral-200, var(--neutral-200)));
  border-radius: 9px;
  background: transparent;
  color: var(--ink, #0f172a);
  cursor: pointer;
}

.hero-modal__btn:hover { background: rgba(15, 23, 42, 0.06); }

.hero-modal__screen {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--hero-bg, var(--neutral-50, var(--neutral-50)));
  container-type: inline-size;
}

.hero-modal__img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}

.hero-modal__mockwrap { position: absolute; inset: 0; }
.hero-modal__mockwrap .mock { font-size: 1.9cqw; }

.hero-modal__nav {
  position: absolute;
  top: 50%;
  translate: 0 -50%;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line, var(--neutral-200, var(--neutral-200)));
  border-radius: 50%;
  background: var(--hero-surface, var(--white));
  color: var(--ink, #0f172a);
  cursor: pointer;
  box-shadow: 0 8px 24px -8px rgba(2, 8, 20, 0.45);
}

.hero-modal__nav--prev { left: 12px; }
.hero-modal__nav--next { right: 12px; }
.hero-modal__nav:hover { border-color: var(--accent, #0f766e); color: var(--accent, #0f766e); }

.hero-modal__btn:focus-visible,
.hero-modal__nav:focus-visible {
  outline: 2px solid var(--accent, #0f766e);
  outline-offset: 2px;
}

[data-theme="dark"] .hero-modal__dialog {
  --hero-surface: #0c1d2e;
  --line: #1e3a52;
  --ink: var(--neutral-100, var(--neutral-100));
  --muted: #9fb3c8;
}

@media (max-width: 620px) {
  .hero-modal__dialog { width: 100vw; max-height: 100dvh; border-radius: 0; }
  .hero-modal__nav { width: 40px; height: 40px; }
  .hero-modal__nav--prev { left: 8px; }
  .hero-modal__nav--next { right: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  .hero-modal__backdrop { backdrop-filter: none; }
}

/* --- Stat cards (per slide) ------------------------------------
   Built by hero-slider.js from the active slide's stats array, so
   the numbers under the fan always match the headline above. */
.hero__stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.7rem;
  width: min(100% - 40px, 1320px);
  margin: 1.15rem auto 0;
}

.hero__stat {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
  padding: 0.85rem 1rem 0.9rem 1.15rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--hero-surface);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
  transition: translate 0.35s cubic-bezier(0.16, 1, 0.3, 1),
    box-shadow 0.35s ease, border-color 0.3s ease;
}

/* Accent bar in the active slide's colour. */
.hero__stat::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--accent);
  transition: background-color 0.5s ease;
}

.hero__stat:hover {
  translate: 0 -3px;
  border-color: color-mix(in srgb, var(--accent) 55%, var(--line));
  box-shadow: 0 16px 34px -22px rgba(2, 8, 20, 0.5);
}

.hero__stat-value {
  font-family: "Inter", var(--font-sans, system-ui), system-ui, sans-serif;
  font-size: clamp(1.3rem, 1rem + 0.9vw, 1.75rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}

.hero__stat-label {
  font-family: "Inter", var(--font-sans, system-ui), system-ui, sans-serif;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--muted);
}

@media (max-width: 620px) {
  .hero__stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.55rem;
    width: min(100% - 32px, 1320px);
  }

  .hero__stat { padding: 0.7rem 0.8rem 0.75rem 0.95rem; }
  .hero__stat-label { font-size: 0.75rem; }
}

@media (prefers-reduced-motion: reduce) {
  .hero__stat { transition: none; }
}

/* Stat cards, part two: icon chip on the left, value + label right.
   The accent chip tints itself with the active slide's colour. */
.hero__stat {
  flex-direction: row;
  align-items: center;
  gap: 0.75rem;
}

.hero__stat-icon {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: color-mix(in srgb, var(--accent) 15%, transparent);
  color: var(--accent);
  transition: background-color 0.5s ease, color 0.5s ease;
}

.hero__stat-icon svg { display: block; width: 20px; height: 20px; }

.hero__stat-body {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

@media (max-width: 620px) {
  .hero__stat { gap: 0.6rem; }
  .hero__stat-icon { width: 34px; height: 34px; border-radius: 10px; }
  .hero__stat-icon svg { width: 18px; height: 18px; }
}
