/* =========================================================
   Dwayne's Tech Support — Design System
   Foundation: tokens, base styles, layout primitives,
   buttons, cards, forms, navigation, footer.
   ========================================================= */

/* ---------- Design Tokens ---------- */
:root {
  /* Brand color ramp */
  --color-navy-950: #060b18;
  --color-navy-900: #0b1526;
  --color-navy-800: #101d33;
  --color-navy-700: #16274a;
  --color-blue-600: #2563eb;
  --color-blue-500: #3b82f6;
  --color-blue-400: #60a5fa;
  --color-cyan-400: #22d3ee;
  --color-white: #ffffff;
  --color-gray-50: #f8fafc;
  --color-gray-100: #eef1f6;
  --color-gray-200: #dfe4ec;
  --color-gray-300: #c7cedb;
  --color-gray-400: #94a3b8;
  --color-gray-600: #57667c;
  --color-gray-900: #0f1723;

  /* Semantic — dark sections */
  --color-bg-dark: var(--color-navy-950);
  --color-bg-dark-alt: var(--color-navy-900);
  --color-surface-dark: var(--color-navy-800);
  --color-border-dark: rgba(255, 255, 255, 0.09);
  --color-text-on-dark: #e8ecf3;
  --color-text-muted-on-dark: #97a3b8;

  /* Semantic — light sections */
  --color-bg-light: var(--color-white);
  --color-bg-light-alt: var(--color-gray-50);
  --color-border-light: var(--color-gray-200);
  --color-text-on-light: var(--color-gray-900);
  --color-text-muted-on-light: var(--color-gray-600);

  /* Accent
     Note: --color-accent is used as small/normal-weight TEXT color in several
     places (eyebrows, "Learn more" links, prices), so it must clear WCAG AA's
     4.5:1 text-contrast ratio on white/light backgrounds. blue-500 only hits
     ~3.7:1 (a real bug caught by a Lighthouse audit); blue-600 hits 5.17:1. */
  --color-accent: var(--color-blue-600);
  --color-accent-hover: var(--color-blue-500);
  --color-accent-cyan: var(--color-cyan-400);
  --gradient-accent: linear-gradient(135deg, var(--color-blue-600), var(--color-cyan-400));

  /* Feedback */
  --color-success: #22c55e;
  --color-error: #f87171;

  /* Typography */
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --fs-xs: 0.8125rem;
  --fs-sm: 0.9375rem;
  --fs-base: 1rem;
  --fs-md: 1.125rem;
  --fs-lg: 1.375rem;
  --fs-xl: 1.75rem;
  --fs-2xl: 2.25rem;
  /* Fluid so long words in headings (e.g. "Development") don't overflow
     narrow viewports — found at 320px in Milestone 8 QA. Reaches its max
     (the old fixed value) by 768px, so desktop/tablet are unchanged. */
  --fs-3xl: clamp(2rem, 1.3rem + 3.5vw, 3rem);
  --fs-4xl: clamp(2.5rem, 1.5rem + 5vw, 3.75rem);
  --lh-tight: 1.15;
  --lh-snug: 1.35;
  --lh-normal: 1.6;

  /* Spacing scale */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-8: 3rem;
  --space-10: 4rem;
  --space-12: 6rem;
  --space-16: 8rem;

  /* Layout */
  --container-max: 1200px;
  --container-pad: var(--space-5);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 999px;

  --shadow-sm: 0 1px 2px rgba(2, 10, 30, 0.08);
  --shadow-md: 0 8px 24px rgba(2, 10, 30, 0.14);
  --shadow-lg: 0 24px 60px rgba(2, 10, 30, 0.22);

  --transition-fast: 150ms ease;
  --transition-base: 220ms ease;

  --header-height: 76px;
}

/* ---------- Reset & Base ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  line-height: var(--lh-normal);
  color: var(--color-text-on-light);
  background: var(--color-bg-light);
  -webkit-font-smoothing: antialiased;
}

img,
picture,
svg {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  margin: 0 0 var(--space-4);
  font-weight: 700;
  line-height: var(--lh-tight);
  letter-spacing: -0.01em;
  overflow-wrap: break-word;
}

h1 {
  font-size: var(--fs-4xl);
}
h2 {
  font-size: var(--fs-3xl);
}
h3 {
  font-size: var(--fs-xl);
}
h4 {
  font-size: var(--fs-md);
}

p {
  margin: 0 0 var(--space-4);
  color: inherit;
}

button {
  font-family: inherit;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* Focus visibility — never remove focus outlines, only restyle them */
:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* Skip link */
.skip-link {
  position: absolute;
  left: var(--space-4);
  top: -100px;
  background: var(--color-accent);
  color: var(--color-white);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-sm);
  z-index: 1000;
  transition: top var(--transition-fast);
}
.skip-link:focus {
  top: var(--space-4);
}

