/* ==========================================================================
   HERO.CSS — Homepage: hero + fast-start, product range, trust band,
   how-it-works strip, closing CTA banner.
   toilet-cubicle.co.uk — A Paneltech brand (see docs/brand/BRAND.md)
   ========================================================================== */

/* =========================================================================
   HERO SECTION
   ========================================================================= */

.hero {
  position: relative;
  min-height: clamp(480px, 72vh, 720px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background-color: var(--color-petrol-deep);
}

/* -------------------------------------------------------------------------
   Background image with petrol overlay for text contrast.
   Worst case (pure-white photo region) at 0.80 alpha petrol-deep leaves
   white text at ~7.6:1 and the lime kicker (top, 0.92 alpha) at ~6:1 —
   both clear of WCAG AA 4.5:1.
   ------------------------------------------------------------------------- */

.hero__bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero__bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 40%;
}

.hero__bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(14, 46, 52, 0.92) 0%,
    rgba(14, 46, 52, 0.84) 45%,
    rgba(14, 46, 52, 0.80) 70%,
    rgba(14, 46, 52, 0.88) 100%
  );
}

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

.hero__overlay {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-block: calc(var(--header-height) + var(--sp-5)) var(--sp-7);
}

.hero__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.hero__kicker {
  /* .kicker--inverse supplies lime-on-petrol-deep (BRAND.md §1) */
  animation: hero-fade-up 0.6s var(--ease-out) 0.1s both;
}

.hero__title {
  font-family: var(--font-display);
  font-size: clamp(var(--text-2xl), 4.5vw + 0.75rem, var(--text-5xl));
  font-weight: var(--weight-extrabold);
  letter-spacing: var(--tracking-tight);
  line-height: 1.08;
  color: var(--color-white);
  max-width: 820px;
  margin-bottom: var(--sp-3);
  animation: hero-fade-up 0.6s var(--ease-out) 0.2s both;
}

.hero__subtitle {
  font-size: clamp(var(--text-base), 1.5vw, var(--text-md));
  color: rgba(255, 255, 255, 0.92);
  max-width: 620px;
  line-height: var(--leading-normal);
  margin-bottom: var(--sp-5);
  animation: hero-fade-up 0.6s var(--ease-out) 0.3s both;
}

/* =========================================================================
   FAST-START CARD — compact configurator entry on the hero
   Builds configurator.html?cubicles=<n>&layout=<inline|corner>
   ========================================================================= */

.fast-start {
  width: 100%;
  max-width: 640px;
  padding: var(--sp-3);
  background-color: var(--color-white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  text-align: left;
  animation: hero-fade-up 0.6s var(--ease-out) 0.4s both;
}

@media (min-width: 768px) {
  .fast-start {
    padding: var(--sp-3) var(--sp-4);
  }
}

/* -- Title — shared kicker recipe, local margin --------------------------- */

.fast-start__title {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  font-family: var(--font-mono);
  font-size: var(--text-2xs);
  font-weight: var(--weight-medium);
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
  color: var(--color-petrol);
  margin-bottom: var(--sp-2);
}

.fast-start__title::before {
  content: "";
  flex-shrink: 0;
  width: 24px;
  height: 2px;
  background-color: var(--color-lime);
}

/* -- Fields row ------------------------------------------------------------ */

.fast-start__fields {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--sp-2);
  align-items: end;
}

@media (min-width: 576px) {
  .fast-start__fields {
    grid-template-columns: auto 1fr auto;
  }
}

.fast-start__field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.fast-start__label {
  font-size: var(--text-2xs);
  font-weight: var(--weight-semibold);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  color: var(--color-grey-600);
}

/* -- Cubicle stepper — −/value/+, mono value, 44px targets (BRAND.md §4) -- */

.fast-start__stepper {
  display: inline-flex;
  align-items: stretch;
  border: 1px solid var(--color-grey-300);
  border-radius: var(--radius);
  background-color: var(--color-white);
  overflow: hidden;
}

.fast-start__step-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 46px;
  border: none;
  background-color: var(--color-grey-50);
  color: var(--color-petrol);
  cursor: pointer;
  transition: background-color var(--transition-fast), color var(--transition-fast);
}

.fast-start__step-btn:hover {
  background-color: var(--color-petrol-tint);
  color: var(--color-petrol-dark);
}

