/* ==========================================================================
   REPTD — layout.css
   Site chrome and page scaffolding: top bar, header/nav, heroes, sections,
   footer.
   ========================================================================== */

/* ---------- Top utility bar ---------- */
.topbar {
  background: var(--brand);
  color: var(--white);
  font-family: var(--font-label);
  font-size: 0.85rem;
  letter-spacing: 0.06em;
}
.topbar__inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  min-height: 2.25rem;
}
.topbar a {
  color: inherit;
  text-decoration: none;
  opacity: 0.9;
  padding-block: 0.4rem;
  transition: opacity var(--fast) var(--ease);
}
.topbar a:hover { opacity: 1; text-decoration: underline; }
.topbar__group { display: flex; gap: 1.25rem; align-items: center; }
.topbar__group--info { display: none; }
@media (min-width: 40em) {
  .topbar__group--info { display: flex; }
}
@media (max-width: 39.99em) {
  .topbar__inner { justify-content: flex-end; }
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgb(255 255 255 / 0.9);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid transparent;
}
@keyframes header-shadow {
  to {
    border-bottom-color: var(--line);
    box-shadow: 0 6px 24px rgb(35 36 31 / 0.08);
  }
}
@supports (animation-timeline: scroll()) {
  .site-header {
    animation: header-shadow linear both;
    animation-timeline: scroll();
    animation-range: 0 120px;
  }
}
@supports not (animation-timeline: scroll()) {
  .site-header { border-bottom-color: var(--line); }
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  min-height: var(--header-h);
}
.brand { display: inline-flex; flex: none; padding-block: 0.5rem; }
.brand img {
  width: auto;
  height: clamp(1.75rem, 1.4rem + 1.2vw, 2.35rem);
  transition: scale var(--med) var(--ease-spring);
}
.brand:hover img { scale: 1.04; }

/* Menu button (mobile) */
.nav-toggle {
  display: inline-grid;
  place-items: center;
  width: 2.75rem; height: 2.75rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--white);
  cursor: pointer;
  transition: background var(--fast) var(--ease), border-color var(--fast) var(--ease);
}
.nav-toggle:hover { background: var(--bg-alt); border-color: var(--stone-200); }
.nav-toggle__bars,
.nav-toggle__bars::before,
.nav-toggle__bars::after {
  display: block;
  width: 1.25rem; height: 2px;
  background: var(--stone-900);
  border-radius: 2px;
}
.nav-toggle__bars { position: relative; }
.nav-toggle__bars::before,
.nav-toggle__bars::after { content: ""; position: absolute; left: 0; }
.nav-toggle__bars::before { top: -6px; }
.nav-toggle__bars::after { top: 6px; }

/* Primary nav.
   Mobile: a native popover (no JS) — gives Esc + tap-outside dismissal.
   Desktop: the same element is laid out inline. */
.site-nav {
  font-family: var(--font-label);
  font-weight: 500;
  font-size: 1.0625rem;
  letter-spacing: 0.03em;
}
.site-nav a {
  color: var(--stone-900);
  text-decoration: none;
}
.site-nav a.btn { color: var(--btn-fg); }
.site-nav__list { display: flex; }

@media (max-width: 61.99em) {
  .site-nav {
    position: fixed;
    inset: 0 0 0 auto;
    width: min(22rem, 88vw);
    height: 100dvh;
    max-height: none;
    margin: 0;
    padding: 1.25rem 1.5rem 2rem;
    border: 0;
    background: var(--white);
    box-shadow: var(--shadow-lg);
    overflow-y: auto;
    overscroll-behavior: contain;
    translate: 100% 0;
    transition:
      translate var(--med) var(--ease),
      overlay var(--med) allow-discrete,
      display var(--med) allow-discrete;
  }
  .site-nav:popover-open { translate: 0 0; }
  @starting-style {
    .site-nav:popover-open { translate: 100% 0; }
  }
  .site-nav::backdrop {
    background: rgb(35 36 31 / 0);
    transition:
      background var(--med) var(--ease),
      overlay var(--med) allow-discrete,
      display var(--med) allow-discrete;
  }
  .site-nav:popover-open::backdrop {
    background: rgb(35 36 31 / 0.5);
    backdrop-filter: blur(2px);
  }
  @starting-style {
    .site-nav:popover-open::backdrop { background: rgb(35 36 31 / 0); }
  }

  .nav-close {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: auto;
    margin-bottom: 0.75rem;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: none;
    font-size: 0.85rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    cursor: pointer;
  }
  .site-nav__list { flex-direction: column; }
  .site-nav__list > li { border-bottom: 1px solid var(--line); }
  .site-nav__list a {
    display: block;
    padding: 0.95rem 0.25rem;
    font-size: 1.2rem;
  }
  .site-nav__list a[aria-current="page"] { color: var(--brand); }
  .site-nav__sub { padding: 0 0 0.75rem 1rem; }
  .site-nav__sub a {
    padding: 0.5rem 0.25rem;
    font-size: 1rem;
    font-weight: 400;
    color: var(--text-muted);
  }
  .site-nav__cta { margin-top: 1.5rem; }
  .site-nav__cta .btn { width: 100%; }
}

