/* ============================================================
   Landing page (QR target)
   Hero = truck counter (counter.css). Everything below the hero
   is copied from the Boycott landing (boycott/css/main.css):
   book-a-demo form, footer with CTA + reveal.
   ============================================================ */

/* ---------------- Hero: counter, fluid ---------------- */
/* --hero-p (0 -> 1, set by js/hero.js) drives the countdown-to-zero
   sequence: digits are painted by js, copy + button fade by css. */
:root { --hero-p: 0; }
html { scrollbar-gutter: stable; }

.hero {
  /* vh first as fallback, svh last so mobile browsers use the area that is
     actually visible under the address bar and toolbar */
  min-height: 100vh;
  min-height: 100svh;
  /* Side rails: same design as the footer's .cta__rail (1px marks,
     midnight-40, 80px apart, at the footer's inset), with the
     centre "on" mark in volt: 13×5 nib outside + 10×1 hairline. */
  --tick-w: 23px;
  --tick-gap: 80px;
  --tick-inset: clamp(1.5rem, 5.5vw, 80px);
}
.hero .counter-scene__lines {
  width: var(--tick-w);
  background:
    linear-gradient(to bottom,
      transparent calc(50% - 0.5px), var(--color-midnight-40) calc(50% - 0.5px),
      var(--color-midnight-40) calc(50% + 0.5px), transparent calc(50% + 0.5px))
    right 0 top 50% / var(--tick-w) var(--tick-gap) repeat-y;
}
.hero .counter-scene__lines::before { /* hairline, inner side */
  right: 0;
  width: 10px;
  height: 1px;
  margin-top: -0.5px;
}
.hero .counter-scene__lines::after {  /* nib, outer side */
  left: 0;
  width: 13px;
  height: 5px;
  margin-top: -2.5px;
}
.hero .counter { padding-inline: clamp(1.25rem, 8vw, 96px); }
.hero {
  /* Set by js/hero.js (eased per phase); fallbacks for no-js */
  --fade-out-t: 0;
  --fade-in-t: 0;
}
.hero .counter__time {
  font-size: clamp(3.5rem, 12.5vw, 180px);
  gap: clamp(0.5rem, 1.7vw, 24px);
}

.hero .counter__headline {
  font-size: clamp(1.375rem, 4vw, 56px);
  max-width: 20ch;
  margin-inline: auto;
}

/* Live and final states share one box; crossfade near the end.
   Digits keep racing while the live block dissolves. */
.hero .counter { display: grid; justify-items: center; align-items: center; }
.hero .counter > * { grid-area: 1 / 1; }

.counter__live {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  width: 100%;
  opacity: calc(1 - var(--fade-out-t));
}

.counter__final {
  /* Equal-height rows above and below the logo, so the logo's centre
     is the block's centre, which is the hero's centre: it lines up
     with the volt marks on the rails. */
  display: grid;
  grid-template-rows: 1fr auto 1fr;
  justify-items: center;
  gap: clamp(2.5rem, 10vh, 96px);
  width: 100%;
  opacity: var(--fade-in-t);
  pointer-events: none;
}
.hero.is-done .counter__final { pointer-events: auto; }

/* "Stop wasting time, switch to": CoFo Regular 40, volt */
.counter__zero {
  font-family: var(--font-secondary);
  font-weight: var(--weight-regular);
  font-size: clamp(1.375rem, 2.8vw, 40px);
  line-height: 1;
  color: var(--color-volt);
  text-align: center;
  align-self: end;
}

/* Big logo: 636×200 at desktop */
.counter__logo {
  width: min(636px, 72vw);
  height: auto;
}

/* Outline pill (Figma "Button / Pill Light"): 1px white, 15px Medium */
.btn.btn--outline {
  background: transparent;
  color: var(--color-white);
  border-color: var(--color-white);
  font-weight: var(--weight-medium);
  font-size: 15px;
  line-height: normal;
  letter-spacing: 0;
}
.btn.btn--outline:hover { background: rgba(255, 255, 255, 0.1); }