/* ---------- Layout Primitives ---------- */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--container-pad);
}

.section {
  padding-block: var(--space-12);
}

.section--tight {
  padding-block: var(--space-8);
}

.section--dark {
  background: var(--color-bg-dark);
  color: var(--color-text-on-dark);
}

.section--dark-alt {
  background: var(--color-bg-dark-alt);
  color: var(--color-text-on-dark);
}

.section--light-alt {
  background: var(--color-bg-light-alt);
}

.section--dark h1,
.section--dark h2,
.section--dark h3,
.section--dark-alt h1,
.section--dark-alt h2,
.section--dark-alt h3 {
  color: var(--color-white);
}

.section--dark p,
.section--dark-alt p {
  color: var(--color-text-muted-on-dark);
}

.section-header {
  max-width: 640px;
  margin-bottom: var(--space-8);
}

.eyebrow {
  display: inline-block;
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: var(--space-3);
}

/* --color-accent (blue-600) is tuned for 4.5:1 contrast on light backgrounds
   but fails on dark ones — use a lighter blue here instead, same pattern as
   the heading color overrides below. */
.section--dark .eyebrow,
.section--dark-alt .eyebrow {
  color: var(--color-blue-400);
}

.grid {
  display: grid;
  gap: var(--space-6);
}

/* Grid items default to min-width: auto, which lets non-wrapping content
   (e.g. a button's nowrap text) force a track — and the whole grid — wider
   than its container. Found twice now (Milestone 4's grid--main-sidebar,
   Milestone 8's grid--2 path panels at 320px) — fixed once, here, for every
   grid variant instead of patching each one separately as it comes up. */
.grid > * {
  min-width: 0;
}

.grid--2 {
  grid-template-columns: repeat(2, 1fr);
}

.grid--3 {
  grid-template-columns: repeat(3, 1fr);
}

.grid--4 {
  grid-template-columns: repeat(4, 1fr);
}

.grid--6 {
  grid-template-columns: repeat(6, 1fr);
}

/* Fits as many columns as the width allows (never leaves a cramped 3-up in a
   narrow column, which is what fixed-count .grid--3 does inside the
   main+sidebar layout). Used by the equipment cards on the service pages. */
.grid--auto {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

@media (max-width: 1024px) {
  .grid--3,
  .grid--4 {
    grid-template-columns: repeat(2, 1fr);
  }
  .grid--6 {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 640px) {
  .grid--2,
  .grid--3,
  .grid--4,
  .grid--6 {
    grid-template-columns: 1fr;
  }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  font-size: var(--fs-sm);
  font-weight: 600;
  padding: 0.875rem 1.75rem;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast),
    background-color var(--transition-fast), color var(--transition-fast),
    border-color var(--transition-fast);
  white-space: nowrap;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn--primary {
  background: var(--gradient-accent);
  color: var(--color-white);
  box-shadow: var(--shadow-sm);
}

.btn--primary:hover {
  box-shadow: var(--shadow-md);
}

.btn--secondary {
  background: transparent;
  border-color: var(--color-border-light);
  color: var(--color-text-on-light);
}

.btn--secondary:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
}

.section--dark .btn--secondary,
.section--dark-alt .btn--secondary,
.page-hero .btn--secondary {
  border-color: var(--color-border-dark);
  color: var(--color-text-on-dark);
}

.section--dark .btn--secondary:hover,
.section--dark-alt .btn--secondary:hover,
.page-hero .btn--secondary:hover {
  border-color: var(--color-accent-cyan);
  color: var(--color-accent-cyan);
}

.btn--ghost {
  background: transparent;
  color: var(--color-accent);
  padding-inline: 0;
}

.btn--ghost:hover {
  color: var(--color-accent-hover);
}

.btn--sm {
  padding: 0.625rem 1.25rem;
  font-size: var(--fs-xs);
}

.btn--block {
  width: 100%;
}

/* ---------- Cards ---------- */
.card {
  background: var(--color-bg-light);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  transition: transform var(--transition-base), box-shadow var(--transition-base),
    border-color var(--transition-base);
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: transparent;
}

.card__icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  background: rgba(59, 130, 246, 0.1);
  color: var(--color-accent);
  margin-bottom: var(--space-5);
}

.card__icon svg {
  width: 24px;
  height: 24px;
}

.card__title {
  font-size: var(--fs-md);
  margin-bottom: var(--space-2);
}

.card__body {
  color: var(--color-text-muted-on-light);
  margin-bottom: var(--space-4);
}

.card__link {
  font-weight: 600;
  color: var(--color-accent);
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
}

.card__link svg {
  width: 16px;
  height: 16px;
  transition: transform var(--transition-fast);
}

