/* ── REACH Monitor — homepage ──────────────────────────────────────────── */

/* ── Hero ── */

.h-hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
  background: var(--paper);
  padding: calc(var(--header-h) + var(--ann-h) + 3rem) 0 7rem;
}

/* Graph-paper ground, fading towards the edges */
.h-hero__grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, rgba(198, 12, 12, .085) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(198, 12, 12, .085) 1px, transparent 1px);
  background-size: 56px 56px;
  background-position: center center;
  -webkit-mask-image: radial-gradient(ellipse 75% 70% at 65% 50%, #000 20%, transparent 78%);
          mask-image: radial-gradient(ellipse 75% 70% at 65% 50%, #000 20%, transparent 78%);
  pointer-events: none;
}

.h-hero__canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.h-hero__stage { position: relative; z-index: 1; width: 100%; }

.h-hero__chapter { max-width: 640px; }
.h-hero__chapter--2 {
  margin-top: 5rem;
  padding-top: 3rem;
  border-top: 1px solid var(--rule);
}

.h-hero__title {
  font-family: var(--f-display);
  font-size: clamp(2.9rem, min(6.6vw, 10.5vh), 6.4rem);
  font-weight: 340;
  line-height: .98;
  letter-spacing: -.022em;
  color: var(--ink);
  margin-bottom: 2rem;
  max-width: 11.5ch;
}
.h-hero__title--caps {
  text-transform: uppercase;
  font-size: clamp(2.6rem, min(6vw, 10vh), 5.8rem);
  letter-spacing: -.005em;
  max-width: 9ch;
}
.h-hero__lead {
  font-size: clamp(1.08rem, 1.4vw, 1.28rem);
  line-height: 1.55;
  color: var(--ink-2);
  max-width: 44ch;
  margin-bottom: 2.25rem;
}

/* Pinned (desktop + motion): chapters overlap in one cell */
.h-hero.is-pinned .h-hero__stage { display: grid; }
.h-hero.is-pinned .h-hero__chapter { grid-area: 1 / 1; }
.h-hero.is-pinned .h-hero__chapter--2 { margin: 0; padding: 0; border: 0; align-self: center; }

.h-hero__foot {
  position: absolute;
  left: 0; right: 0; bottom: 2rem;
  margin-inline: auto;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
}
.h-hero__progress { display: none; gap: .5rem; }
.h-hero.is-pinned .h-hero__progress { display: inline-flex; }
.h-hero__progress i {
  display: block;
  width: 26px; height: 2px;
  background: var(--rule-strong);
  transition: background .4s ease, width .5s var(--ease);
}
.h-hero__progress i.is-on { background: var(--red); width: 44px; }
.h-hero__cue {
  position: relative;
  width: 1px; height: 46px;
  background: var(--rule);
  overflow: hidden;
}
.h-hero__cue span {
  position: absolute;
  left: 0; top: -40%;
  width: 1px; height: 40%;
  background: var(--ink);
  animation: cue 2.2s var(--ease) infinite;
}
@keyframes cue { 0% { top: -40%; } 100% { top: 100%; } }

/* ── Trusted-by marquee ── */

.h-trust {
  padding: 3.5rem 0 4rem;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  background: var(--paper);
}
.h-trust__label {
  font-family: var(--f-display);
  font-style: italic;
  font-size: 1.15rem;
  color: var(--ink-2);
  margin-bottom: 2.25rem;
}
.h-trust__marquee {
  display: flex;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
          mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
}
.h-trust__track {
  display: flex;
  align-items: center;
  flex: none;
  gap: clamp(3rem, 7vw, 6.5rem);
  padding-right: clamp(3rem, 7vw, 6.5rem);
  animation: marquee 38s linear infinite;
}
.h-trust__marquee:hover .h-trust__track { animation-play-state: paused; }
@keyframes marquee { to { transform: translateX(-100%); } }
.trusted-logo { display: flex; align-items: center; flex: none; }
.trusted-logo img {
  display: block;
  height: 44px;
  width: auto;
  opacity: .5;
  transition: opacity .4s ease;
}
.trusted-logo:hover img { opacity: .9; }

/* ── About ── */

.h-about { padding: clamp(6rem, 13vw, 11rem) 0 clamp(3rem, 6vw, 5rem); }
.h-about__grid {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(2rem, 6vw, 6rem);
  align-items: end;
}
.h-about__number {
  display: flex;
  align-items: flex-start;
  font-family: var(--f-display);
  font-weight: 250;
  font-size: clamp(9rem, 24vw, 21rem);
  line-height: .78;
  letter-spacing: -.05em;
  color: var(--red);
  font-variant-numeric: tabular-nums lining-nums;
}
.h-about__plus {
  font-size: .42em;
  font-weight: 300;
  color: var(--red);
  margin-left: .04em;
  line-height: 1;
}
.h-about__claim {
  font-size: clamp(1.6rem, 3vw, 2.6rem);
  margin-bottom: 2rem;
  max-width: 22ch;
}
.h-about__intro {
  font-family: var(--f-display);
  font-size: clamp(1.15rem, 1.6vw, 1.4rem);
  line-height: 1.55;
  color: var(--ink-2);
  max-width: 52ch;
  margin: 0;
}

/* ── Timeline ── */

.h-timeline { position: relative; padding: clamp(3rem, 6vw, 5rem) 0 clamp(5rem, 10vw, 8rem); }
/* Desktop: the pinned scene fills the viewport with the track centred */
@media (min-width: 861px) {
  html.motion .h-timeline { min-height: 100vh; display: flex; align-items: center; padding: 0; }
  html.motion .h-timeline__viewport { width: 100%; }
}
.h-timeline__viewport { position: relative; }
.h-timeline__rail {
  position: absolute;
  left: 0; right: 0;
  top: 2.15rem;
  height: 1px;
  background: var(--rule-strong);
}
.h-timeline__rail span {
  position: absolute;
  inset: 0;
  background: var(--red);
  transform: scaleX(0);
  transform-origin: left;
}
.h-timeline__track {
  list-style: none;
  margin: 0;
  display: flex;
  gap: 0;
  padding: 0 var(--gutter);
  padding-left: max(var(--gutter), calc((100vw - var(--max-width)) / 2 + var(--gutter)));
  width: max-content;
}
.tl-item {
  position: relative;
  width: clamp(270px, 26vw, 360px);
  padding: 0 2.5rem 0 0;
  flex: none;
}
.tl-item__year {
  font-size: .95rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--red);
  height: 1.6rem;
  margin-bottom: 1.5rem;
}
.tl-item::before {
  content: "";
  position: absolute;
  top: 1.85rem; left: 0;
  width: 11px; height: 11px;
  border-radius: 50%;
  background: var(--paper);
  border: 1.5px solid var(--ink);
  transition: background .4s ease, border-color .4s ease, transform .4s var(--ease);
}
.tl-item.is-active::before { background: var(--red); border-color: var(--red); transform: scale(1.25); }
.tl-item__icon {
  width: 38px; height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--rule-strong);
  border-radius: 50%;
  color: var(--ink);
  font-size: .85rem;
  margin: 1rem 0 1.25rem;
}
.tl-item__title {
  font-family: var(--f-display);
  font-weight: 420;
  font-size: 1.45rem;
  line-height: 1.15;
  margin-bottom: .8rem;
}
.tl-item__text { font-size: .95rem; line-height: 1.6; color: var(--muted); margin: 0; }
.tl-item--end {
  display: flex;
  align-items: center;
  width: auto;
  padding-top: 3.5rem;
  padding-right: var(--gutter);
}
.tl-item--end::before { display: none; }