/* Reveal the button a beat after the block */
.hero__btn {
  align-self: start;
  opacity: var(--fade-in-t); /* fade only, no movement */
}

/* Scroll cue at the bottom (indicator only, not a control);
   gone as soon as the sequence fires */
.hero__cue {
  position: absolute;
  left: 50%;
  bottom: clamp(1.5rem, 6vh, 3.5rem);
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: var(--space-8);
  padding: var(--space-8) var(--space-12);
  color: var(--color-midnight-20);
  font-family: var(--font-secondary);
  font-size: 0.875rem;
  letter-spacing: 0.04em;
  opacity: clamp(0, (0.06 - var(--hero-p)) * 16.6667, 1);
  pointer-events: none;
  user-select: none;
}
.hero__cue svg { width: 16px; height: 16px; animation: nudge 2s var(--ease-in-out) infinite; }
@keyframes nudge { 0%,100% { transform: translateY(0); } 50% { transform: translateY(4px); } }
@media (prefers-reduced-motion: reduce) { .hero__cue svg { animation: none; } }

/* Mobile: keep the side ticks, narrower and tucked to the edges,
   and give the digits a touch less room so nothing overlaps */
@media (max-width: 720px) {
  .hero { --tick-inset: 12px; }
  .hero .counter { padding-inline: 40px; }
  .hero .counter__time { font-size: clamp(2rem, 11vw, 180px); gap: 0.12em; }
  .counter__logo { width: min(636px, 68vw); }
}

/* ---------------- Panels ---------------- */
.panels {
  background: var(--color-white);
  color: var(--text-primary);
  padding-block: var(--space-128) var(--space-96);
}

.panels__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-96);
}

.panels__title {
  font-family: var(--font-primary);
  font-weight: var(--weight-light);
  font-size: clamp(1.75rem, 3.5vw, var(--fs-h3));
  line-height: var(--lh-h3);
  letter-spacing: var(--tr-h3);
  color: var(--text-primary);
  text-align: center;
}

/* Demo section: H3 token; the centered form column sets the
   left edge the title follows. */
.panels__cta {
  width: min(630px, 100%);
  font-size: var(--fs-h3);
  line-height: var(--lh-h3);
  letter-spacing: var(--tr-h3);
  font-weight: var(--weight-light);
  text-align: left;
}

/* #demo anchor: lands 40px above the title, unaffected by the
   title's reveal transform (section padding-top is --space-128) */
.panels--demo { position: relative; padding-block: var(--space-128); } /* same top and bottom */
.panels__anchor {
  position: absolute;
  top: calc(var(--space-128) - 40px);
  left: 0;
  width: 1px;
  height: 1px;
}

/* No .container here: the narrow nav gutter, not the 160px one */
.panels--demo .panels__inner {
  gap: var(--space-48);
  align-items: center;
  width: 100%;
  padding-inline: var(--nav-pad);
}

/* ---- Book-a-demo form (no card, per Sphere Design ref) ---- */
.panels__form {
  width: min(630px, 100%);
  display: flex;
  flex-direction: column;
  gap: var(--space-24);
  color: var(--text-primary);
}

.form-field {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
}

.form-field label {
  font-size: var(--fs-body-md);
  line-height: var(--lh-body-md);
  color: var(--text-primary);
}

.form-field input,
.form-field select {
  font: inherit;
  color: var(--text-primary);
  background: var(--color-white);
  border: 1px solid var(--color-stone-80);
  border-radius: var(--radius-sm);
  padding: var(--space-16);
  width: 100%;
  transition: border-color var(--dur-fast) var(--ease-out);
}

.form-field input::placeholder { color: var(--color-midnight-20); }

.form-field select { appearance: none; }

.form-field select:invalid { color: var(--color-midnight-20); }