.card__link:hover svg {
  transform: translateX(3px);
}

/* Card with a photo on top (same idea as .product-card/.project-card): the
   photo sits edge to edge in a white box, the text below gets its own padding.
   contain, not cover, because product photos vary a lot in aspect ratio. */
.card--media {
  padding: 0;
  overflow: hidden;
}

.card__media {
  aspect-ratio: 4 / 3;
  overflow: hidden; /* without this the box grows to fit its photo instead of holding 4:3 */
  padding: var(--space-4);
  background: var(--color-white);
  border-bottom: 1px solid var(--color-border-light);
}

.card__media img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.card__content {
  padding: var(--space-5);
  display: flex;
  flex-direction: column;
  flex: 1;
}

.card--compact .card__body {
  font-size: var(--fs-sm);
}

/* Project card variant */
.project-card {
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--color-border-light);
  background: var(--color-bg-light);
  transition: transform var(--transition-base), box-shadow var(--transition-base);
}

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

.project-card__media {
  aspect-ratio: 16 / 10;
  background: var(--color-bg-dark-alt);
  overflow: hidden;
}

.project-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.project-card__body {
  padding: var(--space-5);
}

.project-card__tag {
  font-size: var(--fs-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-accent);
  margin-bottom: var(--space-2);
  display: block;
}

.project-card__tech {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-4);
}

.tech-pill {
  font-size: var(--fs-xs);
  padding: 0.25rem 0.625rem;
  border-radius: var(--radius-full);
  background: var(--color-gray-100);
  color: var(--color-text-muted-on-light);
}

/* ---------- Forms ---------- */
.form-field {
  margin-bottom: var(--space-5);
}

.form-field label {
  display: block;
  font-size: var(--fs-sm);
  font-weight: 600;
  margin-bottom: var(--space-2);
}

.form-field .hint {
  font-size: var(--fs-xs);
  color: var(--color-text-muted-on-light);
  margin-top: var(--space-1);
}

.form-field .error-message {
  font-size: var(--fs-xs);
  color: var(--color-error);
  margin-top: var(--space-1);
  display: none;
}

.form-field.has-error .error-message {
  display: block;
}

.form-field.has-error input,
.form-field.has-error select,
.form-field.has-error textarea {
  border-color: var(--color-error);
}

input,
select,
textarea {
  width: 100%;
  font-family: inherit;
  font-size: var(--fs-sm);
  padding: 0.75rem 1rem;
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-sm);
  background: var(--color-white);
  color: var(--color-text-on-light);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
  outline: none;
}

textarea {
  min-height: 140px;
  resize: vertical;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-5);
}

@media (max-width: 640px) {
  .form-row {
    grid-template-columns: 1fr;
  }
}

.radio-group,
.checkbox-group {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
}

.radio-option {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: 0.625rem 1rem;
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: var(--fs-sm);
}

.radio-option input {
  width: auto;
}

.form-success,
.form-error {
  padding: var(--space-4) var(--space-5);
  border-radius: var(--radius-md);
  font-size: var(--fs-sm);
  margin-bottom: var(--space-5);
  display: none;
}

.form-success {
  background: rgba(34, 197, 94, 0.1);
  color: #15803d;
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.form-error {
  background: rgba(248, 113, 113, 0.1);
  color: #b91c1c;
  border: 1px solid rgba(248, 113, 113, 0.3);
}

/* ---------- Site Header / Navigation ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-height);
  display: flex;
  align-items: center;
  background: rgba(6, 11, 24, 0.97);
  border-bottom: 1px solid var(--color-border-dark);
}
/* Note: intentionally no backdrop-filter here — it would create a CSS
   containing block for position:fixed descendants (the mobile nav list
   below), collapsing that overlay's height. A solid/near-solid background
   avoids the bug and matches the "no glassmorphism" design direction. */

.nav {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--container-pad);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-6);
}

.nav__left {
  display: flex;
  align-items: center;
  gap: var(--space-8);
  flex: 1;
}

.nav__right {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  flex-shrink: 0;
}

.nav__brand {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.nav__logo {
  height: 50px;
  width: auto;
}

.nav__phone {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--color-text-on-dark);
  text-decoration: none;
  font-size: var(--fs-sm);
  font-weight: 500;
  transition: color var(--transition-fast);
}

.nav__phone:hover {
  color: var(--color-white);
}

.nav__phone svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.nav__list {
  display: flex;
  align-items: center;
  gap: var(--space-6);
}

.nav__link {
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--color-text-on-dark);
  padding: var(--space-2) 0;
  position: relative;
}

.nav__link:hover {
  color: var(--color-white);
}

.nav__link[aria-current="page"] {
  color: var(--color-white);
}