@media (min-width: 62em) {
  .nav-toggle, .nav-close { display: none; }
  /* Undo the UA popover styles so the nav sits in the header */
  .site-nav {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    position: static;
    inset: auto;
    width: auto; height: auto;
    margin: 0; padding: 0;
    border: 0;
    background: none;
    color: inherit;
    overflow: visible;
  }
  .site-nav__list { align-items: center; gap: clamp(0.9rem, 1.8vw, 1.75rem); }
  .site-nav__list > li { position: relative; }
  .site-nav__list > li > a {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding-block: 0.6rem;
  }
  /* Underline that grows from the left */
  .site-nav__list > li > a::after {
    content: "";
    position: absolute;
    left: 0; right: 0; bottom: 0.25rem;
    height: 2px;
    background: var(--brand);
    scale: 0 1;
    transform-origin: left;
    transition: scale var(--med) var(--ease);
  }
  .site-nav__list > li > a:hover::after,
  .site-nav__list > li:focus-within > a::after,
  .site-nav__list > li > a[aria-current="page"]::after { scale: 1 1; }

  .has-sub > a::before {
    content: "";
    order: 2;
    width: 0.4rem; height: 0.4rem;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    rotate: 45deg;
    translate: 0 -2px;
    transition: rotate var(--fast) var(--ease), translate var(--fast) var(--ease);
  }
  .has-sub:hover > a::before,
  .has-sub:focus-within > a::before { rotate: 225deg; translate: 0 2px; }

  .site-nav__sub {
    position: absolute;
    top: 100%; left: -1rem;
    min-width: 17.5rem;
    padding: 0.5rem;
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    opacity: 0;
    visibility: hidden;
    translate: 0 0.5rem;
    transition:
      opacity var(--fast) var(--ease),
      translate var(--fast) var(--ease),
      visibility 0s linear var(--fast);
  }
  .has-sub:hover > .site-nav__sub,
  .has-sub:focus-within > .site-nav__sub {
    opacity: 1;
    visibility: visible;
    translate: 0 0;
    transition-delay: 0s;
  }
  .site-nav__sub a {
    display: block;
    padding: 0.65rem 0.85rem;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-weight: 400;
    transition: background var(--fast) var(--ease), padding-left var(--fast) var(--ease);
  }
  .site-nav__sub a:hover,
  .site-nav__sub a[aria-current="page"] { background: var(--brand-soft); padding-left: 1.1rem; }
  .site-nav__cta .btn { --btn-pad-y: 0.55rem; --btn-pad-x: 1.1rem; font-size: 0.95rem; }
}

