/* RSG homepage — the reference implementation of the new storefront style.
   Section order: hero, product narrative, facts bento, factory gallery,
   OEM steps, resources, contact band. */

:root {
  --hp-dark: #08080a;
}

/* ------------------------------------------------------------------ hero */
/* The whole hero — headline, search, quote button and the promo photograph —
   must fit one 16:9 screen below the topbar. The photo was shot on near-black
   (#0c0c0c → #242425), so the hero is set on the same black and the image
   edges are feathered into it instead of being boxed in a card. */

.hp-hero {
  --hero-bg: #0b0b0c;
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  /* A definite height (not min-height) so the 1fr photo row resolves against
     the screen instead of the image's intrinsic 720px. */
  height: clamp(560px, calc(100svh - var(--topbar-h)), 1000px);
  padding-top: clamp(28px, 5.5vh, 64px);
  background: var(--hero-bg);
  color: var(--on-dark);
  overflow: hidden;
  isolation: isolate;
}

.hp-hero-copy {
  position: relative;
  z-index: 2;
  width: min(100% - (var(--gutter) * 2), 1180px);
  margin-inline: auto;
  text-align: center;
}

.hp-hero-kicker {
  margin-bottom: clamp(10px, 1.6vh, 16px);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: #6fb0ff;
}

/* One line on desktop: the size is driven by both width and height so a
   short 16:9 window never pushes the actions below the fold. */
.hp-hero h1 {
  font-size: clamp(2rem, min(3.8vw, 5.8vh), 4rem);
  font-weight: 680;
  letter-spacing: -0.032em;
  line-height: 1.08;
  color: #f5f5f7;
  text-wrap: balance;
}

.hp-hero h1 .hero-title-line {
  display: inline;
}

.hp-hero h1 em {
  font-style: normal;
  background: linear-gradient(92deg, #7cc0ff 0%, #2f8cff 55%, #5aa8ff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hp-hero .lead {
  margin: clamp(10px, 1.6vh, 18px) auto 0;
  font-size: clamp(0.95rem, 0.85rem + 0.35vw, 1.125rem);
  color: var(--on-dark-muted);
  max-width: 52ch;
}

.hp-hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: var(--space-3);
  margin-top: clamp(16px, 3vh, 28px);
}

.hp-search {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  width: min(100%, 440px);
  padding: 5px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  transition: box-shadow var(--dur-base) var(--ease-out),
    background var(--dur-base) var(--ease-out);
}

.hp-search:focus-within {
  background: rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 0 0 1px rgba(111, 176, 255, 0.7), 0 0 0 4px rgba(10, 99, 196, 0.25);
}

.hp-search > span[aria-hidden] {
  padding-inline-start: var(--space-3);
  font-size: 16px;
  color: var(--on-dark-faint);
}

.hp-search input {
  flex: 1 1 auto;
  min-width: 0;
  height: 40px;
  border: 0;
  background: transparent;
  color: #fff;
  font-size: var(--text-sm);
}

.hp-search input::placeholder {
  color: var(--on-dark-faint);
}

.hp-search input:focus {
  outline: none;
}

.hp-search button {
  flex: 0 0 auto;
  height: 40px;
  padding-inline: var(--space-5);
  border: 0;
  border-radius: var(--radius-pill);
  background: #fff;
  color: var(--ink);
  font-size: var(--text-sm);
  font-weight: 600;
  transition: background var(--dur-fast) var(--ease-soft);
}

.hp-search button:hover {
  background: #e8e8ed;
}

.hp-hero-quote {
  min-height: 50px;
  padding-inline: var(--space-6);
}

/* Promo photograph */

.hp-hero-visual {
  position: relative;
  z-index: 1;
  min-height: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  margin-top: clamp(-8px, -1vh, 0px);
}

