/* ============================================================
   Hi-Tech Printing — shared components (nav, footer, buttons,
   section shells) built from Figma geometry.
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');
@import 'tokens.css';

* { margin: 0; padding: 0; box-sizing: border-box; }

/* V4 responsive foundation.
   --edge remains the legacy page-section inset until each page is migrated.
   Shared header/footer follow V3: 120px gutters through 1680px, then a
   centred 1440px usable content area with the outer gutters excluded. */
:root {
  --site-max: 1440px;
  --site-gutter: 120px;
  --chrome-edge: max(
    var(--site-gutter),
    calc((100vw - var(--site-max)) / 2)
  );
  --edge: max(120px, calc((100% - 1440px) / 2));
}

/* v2.7: kill horizontal page scroll on desktop (client comment 2026-08-26/09-02) */
html, body { overflow-x: hidden; }

/* Figma type system: headings are Inter Regular (400) unless set otherwise */
h1, h2, h3, h4, h5, h6 { font-weight: 400; }

body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--white);
  font-size: var(--fs-body);
  line-height: var(--lh);
  letter-spacing: var(--ls);
  -webkit-font-smoothing: antialiased;
}

/* ---------- text opacity system (Figma fill opacities) ----------
   16px w400 black body/quote/nav text paints at 50% ink;
   long intro paragraphs on dark panels at 70%; footer legal 300 at 50%;
   cert labels 80%; everything else (titles, buttons, names) full. */
.t-50 { color: rgba(0, 0, 0, 0.5); }
.t-50w { color: rgba(255, 255, 255, 0.5); }
.t-60 { color: rgba(0, 0, 0, 0.6); }
.t-60w { color: rgba(255, 255, 255, 0.6); }
.t-70 { color: rgba(0, 0, 0, 0.7); }
.t-70w { color: rgba(255, 255, 255, 0.7); }
.t-80 { color: rgba(0, 0, 0, 0.8); }
.t-80w { color: rgba(255, 255, 255, 0.8); }

img { display: block; }

/* ---------- page shell ---------- */
.shell { width: 100%; margin: 0 auto; position: relative; isolation: isolate; }
.shell::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 109;
  pointer-events: none;
  background: url('../assets/noise/grain-100.png') repeat;
  opacity: .12;
}

/* ---------- buttons ----------
   Figma Primary Button set (16:2821):
   - default: text only, no shadow, 1px vertical white-gradient outline
   - hover:   chevron reveals, drop shadow rgba(17,12,67,.32) y8 b20,
              gradient fill reverses direction
   Ghost (16:2844): glass + black 20% border; hover adds shadow y4 b20
--------------------------------------------------------------- */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  height: var(--btn-h);
  padding: 0 28px;
  border-radius: var(--btn-radius);
  font: var(--btn-font);
  letter-spacing: var(--btn-ls);
  text-decoration: none;
  border: none;
  cursor: pointer;
  white-space: nowrap;
  transition: box-shadow .25s ease, padding .25s ease;
}
/* hover: text drifts left, chevron slides right, equal air both sides of chevron */
.btn:hover { padding-left: 20px; padding-right: 36px; }
/* chevron: transparent at rest (layout space preserved), fades in on hover */
.btn .chevs {
  display: inline-flex; gap: 2px; align-items: center;
  opacity: 0;
  transition: opacity .25s ease, transform .25s ease;
  transform: translateX(-8px);
}
.btn .chevs svg { width: 8px; height: 14px; flex: none; }
.btn .chevs svg + svg { display: none; }   /* hover state shows a single chevron */
.btn:hover .chevs { opacity: 1; transform: translateX(18px); }
.btn--ghost .chevs svg path { fill: var(--ink); }

.btn--primary {
  /* Figma default: #7B5DC0 left -> #B432A8 right */
  background-image: linear-gradient(90deg, #7B5DC0 0%, #B432A8 99.16%);
  color: var(--white);
}
.btn--primary:hover {
  /* Figma hover variant: gradient reverses (start color on the right) */
  background-image: linear-gradient(270deg, #7B5DC0 0%, #B432A8 99.16%);
  box-shadow: 0 8px 20px rgba(17, 12, 67, 0.32);
}
/* 1px vertical gradient outline: white -> clear -> white 80% */
.btn--primary::before {
  content: '';
  position: absolute; inset: 0;
  border-radius: var(--btn-radius);
  padding: 1px;
  background: linear-gradient(180deg,
    rgba(255,255,255,1) 0%,
    rgba(255,255,255,0) 50%,
    rgba(255,255,255,0.8) 100%);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
          mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
          mask-composite: exclude;
  pointer-events: none;
}
.btn--ghost {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(1.33px);
  color: var(--ink);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.2);
}
.btn--ghost:hover {
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.2), 0 4px 20px rgba(0, 0, 0, 0.32);
}