.nav__link[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -2px;
  height: 2px;
  background: var(--gradient-accent);
  border-radius: var(--radius-full);
}

.nav__item {
  display: flex;
  align-items: center;
}

.nav__item--has-dropdown {
  position: relative;
}

.nav__link-row {
  display: flex;
  align-items: center;
}

.nav__caret {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: inherit;
  cursor: pointer;
  padding: var(--space-2);
  margin-left: -2px;
}

.nav__caret svg {
  width: 16px;
  height: 16px;
  transition: transform var(--transition-fast);
}

.nav__caret[aria-expanded="true"] svg {
  transform: rotate(180deg);
}

/* Mega menu (Services dropdown) */
.mega-menu {
  position: absolute;
  top: calc(100% + 14px);
  left: 50%;
  transform: translateX(-50%);
  width: min(680px, 90vw);
  background: var(--color-bg-dark-alt);
  border: 1px solid var(--color-border-dark);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: var(--space-6);
  z-index: 200;
}

.mega-menu[hidden] {
  display: none;
}

.mega-menu__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-1);
  margin-bottom: var(--space-5);
}

.mega-menu__link {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3);
  border-radius: var(--radius-md);
  color: var(--color-text-on-dark);
  transition: background-color var(--transition-fast), color var(--transition-fast);
}

.mega-menu__link:hover,
.mega-menu__link:focus-visible {
  background: rgba(255, 255, 255, 0.07);
  color: var(--color-white);
}

.mega-menu__link svg {
  width: 20px;
  height: 20px;
  color: var(--color-accent-cyan);
  flex-shrink: 0;
}

.mega-menu__link span {
  font-size: var(--fs-sm);
  font-weight: 500;
}

.mega-menu__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-3);
  padding-top: var(--space-5);
  border-top: 1px solid var(--color-border-dark);
  font-size: var(--fs-xs);
  color: var(--color-text-muted-on-dark);
}

.nav__actions {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.nav__toggle {
  display: none;
  background: transparent;
  border: none;
  color: var(--color-white);
  cursor: pointer;
  padding: var(--space-2);
}

.nav__toggle svg {
  width: 26px;
  height: 26px;
}

@media (max-width: 1024px) {
  /* Switch from flex to a 3-column grid (logo | button | hamburger) so the
     middle column can be genuinely centered between the other two via
     justify-self, regardless of how wide the logo or hamburger are —
     flexbox's justify-content: space-between only equalizes the gaps,
     which doesn't visually center a middle item when the two side items
     are different widths. */
  .nav {
    display: grid;
    grid-template-columns: auto 1fr auto;
  }

  .nav__right {
    justify-self: center;
  }

  /* Phone number/icon hidden for the entire hamburger-menu range, not just
     the narrowest widths — there's no width in this range where it should
     reappear alongside the collapsed nav. */
  .nav__phone {
    display: none;
  }

  .nav__left {
    /* flex-basis: auto (not the "flex: 0" shorthand's 0%) so this box
       sizes itself from its actual content (the logo) instead of starting
       from a 0 hypothetical size — flex-basis: 0% let this box compute to
       literally 0 width in some browsers even with the child's own
       flex-shrink: 0, which let Request a Quote overlap the logo. */
    flex: 0 1 auto;
  }

  .nav__list {
    position: fixed;
    inset: var(--header-height) 0 0 0;
    background: var(--color-bg-dark);
    flex-direction: column;
    align-items: stretch;
    padding: var(--space-6) var(--container-pad);
    gap: var(--space-1);
    transform: translateY(-8px);
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--transition-base), transform var(--transition-base),
      visibility var(--transition-base);
    overflow-y: auto;
  }

  .nav__list.is-open {
    opacity: 1;
    transform: translateY(0);
    visibility: visible;
  }

  .nav__item {
    flex-direction: column;
    align-items: stretch;
    border-bottom: 1px solid var(--color-border-dark);
  }

  .nav__link,
  .nav__link-row {
    padding: var(--space-4) 0;
  }

  .nav__link {
    font-size: var(--fs-md);
  }

  .nav__link-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
  }

  .nav__link-row .nav__link {
    padding: 0;
  }

  .nav__caret {
    padding: var(--space-3);
    margin-left: 0;
  }

  /* Mega menu becomes an inline accordion, not a floating panel */
  .mega-menu {
    position: static;
    transform: none;
    width: auto;
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 0 0 var(--space-4) var(--space-4);
  }

  .mega-menu__grid {
    grid-template-columns: 1fr;
    gap: 0;
    margin-bottom: var(--space-3);
  }

  .mega-menu__link {
    padding: var(--space-3) 0;
  }

  .mega-menu__footer {
    border-top: none;
    padding-top: 0;
    flex-direction: column;
    align-items: flex-start;
  }

  .nav__toggle {
    display: block;
  }
}

