/* ==========================================================================
   Squarely — Homepage
   Built from Figma node 416:3 "Homepage". Pixel-faithful at >=1100px,
   stacks/resizes below. Reuses tokens.css + base.css (header/footer/buttons).
   ========================================================================== */

:root {
  --ink-333: #333333;
  --muted-1: #424a52;
  --muted-2: #3a5c5a;
  --muted-3: #7a9a98;
  --beige: #f8f6f1;
  --c-mint: #aada91;
  --c-blue: #cfe2f3;
  --c-lilac: #e4daf5;
  --c-peach: #ffd9c2;
  --box-green: #53bc7d;
  --box-blue: #7ba8d9;
  --box-peach: #f2a57a;
  --box-purple: #a68bd9;
}

/* Homepage content container (design canvas ≈ 1792 with ~60px gutters) */
.h-container {
  width: 100%;
  max-width: 1792px;
  margin-inline: auto;
  padding-inline: 60px;
}

/* shared eyebrow + headings */
.h-eyebrow { font-weight: 600; font-size: 20px; color: var(--green-600); margin: 0 0 10px; letter-spacing: 0.3px; }

/* ============================ HERO ============================ */
.home-hero {
  position: relative;
  overflow: hidden;
  text-align: center;
  padding: 90px 0 70px;
  background: #fff;
}
/* Decorative wave lines — oversized so they always cover the hero (no cropping
   on smaller screens) and spin slowly for a subtle living-background effect. */
.home-hero__lines {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 150vmax;
  height: auto;
  transform: translate(-50%, -50%) rotate(0deg);
  transform-origin: center;
  opacity: 0.85;
  pointer-events: none;
  z-index: 0;
  animation: hero-lines-spin 360s linear infinite;
  will-change: transform;
}
@keyframes hero-lines-spin {
  to { transform: translate(-50%, -50%) rotate(360deg); }
}
@media (prefers-reduced-motion: reduce) {
  .home-hero__lines { animation: none; }
}
.home-hero__inner { position: relative; z-index: 1; }
.home-hero__title {
  font-weight: 800;
  font-size: 80px;
  line-height: 88px;
  letter-spacing: -1.5px;
  color: var(--ink-333);
  margin: 0 auto;
  max-width: 1277px;
}
.home-hero__title .accent { color: var(--green-500); display: block; }
.home-hero__lead {
  font-size: 28px;
  line-height: 1.3;
  color: #000;
  max-width: 1115px;
  margin: 26px auto 0;
}
.home-hero__cta { margin-top: 34px; }
.home-hero__cta .btn { height: 52px; font-size: 22px; padding: 0 40px; }

/* feature strip */
.feature-strip {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 22px 56px;
  margin-top: 48px;
}
.feature-strip__item {
  display: flex;
  align-items: center;
  gap: 11px;
  font-size: 14px;
  line-height: 1.2;
  color: var(--ink-333);
  text-align: left;
}
.feature-strip__item img { width: 32px; height: 32px; flex: none; }

