/* =========================================================
   HOME PAGE (index.html only)
   Loads after styles.css. Hero, recent work strip, before/after
   band, reveal-on-scroll, and the clear header over the dark hero.
   ========================================================= */

/* ---------- 1. Hero: your work is the hero ---------- */
.hp-hero {
  position: relative;
  overflow: hidden;
  margin-top: calc(-1 * var(--header-height)); /* tuck under the sticky header, same as .hero */
  padding: calc(var(--header-height) + 4.5rem) var(--gutter) 5rem;
  background: linear-gradient(160deg, #ffffff 0%, var(--color-bg-alt) 55%, #eef5f4 100%);
  border-bottom: 1px solid var(--color-border);
}
.hp-hero-inner {
  max-width: var(--container-width);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  align-items: center;
  gap: 3rem;
}
.hp-eyebrow {
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-red-dark); /* passes AA on the light backgrounds */
  margin-bottom: 1rem;
}
.hp-hero h1 {
  font-size: clamp(2.5rem, 1.6rem + 3.4vw, 4rem);
  line-height: 1.1;
  margin-bottom: 1.25rem;
}
.hp-hero h1 .hp-hl { color: var(--color-accent); } /* large text, so the teal passes here */
.hp-hero .lede { margin-bottom: 2rem; }
.hp-hero-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; }

/* Filled version of your usual button, for the main call to action */
.btn--solid {
  background: var(--color-button);
  color: var(--color-button-text);
}

/* The fanned stack of real client sites */
.hp-stack {
  position: relative;
  aspect-ratio: 1 / 0.82;
}
.hp-card {
  position: absolute;
  width: 58%;
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 1.25rem 2.5rem rgba(12, 11, 11, 0.18), 0 0 0 1px rgba(12, 11, 11, 0.06);
  transition: transform 0.4s ease;
}
.hp-card-bar {
  display: flex;
  gap: 0.3rem;
  padding: 0.45rem 0.6rem;
  background: #e9e7e7;
}
.hp-card-bar span {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: #c4c1c1;
}
.hp-card img {
  width: 100%;
  aspect-ratio: 4 / 3.4;
  object-fit: cover;
  object-position: top;
}
.hp-card--1 { left: 0;    top: 14%; transform: rotate(-6deg); z-index: 1; }
.hp-card--2 { left: 21%;  top: 0;   transform: rotate(1deg);  z-index: 3; }
.hp-card--3 { right: 0;   top: 20%; transform: rotate(7deg);  z-index: 2; }
.hp-stack:hover .hp-card--1 { transform: rotate(-9deg) translateX(-0.75rem); }
.hp-stack:hover .hp-card--3 { transform: rotate(10deg) translateX(0.75rem); }

@media (prefers-reduced-motion: no-preference) {
  .hp-card--2 { animation: hp-float 6s ease-in-out infinite; }
}
@keyframes hp-float {
  0%, 100% { transform: rotate(1deg) translateY(0); }
  50%      { transform: rotate(1deg) translateY(-0.6rem); }
}

/* ---------- 2. Before/after slider band ---------- */
.hp-ba {
  /* same soft white-to-teal fade as the hero */
  background: linear-gradient(160deg, #ffffff 0%, var(--color-bg-alt) 55%, #eef5f4 100%);
  border-bottom: 1px solid var(--color-border);
  margin-top: 2.5rem; /* breathing room below the cake photo above */
  padding: 5rem var(--gutter);
}
.hp-ba-inner {
  max-width: var(--container-width);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  gap: 3rem;
  align-items: center;
}

.hp-ba-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)); /* all three scores on one row */
  gap: 1.25rem;
  margin: 1.5rem 0 0.75rem;
}
.hp-ba-stats li { display: flex; flex-direction: column; }
.hp-ba-num {
  font-family: var(--font-heading);
  font-weight: var(--fw-heading);
  font-size: clamp(1.5rem, 1.2rem + 1.1vw, 2.125rem);
  color: var(--color-button);
  line-height: 1.1;
}
.hp-ba-num s { color: #7d7a7a; font-size: 0.6em; margin-right: 0.35rem; }
.hp-ba-label { font-size: 0.8125rem; line-height: 1.35; margin-top: 0.25rem; }
.hp-ba-source { font-size: 0.8125rem; color: #5c5959; margin-bottom: 1.25rem; }

.hp-compare {
  --pos: 50%;
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 1rem 2.25rem rgba(12, 11, 11, 0.16);
  user-select: none;
}
.hp-compare {
  aspect-ratio: 16 / 10; /* same shape as the screenshots, so nothing gets trimmed */
}
.hp-compare img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover; /* trims a little off each side, never the top */
  object-position: center top;
}
.hp-compare .hp-before {
  position: absolute;
  inset: 0;
  clip-path: inset(0 calc(100% - var(--pos)) 0 0);
}
.hp-compare-line {
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--pos);
  width: 3px;
  margin-left: -1.5px;
  background: #fff;
  pointer-events: none;
}
.hp-compare-line::after { /* the round handle */
  content: "\2039\00a0\203A";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  background: #fff;
  color: var(--color-button);
  font-size: 1.25rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0.25rem 0.75rem rgba(0, 0, 0, 0.3);
}
.hp-compare-tag {
  position: absolute;
  top: 0.75rem;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  background: rgba(20, 19, 19, 0.75);
  color: #fff;
  pointer-events: none;
}
.hp-compare-tag--before { left: 0.75rem; }
.hp-compare-tag--after  { right: 0.75rem; }
.hp-compare-tag { transition: opacity 0.2s ease; }
.hp-compare.hide-before .hp-compare-tag--before,
.hp-compare.hide-after .hp-compare-tag--after { opacity: 0; }
/* Invisible range input on top does the dragging, so it works with
   mouse, touch and keyboard (arrow keys) with no extra code */
