/* =========================================================
   Peak Group LLC — Landing
   Design tokens taken from the Figma file "Peak Group Landing"
   ========================================================= */

:root {
  /* Colour */
  --blue-500: #3ab3d1;
  --base-100: #e8f7fe;
  --base-200: #ddf4fd;
  --background: #edf9fd;
  --grey-900: #192629;
  --white: #fafafa;

  /* Spacing scale */
  --space-200: 8px;
  --space-300: 12px;
  --space-400: 16px;
  --space-600: 24px;
  --space-800: 32px;
  --space-1200: 48px;
  --space-1600: 64px;
  --space-2400: 96px;

  /* Radii */
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 20px;
  --r-xl: 24px;
  --r-2xl: 48px;

  /* Layout */
  --content: 1248px;
  --gutter: var(--space-2400);

  /* Motion */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  /* Long + gentle: the reveal should be felt, not noticed. */
  --reveal-dur: 1200ms;
  --reveal-ease: cubic-bezier(0.22, 0.61, 0.24, 1);
  --stagger: 1.7; /* multiplier applied to each element's --d */
}

/* ---------------------------------------------------------
   Reset / base
   --------------------------------------------------------- */

*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--background);
  color: var(--grey-900);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.2;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3, h4, p, ol, ul, dl, dd, figure { margin: 0; }
ol, ul { padding: 0; list-style: none; }
img { display: block; max-width: 100%; }
a { color: inherit; }
button, input, textarea { font: inherit; color: inherit; }

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  background: var(--blue-500);
  color: var(--white);
  padding: 12px 20px;
  border-radius: 0 0 var(--r-sm) 0;
  text-decoration: none;
  font-weight: 600;
}
.skip-link:focus { left: 0; }

:focus-visible {
  outline: 2px solid var(--blue-500);
  outline-offset: 3px;
}

/* ---------------------------------------------------------
   Layout primitives
   --------------------------------------------------------- */

.container {
  width: 100%;
  max-width: calc(var(--content) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section { padding-block: var(--space-1200); }

.section__head {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 17px;
  margin-bottom: var(--space-600);
}

/* ---------------------------------------------------------
   Typography
   --------------------------------------------------------- */

.h1,
.h2 {
  font-size: clamp(30px, 3.34vw, 48px);
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.h3 {
  font-size: clamp(24px, 2.23vw, 32px);
  font-weight: 600;
  line-height: 1.25;
}

.accent { color: var(--blue-500); }

.eyebrow {
  display: inline-block;
  background: var(--base-200);
  color: var(--blue-500);
  font-size: clamp(14px, 1.1vw, 16px);
  font-weight: 600;
  line-height: 1.2;
  padding: var(--space-200) var(--space-300);
  border-radius: var(--r-md);
}

/* ---------------------------------------------------------
   Buttons
   --------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-300);
  padding: var(--space-400) var(--space-600);
  border: 0;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  transition: transform 250ms var(--ease-out), box-shadow 250ms var(--ease-out), background-color 250ms var(--ease-out);
}

.btn--primary {
  background: var(--blue-500);
  color: var(--white);
  box-shadow: 0 2px 8px rgb(58 179 209 / 0.24);
}

.btn--primary:hover {
  background: #33a3bf;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgb(58 179 209 / 0.32);
}

.btn--primary:active { transform: translateY(0); }

.btn:disabled {
  cursor: progress;
  opacity: 0.65;
  transform: none;
  box-shadow: none;
}

.btn:disabled:hover { background: var(--blue-500); transform: none; }

.btn__icon {
  width: 20px;
  height: 20px;
  flex: none;
  transition: transform 250ms var(--ease-out);
}

.btn:hover .btn__icon { transform: translateX(3px); }

/* ---------------------------------------------------------
   Icon tile
   --------------------------------------------------------- */

.icon-tile {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 64px;
  height: 64px;
  padding: 12px;
  background: var(--base-200);
  border-radius: var(--r-lg);
}

.icon-tile img {
  width: 40px;
  height: 40px;
}

/* ---------------------------------------------------------
   Hero
   --------------------------------------------------------- */

.hero-block {
  display: flex;
  flex-direction: column;
  isolation: isolate;
}

/* The hero itself is full-bleed so the map spans the whole viewport;
   `hero__inner` is what holds the content to the 1440px grid. */
.hero {
  position: relative;
  z-index: 2;
  width: 100%;
  margin-bottom: -32px;
  /* Clips the map's parallax bleed and, on mobile, the container backdrop
     that intentionally hangs past the right edge. */
  overflow: hidden;
}

.hero__inner {
  display: flex;
  align-items: center;
  gap: var(--space-800);
  width: 100%;
  max-width: calc(var(--content) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
  min-height: 704px;
}

.hero__map {
  position: absolute;
  left: 0;
  top: -40px;
  width: 100%;
  height: calc(100% + 80px); /* bleed for the parallax drift */
  object-fit: cover;
  opacity: 0.4;
  pointer-events: none;
  z-index: -1;
}

.hero__content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: var(--space-600);
  flex: 1 1 0;
  min-width: 0;
  max-width: 640px;
  padding-block: var(--space-1600);
}

.hero__lead {
  font-size: clamp(16px, 1.67vw, 24px);
  line-height: 1.25;
}

.hero__visual {
  position: relative;
  flex: none;
  width: 580px;
  height: 704px;
  overflow: hidden;
}

.hero__visual img {
  position: absolute;
  left: -23.62%;
  top: -2.98%;
  width: 147.59%;
  height: 121.73%;
  max-width: none;
  object-fit: contain;
}

/* Value bar */

.value {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: calc(var(--content) + var(--gutter) * 2 + 64px);
  margin-inline: auto;
  padding-inline: var(--space-1600);
}

.value__card {
  display: flex;
  align-items: flex-start;
  gap: var(--space-800);
  background: var(--base-100);
  border-radius: var(--r-xl);
  padding: var(--space-1200) var(--space-1600);
}

.value__item {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-300);
}

.value__figure {
  color: var(--blue-500);
  font-size: clamp(20px, 1.67vw, 24px);
  font-weight: 700;
  line-height: 1.2;
}

.value__label {
  font-size: clamp(16px, 1.39vw, 20px);
  line-height: 1.2;
}

/* ---------------------------------------------------------
   Services
   --------------------------------------------------------- */

.services {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: var(--space-800);
  align-items: stretch;
}

.services__media {
  border-radius: var(--r-lg);
  overflow: hidden;
  min-height: 500px;
}

.services__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.services__grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  grid-auto-rows: 1fr;
  gap: var(--space-600);
}

/* Row 1: three cards of 2 columns each. Row 2: two cards of 3 columns each. */
.services__grid > .card:nth-child(-n+3) { grid-column: span 2; }
.services__grid > .card:nth-child(n+4)  { grid-column: span 3; }

/* Purely informational — no hover affordance, the cards are not clickable. */
.card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: var(--space-600);
  background: var(--base-100);
  border: 1px solid var(--base-200);
  border-radius: var(--r-lg);
  padding: var(--space-600);
}