/* dashboard mockup */
.home-hero__mockup {
  position: relative;
  z-index: 2; /* sits above the ESG box, which is pulled up to overlap it */
  max-width: 824px;
  margin: 40px auto 0;
  /* Gradient frame around the dashboard image (design 445:341) */
  padding: 10px;
  background: linear-gradient(180deg, #c6e4b3 0%, #cfe2f3 100%);
  border-radius: 30px;
  box-shadow: 0 30px 70px rgba(18, 94, 89, 0.18);
}
.home-hero__mockup img,
.home-hero__mockup video {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 20px;
}

/* Fullscreen toggle button (over the video, bottom-right) */
.mockup-fs {
  position: absolute;
  right: 22px;
  bottom: 22px;
  z-index: 3;
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 10px;
  background: rgba(10, 42, 40, 0.55);
  color: #fff;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s ease, background 0.15s ease;
}
.home-hero__mockup:hover .mockup-fs,
.mockup-fs:focus-visible { opacity: 1; }
.mockup-fs:hover { background: rgba(10, 42, 40, 0.8); }
.mockup-fs__shrink { display: none; }

/* Fullscreen state: fill the screen, drop the frame, keep the button reachable */
.home-hero__mockup:fullscreen {
  padding: 0;
  border-radius: 0;
  background: #0a2a28;
  width: 100vw;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: none;
}
.home-hero__mockup:fullscreen video {
  width: auto;
  height: 100%;
  max-width: 100%;
  border-radius: 0;
}
.home-hero__mockup:fullscreen .mockup-fs { opacity: 1; }
.home-hero__mockup:fullscreen .mockup-fs__expand { display: none; }
.home-hero__mockup:fullscreen .mockup-fs__shrink { display: block; }

/* ====================== ESG COMPLEX (dark) ====================== */
.esg { padding: 24px 0; }
.esg__box {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(120% 90% at 85% 30%, rgba(45,130,103,0.9), rgba(45,130,103,0) 55%),
    var(--teal-700);
  border-radius: 50px;
  padding: 70px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 60px;
  align-items: center;
}
.esg__text { max-width: 642px; color: #fff; }
.esg__eyebrow { font-weight: 600; font-size: 20px; color: var(--c-mint); margin: 0 0 18px; }
.esg__title { font-weight: 700; font-size: 58px; line-height: 60px; letter-spacing: -1.5px; margin: 0 0 28px; max-width: 642px; }
.esg__lead { font-size: 18px; line-height: 1.4; max-width: 616px; margin: 0; }
.esg__lead strong { font-weight: 800; }

.esg__cards { display: grid; grid-template-columns: repeat(2, 425px); gap: 20px; }
.esg-card {
  background: #fff;
  border: 1px solid rgba(18, 94, 89, 0.12);
  border-radius: 30px;
  padding: 29px 39px;
  height: 261px;
}
.esg-card img { width: 32px; height: 32px; margin-bottom: 30px; }
.esg-card h3 { font-weight: 700; font-size: 22px; line-height: 28px; color: #000; margin: 0 0 14px; }
.esg-card p { font-size: 18px; line-height: 1.35; color: var(--muted-3); margin: 0; }

/* Desktop only: pull the dark box up so the hero mockup overlaps its top edge
   (design 440:1697). Extra top padding keeps the box content clear of the mockup. */
@media (min-width: 1101px) {
  .esg { margin-top: -140px; padding-top: 0; }
  .esg__box { padding-top: 150px; }
}

/* ====================== WHY SQUARELY ====================== */
.why { padding: 96px 0 80px; }
.why__inner { display: grid; grid-template-columns: 722px minmax(0, 1fr); gap: 88px; align-items: start; }
.why__title { font-weight: 800; font-size: 44px; line-height: 1.2; color: var(--teal-900); margin: 8px 0 0; }
.why__sub { font-size: 18px; color: var(--muted-1); margin: 16px 0 28px; max-width: 757px; }

.why-stats {
  background: #fff;
  border: 1px solid var(--c-mint);
  border-radius: 30px;
  padding: 8px 39px;
}
.why-stat {
  display: grid;
  grid-template-columns: 140px 1fr;
  align-items: center;
  column-gap: 20px;
  padding: 32px 6px;
}
.why-stat + .why-stat { border-top: 1px solid #e6efe9; }
.why-stat__num { font-weight: 700; font-size: 44px; color: var(--green-600); line-height: 1; }
.why-stat__label { font-weight: 800; font-size: 22px; line-height: 1.1; color: var(--teal-900); margin: 0 0 6px; }
.why-stat__note { font-size: 18px; color: var(--teal-700); margin: 0; }
.why__link { display: inline-block; margin-top: 22px; font-weight: 600; font-size: 18px; color: var(--green-600); }

.why__right { display: flex; flex-direction: column; }
.why-graphic { width: 100%; max-width: 718px; height: auto; margin: 0 0 40px auto; }
.why-features { display: flex; flex-direction: column; gap: 36px; padding-top: 6px; }
.why-feature { display: grid; grid-template-columns: 48px 1fr; gap: 20px; align-items: start; }
.why-feature__icon {
  width: 48px; height: 48px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
}
.why-feature__icon img { width: 32px; height: 32px; }
.why-feature__icon--green { background: var(--box-green); }
.why-feature__icon--blue { background: var(--box-blue); }
.why-feature__icon--peach { background: var(--box-peach); }
.why-feature__icon--purple { background: var(--box-purple); }
.why-feature h3 { font-weight: 800; font-size: 22px; color: var(--teal-900); margin: 4px 0 8px; }
.why-feature p { font-weight: 300; font-size: 18px; line-height: 1.25; color: var(--teal-700); margin: 0; }

/* ====================== FOUR STAGES ====================== */
.stages { padding: 24px 0; }
.stages__box {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(90% 120% at 95% 0%, rgba(83,188,125,0.28), rgba(83,188,125,0) 40%),
    var(--beige);
  border-radius: 50px;
  box-shadow: inset 0 0 50px rgba(45,130,103,0.05);
  padding: 128px 112px;
  display: grid;
  grid-template-columns: 569px minmax(0, 1fr);
  gap: 132px;
  align-items: start;
}
.stages__head { position: sticky; top: 100px; }
.stages__eyebrow { font-weight: 600; font-size: 20px; color: var(--green-600); margin: 0 0 22px; }
.stages__title { font-weight: 800; font-size: 50px; line-height: 57px; letter-spacing: -1.4px; color: var(--teal-900); margin: 0 0 22px; }
.stages__lead { font-size: 16px; line-height: 22px; color: var(--muted-2); margin: 0 0 30px; max-width: 460px; }
.stages__lead strong { font-weight: 600; color: var(--muted-2); }
.stages__btn {
  display: inline-flex; align-items: center; gap: 18px;
  background: linear-gradient(90deg, var(--teal-700), var(--teal-500));
  color: #fbf8f1; font-weight: 800; font-size: 14px;
  padding: 13px 24px; border-radius: 100px;
}
.stages__btn img { width: 14px; height: 14px; }

.stage-list { display: flex; flex-direction: column; gap: 16px; }
.stage-row {
  display: grid;
  grid-template-columns: 92px 1fr 36px;
  align-items: center;
  gap: 18px;
  padding: 26px 28px;
  border-radius: 22px;
  box-shadow: inset 0 0 50px rgba(45,130,103,0.05);
  color: inherit;
  text-decoration: none;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.stage-row:hover {
  transform: translateY(-3px);
  box-shadow: inset 0 0 50px rgba(45,130,103,0.05), 0 14px 28px rgba(0,71,80,0.12);
}
.stage-row:hover .stage-row__arrow { transform: translateX(3px); transition: transform 0.18s ease; }
.stage-row--1 { background: #fff; }
.stage-row--2 { background: var(--c-blue); }
.stage-row--3 { background: var(--c-lilac); }
.stage-row--4 { background: var(--c-peach); }
.stage-row--5 { background: linear-gradient(90deg, var(--teal-500), var(--teal-700)); }
.stage-row__step { font-weight: 800; font-size: 13px; letter-spacing: 1.6px; color: var(--teal-900); }
.stage-row__name { font-weight: 700; font-size: 26px; color: var(--teal-900); margin: 0 0 5px; }
.stage-row__desc { font-size: 14px; line-height: 21px; color: var(--muted-2); margin: 0; }
.stage-row__arrow {
  width: 36px; height: 36px; border-radius: 36px; background: var(--beige);
  display: flex; align-items: center; justify-content: center;
}
.stage-row__arrow img { width: 14px; height: 14px; }
.stage-row--5 .stage-row__step,
.stage-row--5 .stage-row__name { color: #fbf8f1; }
.stage-row--5 .stage-row__desc { color: #fff; }
.stage-row--5 .stage-row__arrow { background: #fff; }

/* ====================== CLIENTS & RESULTS ====================== */
.clients { padding: 70px 0 30px; }
.clients__title { font-weight: 800; font-size: 44px; line-height: 1.2; color: var(--teal-900); margin: 8px 0 36px; max-width: 864px; }
.clients__grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 20px; }
.client-stat {
  background: #fff;
  border: 1px solid var(--c-mint);
  border-radius: 30px;
  height: 175px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  text-align: center;
  padding: 16px;
}
.client-stat:nth-child(3) { border-color: var(--c-blue); }
.client-stat:nth-child(4) { border-color: var(--c-lilac); }
.client-stat:nth-child(5) { border-color: var(--c-peach); }
.client-stat__num { font-weight: 700; font-size: 44px; color: var(--teal-900); line-height: 1; }
.client-stat__label { font-size: 18px; color: var(--green-600); }

/* ====================== TESTIMONIALS ====================== */
.testimonials { padding: 30px 0 80px; }
.testimonials__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px; }
.testimonial {
  background: #fff;
  border-radius: 30px;
  box-shadow: 0 10px 40px rgba(18, 94, 89, 0.06);
  padding: 35px;
  display: flex;
  flex-direction: column;
}
.testimonial__quote { font-size: 18px; line-height: 1.25; color: rgba(0, 71, 80, 0.89); margin: 0 0 24px; flex: 1; }
.testimonial__by { display: flex; align-items: center; gap: 16px; }
.testimonial__avatar {
  width: 38px; height: 38px; border-radius: 19px; background: var(--teal-700);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-family: var(--font-display); font-weight: 800; font-size: 12px;
  flex: none;
}
.testimonial__name { font-size: 18px; color: var(--teal-900); margin: 0; line-height: 1.3; }
.testimonial__meta { font-size: 14px; color: var(--teal-700); }

/* ====================== DEMO (dark) ====================== */
.demo { padding: 24px 0 64px; }
.demo__box {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(110% 100% at 85% 30%, rgba(45,130,103,0.9), rgba(45,130,103,0) 55%),
    var(--teal-700);
  border-radius: 50px;
  padding: 75px 92px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 603px;
  gap: 64px;
  align-items: center;
}
.demo__eyebrow { font-weight: 600; font-size: 20px; color: var(--c-mint); margin: 0 0 12px; }
.demo__title { font-weight: 800; font-size: 44px; line-height: 1.2; color: #fff; margin: 0 0 18px; max-width: 864px; }
.demo__lead { font-size: 18px; line-height: 1.3; color: #eaf3ef; margin: 0 0 34px; max-width: 857px; }
.demo-checklist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 9px; }
.demo-checklist li { display: flex; align-items: center; gap: 10px; font-size: 18px; color: #fff; }
.demo-checklist img { width: 32px; height: 32px; flex: none; }

/* demo form card */
.demo-form {
  background: #fff;
  border-radius: 20px;
  padding: 48px;
  min-width: 0; /* allow the card to shrink to its column (no overflow on phones) */
}
.demo-form h3 { font-weight: 700; font-size: 32px; color: var(--teal-900); margin: 0 0 16px; }
.demo-form p { font-size: 18px; line-height: 1.2; color: var(--teal-900); margin: 0 0 24px; }
.demo-form__row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.demo-field {
  width: 100%;
  height: 42px;
  padding: 0 20px;
  margin-bottom: 14px;
  font-family: var(--font-primary);
  font-weight: 300;
  font-size: 18px;
  color: var(--teal-900);
  background: #fff;
  border: 1px solid var(--teal-500);
  border-radius: 10px;
}
.demo-field::placeholder { color: var(--teal-900); opacity: 1; }
.demo-field:focus { outline: none; box-shadow: 0 0 0 2px rgba(63,162,133,0.25); }
.demo-form__actions { display: flex; justify-content: flex-end; margin-top: 8px; }
.demo-form__actions .btn { height: 42px; font-size: 18px; padding: 0 28px; }

/* CTA variant of the card: centered heading, text and single button */
.demo-form--cta { text-align: center; }
.demo-form--cta h3 { margin-bottom: 14px; }
.demo-form--cta p { margin-bottom: 28px; }
.demo-form__cta { display: inline-flex; height: 46px; padding: 0 32px; font-size: 18px; }

/* ====================== RESPONSIVE ====================== */
@media (max-width: 1280px) {
  .esg__box { grid-template-columns: 1fr; gap: 40px; }
  .esg__cards { grid-template-columns: repeat(2, 1fr); }
  .stages__box { grid-template-columns: 1fr; gap: 48px; }
  .stages__head { position: static; }
  .why__inner { grid-template-columns: 1fr; gap: 56px; }
  .demo__box { grid-template-columns: 1fr; gap: 48px; }
}

@media (max-width: 1100px) {
  .h-container { padding-inline: 40px; }
  .home-hero { padding: 64px 0 56px; }
  .home-hero__title { font-size: clamp(38px, 6.5vw, 64px); line-height: 1.08; }
  .home-hero__lead { font-size: clamp(18px, 2.6vw, 24px); }
  .clients__grid { grid-template-columns: repeat(3, 1fr); }
  .testimonials__grid { grid-template-columns: 1fr; max-width: 560px; margin-inline: auto; }
}

@media (max-width: 760px) {
  .h-container { padding-inline: 22px; }
  .esg__box, .stages__box, .demo__box { padding: 40px 24px; border-radius: 32px; }
  .esg__title { font-size: 36px; line-height: 1.1; }
  .esg__cards { grid-template-columns: 1fr; }
  .esg-card { height: auto; }
  .stages__title { font-size: 34px; line-height: 1.1; }
  .why__title, .clients__title, .demo__title { font-size: 30px; }
  /* Let the stacked Why columns shrink to the viewport (no overflow on small phones) */
  .why__left, .why__right { min-width: 0; }
  .why-graphic { max-width: 100%; }
  .why-stat { grid-template-columns: 90px 1fr; }
  .why-stat__num { font-size: 36px; }
  .clients__grid { grid-template-columns: 1fr 1fr; }
  .demo-form { padding: 28px; }
  .demo-form h3 { font-size: 26px; }

  /* Feature strip → clean left-aligned vertical list (no uneven wrapping) */
  .feature-strip {
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: flex-start;
    gap: 16px;
    margin-top: 30px;
    width: 100%;
    max-width: 330px;
    margin-inline: auto;
  }
  .feature-strip__item { width: 100%; }

  /* Stage rows → step label + body stacked, arrow pinned to the right */
  .stage-row {
    grid-template-columns: 1fr auto;
    column-gap: 16px;
    row-gap: 8px;
    align-items: start;
    padding: 24px 22px;
  }
  .stage-row__step { grid-column: 1; grid-row: 1; }
  .stage-row > div { grid-column: 1; grid-row: 2; }
  .stage-row__arrow { grid-column: 2; grid-row: 1 / span 2; align-self: center; }
  .stage-row__name { font-size: 22px; }

  /* Testimonials → tighter padding on small screens */
  .testimonial { padding: 26px; }
  .testimonial__quote { margin-bottom: 18px; }
}

@media (max-width: 460px) {
  .demo-form__row { grid-template-columns: 1fr; gap: 0; }
  .clients__grid { grid-template-columns: 1fr; max-width: 320px; margin-inline: auto; }
}

/* ==========================================================================
   Mobile-only refinements (≤640): full-width demo button + testimonial carousel
   ========================================================================== */
@media (max-width: 640px) {
  /* Demo form submit → full width, single line */
  .demo-form__actions { justify-content: stretch; }
  .demo-form__actions .btn { width: 100%; font-size: 16px; padding: 0 18px; }

  /* Testimonials → centered swipe carousel + dots (desktop grid untouched) */
  .testimonials__grid {
    display: flex;
    grid-template-columns: none;
    max-width: none;
    gap: 16px;
    margin-inline: -22px;
    padding: 8px 9vw 16px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    align-items: flex-start;
  }
  .testimonials__grid::-webkit-scrollbar { display: none; }
  .testimonial {
    flex: 0 0 82vw;
    max-width: 420px;
    scroll-snap-align: center;
  }
  .testimonial__quote { flex: 0 1 auto; }

  .testi-dots { display: flex; justify-content: center; gap: 8px; margin-top: 16px; }
  .testi-dot {
    width: 8px; height: 8px; padding: 0; border: 0; border-radius: 50%;
    background: rgba(18, 94, 89, 0.2); cursor: pointer;
    transition: width 0.25s ease, background 0.25s ease;
  }
  .testi-dot.is-active { width: 22px; border-radius: 4px; background: var(--green-500); }
}

/* Dots only show for the mobile carousel */
@media (min-width: 641px) {
  .testi-dots { display: none; }
}