.hp-compare input[type="range"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: ew-resize;
}
.hp-compare:has(input:focus-visible) {
  outline: 3px solid var(--color-link);
  outline-offset: 3px;
}

/* ---------- 3. Recent work strip ---------- */
.hp-work {
  padding: 4.5rem var(--gutter) 2rem;
  max-width: var(--container-width);
  margin: 0 auto;
}
.hp-work-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem 2rem;
  margin-bottom: 2rem;
}
.hp-work-head h2 { margin: 0; }
.hp-work-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
}
.hp-work-grid a {
  display: block;
  overflow: hidden;
  border-radius: 8px;
  box-shadow: 0 0.5rem 1.25rem rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.hp-work-grid img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; object-position: top; }
.hp-work-grid a:hover,
.hp-work-grid a:focus-visible {
  transform: translateY(-0.4rem);
  box-shadow: 0 1rem 2rem rgba(0, 0, 0, 0.18);
}
.hp-work-grid span {
  display: block;
  padding: 0.6rem 0.75rem;
  font-size: 0.875rem;
  font-weight: 400;
  color: var(--color-text);
  background: #fff;
}

/* ---------- 4. Gentle reveal on scroll ---------- */
/* Only hides things when JS is running, so nothing is ever stuck invisible */
@media (prefers-reduced-motion: no-preference) {
  .js .reveal {
    opacity: 0;
    transform: translateY(1.5rem);
    transition: opacity 0.7s ease, transform 0.7s ease;
  }
  .js .reveal.is-visible { opacity: 1; transform: none; }
}


/* ---------- 6. Responsive ---------- */
@media (max-width: 56.25em) { /* 900px */
  .hp-hero-inner,
  .hp-ba-inner { grid-template-columns: 1fr; }
  .hp-hero { padding-bottom: 3.5rem; }
  .hp-stack { max-width: 34rem; width: 100%; margin: 0 auto; }
  .hp-work-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 40em) { /* 640px */
  .hp-hero { padding-top: calc(var(--header-height) + 2.5rem); }
  .hp-ba { padding: 3.5rem var(--gutter); }
}

/* "Isn't it time to talk..." right after the tinted before/after band:
   white instead of its usual light gray, so two different pale tints
   don't sit back to back */
.hp-ba + .cta-banner { background: var(--color-bg); }

/* ---------- Dark hero variation (for comparing) ----------
   Turn on by adding hp-hero--dark to the hero section's class:
   <section class="hp-hero hp-hero--dark">. Remove it to go back to light. */
.hp-hero--dark {
  background: var(--hero-dark-bg); /* defined in styles.css */
  border-bottom: none;
  color: var(--color-dark-text);
}
.hp-hero--dark .hp-eyebrow { color: var(--color-orange); }
.hp-hero--dark h1 { color: #fff; }
.hp-hero--dark h1 .hp-hl { color: var(--color-yellow); }
.hp-hero--dark .lede { color: #d9d6d6; }
.hp-hero--dark .btn--solid {
  background: var(--color-yellow);
  border-color: var(--color-yellow);
  color: #141313;
}
.hp-hero--dark .btn:not(.btn--solid) {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.6);
  color: #fff;
}
.hp-hero--dark .btn:hover,
.hp-hero--dark .btn:focus-visible {
  background: var(--color-button-hover);
  border-color: var(--color-button-hover);
  color: #fff;
}
.hp-hero--dark .hp-card { box-shadow: 0 1.5rem 3rem rgba(0, 0, 0, 0.45); }


/* These images sit inside their own rounded frames, so they skip the
   site-wide rounded corners on main img (styles.css) */
.hp-card img,
.hp-compare img,
.hp-work-grid img { border-radius: 0; }