.card__text {
  display: flex;
  flex-direction: column;
  gap: var(--space-200);
}

.card__title,
.feature__title,
.step__title,
.reason__title {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.2;
}

.card__body,
.feature__body,
.step__body,
.reason__body {
  font-size: 16px;
  line-height: 1.25;
}

/* ---------------------------------------------------------
   How it works
   --------------------------------------------------------- */

.steps {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: var(--space-800);
}

.step {
  display: flex;
  flex-direction: column;
  gap: var(--space-600);
  min-width: 0;
}

.step__marker {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--space-800);
}

.step__num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 32px;
  height: 32px;
  background: var(--base-200);
  color: var(--blue-500);
  border-radius: 999px;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.2;
}

.step__line {
  flex: 1 1 0;
  height: 1px;
  background: var(--base-200);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 1300ms var(--reveal-ease) calc(var(--delay, 0ms) + 250ms);
}

.step.is-visible .step__line { transform: scaleX(1); }

.step__text {
  display: flex;
  flex-direction: column;
  gap: var(--space-300);
}

/* ---------------------------------------------------------
   Grow / marketing
   --------------------------------------------------------- */

.grow {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: var(--space-800);
  background: var(--base-100);
  border: 1px solid var(--base-200);
  border-radius: var(--r-2xl);
  padding: var(--space-1200);
}

.grow__content {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: var(--space-1200);
  min-width: 0;
}

.grow__head {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 17px;
  max-width: 640px;
}

.grow__lead { line-height: 1.25; }

.grow__features {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-800);
}

.feature {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-600);
}

.feature .feature__title + .feature__body { margin-top: -8px; }

.feature__title { margin-bottom: 0; }

.grow__media {
  border-radius: var(--r-lg);
  overflow: hidden;
  min-height: 448px;
}

.grow__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ---------------------------------------------------------
   FAQ
   --------------------------------------------------------- */

.faq {
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--base-200);
}

.faq__row {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: var(--space-800);
  align-items: center;
  min-height: 82px;
  padding-block: var(--space-400);
  border-bottom: 1px solid var(--base-200);
}