.fast-start__step-btn:focus-visible {
  outline: 2px solid var(--color-petrol);
  outline-offset: -2px;
}

.fast-start__step-btn[aria-disabled="true"] {
  color: var(--color-grey-400);
  cursor: not-allowed;
  background-color: var(--color-grey-50);
}

.fast-start__value {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 56px;
  font-family: var(--font-mono);
  font-size: var(--text-md);
  font-weight: var(--weight-medium);
  color: var(--color-grey-900);
  border-inline: 1px solid var(--color-grey-200);
  user-select: none;
}

/* -- Layout select (inherits global select styling from components.css) --- */

.fast-start__select {
  min-height: 48px;
  width: 100%;
  min-width: 140px;
}

/* -- Accent CTA — lime bg, petrol-deep ink (never white on lime) ----------- */

.fast-start__cta {
  min-height: 48px;
  white-space: nowrap;
}

.fast-start__cta svg {
  transition: transform var(--transition-fast);
}

.fast-start__cta:hover svg {
  transform: translateX(3px);
}

/* =========================================================================
   SHARED SECTION HEAD — kicker + h2
   ========================================================================= */

.section-head {
  max-width: 720px;
  margin-bottom: var(--sp-5);
}

.section-head h2 {
  margin-bottom: 0;
}

/* =========================================================================
   PRODUCT RANGE GRID — cards per BRAND.md §4
   ========================================================================= */

.products {
  background-color: var(--color-white);
}

.products__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--sp-3);
}

@media (min-width: 576px) {
  .products__grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .products__grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.product-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: var(--sp-3);
  background-color: var(--color-white);
  border: 1px solid var(--color-grey-200);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  color: inherit;
  font-weight: var(--weight-regular);
  text-decoration: none;
  transition:
    border-color var(--transition-fast),
    box-shadow var(--transition-fast),
    transform var(--transition-fast);
}

a.product-card:hover {
  border-color: var(--color-petrol);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  color: inherit;
  text-decoration: none;
}

.product-card__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  margin-bottom: var(--sp-2);
  background-color: var(--color-petrol-tint);
  border-radius: var(--radius-md);
  color: var(--color-petrol);
}

.product-card__name {
  font-size: var(--text-lg);
  margin-bottom: var(--sp-1);
}

.product-card__desc {
  font-size: var(--text-sm);
  color: var(--color-grey-600);
  line-height: var(--leading-normal);
  margin-bottom: var(--sp-2);
}

.product-card__action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: auto;
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: var(--color-petrol);
}

.product-card__action svg {
  transition: transform var(--transition-fast);
}

a.product-card:hover .product-card__action svg {
  transform: translateX(3px);
}

a.product-card:hover .product-card__action {
  color: var(--color-petrol-dark);
}

/* -- Coming-soon tile (IPS) — not a link ----------------------------------- */

.product-card--soon {
  background-color: var(--color-grey-50);
}

.product-card--soon .product-card__icon {
  background-color: var(--color-grey-100);
  color: var(--color-grey-600);
}

.product-card--soon .product-card__name,
.product-card--soon .product-card__desc {
  color: var(--color-grey-600);
}

.product-card__badge {
  position: absolute;
  top: var(--sp-2);
  right: var(--sp-2);
  font-family: var(--font-mono);
  font-size: var(--text-2xs);
  font-weight: var(--weight-medium);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  color: var(--color-grey-600);
  background-color: var(--color-grey-100);
  border: 1px solid var(--color-grey-200);
  padding: 3px 10px;
  border-radius: var(--radius-full);
}

/* =========================================================================
   TRUST BAND — A Paneltech brand
   ========================================================================= */

.trust {
  background-color: var(--color-off-white);
}

.trust__inner {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--sp-5);
  align-items: start;
}

@media (min-width: 1024px) {
  .trust__inner {
    grid-template-columns: 3fr 2fr;
    gap: var(--sp-8);
  }
}

.trust__text {
  font-size: var(--text-base);
  color: var(--color-grey-800);
  line-height: var(--leading-normal);
  max-width: 560px;
  margin-bottom: var(--sp-3);
}

.trust__sectors-title {
  font-size: var(--text-md);
  margin-bottom: var(--sp-2);
}

.trust__chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-1);
  list-style: none;
  padding: 0;
  margin: 0;
}