/* ---------- navbar (Frame 145: 1440x133) ---------- */
.nav {
  height: auto;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  background: #ffffff; /* v2.7: pure white header per client demo */
  padding: 0;
  position: sticky;
  top: 0;
  z-index: 100;
  transition: box-shadow .3s ease;
}
/* v2.7: two-tier header */
.nav__topbar {
  height: 52px;
  background: #0a0a0a;
  color: rgba(255,255,255,.85);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--chrome-edge);
  font-size: 15px;
  letter-spacing: .02em;
}
.nav__topbar-hours { display: flex; align-items: center; gap: 8px; }
.nav__topbar-hours svg { width: 16px; height: 16px; }
.nav__main {
  height: 133px;
  display: flex;
  align-items: center;
  padding: 0 var(--chrome-edge);
}
.nav-quick { margin-left: auto; display: flex; align-items: center; gap: 24px; }
.nav-quick__label { font-size: 16px; color: rgba(0,0,0,.55); line-height: 1.3; max-width: 210px; white-space: nowrap; }
.nav-quick__label br { display: block; }
.nav-quick__btns { display: flex; gap: 20px; }
.nav-quick__btn {
  width: 52px; height: 52px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #8E4FD0 0%, #C14AAE 100%);
  transition: transform .25s ease, filter .25s ease;
}
.nav-quick__btn:hover, .nav-quick__btn:focus-visible { transform: scale(1.08); filter: brightness(1.1); outline: none; }
.nav-quick__btn svg { width: 20px; height: 20px; }
.nav.nav--scrolled { box-shadow: 0 8px 24px rgba(0,0,0,.14); }
.nav__menu { display: none; }
.nav__logo { width: 166px; margin-right: 65px; flex: none; }
.nav__logo img { width: 100%; height: 84px; object-fit: fill; }
.nav__links { display: flex; gap: 46px; align-items: center; }

/* v2.7: nav CTA removed; quick-contact block sits right */
.nav__links a {
  font-size: 16px;
  color: var(--black); /* v2.8: nav links solid black per client */
  text-decoration: none;
  transition: color .2s ease;
}
.nav__links a:hover,
.nav__links a:focus-visible,
.nav__links a[aria-current="page"] { color: var(--black); outline: none; }
/* v2.8: active page gets purple underline (client screenshot) */
.nav__links a[aria-current="page"] {
  text-decoration: underline;
  text-decoration-color: var(--purple-2);
  text-decoration-thickness: 2px;
  text-underline-offset: 8px;
}
.nav__cta { margin-left: auto; }

/* ---------- back to top (Figma Frame 1000008466: 60x60) ---------- */
.back-to-top {
  position: fixed;
  right: 40px;
  bottom: 40px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: 2px solid transparent;
  background:
    linear-gradient(rgba(0,0,0,.8), rgba(0,0,0,.8)) padding-box,
    linear-gradient(145deg, rgba(255,255,255,.8), rgba(255,255,255,.1) 52%, rgba(255,255,255,.2)) border-box;
  box-shadow: 0 8px 24px rgba(0,0,0,.24);
  display: grid;
  place-items: center;
  cursor: pointer;
  z-index: 120;
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: opacity .25s ease, transform .25s ease, visibility .25s, background-color .25s ease;
}
.back-to-top.is-visible { opacity: 1; visibility: visible; transform: translateY(0); }
.back-to-top:hover,
.back-to-top:focus-visible { transform: translateY(-3px) scale(1.04); outline: none; }
.back-to-top svg { width: 18px; height: 25px; }
.back-to-top path { fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- footer (Frame 27: 1440x552, black) ---------- */
.footer {
  position: relative;
  background: var(--black);
  color: var(--white);
  padding: 80px var(--chrome-edge) 0;
}
.footer::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: url('../assets/noise/grain-70.png') repeat;
  opacity: .20;
}
.footer > * { position: relative; z-index: 2; }
.footer__grid { display: flex; gap: 162px; }
.footer__brand { width: 377px; }
.footer__brand .logo { width: 193px; margin-bottom: 72px; }
.footer__cta { display: flex; align-items: center; gap: 16px; }
.footer__heading {
  font-size: var(--fs-title);
  font-weight: 400; /* v2.7: regular, was 700 */
  line-height: 1.47;
}
.footer__subheading {
  font-size: var(--fs-title);
  font-weight: 400; /* v2.7: regular, was 500 */
  line-height: 1.47;
}
.footer__contact { width: 215px; }
.footer__locations { width: 284px; }
.footer__row { display: flex; gap: 16px; align-items: flex-start; margin-bottom: 20px; }
.footer__row .icon { width: 32px; height: 32px; flex: none; }
.footer__row .icon svg { width: 100%; height: 100%; }
.footer__row p { font-weight: 400; line-height: 1.5; } /* v2.7: regular, was 500 */
.footer__legal {
  display: flex;
  justify-content: space-between;
  margin-top: 80px;
}
.footer__legal span {
  display: flex;
  align-items: center;
  width: 401px;
  height: 48px;
  font-weight: 400; /* v2.7: regular, was 300 */
}
.footer__legal span + span { justify-content: center; border-left: 1px solid var(--wline); }
.footer__legal span:last-child { justify-content: flex-end; }
.footer__tagline {
  height: 108px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  font-weight: 400; /* v2.7: regular, was 300 */
}