.faq__q { font-weight: 700; line-height: 1.25; }
.faq__a { margin: 0; line-height: 1.25; }

/* ---------------------------------------------------------
   CTA + form
   --------------------------------------------------------- */

.cta {
  display: grid;
  grid-template-columns: 1fr 596px;
  gap: var(--space-600);
  align-items: start;
}

.cta__intro {
  display: flex;
  flex-direction: column;
  gap: var(--space-800);
  min-width: 0;
}

.cta__head {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 17px;
}

.cta__reasons {
  display: flex;
  flex-direction: column;
  gap: var(--space-600);
}

.cta__reasons-title { font-size: 16px; font-weight: 600; }

.reasons {
  display: flex;
  flex-direction: column;
  gap: var(--space-800);
}

.reason {
  display: flex;
  align-items: center;
  gap: var(--space-800);
}

.reason__text {
  display: flex;
  flex-direction: column;
  gap: var(--space-300);
  min-width: 0;
}

/* Quote card */

.quote-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-800);
  background: var(--base-100);
  border: 1px solid var(--base-200);
  border-radius: var(--r-2xl);
  padding: var(--space-1200);
}

.quote-card__lead { line-height: 1.25; }

.form {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-800);
  margin-top: -8px;
}

.form__fields {
  display: flex;
  flex-direction: column;
  gap: var(--space-400);
  width: 100%;
}

/* Honeypot — must stay invisible and unreachable for real visitors. */
.form__hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.input {
  width: 100%;
  padding: var(--space-400);
  background: var(--base-200);
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  font-size: 16px;
  line-height: 1.2;
  transition: border-color 250ms var(--ease-out), background-color 250ms var(--ease-out);
}

.input::placeholder { color: var(--grey-900); opacity: 1; }

