/* =========================================================
   Spacing + overlap fixes layered over core.css / sections.css
   These are surgical fixes, not redesigns.
   ========================================================= */

/* ---------- Performance: skip rendering for the heaviest off-screen blocks ----------
   The browser defers layout/paint for sections that are not in the viewport,
   then renders them just-in-time as they scroll into view. Applied only to the
   heaviest grids — avoids interfering with rail (01-05) IntersectionObserver. */
.work-grid, .compare-table, .reviews-track {
  content-visibility: auto;
  contain-intrinsic-size: 1px 900px;
}

/* Tighten up word kerning on the heavy display headline — the original
   margin-right of 0.18em ate spaces on Archivo Black at large sizes */
.h-hero .word { margin-right: 0.32em; }
.h-hero .word:last-child { margin-right: 0; }

/* Fix word baseline shift caused by translateY animation while the inner
   span is opacity:0 — give it a stable baseline so layout doesn't jump */
.h-hero .word { line-height: 1; }
.h-hero { line-height: 0.94; }

/* Section title word spacing on the same heavy display font */
.sec-title { line-height: 0.98; }
.manifesto-quote { line-height: 1; }

/* Ghost echo was hugging the title too tight — ease it down */
.sec-head .ghost { margin-top: -0.05em; opacity: 0.55; }

/* Hero geometry — give content vertical breathing room, never clip CTAs */
.hero {
  top: calc(var(--safe-y) + 96px);
  bottom: calc(var(--safe-y) + 80px);
  gap: 56px;
  overflow: visible;
}
.hero-content { max-width: min(880px, 65vw); overflow: visible; min-height: 0; }
.hero-ctas { position: relative; z-index: 8; }

/* Headline — cap the max font-size much lower so the CTAs always sit inside
   the hero on a 1080p / 1440p / 1920p viewport. The original 132px max
   meant the hero overflowed and the trusted-by negative margin then ate
   the buttons. */
.h-hero {
  font-size: clamp(38px, 6.4vw, 88px);
  line-height: 0.96;
  letter-spacing: -0.02em;
}
.hero-sub {
  font-size: clamp(13.5px, 1vw, 15.5px);
  max-width: 52ch;
  margin-top: clamp(14px, 2vh, 22px);
  line-height: 1.55;
}
.hero-ctas { margin-top: clamp(18px, 2.6vh, 28px); }

/* Trusted-by — was overlapping the hero CTAs by 120px which is exactly
   where the buttons sit. Cut the overlap so CTAs are always visible. */
.trusted-sec {
  margin-top: 0;
  padding-top: 56px;
  padding-bottom: 48px;
}
.trusted-sec::before {
  background: linear-gradient(180deg, transparent 0%, rgba(14,14,14,0.7) 60%, var(--bg) 100%);
}

/* Spin card scales down on shorter viewports so it never pushes the CTAs */
@media (max-height: 880px) {
  .spin-card { width: 200px; height: 200px; }
  .spin-card .core { width: 110px; height: 110px; }
  .spin-card .core .ar-logo { width: 56px; height: 56px; }
}
@media (max-height: 760px) {
  .spin-card { width: 170px; height: 170px; }
  .spin-card .core { width: 92px; height: 92px; }
  .spin-card .core .ar-logo { width: 46px; height: 46px; }
}

/* Eyebrow pill margin tuned */
.eyebrow { margin-bottom: clamp(20px, 3vh, 32px); letter-spacing: 0.18em; }
.eyebrow .num { letter-spacing: 0.18em; }

/* Hero CTA spacing — inline-flex was leaving CTAs sticking together on smaller widths */
.hero-ctas { gap: 16px; flex-wrap: wrap; }

/* Spin card — pull off the right edge a touch so it doesn't kiss the timecode */
.spin-card { margin-right: 8px; margin-bottom: 8px; }

/* Timecode — move it down enough that it never collides with the nav even on tall content */
.timecode { top: calc(var(--safe-y) + 72px); }