/* ---------- metrics odometer cards (348x348) ---------- */
.metro-card {
  width: 348px;
  height: 348px;
  position: relative;
  overflow: hidden;
}
.metro-card img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- generic section shells ---------- */
.section { padding: 120px 120px; }
.section--black { background: var(--black); color: var(--white); }
.section__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0;
}
.section__title { font-size: var(--fs-h2); font-weight: 400; }

/* ============================================================
   COMPACT DESKTOP — fluid chrome between mobile and 1440px
   ============================================================ */
@media (min-width: 768px) and (max-width: 1439px) {
  :root {
    /* 32px at 768px, rising smoothly to 120px at 1440px. */
    --chrome-edge: clamp(32px, calc(13.095vw - 68.57px), 120px);
  }

  .nav__logo {
    width: clamp(124px, 11vw, 150px);
    margin-right: clamp(20px, 3vw, 44px);
  }
  .nav__logo img {
    width: 100%;
    height: auto;
  }
  .nav__links { gap: clamp(18px, 2.25vw, 34px); }
  .nav__links a { font-size: 15px; }
  .nav-quick { gap: 16px; }
  .nav-quick__btns { gap: 12px; }
  .nav-quick__btn { width: 48px; height: 48px; }

  .footer { padding-top: 64px; }
  .footer__grid {
    display: grid;
    grid-template-columns: minmax(220px, 1.2fr) minmax(160px, .7fr) minmax(240px, 1fr);
    gap: clamp(24px, 4vw, 64px);
  }
  .footer__brand,
  .footer__contact,
  .footer__locations { width: auto; }
  .footer__brand .logo { margin-bottom: 48px; }
  .footer__legal { margin-top: 64px; gap: 24px; }
  .footer__legal span { width: auto; flex: 1; }
}

@media (min-width: 768px) and (max-width: 1200px) {
  .nav-quick__label { display: none; }
  .footer__cta { flex-direction: column; align-items: flex-start; gap: 20px; }
}

