/* ==========================================================================
   Ashburn Taylor — layout.css
   Nav (dark slate), footer (dark slate), section scaffolding, grid
   ========================================================================== */

.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

section { position: relative; }

.section { padding-block: clamp(4.5rem, 9.5vw, 8.5rem); }
.section--tight { padding-block: clamp(3rem, 6vw, 5rem); }
/* CTA-band sections: the band's own section supplies equal top/bottom gaps.
   Where the preceding section has NO background, drop its bottom padding so the
   white gap above the band isn't doubled. Coloured sections (soft/slate) keep
   their padding so their content never touches the panel edge. */
.section:not(.section--soft):not(.section--slate):has(+ .section--tight > .wrap > .cta-band) { padding-bottom: 0; }
.section--tight:has(> .wrap > .cta-band) { padding-block: clamp(3rem, 6vw, 5rem); }

/* Section backgrounds */
.section--soft { background: var(--bg-soft); }
.section--slate {
  background: var(--slate);
  background-image:
    radial-gradient(900px 500px at 85% -10%, rgba(52,245,197,0.12), transparent 60%),
    radial-gradient(700px 500px at 5% 110%, rgba(54,205,253,0.10), transparent 60%);
}

.section-head {
  max-width: 720px;
  margin-bottom: clamp(2.2rem, 4vw, 3.4rem);
}
.section-head .eyebrow { margin-bottom: 1rem; }
.section-head p { margin-top: 1rem; }
.section-head--center {
  margin-inline: auto;
  text-align: center;
}
.section-head--center .lead { margin-inline: auto; }
.section-head--center .eyebrow { justify-content: center; }
.section-head--wide { max-width: 1000px; }

/* Brand accent line across the top — fills left→right as you scroll the page */
.topline {
  position: fixed; top: 0; left: 0; right: 0; height: 3px;
  z-index: 200;
  background: linear-gradient(90deg, var(--mint), var(--cyan) 55%, #7af9e0);
  transform: scaleX(var(--scroll, 0));
  transform-origin: left center;
  will-change: transform;
  box-shadow: 0 0 10px rgba(52,245,197,0.4);
}

/* ---------- Navigation (dark slate) ---------- */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: transparent;
  transition: box-shadow .4s var(--ease), background .4s var(--ease), backdrop-filter .4s var(--ease);
}
.nav.scrolled {
  background: rgba(36, 54, 74, 0.92);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  box-shadow: 0 10px 30px -12px rgba(0,0,0,0.5);
}
.nav__inner {
  max-width: var(--maxw);
  margin-inline: auto;
  padding: 0.85rem var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}
.nav__links { display: flex; align-items: center; gap: 1.25rem; }
.nav__link {
  font-size: 0.9rem;
  font-weight: 400;
  color: var(--on-dark);
  position: relative;
  padding: 4px 0;
  white-space: nowrap;
  transition: color .25s var(--ease);
}
.nav__link::after {
  content: '';
  position: absolute;
  left: 0; bottom: -2px;
  width: 100%; height: 2px;
  border-radius: 2px;
  background: var(--mint);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .3s var(--ease);
}
.nav__link:hover { color: var(--mint); }
.nav__link:hover::after,
.nav__link[aria-current="page"]::after { transform: scaleX(1); }
.nav__link[aria-current="page"] { color: var(--mint); }