.trust__chip {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: var(--sp-1) var(--sp-2);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--color-grey-800);
  background-color: var(--color-white);
  border: 1px solid var(--color-stone);
  border-radius: var(--radius-full);
}

/* =========================================================================
   HOW IT WORKS STRIP — mono step numerals, kicker heading
   ========================================================================= */

.how {
  background-color: var(--color-white);
}

.how__steps {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--sp-4);
  list-style: none;
  padding: 0;
  margin: 0;
}

@media (min-width: 576px) {
  .how__steps {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .how__steps {
    grid-template-columns: repeat(4, 1fr);
    gap: var(--sp-3);
  }
}

.how__step {
  padding-top: var(--sp-2);
  border-top: 2px solid var(--color-grey-200);
}

/* Mono numerals — JetBrains Mono 500 max; no faux bold (BRAND.md §2) */
.how__numeral {
  display: block;
  font-family: var(--font-mono);
  font-size: var(--text-xl);
  font-weight: var(--weight-medium);
  color: var(--color-petrol);
  margin-bottom: var(--sp-2);
}

.how__step-title {
  font-size: var(--text-md);
  margin-bottom: var(--sp-1);
}

.how__step-desc {
  font-size: var(--text-sm);
  color: var(--color-grey-600);
  line-height: var(--leading-normal);
}

/* =========================================================================
   INSTALLATION SHOWCASE — real-install marquee
   Petrol-deep band so the photos read as one cohesive set via a shared
   duotone/petrol overlay; lime accent only on hover (BRAND.md §1, §4).
   ========================================================================= */

.showcase {
  background-color: var(--color-petrol-deep);
  overflow: hidden; /* clip the off-screen ends of the marquee track */
}

/* .showcase__head also carries .container (page gutters); keep that width
   and only add the band's bottom rhythm here. Heading/lead self-constrain. */
.showcase__head {
  margin-bottom: var(--sp-5);
}

/* Kicker sits on a dark surface here — recolour to the inverse recipe */
.showcase__head .kicker {
  color: var(--color-lime);
}

.showcase__head h2 {
  color: var(--color-white);
  margin-bottom: var(--sp-2);
}

.showcase__lead {
  font-size: var(--text-base);
  color: var(--color-grey-300);
  line-height: var(--leading-normal);
  margin-bottom: 0;
  max-width: 560px;
}

/* -- Marquee viewport ------------------------------------------------------ */

.showcase__marquee {
  position: relative;
  display: flex;
  width: 100%;
  /* Soft fade at both edges so cards enter/exit cleanly, not abruptly cut */
  -webkit-mask-image: linear-gradient(
    90deg,
    transparent 0,
    #000 6%,
    #000 94%,
    transparent 100%
  );
  mask-image: linear-gradient(
    90deg,
    transparent 0,
    #000 6%,
    #000 94%,
    transparent 100%
  );
}

/* Two identical tracks sit side by side; the keyframe shifts the pair left
   by exactly one track width then loops, giving a seamless scroll. */
.showcase__track {
  display: flex;
  flex-shrink: 0;
  gap: var(--sp-3);
  margin: 0;
  list-style: none;
  /* Vertical breathing room for the hover lift/shadow; the trailing right
     padding equals the inter-item gap so the loop seam keeps the same
     rhythm when translateX(-100%) wraps track 1 onto track 2. */
  padding: var(--sp-1) var(--sp-3) var(--sp-1) 0;
  animation: showcase-scroll 60s linear infinite;
}

/* Pause when the visitor hovers or tabs into the strip (no scroll trap),
   or when js/hero.js flags the strip as scrolled out of view. */
.showcase__marquee:hover .showcase__track,
.showcase__marquee:focus-within .showcase__track,
.showcase__marquee--offscreen .showcase__track {
  animation-play-state: paused;
}

.showcase__item {
  flex-shrink: 0;
  width: clamp(240px, 60vw, 320px);
}

.showcase__item--portrait {
  width: clamp(200px, 48vw, 260px);
}

/* -- Cards ----------------------------------------------------------------- */

.showcase__card {
  position: relative;
  margin: 0;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  background-color: var(--color-petrol-dark);
  transition:
    transform var(--transition-base),
    box-shadow var(--transition-base);
}

.showcase__img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3; /* reserved on every image — no CLS */
  object-fit: cover;
  /* Cohesive duotone-ish unification: gently desaturate + warm toward the
     petrol band so the mixed photo set reads as one family. */
  filter: saturate(0.82) contrast(1.02) brightness(0.96);
  transition: filter var(--transition-base), transform var(--transition-base);
}

