/* ===== Design tokens ===== */
:root {
  --color-bg: #F6F3F1;
  --color-bg-alt: #FFFFFF;
  --color-dark: #1A1A1A;
  --color-dark-rgb: 26, 26, 26;
  --color-dark-alt: #333333;
  --color-text: #1A1A1A;
  --color-text-muted: #6B6B6B;
  --color-text-on-dark: #F6F3F1;
  --color-text-on-dark-muted: #9C9C9C;
  --color-border: #DAD5D0;
  --color-border-dark: #4A4A4A;

  --font-display: 'Space Grotesk', sans-serif;
  --font-body: 'Inter', sans-serif;

  --space-1: 0.5rem;
  --space-2: 1rem;
  --space-3: 1.5rem;
  --space-4: 2rem;
  --space-5: 3rem;
  --space-6: 4rem;
  --space-7: 6rem;
  --space-8: 8rem;

  --container-max: 1200px;
  --radius: 0px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --duration: 500ms;
}

/* ===== Reset ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; color-scheme: dark; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    transition-delay: 0s !important;
    scroll-behavior: auto !important;
  }
}

body {
  font-family: var(--font-body);
  font-weight: 600;
  color: var(--color-text-on-dark);
  background: var(--color-dark);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.6), 0 1px 3px rgba(0, 0, 0, 0.8);
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
ul, ol { list-style: none; }
a { color: inherit; text-decoration: none; }

/* ===== Kinetic grid background ===== */
#kinetic-grid-canvas {
  position: fixed;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  background: var(--color-dark);
}
main, .footer {
  position: relative;
  z-index: 1;
}

/* ===== Focus ===== */
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--color-text-on-dark);
  outline-offset: 3px;
}

/* ===== Skip link ===== */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--color-dark);
  color: var(--color-bg);
  padding: var(--space-2) var(--space-3);
  z-index: 1000;
  font-family: var(--font-display);
}
.skip-link:focus {
  left: var(--space-2);
  top: var(--space-2);
}

/* ===== Nav ===== */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: var(--space-3) 0;
  transition: background-color var(--duration) var(--ease), padding var(--duration) var(--ease);
}
.nav.is-scrolled {
  background: rgba(var(--color-dark-rgb), 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: var(--space-2) 0;
  border-bottom: 1px solid var(--color-border-dark);
}
.nav__inner {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--space-4);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav__logo {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.55rem;
  letter-spacing: -0.02em;
  padding: 0.5rem 0;
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.01em;
  padding: 0.9rem 1.75rem;
  border-radius: var(--radius);
  cursor: pointer;
  border: 1.5px solid currentColor;
  min-height: 48px;
  transition: background-color var(--duration) var(--ease), color var(--duration) var(--ease), transform 150ms var(--ease);
  text-shadow: none;
}
.btn:active {
  transform: scale(0.97);
}
.btn--primary {
  background: var(--color-bg);
  color: var(--color-dark);
}
.btn--primary:hover {
  background: transparent;
  color: var(--color-bg);
}
.btn--nav {
  background: transparent;
  color: var(--color-text-on-dark);
  padding: 0.65rem 1.25rem;
  font-size: 0.85rem;
}
.btn--nav:hover {
  background: var(--color-bg);
  color: var(--color-dark);
}

/* ===== Eyebrow labels ===== */
.eyebrow {
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-text-on-dark-muted);
  margin-bottom: var(--space-2);
}
.eyebrow--light { color: var(--color-text-on-dark-muted); }

/* ===== Hero ===== */
.hero {
  position: relative;
  min-height: 92vh;
  min-height: 92dvh;
  /* A wide, soft ellipse anchored at the very bottom-center starts
     introducing darkness before the section boundary, so the transition
     into Services begins inside the Hero rather than snapping on right at
     the edge. Eased (non-linear) stops avoid the banded look a plain
     two-stop gradient gives; the elliptical shape (vs. a uniform
     linear-gradient band) keeps the falloff irregular enough that no
     single line reads as "where it starts." */
  background-color: transparent;
  background-image: radial-gradient(
    ellipse 170% 620px at 50% 100%,
    rgba(var(--color-dark-rgb), 0.34) 0%,
    rgba(var(--color-dark-rgb), 0.19) 28%,
    rgba(var(--color-dark-rgb), 0.08) 55%,
    rgba(var(--color-dark-rgb), 0.02) 78%,
    rgba(var(--color-dark-rgb), 0) 100%
  );
  color: var(--color-text-on-dark);
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
  padding-top: 6rem;
}
/* Interior/service pages don't need the full splash-screen height of the
   homepage hero — the bottom fade-ellipse above still anchors to this
   box's own bottom edge, so the blend into the next section still works
   at a shorter height. */
