/* =============================================================================
   Component layer, loaded last on every page.

   Raises the shared pieces (buttons, cards, focus, scrollbars) and styles the
   sections that carry trust: the business-type strip, example demos, founder,
   questions and the footer's legal block. It uses only the tokens in
   verity.css, so light and dark stay one design.
   ========================================================================== */

:root {
  --up-ease: cubic-bezier(.22, .61, .36, 1);
  --up-spring: cubic-bezier(.34, 1.36, .64, 1);
  --up-ok: #1f9d55;
}
[data-theme="dark"] { --up-ok: #30d158; }

/* ------------------------------------------------------------- buttons --- */
.btn--primary, .btn--fill {
  position: relative;
  background-image: linear-gradient(180deg, rgba(255,255,255,0.16), rgba(255,255,255,0) 55%);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.22),
    0 1px 2px rgba(10,60,140,0.24),
    0 8px 20px -8px rgba(10,132,255,0.55);
  transition:
    background-color .2s var(--up-ease),
    box-shadow .25s var(--up-ease),
    transform .25s var(--up-spring);
}
.btn--primary:hover, .btn--fill:hover {
  transform: translateY(-1px);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.24),
    0 2px 4px rgba(10,60,140,0.24),
    0 14px 28px -10px rgba(10,132,255,0.6);
}
.btn--secondary {
  box-shadow: var(--elev-low);
  transition: border-color .2s var(--up-ease), box-shadow .25s var(--up-ease), transform .25s var(--up-spring);
}
.btn--secondary:hover { transform: translateY(-1px); box-shadow: var(--elev-mid); border-color: var(--ink-muted); }
.btn:active, .btn--primary:active, .btn--fill:active, .btn--secondary:active { transform: translateY(0) scale(0.98); }
.btn svg { transition: transform .3s var(--up-spring); }
.btn:hover svg { transform: translateX(3px); }

/* One focus ring for everything a keyboard can reach. */
a:focus-visible, button:focus-visible, summary:focus-visible, .btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}

/* Browser surfaces carry the design too. */
html { scrollbar-color: color-mix(in srgb, var(--ink) 22%, transparent) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--ink) 18%, transparent); border-radius: 10px; border: 3px solid var(--base); }
::-webkit-scrollbar-thumb:hover { background: color-mix(in srgb, var(--ink) 30%, transparent); }
input, textarea { caret-color: var(--accent); }

/* ------------------------------------------------------ spotlight cards --- */
/* A soft light follows the pointer across a card (js/ui.js sets --mx/--my).
   Without a pointer, or with reduced motion, the card is simply a card. */
.up-spot, .xp-card > a, .x-ind-card a {
  position: relative;
  isolation: isolate;
}
.up-spot::before, .xp-card > a::before, .x-ind-card a::before {
  content: "";
  position: absolute; inset: 0;
  border-radius: inherit;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, -40%), var(--accent-a14), transparent 60%);
  opacity: 0;
  transition: opacity .35s var(--up-ease);
  pointer-events: none;
  z-index: -1;
}
.up-spot:hover::before, .xp-card > a:hover::before, .x-ind-card a:hover::before { opacity: 1; }

/* ------------------------------------------------ business-type strip --- */
.up-strip {
  padding-block: 28px 30px;
  border-block: 1px solid var(--line);
  background: var(--surface);
  overflow: hidden;
}
.up-strip-label { text-align: center; color: var(--ink-muted); margin: 0 0 16px; }
.up-marquee {
  display: flex; width: 100%;
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.up-marquee-track {
  display: flex; flex: none; gap: 10px;
  margin: 0; padding: 0 5px; list-style: none;
  animation: up-scroll 60s linear infinite;
}
.up-marquee:hover .up-marquee-track, .up-marquee:focus-within .up-marquee-track { animation-play-state: paused; }
.up-marquee-track a {
  display: inline-flex; align-items: center;
  padding: 9px 16px; border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--base);
  font-size: 14px; color: var(--ink); white-space: nowrap;
  transition: border-color .2s var(--up-ease), color .2s var(--up-ease), background-color .2s var(--up-ease);
}
.up-marquee-track a:hover { border-color: var(--accent); color: var(--accent-text); background: var(--accent-a08); }
@keyframes up-scroll { to { transform: translateX(-100%); } }
@media (prefers-reduced-motion: reduce) {
  .up-marquee { mask-image: none; -webkit-mask-image: none; }
  .up-marquee-track { animation: none; flex: 1; flex-wrap: wrap; justify-content: center; padding-inline: var(--gutter); }
  .up-marquee-track[aria-hidden="true"] { display: none; }
}