.showcase__item--portrait .showcase__img {
  aspect-ratio: 3 / 4;
}

/* Shared petrol overlay so every photo carries the brand tint */
.showcase__card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(
    180deg,
    rgba(14, 46, 52, 0.10) 0%,
    rgba(14, 46, 52, 0.18) 55%,
    rgba(14, 46, 52, 0.62) 100%
  );
  transition: background var(--transition-base);
}

.showcase__caption {
  position: absolute;
  inset-inline: 0;
  bottom: 0;
  z-index: 2;
  padding: var(--sp-3) var(--sp-2) var(--sp-2);
  font-family: var(--font-mono);
  font-size: var(--text-2xs);
  font-weight: var(--weight-medium);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--color-white);
}

/* Lime accent rule above the caption — appears on hover/focus only */
.showcase__caption::before {
  content: "";
  position: absolute;
  top: var(--sp-1);
  inset-inline-start: var(--sp-2);
  width: 24px;
  height: 2px;
  background-color: var(--color-lime);
  opacity: 0;
  transform: scaleX(0);
  transform-origin: left center;
  transition: opacity var(--transition-base), transform var(--transition-base);
}

/* Hover / focus-within lift — lime only as the accent line, never as text */
.showcase__card:hover,
.showcase__card:focus-within {
  transform: translateY(-4px);
  box-shadow: var(--shadow-xl);
}

.showcase__card:hover .showcase__img,
.showcase__card:focus-within .showcase__img {
  filter: saturate(1) contrast(1) brightness(1);
  transform: scale(1.04);
}

.showcase__card:hover .showcase__caption::before,
.showcase__card:focus-within .showcase__caption::before {
  opacity: 1;
  transform: scaleX(1);
}

@keyframes showcase-scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-100%); }
}

/* =========================================================================
   CLOSING CTA BANNER — petrol-deep, lime accent button
   ========================================================================= */

.cta-banner {
  background-color: var(--color-petrol-deep);
  padding-block: var(--sp-6);
}

@media (min-width: 768px) {
  .cta-banner {
    padding-block: var(--sp-8);
  }
}

.cta-banner__inner {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--sp-3);
}

@media (min-width: 768px) {
  .cta-banner__inner {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: var(--sp-4);
  }
}

.cta-banner__title {
  color: var(--color-white);
  margin-bottom: var(--sp-1);
}

.cta-banner__text {
  color: var(--color-grey-300);
  font-size: var(--text-base);
  margin-bottom: 0;
}

.cta-banner__btn {
  flex-shrink: 0;
}

/* =========================================================================
   ENTRY + SCROLL ANIMATIONS
   ========================================================================= */

@keyframes hero-fade-up {
  0% {
    opacity: 0;
    transform: translateY(20px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Scroll-reveal states applied by js/hero.js (skipped under reduced motion) */
.animate-prepare {
  opacity: 0;
  transform: translateY(16px);
}

.animate-in {
  opacity: 1;
  transform: translateY(0);
  transition:
    opacity 0.6s var(--ease-out),
    transform 0.6s var(--ease-out);
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  .hero__kicker,
  .hero__title,
  .hero__subtitle,
  .fast-start {
    animation: none;
    opacity: 1;
    transform: none;
  }

  .animate-prepare,
  .animate-in {
    opacity: 1;
    transform: none;
    transition: none;
  }

  /* Showcase: no marquee. Static, manually scrollable strip — never moves
     on its own and never traps the page scroll. The duplicate track is
     redundant for AT but harmless; hide it to avoid a doubled static set. */
  .showcase__track {
    animation: none;
    padding-inline: var(--sp-2);
  }

  .showcase__track[aria-hidden="true"] {
    display: none;
  }

  .showcase__marquee {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    -webkit-mask-image: none;
    mask-image: none;
  }

  .showcase__card:hover,
  .showcase__card:focus-within {
    transform: none;
  }

  .showcase__card:hover .showcase__img,
  .showcase__card:focus-within .showcase__img {
    transform: none;
  }
}