/* The header can collapse before the page body stacks. */
@media (min-width: 768px) and (max-width: 900px) {
  .nav__main { height: 96px; justify-content: space-between; }
  .nav__menu {
    display: block;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 0;
    background:
      linear-gradient(#000 0 0) 0 7px / 32px 1px no-repeat,
      linear-gradient(#000 0 0) 0 16px / 32px 1px no-repeat,
      linear-gradient(#000 0 0) 0 26px / 32px 1px no-repeat;
    cursor: pointer;
  }
  .nav__menu span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .nav__logo { width: 132px; margin: 0; }
  .nav__links { display: none; }
  .nav-quick { margin-left: 0; }
  .nav.mobile-open { box-shadow: 0 8px 24px rgba(0,0,0,.14); }
  .nav.mobile-open .nav__links {
    position: absolute;
    left: 0;
    top: 148px;
    width: 100%;
    padding: 20px var(--chrome-edge);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    background: #fff;
    box-shadow: 0 12px 24px rgba(0,0,0,.16);
  }
  .nav.mobile-open .nav__links a { width: 100%; padding: 12px 0; font-size: 17px; }
}

/* ============================================================
   MOBILE — shared fluid shell / nav / footer
   ============================================================ */
@media (max-width: 767px) {
  :root {
    --page-w: 440px;
    --content-w: 400px;
    --margin-x: 20px;
    --fs-display: 40px;
    --fs-h2: 32px;
    --fs-h3: 28px;
    --fs-title: 20px;
    --fs-num: 48px;
  }

  html, body { width: 100%; min-width: 320px; overflow-x: hidden; }
  body { font-size: 16px; }
  .shell { width: 100%; }

  .nav {
    width: 100%;
    height: auto;
    padding: 0;
    justify-content: space-between;
  }
  .nav__topbar { display: none; } /* hidden on mobile per Figma demo */
  .nav__topbar-hours { display: none; }
  .nav__main { height: 88px; padding: 12px 24px; justify-content: space-between; }
  .nav-quick { display: none; }
  .nav__logo { order: 3; width: 95px; height: 48px; margin: 0; }
  .nav__logo img { width: 95px; height: 48px; object-fit: fill; }
  .nav__menu {
    display: block;
    order: 1;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 0;
    background:
      linear-gradient(#000 0 0) 0 7px / 32px 1px no-repeat,
      linear-gradient(#000 0 0) 0 16px / 32px 1px no-repeat,
      linear-gradient(#000 0 0) 0 26px / 32px 1px no-repeat;
    cursor: pointer;
  }
  .nav__menu span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .nav__links, .nav__cta { display: none; }
  .nav.mobile-open { box-shadow: 0 8px 24px rgba(0,0,0,.14); }
  .nav.mobile-open .nav__links {
    position: absolute;
    left: 0;
    top: 88px;
    width: 100%;
    padding: 24px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    background: #ffffff;
    box-shadow: 0 12px 24px rgba(0,0,0,.16);
  }
  .nav.mobile-open .nav__links a { width: 100%; padding: 14px 0; font-size: 18px; }

  .back-to-top { right: 20px; bottom: 20px; }

  .footer {
    width: 100%;
    height: 1133px;
    padding: 0 20px;
    text-align: center;
  }
  .footer__grid { position: absolute; inset: 0; display: block; }
  .footer__brand { position: absolute; left: 20px; top: 60px; width: calc(100% - 40px); }
  .footer__brand .logo { width: 135px; height: 69px; margin: 0 auto 40px; object-fit: fill; }
  .footer__brand > div { display: flex !important; flex-direction: column; align-items: center !important; gap: 28px !important; }
  .footer__heading, .footer__subheading { font-size: 20px; }
  .footer__brand .btn { width: 100%; justify-content: center; }

  .footer__contact { position: absolute; left: 20px; top: 352px; width: calc(100% - 40px); height: 240px; }
  .footer__locations { position: absolute; left: 20px; top: 652px; width: calc(100% - 40px); height: 188px; }
  .footer__row { position: absolute; left: 0; width: 100%; margin: 0; display: block; text-align: center; }
  .footer__row .icon { display: block; width: 32px; height: 32px; margin: 0 auto 20px; }
  .footer__row .icon svg { display: none; }
  .footer__contact .footer__row:nth-child(1) .icon { background: url('../assets/icons/contact/email.svg') center / contain no-repeat; }
  .footer__contact .footer__row:nth-child(2) .icon { background: url('../assets/icons/contact/footer-phone.svg') center / contain no-repeat; }
  .footer__locations .footer__row:nth-child(1) .icon { background: url('../assets/icons/contact/footer-pin.svg') center / contain no-repeat; }
  .footer__row p { font-weight: 400; line-height: 1.5; }
  .footer__contact .footer__row:nth-child(1) { top: 0; }
  .footer__contact .footer__row:nth-child(2) { top: 124px; }
  .footer__contact .footer__row:nth-child(3) { top: 228px; }
  .footer__contact .footer__row:nth-child(3) .icon { display: none; }
  .footer__contact br,
  .footer__locations br { display: none; }
  .footer__locations .footer__row p br:last-of-type { display: block; }
  .footer__locations .footer__row:nth-child(1) { top: 0; }
  .footer__locations .footer__row:nth-child(2) { top: 152px; }
  .footer__locations .footer__row:nth-child(2) .icon { display: none; }

  .footer__legal {
    position: absolute;
    left: 20px;
    top: 900px;
    width: calc(100% - 40px);
    height: 116px;
    margin: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 0;
  }
  .footer__legal span,
  .footer__legal span + span,
  .footer__legal span:last-child {
    width: 100%;
    height: 52px;
    justify-content: center;
    border: 0;
  }
  .footer__tagline {
    position: absolute;
    left: 20px;
    top: 1056px;
    width: calc(100% - 40px);
    height: 45px;
    border-top: 1px solid rgba(255,255,255,.2);
    align-items: flex-end;
    justify-content: center;
  }
}