.hp-hero-visual img {
  width: auto;
  height: 100%;
  max-width: min(100%, 1480px);
  max-height: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  object-position: 50% 58%;
  /* Feather every edge into the section background. */
  -webkit-mask-image:
    linear-gradient(to right, transparent 0%, #000 12%, #000 88%, transparent 100%),
    linear-gradient(to bottom, transparent 0%, #000 14%, #000 80%, transparent 100%);
  -webkit-mask-composite: source-in;
  mask-image:
    linear-gradient(to right, transparent 0%, #000 12%, #000 88%, transparent 100%),
    linear-gradient(to bottom, transparent 0%, #000 14%, #000 80%, transparent 100%);
  mask-composite: intersect;
}

/* A soft brand glow sits under the parts so the black is not flat. */
.hp-hero::before {
  content: "";
  position: absolute;
  z-index: 0;
  left: 50%;
  bottom: 6%;
  width: min(1100px, 90vw);
  height: 46%;
  transform: translateX(-50%);
  background: radial-gradient(50% 50% at 50% 60%, rgba(10, 99, 196, 0.28), transparent 72%);
  filter: blur(30px);
  pointer-events: none;
}

.hp-hero .home-scroll-nav {
  position: relative;
  z-index: 2;
  margin: 0 auto clamp(14px, 2.4vh, 24px);
  padding: var(--space-2) var(--space-4);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
  color: var(--on-dark-muted);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
}

.hp-hero .home-scroll-nav:hover {
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.28);
}

/* Trust strip — slim band directly under the hero */

.trust {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  width: min(100% - (var(--gutter) * 2), var(--measure-wide));
  margin: 0 auto;
  padding-block: clamp(28px, 4vw, 44px);
  border-bottom: 1px solid var(--hairline-soft);
}

.trust > span {
  display: grid;
  gap: 2px;
  padding-inline: var(--space-5);
  text-align: center;
}

.trust > span + span {
  border-left: 1px solid var(--hairline-soft);
}

.trust b {
  font-size: clamp(1.5rem, 1.1rem + 1.2vw, 2.25rem);
  font-weight: 660;
  letter-spacing: -0.025em;
  line-height: 1.15;
}

.trust small {
  font-size: var(--text-xs);
  color: var(--ink-faint);
}

/* ---------------------------------------------------------- shared heads */

.hp-section-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: end;
  gap: var(--space-6);
  margin-bottom: clamp(32px, 4vw, 56px);
}

.hp-section-head h2 {
  font-size: var(--text-3xl);
  font-weight: 680;
  letter-spacing: var(--tracking-hero);
  line-height: 1.08;
}

.hp-section-head p {
  font-size: var(--text-base);
  color: var(--ink-muted);
  max-width: 54ch;
}

.hp-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-4);
  margin-top: var(--space-6);
}

/* ------------------------------------------------------ product lines */
/* Each line is a shelf of real catalog photos. The photos are small
   white-background catalog shots, so they are shown at modest size inside
   uniform white tiles — never blown up as hero imagery. */

.hp-lines {
  padding-block: var(--section-y);
}

.hp-line {
  padding: clamp(20px, 2.4vw, 32px);
  border-radius: var(--radius-lg);
  background: var(--surface-muted);
}

.hp-line + .hp-line {
  margin-top: var(--space-4);
}

.hp-line-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: end;
  gap: var(--space-6);
  margin-bottom: clamp(16px, 2vw, 24px);
}

.hp-line-kicker {
  margin-bottom: var(--space-2);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--brand);
}

.hp-line-title h3 {
  font-size: var(--text-2xl);
  font-weight: 660;
  letter-spacing: -0.022em;
  line-height: 1.1;
}

.hp-line-meta {
  display: flex;
  gap: var(--space-6);
  margin: 0;
}

.hp-line-meta > div {
  display: grid;
  gap: 2px;
}

.hp-line-meta dt {
  font-size: var(--text-xs);
  color: var(--ink-faint);
}

.hp-line-meta dd {
  margin: 0;
  font-size: var(--text-base);
  font-weight: 620;
  white-space: nowrap;
}

.hp-line-meta dd small {
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--ink-muted);
}

.hp-line-link {
  align-self: center;
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-pill);
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--hairline);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
  transition: background var(--dur-fast) var(--ease-soft),
    color var(--dur-fast) var(--ease-soft), box-shadow var(--dur-fast) var(--ease-soft);
}

.hp-line-link:hover {
  background: var(--brand);
  color: #fff;
  box-shadow: none;
}

.hp-line-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: var(--space-3);
  margin: 0;
  padding: 0;
  list-style: none;
}

.hp-part {
  position: relative;
  display: grid;
  grid-template-rows: auto auto;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  background: var(--surface);
  overflow: hidden;
  transition: transform var(--dur-base) var(--ease-out),
    box-shadow var(--dur-base) var(--ease-out);
}

.hp-part::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(220px circle at var(--spot-x, 50%) var(--spot-y, 40%), rgba(10, 99, 196, 0.08), transparent 60%);
  opacity: 0;
  transition: opacity var(--dur-base) var(--ease-soft);
  pointer-events: none;
}

.hp-part:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.hp-part:hover::after {
  opacity: 1;
}