@media (max-width: 768px) {
  .hero__animate {
    display: none;
  }
}

@media (max-width: 640px) {
  .nav {
    gap: var(--space-2);
  }

  .nav__left {
    /* No min-width: 0 here: with flex-basis: 0% (from .nav__left { flex: 0 }
       at 1024px) plus min-width: 0, this box could shrink to literally 0
       width while its child (the logo) still rendered at full size and
       visually overflowed it — Request a Quote then got positioned based
       on the shrunk 0-width box, overlapping the logo. Leaving min-width
       at its default (auto) makes this box hug the logo's real content
       size instead, which is what we actually want here. */
    gap: 0;
  }

  .nav__logo {
    height: 32px;
  }

  .nav__right {
    gap: var(--space-3);
  }

  .btn--sm {
    font-size: var(--fs-xs);
    padding: var(--space-2) var(--space-3);
  }
}

/* Below ~360px, the logo + "Request a Quote" + hamburger genuinely don't
   fit together even at minimum padding (the text alone is ~104px, but
   only ~90px is available). Shrink the visible label instead of letting
   it overlap the logo. font-size: 0 hides the real text visually without
   removing it from the accessible name (verified via Playwright's
   accessibility tree — screen readers still announce "Request a Quote"),
   while ::after supplies the shorter visual label. */
@media (max-width: 380px) {
  .nav {
    gap: var(--space-1);
  }

  .nav__right .btn--primary {
    font-size: 0;
    padding-inline: var(--space-2);
  }

  .nav__right .btn--primary::after {
    content: "Get Quote";
    font-size: var(--fs-xs);
  }
}

/* ---------- Site Footer ---------- */
.site-footer {
  background: var(--color-bg-dark);
  color: var(--color-text-muted-on-dark);
  padding-block: var(--space-10) var(--space-6);
}

.footer__grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: var(--space-8);
  padding-bottom: var(--space-8);
  border-bottom: 1px solid var(--color-border-dark);
}

@media (max-width: 768px) {
  .footer__grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 480px) {
  .footer__grid {
    grid-template-columns: 1fr;
  }
}

.footer__brand-mark {
  color: var(--color-white);
  font-weight: 700;
  font-size: var(--fs-md);
  margin-bottom: var(--space-2);
}

.footer__tagline {
  font-size: var(--fs-sm);
  max-width: 320px;
}

.footer__heading {
  color: var(--color-white);
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
  margin-bottom: var(--space-4);
}

.footer__list li {
  margin-bottom: var(--space-3);
}

.footer__list a:hover {
  color: var(--color-white);
}

.footer__contact-link {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  text-decoration: none;
  color: var(--color-text-muted-on-dark);
  transition: color var(--transition-fast);
}

.footer__contact-link:hover {
  color: var(--color-white);
}

.footer__contact-link svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.footer__contact-link span {
  word-break: break-word;
}

.footer__bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-3);
  padding-top: var(--space-6);
  font-size: var(--fs-xs);
}

.footer__legal {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.footer__legal a:hover {
  color: var(--color-white);
}

@media (max-width: 640px) {
  .footer__bottom {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ---------- Homepage: Hero ---------- */
.hero {
  position: relative;
  padding-block: var(--space-16) var(--space-12);
  text-align: center;
  background: radial-gradient(ellipse at top, var(--color-navy-800) 0%, var(--color-bg-dark) 60%);
  overflow: hidden;
}

.hero__animate {
  position: absolute;
  border-radius: 50%;
  opacity: 0.1;
  pointer-events: none;
}

.hero__animate--left-1 {
  width: 120px;
  height: 120px;
  background: var(--color-blue-400);
  left: 5%;
  top: 10%;
  animation: float-left-1 6s ease-in-out infinite;
}

.hero__animate--left-2 {
  width: 80px;
  height: 80px;
  background: var(--color-accent);
  left: 8%;
  bottom: 15%;
  animation: float-left-2 8s ease-in-out infinite;
}

.hero__animate--right-1 {
  width: 100px;
  height: 100px;
  background: var(--color-accent);
  right: 6%;
  top: 20%;
  animation: float-right-1 7s ease-in-out infinite;
}

.hero__animate--right-2 {
  width: 90px;
  height: 90px;
  background: var(--color-blue-400);
  right: 4%;
  bottom: 10%;
  animation: float-right-2 9s ease-in-out infinite;
}

@keyframes float-left-1 {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-20px); }
}

@keyframes float-left-2 {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(20px); }
}

@keyframes float-right-1 {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(15px); }
}

@keyframes float-right-2 {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-25px); }
}

.hero__inner {
  position: relative;
  z-index: 1;
  max-width: 760px;
}