/* Nav — keep the CTA visible on standard widths by trimming padding and
   collapsing the status meta on narrower viewports */
.nav { padding: 8px 10px 8px 16px; gap: 14px; }
.nav .brand { padding-right: 14px; font-size: 12.5px; }
.nav-links { gap: 2px; }
.nav-links a { padding: 7px 12px; font-size: 12.5px; }
.nav-meta { font-size: 10.5px; letter-spacing: 0.16em; }
.nav-cta { padding: 9px 16px; font-size: 12px; }
@media (max-width: 1240px) {
  .nav-meta { display: none; }
}
@media (max-width: 1080px) {
  .nav-links a { padding: 6px 9px; font-size: 12px; }
  .nav .brand { padding-right: 10px; font-size: 12px; }
}

/* Side rail — minimal numbered indicator at the very edge of the viewport.
   z-index 100 so it survives every section, including the trusted-by gradient
   and the .page stacking context. Backdrop-blur so the badges always read. */
.rail {
  position: fixed;
  left: clamp(10px, 1.4vw, 22px);
  top: 50%;
  transform: translateY(-50%);
  transform-origin: unset;
  display: flex;
  flex-direction: column;
  gap: 14px;
  font-family: var(--font-sans);
  font-size: 0;
  letter-spacing: 0;
  text-transform: uppercase;
  color: transparent;
  white-space: nowrap;
  z-index: 100;
  width: 32px;
  align-items: center;
  isolation: isolate;
}
.rail::before {
  content: '';
  position: absolute;
  inset: -10px -8px;
  background: rgba(10, 10, 10, 0.35);
  backdrop-filter: blur(8px) saturate(1.2);
  -webkit-backdrop-filter: blur(8px) saturate(1.2);
  border-radius: 999px;
  z-index: -1;
  pointer-events: none;
}
.rail .item {
  display: flex;
  align-items: center;
  gap: 0;
  opacity: 0.5;
  transition: opacity 0.3s ease, color 0.3s ease;
  cursor: pointer;
  position: relative;
  font-size: 0;
}
/* Hide the inline label text — keep the badge only */
.rail .item > :not(.num) {
  position: absolute;
  left: 30px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: var(--ink-2);
  text-transform: uppercase;
  white-space: nowrap;
  opacity: 0;
  transform: translateX(-6px);
  transition: opacity 0.25s ease, transform 0.25s ease;
  pointer-events: none;
  background: rgba(22, 22, 22, 0.85);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 4px 8px;
  backdrop-filter: blur(10px);
}
.rail .item:hover > :not(.num) { opacity: 1; transform: translateX(0); }
.rail .item.is-current { opacity: 1; }
.rail .item .num {
  background: rgba(255,255,255,0.10);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 4px;
  padding: 3px 6px;
  font-size: 9.5px;
  color: var(--ink-1);
  letter-spacing: 0.05em;
  font-weight: 700;
  font-family: var(--font-sans);
  display: inline-block;
  min-width: 24px;
  text-align: center;
}
.rail .item.is-current .num {
  background: var(--y-yellow);
  color: #161616;
  border-color: transparent;
  box-shadow: 0 0 16px rgba(251,191,21,0.35);
}
@media (max-width: 980px) {
  .rail { display: none; }
}

/* Audio pill — give it real distance from the spin card */
.audio-pill { bottom: calc(var(--safe-y) + 8px); }

/* Section padding top tightened so the trusted-by marquee doesn't have a dead band */
.trusted-sec { padding-top: 64px; padding-bottom: 48px; }

/* Trusted-by label — better wrapping behaviour, especially on mobile */
.trusted-label {
  flex-wrap: wrap;
  row-gap: 6px;
  column-gap: 10px;
}
.trusted-label .trusted-sep { color: var(--ink-4); }
@media (max-width: 700px) {
  .trusted-label {
    justify-content: center;
    text-align: center;
    font-size: 10px;
    letter-spacing: 0.18em;
    column-gap: 8px;
    padding: 0 16px;
  }
  .trusted-label .trusted-sep { display: none; }
  .trusted-label .trusted-stat { flex-basis: 100%; color: var(--ink-2); }
  .trusted-label .dot { order: -1; }
}