.input:hover { background: #d2f0fb; }

.input:focus {
  outline: none;
  border-color: var(--blue-500);
  background: #f2fbff;
}

.input--area {
  min-height: 166px;
  resize: vertical;
  font-family: inherit;
}

.input.is-invalid { border-color: #d6564f; }

.form__status {
  font-size: 14px;
  line-height: 1.3;
  text-align: center;
  min-height: 18px;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 300ms var(--ease-out), transform 300ms var(--ease-out);
}

.form__status.is-shown { opacity: 1; transform: translateY(0); }
.form__status[data-state="ok"] { color: #1f8a63; }
.form__status[data-state="error"] { color: #c0453f; }
.form__status[data-state="pending"] { color: var(--grey-900); }

/* ---------------------------------------------------------
   Footer
   --------------------------------------------------------- */

.footer {
  background: var(--base-100);
  padding-block: var(--space-2400);
}

.footer__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-800);
  flex-wrap: wrap;
}

.footer__logo {
  width: 300px;
  max-width: 100%;
  height: auto;
}

.footer__meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: var(--space-200);
  text-align: right;
}

.footer__mail {
  text-decoration: none;
  transition: color 250ms var(--ease-out);
}

.footer__mail:hover { color: var(--blue-500); }

.footer__copy { line-height: 1.2; }

/* =========================================================
   Reveal animations
   ========================================================= */

.reveal {
  --delay: calc(var(--d, 0ms) * var(--stagger));
  opacity: 0;
  transform: translateY(18px);
  transition:
    opacity var(--reveal-dur) var(--reveal-ease) var(--delay),
    transform var(--reveal-dur) var(--reveal-ease) var(--delay);
  will-change: opacity, transform;
}

.reveal--img {
  transform: translateY(18px) scale(1.015);
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
  will-change: auto;
}

/* =========================================================
   Parallax — a few pixels of drift, driven from script.js
   ========================================================= */

[data-parallax] {
  transform: translate3d(0, var(--py, 0px), 0);
  will-change: transform;
}

/* Extra bleed so the drift never exposes an edge inside a clipped frame. */
.services__media img,
.grow__media img {
  height: calc(100% + 72px);
  margin-top: -36px;
}

/* =========================================================
   Responsive
   ========================================================= */

/* --- Large tablet / small desktop --- */
@media (max-width: 1200px) {
  :root { --gutter: 48px; }

  .hero__inner { min-height: 0; gap: var(--space-600); }
  .hero__visual { width: 44%; height: auto; aspect-ratio: 580 / 704; }
  .hero__content { padding-block: var(--space-1200); }

  .value { padding-inline: var(--space-1200); }
  .value__card { padding: var(--space-800) var(--space-1200); }

  .services { grid-template-columns: 300px 1fr; }
  .services__media { min-height: 0; }

  .grow { grid-template-columns: 1fr 300px; padding: var(--space-800); }
  .grow__media { min-height: 0; }

  .cta { grid-template-columns: 1fr 1fr; }
  .quote-card { padding: var(--space-800); }
}

/* --- Tablet --- */
@media (max-width: 960px) {
  .services {
    grid-template-columns: 1fr;
  }

  .services__media {
    aspect-ratio: 16 / 7;
  }

  .services__grid {
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: auto;
  }

  .services__grid > .card:nth-child(-n+3),
  .services__grid > .card:nth-child(n+4) { grid-column: span 1; }

  /* The fifth card fills the remaining row */
  .services__grid > .card:nth-child(5) { grid-column: span 2; }

  .steps {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .step {
    position: relative;
    flex-direction: row;
    align-items: flex-start;
    gap: var(--space-600);
    padding-bottom: var(--space-800);
  }

  .step:last-child { padding-bottom: 0; }

  .step__marker {
    position: static;
    flex-direction: column;
    align-self: flex-start;
    gap: 0;
  }

  /* The rail runs from under the number down to the next step. */
  .step__line {
    position: absolute;
    left: 15px;
    top: 44px;
    bottom: 4px;
    width: 1px;
    height: auto;
    flex: none;
    transform: scaleY(0);
    transform-origin: top center;
  }

  .step.is-visible .step__line { transform: scaleY(1); }
  .step:last-child .step__line { display: none; }

  .step__text { padding-top: 5px; }

  .grow {
    grid-template-columns: 1fr;
    border-radius: var(--r-xl);
  }

  .grow__media {
    order: -1;
    aspect-ratio: 16 / 7;
  }

  .cta { grid-template-columns: 1fr; gap: var(--space-800); }
  .quote-card { border-radius: var(--r-xl); }
}

/* --- Small tablet / large phone --- */
@media (max-width: 820px) {
  :root { --gutter: 32px; }

  .hero { margin-bottom: -24px; }

  .hero__inner {
    min-height: 600px;
    padding-block: var(--space-1600) var(--space-1200);
  }

  .hero__content {
    max-width: none;
    padding-block: 0;
  }

  /* Per the Figma mobile frame the container becomes a soft backdrop
     tucked into the bottom-right corner, behind the copy. */
  .hero__visual {
    position: absolute;
    right: -6%;
    bottom: 0;
    height: 68%;
    width: auto;
    aspect-ratio: 580 / 704;
    z-index: -1;
    pointer-events: none;
    overflow: visible;
  }

  .hero__visual img {
    position: static;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: bottom right;
    /* The reveal animation drives the wrapper's opacity, so the backdrop
       fade has to live on the image itself or it would be overridden. */
    opacity: 0.22;
  }

  .value { padding-inline: var(--gutter); }

  .value__card {
    flex-direction: column;
    gap: 40px;
    padding: var(--space-600);
  }

  .faq__row {
    grid-template-columns: 1fr;
    gap: var(--space-400);
    align-items: start;
    min-height: 0;
  }

  .footer { padding-block: var(--space-1200); }

  .footer__inner {
    flex-direction: column;
    text-align: center;
  }

  .footer__logo { width: 240px; }

  .footer__meta { align-items: center; text-align: center; }
}

/* --- Phone --- */
@media (max-width: 560px) {
  :root { --gutter: 24px; }

  .section { padding-block: var(--space-600); }

  .section__head { gap: var(--space-400); margin-bottom: var(--space-600); }

  .hero__inner { min-height: 520px; padding-block: var(--space-1200) var(--space-800); }

  .hero__visual { height: 58%; right: -8%; }

  .services__grid { gap: var(--space-400); }

  .card { padding: 13px; gap: var(--space-600); }

  .icon-tile {
    width: 56px;
    height: 56px;
  }

  .icon-tile img { width: 32px; height: 32px; }

  .grow { padding: var(--space-400); }
  .grow__content { gap: var(--space-800); }
  .grow__features { gap: var(--space-600); }

  .reason { align-items: flex-start; gap: var(--space-400); }

  .quote-card { padding: var(--space-600); gap: var(--space-600); }

  .form .btn { width: 100%; }

  .footer__logo { width: 100%; max-width: 210px; }
}

/* --- Very small phone --- */
@media (max-width: 380px) {
  .services__grid { grid-template-columns: 1fr; }
  .services__grid > .card:nth-child(5) { grid-column: span 1; }
  .grow__features { grid-template-columns: 1fr; }
}

/* =========================================================
   Reduced motion
   ========================================================= */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  .reveal,
  .reveal--img {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }

  .step__line { transform: none !important; transition: none !important; }

  [data-parallax] { transform: none !important; }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