.hero h1 {
  color: var(--color-white);
}

.hero__lead {
  font-size: var(--fs-md);
  max-width: 600px;
  margin-inline: auto;
}

.hero__actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: var(--space-4);
  margin-block: var(--space-6);
}

.hero__trust {
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: 0.03em;
  color: var(--color-text-muted-on-dark);
  margin: 0;
}

@media (max-width: 640px) {
  .hero {
    padding-block: var(--space-12) var(--space-8);
  }
}

/* ---------- Homepage: Technology Bar ---------- */
.tech-bar__label {
  text-align: center;
  font-size: var(--fs-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-muted-on-dark);
  margin-bottom: var(--space-5);
}

.tech-bar__list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-2) var(--space-8);
}

.tech-bar__list li {
  font-weight: 600;
  font-size: var(--fs-sm);
  color: var(--color-text-on-dark);
}

/* ---------- Homepage: Technology Flow Diagram ---------- */
.flow-diagram {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
}

.flow-diagram__chip {
  padding: var(--space-3) var(--space-5);
  border: 1px solid var(--color-border-dark);
  border-radius: var(--radius-full);
  background: var(--color-surface-dark);
  color: var(--color-white);
  font-weight: 600;
  font-size: var(--fs-sm);
}

.flow-diagram__arrow {
  color: var(--color-accent-cyan);
  font-weight: 700;
}

/* ---------- Homepage: Local vs Remote ---------- */
.path-panel {
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-lg);
  padding: var(--space-8);
  height: 100%;
}

.path-panel--dark {
  background: var(--color-bg-dark);
  border-color: var(--color-border-dark);
  color: var(--color-text-on-dark);
}

.path-panel--dark h3 {
  color: var(--color-white);
}

.path-panel__icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  background: rgba(59, 130, 246, 0.12);
  color: var(--color-accent);
  margin-bottom: var(--space-5);
}

.path-panel--dark .path-panel__icon {
  color: var(--color-accent-cyan);
}

.path-panel__icon svg {
  width: 24px;
  height: 24px;
}

.path-panel__list {
  margin-block: var(--space-5);
}

.path-panel__list li {
  padding: var(--space-2) 0;
  color: var(--color-text-muted-on-light);
}

.path-panel--dark .path-panel__list li {
  color: var(--color-text-muted-on-dark);
}

/* ---------- Homepage: Checklist ---------- */
.checklist li {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-3) 0;
}

.checklist svg {
  width: 20px;
  height: 20px;
  color: var(--color-accent);
  flex-shrink: 0;
  margin-top: 2px;
}

/* ---------- Homepage: Process Steps ---------- */
.grid--5 {
  grid-template-columns: repeat(5, 1fr);
}

@media (max-width: 1024px) {
  .grid--5 {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 640px) {
  .grid--5 {
    grid-template-columns: 1fr;
  }
}

.process-step__number {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  background: var(--gradient-accent);
  color: var(--color-white);
  font-weight: 700;
  margin-bottom: var(--space-4);
}

.process-step h3 {
  font-size: var(--fs-md);
  color: var(--color-white);
}

.process-step p {
  font-size: var(--fs-sm);
}

/* ---------- Homepage: FAQ ---------- */
.faq-item {
  border-bottom: 1px solid var(--color-border-light);
  padding-block: var(--space-5);
}

.faq-item summary {
  cursor: pointer;
  font-weight: 600;
  font-size: var(--fs-md);
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item__caret {
  flex-shrink: 0;
  transition: transform var(--transition-fast);
}

.faq-item__caret svg {
  width: 18px;
  height: 18px;
}

.faq-item[open] .faq-item__caret {
  transform: rotate(180deg);
}

.faq-item p {
  margin-top: var(--space-3);
  color: var(--color-text-muted-on-light);
}

/* ---------- Homepage: Final CTA ---------- */
.final-cta {
  text-align: center;
}

.final-cta h2 {
  max-width: 640px;
  margin-inline: auto;
}

.final-cta p {
  max-width: 480px;
  margin: var(--space-3) auto 0;
}

.final-cta .hero__actions {
  margin-top: var(--space-6);
  margin-bottom: 0;
}

/* ---------- Inner Pages: Breadcrumb + Page Hero ---------- */
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--fs-xs);
  color: var(--color-text-muted-on-dark);
  margin-bottom: var(--space-5);
}

.breadcrumb a {
  color: var(--color-text-muted-on-dark);
}

.breadcrumb a:hover {
  color: var(--color-white);
}

.breadcrumb__current {
  color: var(--color-white);
  font-weight: 600;
}

.page-hero {
  padding-block: var(--space-10) var(--space-10);
  background: radial-gradient(ellipse at top, var(--color-navy-800) 0%, var(--color-bg-dark) 60%);
  color: var(--color-text-on-dark);
}