/* ---------- Home hero ---------- */
.hero {
  position: relative;
  isolation: isolate;
  display: grid;
  align-items: center;
  min-height: min(46rem, 82svh);
  padding-block: clamp(4rem, 10vw, 7rem) clamp(6rem, 12vw, 9rem);
  color: var(--white);
  background: var(--olive-900);
  overflow: clip;
}
.hero__media {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%; height: 100%;
  object-fit: cover;
}
@media (prefers-reduced-motion: no-preference) {
  .hero__media { animation: hero-drift 28s var(--ease) both alternate infinite; }
}
@keyframes hero-drift {
  from { scale: 1.02; }
  to   { scale: 1.1; translate: -1.5% -1%; }
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(100deg, rgb(35 37 20 / 0.93) 0%, rgb(52 55 32 / 0.8) 40%, rgb(76 79 70 / 0.32) 100%),
    linear-gradient(to top, rgb(35 37 20 / 0.55), transparent 40%);
}
@media (max-width: 47.99em) {
  .hero::before {
    background: linear-gradient(to bottom, rgb(35 37 20 / 0.82), rgb(45 48 28 / 0.9));
  }
}
.hero__content { max-width: 44rem; }
.hero__logo {
  width: min(27rem, 78vw);
  margin-left: -0.35rem;
}
.hero h1 { font-size: inherit; line-height: inherit; }
.hero__lede {
  margin-top: 1.75rem;
  max-width: 36rem;
  font-size: var(--step-1);
  line-height: 1.55;
  color: rgb(255 255 255 / 0.9);
}
.hero__actions { display: flex; flex-wrap: wrap; gap: 0.85rem; margin-top: 2rem; }
.hero .eyebrow { color: var(--olive-200); margin-bottom: 1.5rem; }

@media (prefers-reduced-motion: no-preference) {
  .hero__content > * { animation: rise 700ms var(--ease) both; }
  .hero__content > :nth-child(2) { animation-delay: 90ms; }
  .hero__content > :nth-child(3) { animation-delay: 180ms; }
  .hero__content > :nth-child(4) { animation-delay: 270ms; }
}
@keyframes rise {
  from { opacity: 0; translate: 0 1.25rem; }
  to   { opacity: 1; translate: 0 0; }
}

/* R·E·P·T·D acronym strip that overlaps the hero */
.acronym {
  position: relative;
  z-index: 2;
  margin-top: clamp(-4.5rem, -6vw, -3rem);
}
.acronym__list {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.acronym__item {
  display: grid;
  justify-items: center;
  gap: 0.15rem;
  padding: clamp(1rem, 2.5vw, 1.75rem) 0.5rem;
  text-align: center;
  border-left: 1px solid var(--line);
  transition: background var(--med) var(--ease);
}
.acronym__item:first-child { border-left: 0; }
.acronym__item:hover { background: var(--brand-soft); }
.acronym__letter {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.75rem, 1.2rem + 2.6vw, 3rem);
  line-height: 1;
  color: var(--brand);
  transition: translate var(--med) var(--ease-spring), color var(--med) var(--ease);
}
.acronym__item:hover .acronym__letter { translate: 0 -4px; color: var(--stone-900); }
.acronym__word {
  font-family: var(--font-label);
  font-size: clamp(0.62rem, 0.4rem + 0.9vw, 0.9rem);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* ---------- Inner page hero ---------- */
.page-hero {
  position: relative;
  isolation: isolate;
  padding-block: clamp(3rem, 8vw, 5.5rem);
  color: var(--white);
  background: linear-gradient(135deg, var(--olive-600) 0%, var(--stone-700) 100%);
  overflow: clip;
}
/* Hex motif — nods to the homepage collage */
.page-hero::after {
  content: "";
  position: absolute;
  z-index: -1;
  right: -4rem; top: 50%;
  width: clamp(16rem, 38vw, 30rem);
  aspect-ratio: 1 / 0.866;
  translate: 0 -50%;
  background: rgb(255 255 255 / 0.06);
  clip-path: polygon(25% 0, 75% 0, 100% 50%, 75% 100%, 25% 100%, 0 50%);
}
.page-hero h1 { color: var(--white); font-size: var(--step-5); font-weight: 500; }
.page-hero .lede { margin-top: 1rem; max-width: 42rem; color: rgb(255 255 255 / 0.88); }
.page-hero .eyebrow { color: var(--olive-200); margin-bottom: 0.9rem; }

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
  font-family: var(--font-label);
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.breadcrumb li + li::before { content: "/"; margin-right: 0.5rem; opacity: 0.5; }
.breadcrumb a { color: rgb(255 255 255 / 0.8); text-decoration: none; }
.breadcrumb a:hover { color: var(--white); text-decoration: underline; }
.breadcrumb [aria-current] { color: var(--white); }

/* ---------- Sections ---------- */
.section { padding-block: var(--section); }
.section--alt { background: var(--bg-alt); }
.section--brand {
  background: var(--brand);
  color: rgb(255 255 255 / 0.92);
}
.section--stone {
  background: linear-gradient(180deg, var(--stone-700), #3d4038);
  color: rgb(255 255 255 / 0.92);
}
.section--brand :is(h2, h3, h4),
.section--stone :is(h2, h3, h4) { color: var(--white); }
.section--brand .eyebrow,
.section--stone .eyebrow { color: var(--olive-200); }
.section--brand a:not(.btn) { color: var(--white); }

.section__head { max-width: 44rem; margin-bottom: clamp(2rem, 5vw, 3.25rem); }
.section__head.center { margin-inline: auto; }
.section__head.center .eyebrow { justify-content: center; }
.section__head h2 { margin-top: 0.6rem; }
.section__head p { margin-top: 1rem; }

.split {
  display: grid;
  gap: clamp(2rem, 6vw, 4.5rem);
  align-items: center;
}
@media (min-width: 52em) {
  .split { grid-template-columns: 1.1fr 0.9fr; }
  .split--flip { grid-template-columns: 0.8fr 1.2fr; }
}
.split--top { align-items: start; }

.grid { display: grid; gap: clamp(1rem, 2.5vw, 1.75rem); }
.grid--2 { grid-template-columns: 1fr; }
@media (min-width: 44em) {
  .grid--2 { grid-template-columns: 1fr 1fr; }
}
.grid--4 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr)); }