.hp-part-img {
  display: grid;
  place-items: center;
  aspect-ratio: 1 / 1;
}

.hp-part-img img {
  width: 78%;
  height: 78%;
  object-fit: contain;
  mix-blend-mode: multiply;
  transition: transform var(--dur-slow) var(--ease-out);
}

.hp-part:hover .hp-part-img img {
  transform: scale(1.05);
}

.hp-part-sku {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-align: center;
  color: var(--ink-soft);
}

.hp-sourcing {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-5);
  margin-top: var(--space-4);
  padding: clamp(20px, 2.4vw, 32px);
  border-radius: var(--radius-lg);
  box-shadow: inset 0 0 0 1px var(--hairline-soft);
}

.hp-sourcing h3 {
  font-size: var(--text-xl);
  font-weight: 640;
}

.hp-sourcing p {
  max-width: 68ch;
  margin-top: var(--space-3);
  color: var(--ink-soft);
}

/* ----------------------------------------------------------- facts bento */

.hp-facts {
  padding-block: var(--section-y);
}

.hp-bento {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: var(--space-4);
}

.hp-tile {
  display: grid;
  align-content: end;
  gap: var(--space-3);
  min-height: 190px;
  padding: var(--space-6);
  border-radius: var(--radius-md);
  background: var(--surface-muted);
  overflow: hidden;
}

.hp-tile b {
  font-size: clamp(2rem, 1.2rem + 2.6vw, 3.25rem);
  font-weight: 680;
  letter-spacing: -0.03em;
  line-height: 1;
}

.hp-tile span {
  font-size: var(--text-sm);
  color: var(--ink-muted);
}

.hp-tile--wide {
  grid-column: span 3;
}

a.hp-tile {
  color: inherit;
  text-decoration: none;
  transition: background var(--dur-base) var(--ease-out), transform var(--dur-base) var(--ease-out);
}

a.hp-tile:hover {
  background: var(--surface-sunken);
  transform: translateY(-3px);
}

.hp-tile--third {
  grid-column: span 2;
}

.hp-tile--accent {
  background: var(--ink);
  color: var(--on-dark);
}

.hp-tile--accent span {
  color: var(--on-dark-muted);
}

.hp-tile--brand {
  background: var(--brand);
  color: #fff;
}

.hp-tile--brand span {
  color: rgba(255, 255, 255, 0.78);
}

.hp-tile--photo {
  grid-column: span 3;
  padding: 0;
  min-height: 260px;
}

.hp-tile--photo {
  position: relative;
}

.hp-tile--photo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

@media (max-width: 960px) {
  .hp-bento {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .hp-tile--wide,
  .hp-tile--third,
  .hp-tile--photo {
    grid-column: span 2;
  }
}

@media (max-width: 560px) {
  .hp-tile--third {
    grid-column: span 2;
  }
}

/* -------------------------------------------------------- factory gallery */

/* The pinned gallery must fit inside one screen, so card height is tied to
   the viewport height and the section padding is tighter than elsewhere. */
.hp-gallery {
  padding-block: clamp(56px, 9vh, 104px) clamp(36px, 6vh, 64px);
  background: var(--hp-dark);
  color: var(--on-dark);
}

.hp-gallery .hp-section-head {
  margin-bottom: clamp(24px, 4vh, 40px);
}

.hp-gallery .hp-section-head h2 {
  color: var(--on-dark);
}

.hp-gallery .hp-section-head p {
  color: var(--on-dark-muted);
}

/* The viewport is the scroll container; the track is what GSAP translates, so
   it must never own overflow itself. */
.hp-gallery-viewport {
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  overscroll-behavior-x: contain;
}

.hp-gallery-viewport::-webkit-scrollbar {
  display: none;
}

.hp-gallery-track {
  display: flex;
  gap: var(--space-3);
  padding-inline: var(--gutter);
  width: max-content;
  will-change: transform;
}

.hp-shot {
  --shot-h: clamp(200px, 36vh, 380px);
  position: relative;
  flex: 0 0 auto;
  height: var(--shot-h);
  aspect-ratio: 4 / 3;
  scroll-snap-align: start;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--surface-dark);
}

.hp-shot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--dur-slow) var(--ease-out);
}

.hp-shot:hover img {
  transform: scale(1.04);
}

.hp-shot figcaption {
  position: absolute;
  inset-inline: 0;
  inset-block-end: 0;
  padding: var(--space-6) var(--space-4) var(--space-3);
  background: linear-gradient(transparent, rgba(8, 8, 10, 0.8));
  font-size: var(--text-sm);
  font-weight: 500;
}