.hero--compact {
  min-height: 52vh;
  min-height: 52dvh;
  padding-bottom: var(--space-6);
}
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--color-text-on-dark-muted);
  margin-bottom: var(--space-4);
  transition: color var(--duration) var(--ease);
}
.back-link:hover { color: var(--color-text-on-dark); }
.hero__inner {
  position: relative;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--space-4);
  width: 100%;
  text-align: left;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}
.hero__headline {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.65rem, 4.09vw, 3.47rem);
  line-height: 1.02;
  letter-spacing: -0.03em;
  max-width: 20ch;
  margin-bottom: var(--space-5);
  text-wrap: balance;
}
.hero__sub {
  font-size: clamp(1.05rem, 1.6vw, 1.35rem);
  color: var(--color-text-on-dark-muted);
  max-width: 42ch;
  margin-bottom: var(--space-5);
  line-height: 1.5;
}

/* Keeps anchor-nav targets (footer/nav links to #services etc.) from
   landing flush under the fixed header. */
#main, .section, .cta {
  scroll-margin-top: 6.5rem;
}

/* ===== Sections ===== */
/* Statically scrollable — no pin/stack/scroll-triggered mechanics. The
   dark near-opaque tint is kept deliberately: it's the visual separation
   between the transparent Hero (kinetic-grid canvas fully visible) and
   every section after it. */
.section { padding: var(--space-8) 0; }
.section--light { background: rgba(var(--color-dark-rgb), 0.9); color: var(--color-text-on-dark); }
.section--dark { background: rgba(var(--color-dark-rgb), 0.9); color: var(--color-text-on-dark); }
.section__inner {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--space-4);
}
.section__inner--narrow { max-width: 780px; }
/* Services and Process are sized to fit one viewport: content is compacted
   (tighter padding below) and the section is centered within a 100vh floor
   so it neither overflows past one screen nor falls short of it. */
#services, #process {
  min-height: 100vh;
  min-height: 100dvh;
  padding: var(--space-5) 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
/* Services sits directly under the fully-transparent Hero, so its top edge
   fades in from transparent rather than cutting straight to the near-opaque
   scrim — softens what was a hard visual seam at the section boundary. */
#services {
  /* Mirrors the ellipse in .hero, anchored at top-center: transparent right
     at the boundary, easing out to the section's full 0.9 scrim well below
     it. Combined with the Hero-side ellipse, the perceptible transition
     spans well over a thousand pixels with no single edge to point to. */
  background-color: transparent;
  background-image: radial-gradient(
    ellipse 170% 620px at 50% 0%,
    rgba(var(--color-dark-rgb), 0) 0%,
    rgba(var(--color-dark-rgb), 0.1) 22%,
    rgba(var(--color-dark-rgb), 0.42) 45%,
    rgba(var(--color-dark-rgb), 0.72) 68%,
    rgba(var(--color-dark-rgb), 0.88) 86%,
    rgba(var(--color-dark-rgb), 0.9) 100%
  );
}
.section__head { margin-bottom: var(--space-4); }
.section__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.75rem, 3.9vw, 2.85rem);
  letter-spacing: -0.02em;
  line-height: 1.1;
  text-wrap: balance;
}
.section__title--light { color: var(--color-text-on-dark); }

/* ===== Prose block (service-page problem statements) ===== */
.prose__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin-bottom: var(--space-3);
  text-wrap: balance;
}
.prose__body {
  font-size: 1.15rem;
  color: var(--color-text-on-dark-muted);
  max-width: 60ch;
  line-height: 1.6;
}

/* ===== Scroll-entry reveal ===== */
/* Progressive enhancement: the hidden starting state below only applies
   once script.js has confirmed IntersectionObserver support and that the
   user doesn't prefer reduced motion (see the .reveal-supported class it
   adds to <html>). Without that class, everything stays visible — no FOUC,
   no permanently-invisible content if JS fails. */