/* ── Services ── */

.h-services { padding: clamp(6rem, 12vw, 10rem) 0; border-top: 1px solid var(--rule); }
.h-services__head { margin-bottom: clamp(2.5rem, 5vw, 4rem); }
.h-section-title { font-size: clamp(2.8rem, 7.5vw, 7rem); line-height: .92; }

.h-services__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--rule-strong);
  border-left: 1px solid var(--rule);
}
.svc {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 300px;
  padding: 2rem 2rem 1.75rem;
  border-right: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  color: var(--ink);
  isolation: isolate;
  overflow: hidden;
}
.svc::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--red);
  clip-path: inset(100% 0 0 0);
  transition: clip-path .6s var(--ease);
}
.svc:hover { color: #fff; }
.svc:hover::before { clip-path: inset(0 0 0 0); }
.svc__icon {
  width: 44px; height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--rule-strong);
  border-radius: 50%;
  font-size: .95rem;
  color: var(--red);
  margin-bottom: 3.25rem;
  transition: border-color .4s ease, background .4s ease, color .4s ease, transform .6s var(--ease);
}
.svc:hover .svc__icon { background: #fff; border-color: #fff; color: var(--red); transform: rotate(-12deg); }
.svc__title {
  font-family: var(--f-sans);
  font-size: .9rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  margin: 0 0 .75rem;
  color: inherit;
  transition: color .4s ease;
}
.svc__text {
  font-family: var(--f-display);
  font-size: 1.2rem;
  line-height: 1.4;
  color: inherit;
  opacity: .82;
  margin-bottom: 1.75rem;
}
.svc__more {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  font-size: .92rem;
  font-weight: 600;
  color: var(--red);
  margin-top: auto;
  transition: opacity .4s ease, gap .4s var(--ease);
}
.svc:hover .svc__more { color: #fff; gap: .9rem; }

/* ── Training (night) ── */

.h-training {
  position: relative;
  background: var(--red);
  color: #fff;
  padding: clamp(6rem, 12vw, 10rem) 0 clamp(5rem, 9vw, 8rem);
}
.eyebrow--night { color: #fff; }
.h-training__grid {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: clamp(2.5rem, 6vw, 6rem);
  align-items: center;
}
.h-training__title {
  color: #fff;
  font-size: clamp(2.2rem, 4.6vw, 4.3rem);
  margin-bottom: 2rem;
}
.h-training__text {
  color: rgba(255, 255, 255, .86);
  font-size: 1.1rem;
  line-height: 1.7;
  max-width: 56ch;
  margin-bottom: 2.5rem;
}
.btn--light { background: #fff; color: var(--red) !important; border-color: #fff; }
.btn--light::before { background: var(--ink); }
.btn--light:hover { color: #fff !important; border-color: var(--ink); }

.h-training__media {
  position: relative;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  border-radius: 3px;
  background: var(--red-deep);
}
.h-training__media img {
  position: absolute;
  inset: -8% 0;
  width: 100%;
  height: 116%;
  object-fit: cover;
  will-change: transform;
}

.h-benefits {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin-top: clamp(4rem, 8vw, 7rem);
  border-top: 1px solid rgba(255, 255, 255, .3);
}
.h-benefit {
  padding: 2rem 2rem 0 0;
}
.h-benefit + .h-benefit { padding-left: 2rem; border-left: 1px solid rgba(255, 255, 255, .3); }
.h-benefit__icon { display: block; color: #fff; font-size: 1.05rem; margin-bottom: 1.5rem; }
.h-benefit h4 {
  font-family: var(--f-sans);
  font-size: .85rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: #fff;
  margin-bottom: .7rem;
}
.h-benefit p { color: rgba(255, 255, 255, .82); font-size: .95rem; line-height: 1.6; margin: 0; }


/* ── Responsive ── */

@media (max-width: 1100px) {
  .h-services__grid { grid-template-columns: repeat(2, 1fr); }
  .h-benefits { grid-template-columns: repeat(2, 1fr); }
  .h-benefit:nth-child(3) { padding-left: 0; border-left: 0; }
  .h-benefit { padding-bottom: 2rem; }
}

@media (max-width: 860px) {
  .h-hero { padding-top: calc(var(--header-h) + var(--ann-h) + 40svh); padding-bottom: 6rem; justify-content: flex-start; }
  .h-hero__canvas { top: calc(var(--header-h) + var(--ann-h)); bottom: auto; height: 40svh; }
  .h-hero__grid { -webkit-mask-image: radial-gradient(ellipse 90% 40% at 50% 26%, #000 20%, transparent 80%); mask-image: radial-gradient(ellipse 90% 40% at 50% 26%, #000 20%, transparent 80%); }
  .h-hero__foot { justify-content: center; }

  .h-about__grid { grid-template-columns: 1fr; align-items: start; }

  /* Vertical timeline */
  .h-timeline__rail { top: 0; bottom: 0; left: calc(var(--gutter) + 5px); right: auto; width: 1px; height: auto; }
  .h-timeline__rail span { transform-origin: top; transform: scaleY(0); }
  .h-timeline__track { flex-direction: column; width: auto; padding: 0 var(--gutter); gap: 3rem; }
  .tl-item { width: auto; padding: 0 0 0 2.5rem; }
  .tl-item::before { top: .25rem; left: 0; }
  .tl-item__year { height: auto; margin-bottom: .25rem; }
  .tl-item--end { padding-top: 0; }

  .h-training__grid { grid-template-columns: 1fr; }
  .h-training__media { aspect-ratio: 4 / 3; }
}

@media (max-width: 640px) {
  .h-services__grid { grid-template-columns: 1fr; }
  .svc { min-height: 0; }
  .svc__icon { margin-bottom: 2rem; }
  .h-benefits { grid-template-columns: 1fr; }
  .h-benefit, .h-benefit + .h-benefit { padding: 1.75rem 0; border-left: 0; border-bottom: 1px solid rgba(255, 255, 255, .3); }
}

@media (prefers-reduced-motion: reduce) {
  .h-trust__track { animation: none; }
  .h-trust__marquee { flex-wrap: wrap; }
  .h-trust__track[aria-hidden="true"] { display: none; }
  .h-hero__cue span { animation: none; }
}