.page-hero__inner {
  max-width: 720px;
}

.page-hero h1 {
  color: var(--color-white);
  font-size: var(--fs-3xl);
}

.page-hero__lead {
  font-size: var(--fs-md);
  color: var(--color-text-muted-on-dark);
}

.page-hero .hero__actions {
  justify-content: flex-start;
  margin-bottom: 0;
}
.page-hero__profile {
  display: flex;
  align-items: center;
  gap: var(--space-6);
}
.page-hero__profile picture {
  flex-shrink: 0;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  overflow: hidden;
  background: #efe9e0;
  box-shadow: var(--shadow-md);
}
.page-hero__avatar {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
@media (max-width: 640px) {
  .page-hero__profile {
    flex-direction: column;
    align-items: flex-start;
  }
  .page-hero__profile picture {
    width: 132px;
    height: 132px;
  }
}

/* ---------- Inner Pages: Main + Sidebar Layout ---------- */
.grid--main-sidebar {
  grid-template-columns: 2fr 1fr;
  align-items: start;
}

@media (max-width: 900px) {
  .grid--main-sidebar {
    grid-template-columns: 1fr;
  }
}

.sidebar-stack {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
  position: sticky;
  top: calc(var(--header-height) + var(--space-6));
}

@media (max-width: 900px) {
  .sidebar-stack {
    position: static;
  }
}

.sidebar-stack .btn--block + .btn--block {
  margin-top: var(--space-3);
}

.content-block {
  margin-bottom: var(--space-10);
}

.content-block:last-child {
  margin-bottom: 0;
}

.content-block h2 {
  font-size: var(--fs-xl);
}

/* Cards inside content blocks (service-page equipment cards): equal-height
   columns with the link pinned to the bottom, a comfortable tap target, and an
   arrow that doesn't shrink when the link text wraps. */
.content-block .card {
  display: flex;
  flex-direction: column;
}

.content-block .card__link {
  min-height: 44px;
  margin-top: auto;
  align-self: flex-start;
}

.content-block .card__link svg {
  flex-shrink: 0;
}

.content-block__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  margin-top: var(--space-6);
}

.content-block__actions .btn {
  white-space: normal;
  text-align: center;
}

.content-block__note {
  margin: var(--space-5) 0 0;
  font-size: var(--fs-sm);
  color: var(--color-text-muted-on-light);
}

.content-block__note a {
  color: var(--color-accent);
  font-weight: 600;
}

/* ---------- Inner Pages: Pricing List ---------- */
.pricing-list {
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.pricing-item {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-5) var(--space-6);
  border-bottom: 1px solid var(--color-border-light);
}

.pricing-item:last-child {
  border-bottom: none;
}

.pricing-item__name {
  font-weight: 600;
}

.pricing-item__note {
  display: block;
  font-size: var(--fs-xs);
  color: var(--color-text-muted-on-light);
  font-weight: 400;
  margin-top: var(--space-1);
}

.pricing-item__price {
  font-weight: 700;
  color: var(--color-accent);
  white-space: nowrap;
}

.link-list li {
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--color-border-light);
}

.link-list li:last-child {
  border-bottom: none;
}

.link-list a {
  font-weight: 600;
  color: var(--color-accent);
}

.link-list a:hover {
  color: var(--color-accent-hover);
}

/* ---------- Credibility Strip ---------- */
.credibility-strip__grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-8) var(--space-10);
  text-align: center;
}

.credibility-strip__item {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.credibility-strip__number {
  font-size: var(--fs-xl);
  font-weight: 800;
  color: var(--color-white);
  line-height: 1;
}

.credibility-strip__label {
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--color-text-muted-on-dark);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.credibility-strip__link {
  text-align: center;
  margin-top: var(--space-6);
  margin-bottom: 0;
}

.credibility-strip__link a {
  color: var(--color-accent-cyan);
  font-weight: 600;
  font-size: var(--fs-sm);
}

/* ---------- Testimonials ---------- */
.testimonial-carousel {
  width: 100%;
}

.testimonial-carousel__track {
  display: flex;
  align-items: flex-start;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-behavior: smooth;
  scroll-snap-type: x mandatory;
  padding: var(--space-2) 0 var(--space-3);
  scrollbar-width: none;
  transition: height 0.3s ease;
}

.testimonial-carousel__track::-webkit-scrollbar {
  display: none;
}

.testimonial-card {
  padding: var(--space-4) var(--space-6);
  flex: 0 0 100%;
  scroll-snap-align: start;
  text-align: center;
}

.testimonial-card__quote {
  font-size: var(--fs-md);
  color: var(--color-text-on-light);
  max-width: 700px;
  margin-inline: auto;
  margin-bottom: var(--space-5);
}

.testimonial-card__quote::before {
  content: "\201C";
}

.testimonial-card__quote::after {
  content: "\201D";
}

.testimonial-card__meta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-1);
  border-top: 1px solid var(--color-border-light);
  padding-top: var(--space-4);
}