/* dropdown submenu */
.nav__item { position: relative; display: inline-flex; align-items: center; }
.nav__item--has-sub > .nav__link { display: inline-flex; align-items: center; gap: 6px; }
.nav__caret { width: 11px; height: 11px; transition: transform .25s var(--ease); }
.nav__sub {
  position: absolute; top: 100%; left: 50%;
  transform: translateX(-50%) translateY(10px);
  min-width: 230px; padding: 0.55rem;
  background: rgba(36, 54, 74, 0.97);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 16px;
  box-shadow: 0 24px 50px -18px rgba(0,0,0,0.55);
  display: flex; flex-direction: column;
  opacity: 0; visibility: hidden;
  transition: opacity .25s var(--ease), transform .25s var(--ease), visibility .25s;
  z-index: 120;
}
.nav__sub { min-width: 304px; padding: 0.5rem; }
.nav__sub a {
  display: flex; align-items: center; gap: 0.7rem;
  padding: 0.55rem 0.6rem; border-radius: 11px;
  white-space: nowrap;
  transition: background .2s, transform .2s;
}
.nav__sub a:hover { background: rgba(255,255,255,0.06); }
.nav__sub-ico { width: 38px; height: 38px; flex: none; border-radius: 10px; display: grid; place-items: center; color: #fff; }
.nav__sub-ico svg { width: 19px; height: 19px; }
.nav__sub-ico--1 { background: linear-gradient(135deg, #34f5c5, #1cc5a3); color: #06222e; }
.nav__sub-ico--2 { background: linear-gradient(135deg, #36cdfd, #2f8fd0); }
.nav__sub-ico--3 { background: var(--slate); border: 1px solid rgba(255,255,255,.12); }
.nav__sub-ico--4 { background: linear-gradient(135deg, #5bbfa3, #3a9b80); }
.nav__sub-txt { display: flex; flex-direction: column; line-height: 1.25; }
.nav__sub-txt b { font-weight: 600; font-size: 0.94rem; color: #fff; }
.nav__sub-txt small { font-size: 0.77rem; color: var(--on-dark-mute); }
.nav__sub a:hover .nav__sub-txt b { color: var(--mint); }
.nav__item--has-sub:hover .nav__sub { opacity: 1; visibility: visible; transform: translateX(-50%) translateY(4px); }
.nav__item--has-sub:hover .nav__caret { transform: rotate(180deg); }

.nav__right { display: flex; align-items: center; gap: 1.2rem; }

.nav__toggle {
  display: none;
  background: none; border: 0;
  width: 30px; height: 22px;
  position: relative; cursor: pointer;
}
.nav__toggle span {
  position: absolute; left: 0;
  width: 100%; height: 2px;
  background: #fff; border-radius: 2px;
  transition: transform .35s var(--ease), opacity .25s var(--ease);
}
.nav__toggle span:nth-child(1) { top: 3px; }
.nav__toggle span:nth-child(2) { top: 10px; }
.nav__toggle span:nth-child(3) { top: 17px; }
body.menu-open .nav__toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
body.menu-open .nav__toggle span:nth-child(2) { opacity: 0; }
body.menu-open .nav__toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Logo ---------- */
.logo { display: inline-flex; align-items: center; gap: 0.6rem; }
.logo img { height: 30px; width: auto; }
.footer .logo img { height: 34px; }
/* Nav logo: animated-colour mark (real brand shape, masked) + static text */
.logo__mark {
  width: 32px; height: 32px; flex: none; display: block;
  background: linear-gradient(120deg, var(--mint) 0%, var(--cyan) 45%, #7af9e0 60%, var(--cyan) 75%, var(--mint) 100%);
  background-size: 240% 100%;
  animation: btn-flow 5s linear infinite alternate;
  -webkit-mask: url(../assets/favicon.png) center / contain no-repeat;
          mask: url(../assets/favicon.png) center / contain no-repeat;
}
.logo__word {
  font-family: var(--font-display); font-weight: 500;
  font-size: 1.02rem; letter-spacing: 0.16em; text-transform: uppercase;
  color: #fff; white-space: nowrap; line-height: 1;
}

/* offset for fixed nav on interior pages handled per-page via padding-top */

/* ---------- Footer (dark slate) ---------- */
.footer {
  background: var(--slate-deep);
  color: var(--on-dark-soft);
  padding-block: clamp(3.5rem, 6vw, 5rem) 2rem;
}
.footer__grid {
  display: grid;
  grid-template-columns: 1.7fr 1fr 1fr 1.3fr;
  gap: 2.5rem;
}
.footer__brand .logo { margin-bottom: 1.1rem; }
.footer__brand p { color: var(--on-dark-mute); font-size: 0.94rem; max-width: 34ch; }
.footer__col h5 {
  font-family: var(--font-display);
  font-size: 0.95rem;
  color: #fff;
  margin-bottom: 1rem;
  font-weight: 600;
}
.footer__col a {
  display: block;
  color: var(--on-dark-mute);
  font-size: 0.95rem;
  padding: 0.32rem 0;
  transition: color .25s var(--ease), transform .25s var(--ease);
}
.footer__col a:hover { color: var(--mint); transform: translateX(3px); }
.footer__bottom {
  margin-top: clamp(2.5rem, 5vw, 4rem);
  padding-top: 1.6rem;
  border-top: 1px solid rgba(255,255,255,0.1);
  display: flex; justify-content: space-between; align-items: center;
  gap: 1rem; flex-wrap: wrap;
  color: var(--on-dark-mute); font-size: 0.86rem;
}
.footer__socials { display: flex; gap: 0.7rem; }
.footer__socials a {
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border: 1px solid rgba(255,255,255,0.16);
  border-radius: 50%;
  color: var(--on-dark-soft);
  transition: all .3s var(--ease);
}
.footer__socials a:hover {
  color: var(--slate);
  background: var(--mint);
  border-color: var(--mint);
  transform: translateY(-3px);
}

/* ---------- Mobile ---------- */
@media (max-width: 1080px) {
  .nav__toggle { display: block; }
  /* keep the logo + close button above the full-screen menu, in the nav row */
  .logo, .nav__right { position: relative; z-index: 2; }
  .nav__links {
    position: fixed;
    inset: 0;
    width: 100%;
    z-index: 1;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 1.15rem;
    padding: 5.5rem var(--gutter) 2.5rem;
    background: var(--slate-deep);
    transform: translateX(100%);
    transition: transform .45s var(--ease);
    overflow-y: auto;
  }
  body.menu-open { overflow: hidden; }
  body.menu-open .nav__links { transform: translateX(0); }
  /* CRITICAL: never use backdrop-filter on the nav at mobile widths. backdrop-filter
     makes the nav a containing block for the fixed full-screen menu, trapping it inside
     the bar. Because the filter is also transitioned, animating it off on open produces
     a glitch frame. Use a solid bar instead — no containing block, no glitch. */
  .nav { transition: background .3s var(--ease), box-shadow .3s var(--ease); }
  .nav.scrolled {
    background: rgba(35, 54, 73, 0.97);
    backdrop-filter: none; -webkit-backdrop-filter: none;
  }
  body.menu-open .nav,
  body.menu-open .nav.scrolled {
    background: transparent;
    box-shadow: none;
  }
  .nav__links .nav__link { font-size: 1.35rem; font-weight: 500; }
  /* no underline animation in the mobile menu — keep it clean (active = colour only) */
  .nav__link::after { display: none; }
  .nav__right .btn--ghost { display: none; }
  /* dropdown shows inline on mobile as plain links — same look as every other link */
  .nav__item { display: block; }
  .nav__caret { display: none; }
  .nav__sub {
    position: static; transform: none; opacity: 1; visibility: visible;
    background: none; border: 0; box-shadow: none; backdrop-filter: none;
    padding: 1.15rem 0 0 1rem; min-width: 0; gap: 1.15rem;
  }
  /* keep the submenu put on tap/hover (desktop centres it with translateX — off-screen on mobile) */
  .nav__item--has-sub:hover .nav__sub { transform: none; }
  .nav__sub a { padding: 0; gap: 0; }
  /* strip the icons + subtitles on mobile; sub-links match the other nav links exactly */
  .nav__sub-ico { display: none; }
  .nav__sub-txt small { display: none; }
  .nav__sub-txt b { font-weight: 500; font-size: 1.35rem; color: var(--on-dark); }

  .footer__grid { grid-template-columns: 1fr 1fr; gap: 2rem; }
  .footer__brand { grid-column: 1 / -1; }
}
@media (max-width: 520px) {
  .footer__grid { grid-template-columns: 1fr; }
}