/* Custom chevron for the select */
.form-field select {
  background-image: linear-gradient(45deg, transparent 50%, var(--color-night) 50%),
    linear-gradient(135deg, var(--color-night) 50%, transparent 50%);
  background-position: calc(100% - 25px) 50%, calc(100% - 20px) 50%;
  background-size: 5px 5px;
  background-repeat: no-repeat;
}

.form-field input:focus-visible,
.form-field select:focus-visible {
  outline: none;
  border-color: var(--color-night);
  background: var(--color-stone-20);
}

.form-submit {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-16);
  margin-top: var(--space-8);
  padding: var(--space-16) var(--space-24);
  font-size: var(--fs-button);
  line-height: var(--lh-button);
  letter-spacing: var(--tr-button);
  color: var(--color-white);
  background: var(--color-night);
  border: none;
  border-radius: var(--radius-pill);
  transition: background-color var(--dur-fast) var(--ease-out);
}

.form-submit:hover { background: var(--color-midnight-80); }

/* ---------------- Buttons (from Ground Truth) ---------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-8);
  padding: 14px 24px;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  font-family: var(--font-secondary);
  font-weight: var(--weight-regular);
  font-size: var(--fs-button);
  line-height: var(--lh-button);
  letter-spacing: var(--tr-button);
  white-space: nowrap;
  transition: transform var(--dur-fast) var(--ease-out),
              background-color var(--dur-fast) var(--ease-out),
              border-color var(--dur-fast) var(--ease-out),
              opacity var(--dur-fast) var(--ease-out);
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

/* White pill for dark backgrounds (no border) */
.btn--invert {
  background: var(--color-white);
  color: var(--color-night);
}
.btn--invert:hover { background: var(--color-stone-40); }

/* ---------------- Footer (from Ground Truth) ---------------- */
.footer {
  position: relative;
  overflow: hidden;
  background: var(--color-night);
  color: var(--color-white);
}

/* Site container: max 1416px, 48px gutters, centred (1440 → 60px
   from the edges, 1728 → 204px, 1280 → 48px) */
.site-container {
  width: 100%;
  max-width: 1416px;
  margin-inline: auto;
  padding-inline: 48px;
}

/* --- CTA (1:1 with the site's footer CTA at 1440) ---
   Section: min-height 633, padding 144 top / 96 bottom, text at the
   top and the button pinned to the bottom. --------------------- */
.cta {
  position: relative;
  z-index: 1;
  min-height: 633px;
  padding-block: 144px 96px; /* site: md:pt-36 md:pb-24 (fixed) */
  display: flex;
  flex-direction: column;
}
.cta__wrap {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.cta__info {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-48);
  padding-inline: 88px; /* site: text sits 88px inside the container */
}
.cta__txt {
  display: flex;
  flex-direction: column;
  max-width: 860px;
}
/* Cambon Light 68 / 68, -0.018em (site: text-68px-heading) */
.cta__title {
  font-family: var(--font-primary);
  font-weight: var(--weight-light);
  font-size: 68px; /* site: text-68px-heading, fixed from md up */
  line-height: 1;
  letter-spacing: -0.018em;
  color: var(--color-white);
}
/* Cambon Light 22 / 1.2, -0.02em, 80%, 24px below the title */
.cta__sub {
  margin-top: var(--space-24);
  max-width: 500px;
  font-family: var(--font-primary);
  font-weight: var(--weight-light);
  font-size: 22px; /* site: md:text-[1.375rem] */
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--color-white);
  opacity: 0.8;
}
/* Print-in title (js/reveal.js + js/card-dance-worker.js): characters
   fade in by position while the Card Dance strip sweeps each line. */
.print__probe { display: block; }
.print__stage { display: block; }
.print__line { position: relative; display: block; }
.print__text { white-space: pre; }
.print__char { opacity: 0; }
.print__overlay {
  position: absolute;
  left: 0;
  top: 0;
  bottom: -8%;
  width: 100%;
  overflow: hidden;
  pointer-events: none;
  z-index: 1;
}
.print__canvas { position: absolute; inset: 0; display: block; width: 100%; height: 100%; }
.is-printed .print__overlay { display: none; }
@media (prefers-reduced-motion: reduce) { .print__char { opacity: 1; } .print__overlay { display: none; } }