/* ------------------------------------------------------- example demos --- */
.up-head { display: grid; gap: 20px; margin-bottom: clamp(40px, 5vw, 64px); }
@media (min-width: 960px) { .up-head { grid-template-columns: 1fr 1fr; align-items: end; gap: 80px; } }
.up-head .h-lg { max-width: 16ch; margin: 0; }
.up-head-deck { max-width: 46ch; }

.up-story-grid {
  display: grid; gap: 16px;
  margin: 0; padding: 0; list-style: none;
}
@media (min-width: 960px) {
  .up-story-grid { grid-template-columns: 1.25fr 1fr; grid-template-rows: auto auto; }
  .up-story--big { grid-row: span 2; }
}
.up-story > a {
  display: flex; flex-direction: column; gap: 18px; height: 100%;
  padding: clamp(24px, 3vw, 36px);
  border: 1px solid var(--line); border-radius: var(--r-panel);
  background: var(--surface);
  box-shadow: var(--elev-low);
  color: var(--ink);
  transition: border-color .25s var(--up-ease), box-shadow .3s var(--up-ease), transform .3s var(--up-spring);
}
.up-story > a:hover { border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); box-shadow: var(--elev-mid); transform: translateY(-2px); }
.up-story > a:active { transform: translateY(0) scale(0.995); }
.up-story-tag {
  align-self: flex-start;
  padding: 5px 10px; border-radius: 999px;
  background: var(--base-alt); color: var(--ink-muted);
  font-size: 12px; letter-spacing: 0.01em;
}
.up-story-title { font-size: clamp(22px, 2.2vw, 30px); line-height: 1.15; font-weight: 300; letter-spacing: -0.025em; text-wrap: balance; }
.up-story-pair { display: grid; gap: 14px; font-size: 14.5px; line-height: 1.55; color: var(--ink-body); }
@media (min-width: 640px) { .up-story--big .up-story-pair { grid-template-columns: 1fr 1fr; gap: 24px; } }
.up-story-k { display: block; margin-bottom: 4px; font-size: 12px; font-weight: 500; color: var(--ink); }
.up-story-pair > span:last-child .up-story-k { color: var(--accent-text); }
.up-story-link { margin-top: auto; display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 500; color: var(--accent-text); }
.up-story-link svg { transition: transform .3s var(--up-spring); }
.up-story > a:hover .up-story-link svg { transform: translateX(4px); }

/* The illustrative lot screen inside the large example. */
.up-mini {
  display: grid; gap: 10px;
  padding: 16px 18px;
  border: 1px solid var(--line); border-radius: 12px;
  background: var(--base);
  font-size: 13px; color: var(--ink-body);
}
.up-mini-head { display: flex; justify-content: space-between; align-items: center; font-weight: 500; color: var(--ink); margin-bottom: 2px; }
.up-live { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-muted); }
.up-live::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--up-ok); box-shadow: 0 0 0 3px color-mix(in srgb, var(--up-ok) 22%, transparent); }
.up-mini-row { display: grid; grid-template-columns: 78px 1fr 48px; align-items: center; gap: 12px; }
.up-mini-row > span:last-child { text-align: right; font-variant-numeric: tabular-nums; color: var(--ink); }
.up-bar { height: 6px; border-radius: 6px; background: var(--line); overflow: hidden; }
.up-bar i { display: block; height: 100%; width: var(--w); border-radius: inherit; background: var(--accent); }
.up-mini-foot { display: flex; justify-content: space-between; padding-top: 10px; border-top: 1px solid var(--line); }
.up-mini-foot b { font-weight: 500; color: var(--ink); font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------- founder --- */
.up-founder-grid { display: grid; gap: clamp(40px, 6vw, 96px); align-items: center; }
@media (min-width: 900px) { .up-founder-grid { grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); } }
.up-founder-photo {
  margin: 0; position: relative;
  max-width: 440px; width: 100%;
  border-radius: 22px; overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: var(--elev-high);
  background: var(--surface);
}
.up-founder-photo img { display: block; width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; filter: saturate(0.92) contrast(1.02); }
.up-founder-photo figcaption {
  position: absolute; left: 14px; right: 14px; bottom: 14px;
  display: grid; gap: 2px;
  padding: 12px 16px; border-radius: 14px;
  background: var(--surface-floating);
  -webkit-backdrop-filter: blur(16px) saturate(1.4); backdrop-filter: blur(16px) saturate(1.4);
  border: 1px solid color-mix(in srgb, var(--surface) 60%, transparent);
  font-size: 13px; color: var(--ink-body);
}
.up-founder-photo figcaption b { font-size: 15px; font-weight: 500; color: var(--ink); }
@media (prefers-reduced-transparency: reduce) { .up-founder-photo figcaption { background: var(--surface); -webkit-backdrop-filter: none; backdrop-filter: none; } }
.up-founder-copy .h-lg { margin: 0; max-width: 14ch; }
.up-founder-note { margin-top: 22px; max-width: 54ch; }
.up-founder-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }

/* ----------------------------------------------------------- questions --- */
.up-faq-grid { display: grid; gap: 40px; }
@media (min-width: 960px) { .up-faq-grid { grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: 80px; } .up-faq-head { position: sticky; top: 112px; align-self: start; } }
.up-faq-head .h-lg { margin: 0 0 18px; max-width: 12ch; }
.up-link { color: var(--accent-text); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.up-faq-list { border-top: 1px solid var(--line); }
.up-q { border-bottom: 1px solid var(--line); }
.up-q summary {
  display: flex; justify-content: space-between; align-items: center; gap: 24px;
  padding: 22px 2px; min-height: 44px;
  font-size: 17px; font-weight: 400; color: var(--ink);
  cursor: pointer; list-style: none;
  transition: color .2s var(--up-ease);
}
.up-q summary::-webkit-details-marker { display: none; }
.up-q summary:hover { color: var(--accent-text); }
.up-q-icon { position: relative; flex: none; width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--line); transition: background-color .2s var(--up-ease), border-color .2s var(--up-ease), transform .35s var(--up-spring); }
.up-q-icon::before, .up-q-icon::after { content: ""; position: absolute; left: 50%; top: 50%; width: 10px; height: 1.5px; margin: -0.75px 0 0 -5px; border-radius: 2px; background: currentColor; }
.up-q-icon::after { transform: rotate(90deg); transition: transform .35s var(--up-spring); }
.up-q[open] .up-q-icon { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); transform: rotate(180deg); }
.up-q[open] .up-q-icon::after { transform: rotate(0deg); }
.up-q-a p { margin: 0 0 22px; max-width: 62ch; font-size: 15.5px; line-height: 1.65; color: var(--ink-body); }
@supports (interpolate-size: allow-keywords) {
  .up-q { interpolate-size: allow-keywords; }
  .up-q::details-content { height: 0; overflow: clip; transition: height .35s var(--up-ease), content-visibility .35s allow-discrete; }
  .up-q[open]::details-content { height: auto; }
}

/* ------------------------------------------------------------- footer --- */
.pf-foot-legal { margin-top: 18px; font-style: normal; line-height: 1.7; color: var(--ink-muted); }

/* Wage rows in the large example: who, what, pieces, pay. */
.up-mini-sub { font-weight: 400; font-size: 12px; color: var(--ink-muted); }
.up-mini-pay { display: grid; grid-template-columns: 28px 1fr auto 72px; align-items: center; gap: 12px; }
.up-mini-pay > span:nth-child(3) { color: var(--ink-muted); font-variant-numeric: tabular-nums; }
.up-mini-pay b { text-align: right; font-weight: 500; color: var(--ink); font-variant-numeric: tabular-nums; }
.up-av { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--accent-a14); color: var(--accent-text); font-size: 11px; font-weight: 500; }

/* ================================================================ hero === */
/* At rest the hero is a clean field: slow light, a faint grid, the promise.
   Scrolling hands over to the assembling product screen (hero-assemble.js),
   so every layer here fades out against the same --p the scrub drives. */