/* Trusted-by — using PNG logos instead of SVG wordmark imitations */
.logo-item img {
  height: 36px;
  width: auto;
  max-width: 160px;
  object-fit: contain;
  filter: brightness(0) invert(1) opacity(0.55);
  transition: filter 0.3s ease, opacity 0.3s ease;
  display: block;
}
.logo-item:hover img { filter: brightness(0) invert(1) opacity(1); }

/* Logos that ship with their own colour palette and a dark background of
   their own (e.g. Andy Harrington wordmark). Skip the white-invert filter
   so the original colours read naturally on charcoal. */
.logo-item.natural img {
  filter: none;
  opacity: 0.9;
  height: 40px;
  max-width: 200px;
  border-radius: 6px;
}
.logo-item.natural:hover img { opacity: 1; }

/* Text-based logo entries (used when we don't have an authorised image) */
.logo-item.text-logo {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-1);
  opacity: 0.55;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  height: 36px;
  transition: opacity 0.3s ease;
}
.logo-item.text-logo:hover { opacity: 1; }
.logo-item.text-logo .small {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 9px;
  letter-spacing: 0.30em;
  margin-left: 6px;
  opacity: 0.75;
}

/* Section heads alignment — number+eyebrow had unbalanced visual weight */
.sec-meta { align-items: center; }
.sec-num {
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.12em;
  padding: 5px 9px;
}

/* Section sub-text spacing — was bunched up under the ghost echo */
.sec-sub { margin-top: 32px; max-width: 56ch; }

/* Modules — title and description were stacking too tight */
.module-title { margin-bottom: 12px; }
.module-row { padding: 36px 0; }

/* FAQ rows — number column was wider than necessary; pull it in */
.faq-q { grid-template-columns: 56px 1fr 24px; padding: 22px 0; gap: 20px; }
.faq-num { font-size: 10.5px; letter-spacing: 0.18em; }
.faq-text { font-size: 18px; line-height: 1.18; letter-spacing: 0; }
.faq-a { padding-left: 76px; padding-right: 32px; }

/* Final CTA — title gap was visually heavy */
.final-title { margin-top: 28px; }

/* Footer — give brand a little more presence */
.site-footer .brand .ar-logo { width: 32px; height: 32px; }

/* ============= Reveal default state for vanilla impl ============= */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity 0.9s cubic-bezier(.22,.61,.36,1), transform 0.9s cubic-bezier(.22,.61,.36,1); }
.reveal.is-in { opacity: 1; transform: translateY(0); }

/* Headline word-rise — drives directly from CSS, no JS race */
.h-hero .word > span {
  display: inline-block;
  transform: translateY(110%);
  opacity: 0;
  animation: word-rise 0.95s cubic-bezier(.22,.9,.32,1) forwards;
}

/* Smaller / more usable on standard laptops */
@media (max-height: 820px) {
  .hero { top: calc(var(--safe-y) + 84px); bottom: calc(var(--safe-y) + 44px); }
  .h-hero { font-size: clamp(38px, 6.6vw, 92px); }
  .hero-sub { font-size: 14px; max-width: 50ch; }
}

/* Disable Vimeo card insanity on portrait phones */
@media (max-width: 720px) {
  .hero-content { max-width: 100%; }
  .audio-pill { display: none; }
  .timecode { display: none; }
  .rail { display: none; }
  .sec-head { margin-bottom: 36px; }
}

/* Manifesto — words start visible, no progressive opacity gating, otherwise it
   reads as broken until JS attaches. Original intended a scroll reveal but
   the implementation was fragile. */
.m-word { opacity: 1; }
.manifesto-inner .m-word { opacity: 0.22; transition: opacity 0.5s ease; }
.manifesto-inner.is-in .m-word { opacity: 1; }

/* Footer alignment fix on mobile */
@media (max-width: 700px) {
  .site-footer .brand { flex-wrap: wrap; }
}