/* White pill, 10×20 padding, 46 tall (site "Get a demo") */
.cta__btn { padding: 10px 20px; min-height: 46px; border: 0; } /* site button has no border */

/* Device rails: 60px from the edges, five 15×1 white marks spread
   from the title's first line to the button's centre (84px apart at
   1440). The "on" mark (left rail, last) is a 15×5 nib plus a 15×1
   hairline on the inner side. */
.cta__rail {
  position: absolute;
  left: 48px;   /* container gutter */
  top: 36px;    /* first mark (site: 180 from the section top) */
  bottom: 22px; /* last mark (site: 514 from the section top) */
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-start;
}
.cta__rail--right { left: auto; right: 48px; }
/* Each mark is a 1px hairline; the "on" mark adds a 15×5 nib on the
   outer side, centred on the hairline (site: nib 512–517, line 514) */
.rail__mark { position: relative; height: 1px; flex-shrink: 0; }
.rail__off  { display: block; width: 15px; height: 1px; background: var(--color-white); }
.rail__on   { display: block; position: relative; width: 30px; height: 1px; color: var(--color-white); }
.rail__on i { position: absolute; display: block; background: currentColor; }
.rail__on i:first-child { left: 0; top: -2px; width: 15px; height: 5px; }
.rail__on i:last-child  { left: 15px; top: 0; width: 15px; height: 1px; }

/* --- Bottom bar: 1:1 with the site footer at 1440 ---------------
   padding-top 80, 60px side gutters, logo (108 wide) left, nav
   right-aligned in a 1008px box with 48px gaps, copyright centred
   at the bottom (footer 678 tall). ----------------------------- */
.foot {
  position: relative;
  z-index: 1;
  min-height: 678px;
  padding: 80px 0 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: var(--space-48);
}
.foot__inner {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-48);
}

/* Spokes: centred, the graphic's centre 228px below the footer's
   bottom edge (site: bottom -250% of a 420px block), rotating once
   every 30s. The footer clips it. */
.foot__spokes {
  position: absolute;
  left: 50%;
  bottom: -1050px;
  width: 1641px;
  height: 1645px;
  margin-left: -820.5px;
  pointer-events: none;
  z-index: 0;
}
.foot__spin {
  display: block;
  width: 100%;
  height: 100%;
  animation: foot-spin 30s linear infinite;
}
.foot__spin img { display: block; width: 100%; height: 100%; max-width: none; }
@keyframes foot-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .foot__spin { animation: none; } }

/* Logo: 32px mark + wordmark, 6px apart. Hover: the 24 spokes swell
   to 1.1 from the centre, one after another (20ms apart), on the
   site's spring curve. */
.foot__logo {
  flex: 1;
  max-width: 108px;
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--color-white);
  scale: 1;
  transition: scale 200ms var(--ease-out);
}
.foot__logo:active { scale: 0.97; }
.foot__mark { width: 32px; height: 32px; display: block; flex: none; }
.foot__mark svg { width: 100%; height: 100%; overflow: visible; }
.foot__mark .spoke {
  fill: currentColor;
  transform-box: view-box;
  transform-origin: center;
  scale: 1;
  transition: scale 700ms linear(0, .015 1%, .06 2.2%, .44 9.1%, .64 14%, .722 16.8%, .792 19.9%, .849 23.3%, .893 27%, .927 31.1%, .953 35.7%, .984 47.5%, .997 64.6%, 1);
}
.foot__logo:hover .spoke { scale: 1.1; }
.foot__wordmark { width: 65px; height: 20px; display: block; }
@media (prefers-reduced-motion: reduce) {
  .foot__mark .spoke, .foot__logo { transition: none; }
}