.testimonial-card__author {
  font-weight: 700;
}

.testimonial-card__detail {
  font-size: var(--fs-xs);
  color: var(--color-text-muted-on-light);
}

.testimonial-card__rating {
  color: #f59e0b;
  font-size: var(--fs-lg);
  display: flex;
  justify-content: center;
  gap: 0.1em;
  margin-top: var(--space-2);
}

.testimonial-card__rating svg {
  width: 1.1em;
  height: 1.1em;
}

/* ---------- Filter Bar (category chips) ---------- */
/* Shared by /shop/ (equipment category) and /projects/ (client project /
   plugin / theme). Reused as-is, not duplicated, when adding a new grid
   that needs client-side filtering. */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-8);
  /* Deep links from the service pages scroll this into view; keep it clear
     of the sticky header. */
  scroll-margin-top: calc(var(--header-height) + var(--space-5));
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  font-size: var(--fs-sm);
  font-weight: 600;
  padding: 0.5rem 1.125rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--color-border-light);
  background: var(--color-bg-light);
  color: var(--color-text-on-light);
  cursor: pointer;
  transition: background-color var(--transition-fast), border-color var(--transition-fast),
    color var(--transition-fast);
}

.filter-chip:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
}

.filter-chip[aria-pressed="true"] {
  background: var(--gradient-accent);
  border-color: transparent;
  color: var(--color-white);
}

.filter-status {
  margin: 0 0 var(--space-5);
  text-align: center;
  font-size: var(--fs-sm);
  color: var(--color-text-muted-on-light);
}

/* ---------- Shop: Product Card ---------- */
.product-card {
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--color-border-light);
  background: var(--color-bg-light);
  transition: transform var(--transition-base), box-shadow var(--transition-base);
}

/* A card's own `display` (flex/grid/etc.) overrides the browser's default
   [hidden] { display: none } UA rule (author CSS always wins over UA styles,
   regardless of specificity), which silently broke the filter bar's
   `card.hidden = true` on .product-card. .project-card doesn't currently set
   its own `display`, so it isn't broken today, but both are covered here so
   this bug class can't resurface if that ever changes. */
.product-card[hidden],
.project-card[hidden] {
  display: none;
}

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

.product-card__media {
  aspect-ratio: 4 / 3;
  background: var(--color-white);
  overflow: hidden;
  padding: var(--space-4);
}

/* contain, not cover: real Amazon product photos already have their own
   white-background padding and vary wildly in aspect ratio (some are very
   wide flat-profile shots) — cover would crop parts of the product off.
   The remaining generic placeholder tiles are pre-rendered at an exact
   4:3 ratio, so contain vs. cover makes no visible difference for those. */
.product-card__media img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.product-card__body {
  padding: var(--space-5);
  display: flex;
  flex-direction: column;
  flex: 1;
}

.product-card__category {
  font-size: var(--fs-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-accent);
  margin-bottom: var(--space-2);
  display: block;
}

.product-card__brand {
  font-size: var(--fs-xs);
  font-weight: 700;
  color: var(--color-text-muted-on-light);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: var(--space-1);
  display: block;
}

.product-card__features {
  list-style: none;
  padding: 0;
  margin: 0 0 var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.product-card__features li {
  font-size: var(--fs-sm);
  color: var(--color-text-muted-on-light);
  padding-left: var(--space-4);
  position: relative;
}

.product-card__features li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 6px;
  height: 6px;
  border-radius: var(--radius-full);
  background: var(--color-accent);
}

.product-card__best-for {
  font-size: var(--fs-sm);
  color: var(--color-text-muted-on-light);
  margin-bottom: var(--space-5);
}

.product-card__best-for strong {
  color: var(--color-text-on-light);
}

.product-card__cta {
  margin-top: auto;
}

/* Disabled state for placeholder products awaiting a real Amazon link —
   a real disabled <button>, not a fake "#" href, per the no-fake-link rule. */
.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn:disabled:hover {
  transform: none;
  box-shadow: none;
}

/* ---------- Shop: Affiliate Disclosure ---------- */
.disclosure-banner {
  background: var(--color-bg-light-alt);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-md);
  padding: var(--space-5);
  font-size: var(--fs-sm);
  color: var(--color-text-muted-on-light);
  margin-bottom: var(--space-8);
}

.disclosure-banner strong {
  color: var(--color-text-on-light);
}

/* ---------- Utilities ---------- */
.text-center {
  text-align: center;
}

.mx-auto {
  margin-inline: auto;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