/* =========================================================
   ABOUT THE FOUNDER section
   ========================================================= */
.founder-sec {
  padding: clamp(80px, 14vh, 180px) var(--safe-x);
  position: relative;
  overflow: hidden;
}
.founder-grid {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: clamp(40px, 7vw, 110px);
  max-width: 1380px;
  margin: 0 auto;
  align-items: center;
}
@media (max-width: 980px) {
  .founder-grid { grid-template-columns: 1fr; gap: 56px; }
  .founder-portrait { order: -1; max-width: 480px; margin: 0 auto; }
}
.founder-copy { max-width: 560px; }
.founder-copy h2 { margin-top: 28px; margin-bottom: 32px; }
.founder-copy p {
  color: var(--ink-2);
  font-size: clamp(15px, 1.05vw, 17px);
  line-height: 1.7;
  max-width: 52ch;
  margin-bottom: 20px;
}
.founder-copy p strong { color: var(--ink-1); font-weight: 600; }
.founder-signature {
  margin-top: 36px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 14px;
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.founder-signature em {
  font-style: normal;
  color: var(--ink-1);
  letter-spacing: 0.18em;
}

/* Portrait — premium vignette + soft glow */
.founder-portrait {
  position: relative;
  aspect-ratio: 4 / 5;
  max-width: 540px;
  width: 100%;
  margin-left: auto;
  border-radius: 14px;
  overflow: hidden;
  isolation: isolate;
  box-shadow:
    0 50px 120px -30px rgba(0,0,0,0.7),
    0 0 0 1px rgba(255,255,255,0.06);
}
.founder-portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: contrast(1.06) saturate(0.92) brightness(0.95);
  transform: scale(1.02);
  transition: transform 0.9s cubic-bezier(.22,1,.36,1), filter 0.6s ease;
}
.founder-portrait:hover img {
  transform: scale(1.06);
  filter: contrast(1.08) saturate(1) brightness(0.98);
}
/* Inner vignette — pulls focus to the centre, fades edges to charcoal */
.founder-portrait::after {
  content: "";
  position: absolute; inset: 0; pointer-events: none; z-index: 2;
  background:
    radial-gradient(120% 90% at 55% 35%, transparent 30%, rgba(22,22,22,0.55) 95%),
    linear-gradient(180deg, transparent 55%, rgba(22,22,22,0.85) 100%),
    linear-gradient(90deg, rgba(22,22,22,0.30) 0%, transparent 18%, transparent 82%, rgba(22,22,22,0.40) 100%);
}
/* Brand-colour ambient haze that bleeds into the surrounding section */
.founder-portrait::before {
  content: "";
  position: absolute; inset: -20%;
  z-index: -1;
  background:
    radial-gradient(60% 50% at 30% 30%, rgba(251,191,21,0.18), transparent 65%),
    radial-gradient(50% 40% at 80% 80%, rgba(106,107,217,0.20), transparent 65%);
  filter: blur(60px);
  pointer-events: none;
}

/* Floating tag chip on the portrait */
.founder-tag {
  position: absolute;
  top: 18px; left: 18px;
  z-index: 3;
  padding: 7px 12px;
  background: rgba(10,10,10,0.55);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 999px;
  font-family: var(--font-sans);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.20em;
  text-transform: uppercase;
  color: var(--ink-1);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.founder-tag::before {
  content: "";
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--y-yellow);
  box-shadow: 0 0 10px var(--y-yellow);
}
.founder-name-overlay {
  position: absolute;
  bottom: 22px; left: 22px; right: 22px;
  z-index: 3;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(22px, 2.4vw, 32px);
  line-height: 1.05;
  letter-spacing: -0.01em;
  color: var(--ink-1);
  text-transform: uppercase;
  text-shadow: 0 2px 20px rgba(0,0,0,0.5);
}
.founder-name-overlay .role {
  display: block;
  margin-top: 6px;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.22em;
  color: rgba(247,245,241,0.7);
  text-transform: uppercase;
}