.hp-gallery-foot {
  display: flex;
  justify-content: center;
  padding: clamp(20px, 3vh, 32px) var(--gutter) 0;
}

.hp-gallery-foot a {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--on-dark);
  border-bottom: 1px solid var(--on-dark-faint);
  padding-bottom: 2px;
}

/* ------------------------------------------------------------- OEM steps */

.hp-oem {
  padding-block: var(--section-y);
}

.hp-oem-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-4);
  counter-reset: oem;
}

.hp-oem-card {
  display: grid;
  align-content: start;
  gap: var(--space-3);
  padding: var(--space-6);
  border-radius: var(--radius-md);
  background: var(--surface-muted);
  transition: background var(--dur-base) var(--ease-soft),
    transform var(--dur-base) var(--ease-out);
}

.hp-oem-card:hover {
  background: #fff;
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.hp-oem-card::before {
  counter-increment: oem;
  content: counter(oem, decimal-leading-zero);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.1em;
  color: var(--brand);
}

.hp-oem-card h3 {
  font-size: var(--text-lg);
  font-weight: 640;
}

.hp-oem-card p {
  font-size: var(--text-sm);
  color: var(--ink-muted);
}

@media (max-width: 960px) {
  .hp-oem-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .hp-oem-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ------------------------------------------------------------ resources */

.hp-resources {
  padding-block: 0 var(--section-y);
}

.hp-resource-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-4);
}

.hp-resource-grid a {
  display: grid;
  align-content: space-between;
  gap: var(--space-6);
  min-height: 200px;
  padding: var(--space-6);
  border-radius: var(--radius-md);
  background: var(--surface-muted);
  transition: background var(--dur-base) var(--ease-soft),
    transform var(--dur-base) var(--ease-out);
}

.hp-resource-grid a:hover {
  background: #fff;
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.hp-resource-grid h3 {
  font-size: var(--text-lg);
  font-weight: 640;
}

.hp-resource-grid span {
  font-size: var(--text-sm);
  color: var(--ink-muted);
}

@media (max-width: 860px) {
  .hp-resource-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* -------------------------------------------------------------- contact */

.hp-contact {
  padding-block: var(--section-y);
  background: var(--hp-dark);
  color: var(--on-dark);
}

.hp-contact-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: clamp(32px, 6vw, 88px);
}

.hp-contact h2 {
  font-size: var(--text-3xl);
  font-weight: 680;
  letter-spacing: var(--tracking-hero);
}

.hp-contact .hp-contact-note {
  margin-top: var(--space-4);
  color: var(--on-dark-muted);
}

.hp-contact-list {
  display: grid;
  gap: var(--space-3);
  align-content: start;
  font-size: var(--text-sm);
}

.hp-contact-list a,
.hp-contact-list span {
  color: var(--on-dark);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid rgba(245, 245, 247, 0.14);
}

.hp-contact-list a:hover {
  color: #fff;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.hp-contact-cta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-top: var(--space-6);
}

/* ------------------------------------------------------------ responsive */

@media (max-width: 1100px) {
  .hp-line-head {
    grid-template-columns: minmax(0, 1fr) auto;
  }
  .hp-line-meta {
    grid-column: 1 / -1;
    grid-row: 2;
  }
}

@media (max-width: 960px) {
  .hp-section-head,
  .hp-contact-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-4);
  }
  .hp-hero {
    height: auto;
  }
  .hp-hero-visual img {
    width: 100%;
    height: auto;
  }
  .hp-line-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .hp-line-grid > li:nth-child(n + 4) {
    display: none;
  }
  .trust {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    row-gap: var(--space-5);
  }
  .trust > span:nth-child(3) {
    border-left: 0;
  }
}

@media (max-width: 620px) {
  .hp-hero h1 {
    font-size: clamp(2rem, 9vw, 2.6rem);
  }
  .hp-hero h1 .hero-title-line--accent {
    display: block;
  }
  .hp-search {
    width: 100%;
  }
  .hp-hero-quote {
    width: 100%;
  }
  .hp-line-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .hp-line-grid > li:nth-child(n + 4) {
    display: list-item;
  }
  .hp-line-grid > li:nth-child(n + 5) {
    display: none;
  }
  .hp-line-link {
    grid-column: 1 / -1;
    justify-self: start;
  }
  .hp-line-head {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-4);
  }
  .hp-sourcing {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 620px) {
  .hp-shot {
    --shot-h: 58vw;
  }
}