html.reveal-supported .reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 700ms var(--ease), transform 700ms var(--ease);
}
html.reveal-supported .reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ===== Row list (Services) ===== */
.rowlist { border-top: 1px solid var(--color-border-dark); }
.rowlist__item {
  display: grid;
  grid-template-columns: 4rem 1fr 1.4fr;
  align-items: baseline;
  gap: var(--space-3);
  padding: var(--space-2) 0;
  border-bottom: 1px solid var(--color-border-dark);
  will-change: transform;
  transition: transform 380ms var(--ease), background-color 380ms var(--ease), box-shadow 380ms var(--ease);
}
.rowlist__item:hover,
.rowlist__item:focus-within {
  transform: translateY(-8px);
  background: rgba(255,255,255,0.05);
  box-shadow: 0 28px 48px -16px rgba(0,0,0,0.28), 0 8px 20px -8px rgba(0,0,0,0.18);
}
/* Reveal + stagger for rowlist items. opacity carries the per-item stagger
   delay; transform/background-color/box-shadow stay at 0ms delay so the
   hover-lift (which also transitions transform) never inherits the stagger
   and feels laggy on hover-out. The hover-lift itself is re-declared here
   scoped to .is-visible:hover with higher specificity than the plain
   .rowlist__item transform above, so it always wins once revealed —
   mirrors the earlier fix for the .reveal.is-visible/:hover conflict. */
html.reveal-supported .rowlist__item {
  opacity: 0;
  transform: translateY(24px);
  transition-property: opacity, transform, background-color, box-shadow;
  transition-duration: 700ms, 380ms, 380ms, 380ms;
  transition-delay: var(--reveal-delay, 0ms), 0ms, 0ms, 0ms;
  transition-timing-function: var(--ease);
}
html.reveal-supported .rowlist__item.is-visible {
  opacity: 1;
  transform: translateY(0);
}
html.reveal-supported .rowlist__item.is-visible:hover,
html.reveal-supported .rowlist__item.is-visible:focus-within {
  transform: translateY(-8px);
}
html.reveal-supported .rowlist__item:nth-child(1) { --reveal-delay: 0ms; }
html.reveal-supported .rowlist__item:nth-child(2) { --reveal-delay: 90ms; }
html.reveal-supported .rowlist__item:nth-child(3) { --reveal-delay: 180ms; }
html.reveal-supported .rowlist__item:nth-child(4) { --reveal-delay: 270ms; }
html.reveal-supported .rowlist__item:nth-child(5) { --reveal-delay: 360ms; }
.rowlist__index {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--color-text-on-dark-muted);
  font-size: 0.95rem;
}
.rowlist__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.15rem, 2.4vw, 1.6rem);
  letter-spacing: -0.01em;
}
.rowlist__desc {
  color: var(--color-text-on-dark-muted);
  font-size: 1rem;
  max-width: 46ch;
}

/* ===== Step list (Process) ===== */
.steplist { border-top: 1px solid var(--color-border-dark); }
.steplist__item {
  display: flex;
  align-items: baseline;
  gap: var(--space-4);
  padding: var(--space-2) 0;
  border-bottom: 1px solid var(--color-border-dark);
}
.steplist__num {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.75rem, 4.2vw, 2.9rem);
  color: var(--color-text-on-dark-muted);
  min-width: 4.5rem;
  letter-spacing: -0.02em;
}
.steplist__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.25rem, 2.6vw, 1.75rem);
  margin-bottom: 0.25rem;
}
.steplist__desc {
  color: var(--color-text-on-dark-muted);
  font-size: 1.05rem;
}
html.reveal-supported .steplist__item {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 700ms var(--ease), transform 700ms var(--ease);
  transition-delay: var(--reveal-delay, 0ms);
}
html.reveal-supported .steplist__item.is-visible {
  opacity: 1;
  transform: translateY(0);
}
html.reveal-supported .steplist__item:nth-child(1) { --reveal-delay: 0ms; }
html.reveal-supported .steplist__item:nth-child(2) { --reveal-delay: 90ms; }
html.reveal-supported .steplist__item:nth-child(3) { --reveal-delay: 180ms; }