.up-aurora, .up-hero-grid { position: absolute; inset: 0; z-index: 1; pointer-events: none; opacity: calc(1 - var(--p, 0) * 1.8); }
.up-aurora { overflow: hidden; }
.up-aurora i {
  position: absolute; border-radius: 50%;
  filter: blur(70px);
  will-change: transform;
}
.up-aurora i:nth-child(1) { width: 46vw; height: 46vw; left: -8vw; top: -14vw; background: color-mix(in srgb, var(--accent) 26%, transparent); animation: up-drift-a 22s ease-in-out infinite alternate; }
.up-aurora i:nth-child(2) { width: 38vw; height: 38vw; right: -10vw; top: 4vw; background: color-mix(in srgb, #5ac8fa 24%, transparent); animation: up-drift-b 26s ease-in-out infinite alternate; }
.up-aurora i:nth-child(3) { width: 34vw; height: 34vw; left: 30vw; bottom: -22vw; background: color-mix(in srgb, var(--accent) 16%, transparent); animation: up-drift-c 30s ease-in-out infinite alternate; }
@keyframes up-drift-a { to { transform: translate3d(9vw, 6vw, 0) scale(1.12); } }
@keyframes up-drift-b { to { transform: translate3d(-8vw, 7vw, 0) scale(0.92); } }
@keyframes up-drift-c { to { transform: translate3d(-6vw, -5vw, 0) scale(1.08); } }

.up-hero-grid {
  background:
    linear-gradient(var(--grid-line) 1px, transparent 1px) 0 0 / 56px 56px,
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px) 0 0 / 56px 56px;
  mask-image: radial-gradient(70% 60% at 50% 46%, #000 20%, transparent 80%);
  -webkit-mask-image: radial-gradient(70% 60% at 50% 46%, #000 20%, transparent 80%);
}

.up-hero { gap: 26px; }
.up-hero .up-hero-h1 {
  display: flex; flex-direction: column; align-items: center;
  max-width: none;
  font-size: clamp(40px, 5.2vw, 80px);
  line-height: 1.04;
  letter-spacing: -0.04em;
  color: var(--ink);
}
.up-hero .up-hero-h1 > span:first-child { color: var(--ink-muted); }
.up-hero .hero-sub { max-width: 600px; }

/* The cycling business type. A single line box, so the headline never jumps. */
.up-rotor { position: relative; display: inline-grid; height: 1.08em; overflow: hidden; color: var(--accent-text); padding-inline: 0.04em; }
.up-rotor-word { grid-area: 1 / 1; white-space: nowrap; }
.up-rotor-word.is-in { animation: up-word-in .7s var(--up-spring) both; }
/* The outgoing word leaves the layout, so the line takes the new word's
   width at once and the sentence stays centred. */
.up-rotor-word.is-out { position: absolute; left: 50%; top: 0; translate: -50% 0; animation: up-word-out .45s var(--up-ease) both; }
@keyframes up-word-in { from { transform: translateY(70%); opacity: 0; filter: blur(8px); } }
@keyframes up-word-out { to { transform: translateY(-70%); opacity: 0; filter: blur(8px); } }
.up-rotor { overflow: visible; clip-path: inset(0 -100vw); height: 1.2em; line-height: 1.2em; }

/* Announcement pill: the offer, one tap from the form. */
.up-pill {
  position: relative;
  display: inline-flex; align-items: center; gap: 10px;
  padding: 8px 16px 8px 12px; border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--elev-low);
  font-size: 13.5px; color: var(--ink);
  transition: border-color .25s var(--up-ease), box-shadow .25s var(--up-ease), transform .3s var(--up-spring);
}
.up-pill:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); box-shadow: var(--elev-mid); transform: translateY(-1px); }
.up-pill svg { color: var(--accent-text); transition: transform .3s var(--up-spring); }
.up-pill:hover svg { transform: translateX(3px); }
.up-pill-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--up-ok); box-shadow: 0 0 0 0 color-mix(in srgb, var(--up-ok) 50%, transparent); animation: up-ping 2.4s var(--up-ease) infinite; }
@keyframes up-ping { 70%, 100% { box-shadow: 0 0 0 8px transparent; } }

/* A light that runs round the primary button's edge. */
@property --up-a { syntax: "<angle>"; initial-value: 0deg; inherits: false; }
.up-beam { overflow: visible; }
.up-beam::after {
  content: ""; position: absolute; inset: -2px; border-radius: calc(var(--r-control) + 2px);
  padding: 2px;
  background: conic-gradient(from var(--up-a), transparent 0 70%, rgba(255,255,255,0.9) 82%, #5ac8fa 88%, transparent 96%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  animation: up-spin 3.2s linear infinite;
  pointer-events: none;
}
@keyframes up-spin { to { --up-a: 360deg; } }

.up-trust { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 22px; margin: 4px 0 0; padding: 0; list-style: none; font-size: 13.5px; color: var(--ink-muted); }
.up-trust li { display: inline-flex; align-items: center; gap: 7px; }
.up-trust li::before {
  content: ""; width: 14px; height: 14px; flex: none;
  background: var(--up-ok);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3 8.5l3.2 3L13 4.5' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%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 16 16'%3E%3Cpath d='M3 8.5l3.2 3L13 4.5' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* Entrance: each line rises out of a soft blur, one after the other. */
.up-in { animation: up-rise .9s var(--up-ease) both; animation-delay: calc(var(--d, 0) * 90ms + 120ms); }
@keyframes up-rise { from { opacity: 0; transform: translateY(18px); filter: blur(8px); } }

@media (max-width: 720px) {
  .up-hero .up-hero-h1 { font-size: clamp(34px, 9vw, 44px); }
  .up-hero .up-hero-h1 > span { text-wrap: balance; }
  .up-trust { font-size: 12.5px; gap: 6px 14px; }
}
@media (prefers-reduced-motion: reduce) {
  .up-aurora i, .up-pill-dot, .up-beam::after, .up-in, .up-rotor-word { animation: none !important; }
}