/* Photo with an offset olive block behind it (from the current site) */
.framed {
  position: relative;
  width: min(100%, 26rem);
  margin-inline: auto;
}
.framed::before {
  content: "";
  position: absolute;
  inset: -1.25rem -1.25rem 30% 22%;
  background: var(--brand);
  border-radius: var(--radius);
  transition: translate var(--med) var(--ease);
}
.framed:hover::before { translate: 0.4rem -0.4rem; }
.framed img {
  position: relative;
  width: 100%;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.section--brand .framed::before { background: var(--olive-400); }

/* ---------- CTA band ---------- */
.cta-band {
  background: var(--stone-900);
  color: rgb(255 255 255 / 0.85);
  padding-block: clamp(2.5rem, 6vw, 4rem);
}
.cta-band__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem 2.5rem;
}
.cta-band h2 { color: var(--white); font-size: var(--step-3); }
.cta-band p { margin-top: 0.5rem; max-width: 36rem; }
.cta-band__actions { display: flex; flex-wrap: wrap; gap: 0.75rem; }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--olive-400);
  color: var(--stone-900);
  padding-block: clamp(2.75rem, 6vw, 4.5rem) 1.5rem;
}
.site-footer__grid {
  display: grid;
  gap: 2.25rem 2rem;
  grid-template-columns: repeat(2, 1fr);
}
.site-footer__brand { grid-column: 1 / -1; }
.site-footer__brand img { width: 11.5rem; }
@media (min-width: 52em) {
  .site-footer__grid { grid-template-columns: 1.3fr 1.2fr 1fr 1fr; }
  .site-footer__brand { grid-column: auto; }
}
.site-footer h2 {
  margin-bottom: 0.85rem;
  font-family: var(--font-label);
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--stone-900);
}
.site-footer a { color: inherit; text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }
.site-footer__links { display: grid; gap: 0.4rem; }
.site-footer__links a {
  display: inline-block;
  transition: translate var(--fast) var(--ease);
}
.site-footer__links a:hover { translate: 4px 0; }

.socials { display: flex; gap: 0.6rem; margin-bottom: 1.25rem; }
.socials a {
  display: grid;
  place-items: center;
  width: 2.75rem; height: 2.75rem;
  border-radius: 50%;
  background: var(--stone-900);
  color: var(--white);
  transition: translate var(--med) var(--ease-spring), background var(--fast) var(--ease);
}
.socials a:hover { translate: 0 -3px; background: var(--olive-700); }
.socials svg { width: 1.2rem; height: 1.2rem; fill: currentColor; }

.site-footer__legal {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 2rem;
  margin-top: clamp(2rem, 5vw, 3.5rem);
  padding-top: 1.25rem;
  border-top: 1px solid rgb(35 36 31 / 0.2);
  font-size: var(--step--1);
}