/* ===== Guarantee ===== */
.guarantee {
  border: 1.5px solid var(--color-border-dark);
  padding: var(--space-7) var(--space-6);
}
.guarantee__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.75rem, 4vw, 2.75rem);
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin-bottom: var(--space-4);
  text-wrap: balance;
}
.guarantee__body {
  font-size: 1.15rem;
  max-width: 60ch;
  margin-bottom: var(--space-3);
}
.guarantee__note {
  color: var(--color-text-on-dark-muted);
  font-size: 0.95rem;
  max-width: 60ch;
}

/* ===== CTA ===== */
.cta {
  position: relative;
  /* Same soft-ellipse treatment as the Hero/Services blend, mirrored:
     transparent right at the bottom boundary, easing up to the full 0.9
     scrim well above it, so it fades into the Footer's own top-fade
     instead of cutting hard against it. */
  background-color: transparent;
  background-image: radial-gradient(
    ellipse 170% 620px at 50% 100%,
    rgba(var(--color-dark-rgb), 0) 0%,
    rgba(var(--color-dark-rgb), 0.1) 22%,
    rgba(var(--color-dark-rgb), 0.42) 45%,
    rgba(var(--color-dark-rgb), 0.72) 68%,
    rgba(var(--color-dark-rgb), 0.88) 86%,
    rgba(var(--color-dark-rgb), 0.9) 100%
  );
  color: var(--color-text-on-dark);
  padding: calc(var(--space-8) + var(--space-3)) 0;
  text-align: center;
  overflow: hidden;
}
.cta__inner {
  position: relative;
  max-width: 700px;
  margin: 0 auto;
  padding: 0 var(--space-4);
}
.cta__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2.25rem, 6vw, 4rem);
  letter-spacing: -0.03em;
  line-height: 1.05;
  margin-bottom: var(--space-4);
  text-wrap: balance;
}
.cta__sub {
  font-size: 1.15rem;
  color: var(--color-text-on-dark-muted);
  margin-bottom: var(--space-5);
}
.cta__fine {
  margin-top: var(--space-3);
  font-size: 0.85rem;
  color: var(--color-text-on-dark-muted);
}

/* ===== Footer ===== */
/* Mirrors the Hero's bottom ellipse: introduces a little darkness right at
   the CTA boundary, easing out to fully transparent going down the page —
   meets the CTA's fade-out halfway instead of snapping straight to clear. */
.footer {
  background-color: transparent;
  background-image: radial-gradient(
    ellipse 170% 620px at 50% 0%,
    rgba(var(--color-dark-rgb), 0.34) 0%,
    rgba(var(--color-dark-rgb), 0.19) 28%,
    rgba(var(--color-dark-rgb), 0.08) 55%,
    rgba(var(--color-dark-rgb), 0.02) 78%,
    rgba(var(--color-dark-rgb), 0) 100%
  );
}
.footer__inner {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: var(--space-5) var(--space-4);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}
.footer__logo {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.1rem;
  display: inline-block;
  padding: 0.5rem 0;
}
.footer__nav { display: flex; gap: var(--space-4); }
.footer__nav a {
  display: inline-block;
  padding: 0.6rem 0;
  font-size: 0.95rem;
  color: var(--color-text-on-dark-muted);
  transition: color var(--duration) var(--ease);
}
.footer__nav a:hover { color: var(--color-text-on-dark); }
.footer__bottom {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--space-4) var(--space-4);
  font-size: 0.85rem;
  color: var(--color-text-on-dark-muted);
}

/* ===== Responsive ===== */
@media (max-width: 1024px) {
  .rowlist__item { grid-template-columns: 3rem 1fr; }
  .rowlist__desc { grid-column: 2 / -1; max-width: 60ch; }
}

@media (max-width: 768px) {
  :root { --space-8: 5rem; --space-7: 4rem; }
  .hero { min-height: 80vh; padding-top: 5.5rem; }
  .rowlist__item { grid-template-columns: 1fr; gap: var(--space-1); }
  .rowlist__index { order: -1; }
  .steplist__item { flex-direction: column; gap: var(--space-2); }
  .guarantee { padding: var(--space-4); }
  .footer__inner { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 375px) {
  .hero__headline { font-size: 1.45rem; }
}