/* Nav: columns are content-width, 48px apart, pushed to the right */
.foot__nav {
  flex: 1;
  max-width: 1008px;
  display: flex;
  justify-content: flex-end;
  gap: 48px;
}
.foot__cols { flex: 1; display: flex; gap: 48px; } /* columns share the free space, like the site */
.foot__col { flex: auto; }
.foot__col--social { flex: none; }
.foot__heading {
  margin-bottom: 24px;
  font-family: var(--font-secondary);
  font-size: var(--fs-button);
  line-height: var(--lh-button);
  letter-spacing: var(--tr-button);
  color: #8a8f8a;
}
.foot__list { display: flex; flex-direction: column; gap: 12px; }
.foot__list li { display: flex; align-items: center; gap: 12px; }
.foot__link {
  font-family: var(--font-secondary);
  font-size: var(--fs-button);
  line-height: var(--lh-button);
  letter-spacing: var(--tr-button);
  color: var(--color-white);
  transition: opacity var(--dur-fast) var(--ease-out);
}
.foot__link:hover { opacity: 0.8; }
/* "Coming soon" pill: midnight-80, 8px uppercase */
.foot__badge {
  display: inline-flex;
  align-items: center;
  min-height: 17px;
  padding: 1px 8px;
  border-radius: var(--radius-pill);
  background: var(--color-midnight-80);
  font-family: var(--font-secondary);
  font-size: 8px;
  line-height: 1;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--color-white);
}
/* Social buttons (site): 32px, white/4%, radius 6, a 1px ring with a
   mint gradient at 30%, hover white/10%, press scale .95 */
.foot__social { display: flex; gap: 12px; }
.foot__social-btn {
  position: relative;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--color-white);
  scale: 1;
  transition: background-color var(--dur-base) var(--ease-out), scale var(--dur-base) var(--ease-out);
}
.foot__social-btn:hover { background: rgba(255, 255, 255, 0.1); }
.foot__social-btn:active { scale: 0.95; }
.foot__social-ring {
  position: absolute;
  inset: 0;
  border-radius: 6px;
  padding: 1px;
  opacity: 0.3;
  pointer-events: none;
  background: linear-gradient(180deg, #DCF8DA 0%, rgba(8, 9, 10, 0) 50%, #DCF8DA 100%);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask-composite: exclude;
}
.foot__social-icon { display: block; line-height: 0; }
.foot__social-icon svg { display: block; }
.foot__copy {
  position: relative;
  z-index: 1;
  font-family: var(--font-secondary);
  font-size: var(--fs-body);
  line-height: 1.15;
  color: var(--color-midnight-40);
  text-align: center;
}

/* Below lg the site stacks: logo above, columns in a 2/3-col grid */
@media (max-width: 1024px) {
  .foot__inner { flex-direction: column; gap: 48px; }
  .foot__logo { max-width: none; flex: none; }
  .foot__nav { max-width: none; flex-direction: column; justify-content: flex-start; }
  .foot__cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; }
}
@media (max-width: 640px) {
  .foot__cols { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .cta__rail { display: none; }
  .cta { min-height: 0; padding-block: 80px; }   /* site: py-20, min-height only from md up */
  .cta__info { padding-inline: 0; }
  .site-container { padding-inline: 20px; }
  .cta__title { font-size: 40px; }
  .cta__sub { font-size: 16px; }
  .foot { min-height: 0; }
}

/* The footer sits in normal flow (the site does the same). The old
   "footer reveal" from Ground Truth is gone: at 1311px the footer is
   taller than most viewports, so pinning it cut the CTA off. */
.js main { position: relative; z-index: 1; background: var(--bg-page); }

/* ---------------- Reveal on scroll ---------------- */
.js [data-reveal] {
  opacity: 0;
  transform: translateY(20px);
  transition:
    opacity var(--dur-slow) var(--ease-out),
    transform var(--dur-slow) var(--ease-out);
}

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

@media (prefers-reduced-motion: reduce) {
  .js [data-reveal] { opacity: 1; transform: none; transition: none; }
}
