/*
  Palette derived from Synergy Testing House's own equipment/lab photography
  (no usable logo file exists anywhere -- live site, backup and web archive
  all come up empty) -- navy-slate and machine-blue from the CBR rig / UTM
  photos, terracotta-orange from the brick and safety-glove tones.
*/
:root {
  --navy: #2d499c;
  --navy-light: #1e3a4a;
  --blue: #235974;
  --blue-light: #eaf2f6;
  --accent: #d97a3d;
  --accent-dark: #b6612a;
  --text: #1a2230;
  --muted: #5b6472;
  --bg: #ffffff;
  --bg-alt: #f4f6f8;
  --border: #e3e7ec;
  --ease: cubic-bezier(.2,.7,.3,1);
}

* { box-sizing: border-box; }

html { overflow-x: hidden; scroll-behavior: smooth; }
body { overflow-x: hidden; max-width: 100vw; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

/* Flex/grid items default to a content-based min-width, which can force
   long text to refuse to wrap and overflow the viewport on narrow screens. */
.offer-grid > *, .about-split > *, .contact-grid > *, .test-detail > *,
.cta-inner > *, .why-grid > *, .header-inner > *, .top-bar-inner > *,
.brand, .brand-text { min-width: 0; }

@media (prefers-reduced-motion: no-preference) {
  .reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
  .reveal.in-view { opacity: 1; transform: translateY(0); }
  .reveal-stagger.in-view > * { animation: reveal-up .6s var(--ease) both; }
  .reveal-stagger.in-view > *:nth-child(1) { animation-delay: .02s; }
  .reveal-stagger.in-view > *:nth-child(2) { animation-delay: .08s; }
  .reveal-stagger.in-view > *:nth-child(3) { animation-delay: .14s; }
  .reveal-stagger.in-view > *:nth-child(4) { animation-delay: .2s; }
  .reveal-stagger.in-view > *:nth-child(5) { animation-delay: .26s; }
  .reveal-stagger.in-view > *:nth-child(6) { animation-delay: .32s; }
  .reveal-stagger.in-view > *:nth-child(n+7) { animation-delay: .36s; }
}
@keyframes reveal-up { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: translateY(0); } }
@keyframes kenburns { from { transform: scale(1.08); } to { transform: scale(1); } }
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }

body {
  margin: 0;
  font-family: "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  /* color: var(--text);*/
  background: var(--bg);
  line-height: 1.65;
  animation: fadein .4s var(--ease);
}

img, svg { max-width: 100%; }
.icon { flex-shrink: 0; }

a { color: var(--blue); }

h1, h2, h3, h4 { color: var(--navy); line-height: 1.25; }

.wrap {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Top bar */
.top-bar { background: var(--navy); color: #cfe0f0; font-size: 12.5px; }
.top-bar-inner { display: flex; gap: 20px; padding: 5px 20px; }
.top-bar-inner span { display: inline-flex; align-items: center; gap: 6px; }
.top-bar-inner a { color: inherit; text-decoration: none; transition: color .15s var(--ease); }
.top-bar-inner a:hover { color: var(--accent); }
.top-bar-loc { margin-left: auto; }

/* Header */
.site-header { background: #fff; border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 100; transition: box-shadow .25s var(--ease); }
.site-header.scrolled { box-shadow: 0 6px 20px rgba(11,37,69,.1); }
.header-inner { display: flex; align-items: center; justify-content: space-between; padding: 8px 20px; flex-wrap: wrap; }

.brand { display: flex; align-items: center; gap: 9px; text-decoration: none; }
.brand-logo { border-radius: 10px; transition: transform .3s var(--ease); }
.brand:hover .brand-logo { transform: rotate(-4deg) scale(1.04); }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-name { font-size: 18px; font-weight: 700; color: var(--navy); }
.brand-tagline { font-size: 11px; color: var(--muted); letter-spacing: .02em; }
.footer-brand .brand-logo { margin-bottom: 10px; }

.nav-toggle { display: none; background: none; border: none; color: var(--navy); cursor: pointer; padding: 4px; }

.site-nav ul { list-style: none; display: flex; align-items: center; gap: 1px; margin: 0; padding: 0; flex-wrap: wrap; }
.site-nav > ul > li { position: relative; }
.site-nav > ul > li > a, .nav-link {
  display: block; color: var(--navy); text-decoration: none;
  padding: 10px 12px; font-size: 14px; font-weight: 600; border-radius: 4px;
  position: relative; transition: background .15s var(--ease), color .15s var(--ease);
}
.site-nav > ul > li > a::after, .nav-link::after {
  content: ''; position: absolute; left: 12px; right: 12px; bottom: 5px; height: 2px;
  background: var(--accent); border-radius: 2px; transform: scaleX(0); transform-origin: left;
  transition: transform .2s var(--ease);
}
.site-nav > ul > li > a:hover, .nav-link:hover { background: var(--blue-light); color: var(--blue); }
.site-nav > ul > li > a:hover::after, .nav-link:hover::after,
.site-nav > ul > li > a.active::after, .nav-link.active::after,
.has-dropdown.active > .dropdown-link::after { transform: scaleX(1); }
.site-nav > ul > li > a.active, .nav-link.active { color: var(--blue); }

.nav-cta { background: var(--accent); color: #fff !important; padding: 9px 16px !important; }
.nav-cta:hover { background: var(--accent-dark) !important; transform: translateY(-1px); }

.has-dropdown { position: relative; }
.dropdown-toggle { display: none; }
.dropdown-link { display: block; }
.mega {
  display: grid; position: absolute; left: 0; top: 100%;
  background: #fff; border: 1px solid var(--border); box-shadow: 0 12px 28px rgba(11,37,69,.14);
  padding: 14px; border-radius: 8px; z-index: 60;
  grid-template-columns: repeat(2, minmax(220px, 1fr)); gap: 4px;
  opacity: 0; visibility: hidden; transform: translateY(-6px);
  transition: opacity .2s var(--ease), transform .2s var(--ease), visibility .2s;
}
.has-dropdown:hover .mega, .has-dropdown:focus-within .mega, .has-dropdown.open .mega { opacity: 1; visibility: visible; transform: translateY(0); }

.mega-item { display: flex; align-items: flex-start; gap: 10px; padding: 9px 10px; border-radius: 6px; text-decoration: none; color: var(--text); transition: background .15s var(--ease), transform .15s var(--ease); }
.mega-item:hover { background: var(--bg-alt); transform: translateX(3px); }
.mega-icon { color: var(--blue); margin-top: 1px; }
.mega-title { display: block; font-weight: 600; font-size: 14px; color: var(--navy); }
.mega-standard { display: block; font-size: 12px; color: var(--muted); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 20px; border-radius: 5px; text-decoration: none;
  font-weight: 600; font-size: 14.5px; border: 2px solid transparent; cursor: pointer;
  transition: background .2s var(--ease), transform .2s var(--ease), box-shadow .2s var(--ease), border-color .2s var(--ease);
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); box-shadow: 0 10px 22px rgba(217,122,61,.35); }
.btn-outline { border-color: var(--blue); color: var(--blue); background: transparent; }
.btn-outline:hover { background: var(--blue-light); }
.btn-outline-light { border-color: #fff; color: #fff; }
.btn-outline-light:hover { background: rgba(255,255,255,.15); }
.btn-light { background: #fff; color: var(--navy); }
.btn-light:hover { background: var(--blue-light); box-shadow: 0 10px 22px rgba(0,0,0,.2); }
.btn .icon { transition: transform .2s var(--ease); }
.btn:hover .icon-arrow-right { transform: translateX(3px); }

/* Hero (photo-backed) */
.hero {
  position: relative; color: #fff; min-height: clamp(380px, 58vw, 500px); display: flex; align-items: center; overflow: hidden;
}
.hero-bg {
  position: absolute; inset: 0; background-size: cover; background-position: center 30%;
  animation: kenburns 16s var(--ease) forwards;
}
.hero-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(115deg, rgba(6,21,42,.92) 0%, rgba(45,73,156,.85) 45%, rgba(20,37,48,.5) 100%);
}
.hero::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 34px;
  background: var(--bg); clip-path: polygon(0 100%, 100% 100%, 100% 0, 0 100%);
}
.hero-inner { position: relative; z-index: 1; padding: 44px 20px; min-width: 0; width: 100%; }
.hero-copy { animation: hero-in .8s var(--ease) .1s both; }
@keyframes hero-in { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
.eyebrow { text-transform: uppercase; letter-spacing: .08em; font-size: 12px; font-weight: 700; color: var(--accent); margin: 0 0 10px; display: flex; align-items: center; gap: 8px; }
.hero h1 { color: #fff; font-size: clamp(26px, 4.4vw, 40px); margin: 0 0 14px; max-width: 640px; line-height: 1.15; }
.hero-lead { color: #d7e3f0; max-width: 560px; font-size: clamp(14.5px, 1.6vw, 16.5px); margin: 0 0 22px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }

/* Category page photo header */
.page-hero {
  position: relative; color: #fff; background-size: cover; background-position: center;
  min-height: clamp(180px, 24vw, 240px); display: flex; align-items: flex-end; overflow: hidden;
}
.page-hero-overlay { position: absolute; inset: 0; background: linear-gradient(0deg, rgba(6,21,42,.92) 10%, rgba(11,37,69,.35) 100%); }
.page-hero-inner { position: relative; z-index: 1; padding: 24px 20px; min-width: 0; width: 100%; }
.page-hero-inner h1 { color: #fff; margin: 4px 0 8px; font-size: clamp(22px, 3.4vw, 28px); }
.page-hero .eyebrow { color: var(--accent); }

/* Stat strip */
.stat-strip { background: var(--bg-alt); border-bottom: 1px solid var(--border); }
.stat-strip-inner { display: flex; justify-content: space-between; flex-wrap: wrap; padding: 16px 20px; gap: 14px; }
.stat { text-align: center; flex: 1; min-width: 130px; }
.stat-num { display: block; font-size: 23px; font-weight: 800; color: var(--navy); }
.stat-label { display: block; font-size: 12.5px; color: var(--muted); margin-top: 1px; }

/* Sections */
.section { padding: 40px 0; }
.section-alt { background: var(--bg-alt); }
.section-title { font-size: 22px; margin: 0 0 6px; }
.section-lead { color: var(--muted); margin: 0 0 20px; max-width: 640px; }

/* Card grid (photo-driven service cards) */
.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.card-grid-tight { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }

.service-card, .test-card {
  display: flex; flex-direction: column; background: #fff; border: 1px solid var(--border); border-radius: 10px;
  overflow: hidden; text-decoration: none; color: var(--text); transition: box-shadow .15s, transform .15s;
}
.service-card:hover, .test-card:hover { box-shadow: 0 14px 30px rgba(11,37,69,.14); transform: translateY(-3px); }

.service-photo, .test-card-photo {
  height: 140px; background-size: cover; background-position: center; position: relative; background-color: var(--blue-light);
  transition: transform .4s var(--ease);
}
.test-card-photo { height: 110px; }
.service-card:hover .service-photo, .test-card:hover .test-card-photo { transform: scale(1.06); }
.service-icon {
  position: absolute; left: 12px; bottom: -16px; color: var(--blue); background: #fff;
  padding: 9px; border-radius: 8px; box-shadow: 0 4px 10px rgba(11,37,69,.18); display: inline-flex;
}
.service-body { padding: 22px 16px 16px; }
.test-card-body { padding: 14px; }
.service-card h3, .test-card h3 { font-size: 16.5px; margin: 0 0 5px; }
.service-card p, .test-card p { color: var(--muted); font-size: 13.5px; margin: 0 0 8px; }
.service-standard {
  display: inline-block; font-size: 12px; font-weight: 700; color: var(--blue);
  background: var(--blue-light); padding: 3px 9px; border-radius: 4px;
}

/* What we offer + certifications */
.offer-grid { display: grid; grid-template-columns: 1.2fr .8fr; gap: 28px; align-items: start; }
.offer-list { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 16px; }
.offer-item { display: flex; align-items: center; gap: 12px; background: #fff; border: 1px solid var(--border); border-radius: 8px; padding: 14px; transition: border-color .2s var(--ease), transform .2s var(--ease); }
.offer-item:hover { border-color: var(--blue); transform: translateY(-2px); }
.offer-item .icon { color: var(--blue); }
.offer-item h4 { margin: 0; font-size: 14px; }

.cert-panel { background: var(--navy); color: #fff; border-radius: 10px; padding: 22px; }
.cert-panel h3 { color: #fff; margin-top: 0; }
.cert-panel p { color: #cfe0f0; }
.cert-badges { display: flex; gap: 12px; margin: 14px 0 18px; flex-wrap: wrap; }
.cert-badge {
  flex: 1; min-width: 100px; text-align: center; background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.18); border-radius: 8px; padding: 14px 8px; color: #fff;
  transition: background .2s var(--ease), transform .2s var(--ease);
}
.cert-badge:hover { background: rgba(255,255,255,.16); transform: translateY(-2px); }
.cert-badge .icon { color: var(--accent); margin-bottom: 6px; }
.cert-badge span { display: block; font-size: 12.5px; font-weight: 600; }
.cert-badges-page .cert-badge { color: var(--navy); background: var(--blue-light); border-color: var(--border); }
.cert-badges-page .cert-badge:hover { background: #dcedf5; }
.cert-badges-page .cert-badge .icon { color: var(--blue); }
.cert-badges-page { display: flex; gap: 14px; flex-wrap: wrap; margin: 18px 0; }
.cert-badges-page .cert-badge { flex: 1; min-width: 160px; padding: 18px 12px; }

/* About split */
.about-split { display: grid; grid-template-columns: .8fr 1.2fr; gap: 28px; align-items: center; }
.about-split-photo { border-radius: 10px; background-size: cover; background-position: center; min-height: 300px; box-shadow: 0 14px 30px rgba(11,37,69,.14); }
.core-photo { border-radius: 10px; background-size: cover; background-position: center; height: 280px; margin: 16px 0; }

/* Gallery */
.gallery-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 18px; }
.gallery-thumb {
  display: block; height: 160px; border-radius: 8px; background-size: cover; background-position: center; cursor: zoom-in;
  transition: transform .3s var(--ease), box-shadow .3s var(--ease);
}
.gallery-thumb:hover { transform: scale(1.04); box-shadow: 0 12px 26px rgba(11,37,69,.2); }
.gallery-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.gallery-grid-item {
  display: flex; align-items: flex-end; height: 210px; border-radius: 8px; background-size: cover; background-position: center;
  cursor: zoom-in; position: relative; text-decoration: none; overflow: hidden;
  transition: background-size .4s var(--ease);
}
.gallery-grid-item:hover { background-size: 112%; }
.gallery-grid-item span { position: relative; z-index: 1; transition: transform .3s var(--ease); }
.gallery-grid-item:hover span { transform: translateY(-3px); }
.gallery-grid-item span {
  background: linear-gradient(0deg, rgba(6,21,42,.85), transparent); color: #fff; font-size: 13px;
  padding: 30px 12px 10px; width: 100%; border-radius: 0 0 8px 8px;
}
.lightbox-overlay {
  display: none; position: fixed; inset: 0; background: rgba(6,21,42,.92); z-index: 1000;
  align-items: center; justify-content: center; padding: 30px; cursor: zoom-out;
}
.lightbox-overlay.active { display: flex; }
.lightbox-overlay img { max-width: 90vw; max-height: 90vh; border-radius: 6px; box-shadow: 0 20px 50px rgba(0,0,0,.5); }

/* Why / test detail */
.why-list { list-style: none; padding: 0; margin: 0 0 26px; }
.why-list li { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 14px; color: var(--text); }
.why-list .icon { color: var(--accent); margin-top: 2px; }

.test-detail { display: grid; grid-template-columns: .8fr 1.2fr; gap: 28px; align-items: start; }
.test-detail-photo { border-radius: 10px; background-size: cover; background-position: center; min-height: 260px; position: sticky; top: 74px; box-shadow: 0 14px 30px rgba(11,37,69,.12); }

/* CTA band */
.cta-band { background: var(--navy); color: #fff; }
.cta-inner { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 30px 20px; flex-wrap: wrap; }
.cta-inner h2 { color: #fff; margin: 0 0 4px; font-size: 20px; }
.cta-inner p { margin: 0; color: #cfe0f0; }

/* Page header block (category / test / core pages) */
.page-header-block { padding-top: 28px; padding-bottom: 28px; }
.page-header-block h1 { font-size: 26px; margin: 4px 0 8px; }
.standard-badge {
  display: inline-block; background: var(--blue-light); color: var(--blue);
  font-weight: 700; font-size: 12.5px; padding: 4px 12px; border-radius: 20px; margin-bottom: 14px;
}
.page-hero .standard-badge { background: rgba(255,255,255,.15); color: #fff; }
.breadcrumb { margin: 0 0 6px; }
.breadcrumb a { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); text-decoration: none; font-size: 13px; font-weight: 600; transition: color .15s var(--ease), gap .15s var(--ease); }
.breadcrumb a:hover { color: var(--blue); gap: 8px; }
.prose { max-width: 760px; color: var(--text); }
.prose p { margin: 0 0 14px; }
.prose ul { margin: 0 0 14px; padding-left: 20px; }
.prose li { margin-bottom: 6px; }
.page-header-block .btn { margin-top: 8px; }

/* Contact */
.contact-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 24px; margin-top: 20px; }
.contact-form { display: flex; flex-direction: column; gap: 12px; background: #fff; border: 1px solid var(--border); border-radius: 8px; padding: 20px; }
.contact-form label { display: flex; flex-direction: column; gap: 5px; font-size: 13px; font-weight: 600; color: var(--navy); }
.contact-form input, .contact-form textarea {
  font: inherit; padding: 9px 11px; border: 1px solid var(--border); border-radius: 5px; color: var(--text);
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
.contact-form input:focus, .contact-form textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-light); }
.contact-details { background: var(--bg-alt); border-radius: 8px; padding: 20px; height: fit-content; }
.contact-details p { display: flex; align-items: center; gap: 10px; margin: 0 0 10px; }
.contact-details .muted { color: var(--muted); font-size: 12.5px; }

/* Sitemap */
.sitemap-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 6px 24px; margin-bottom: 22px; }

/* Footer */
.site-footer { background: var(--navy); color: #ffffff; margin-top: 16px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 24px; padding: 36px 20px 22px; }
.footer-col h4 { color: #fff; font-size: 13.5px; text-transform: uppercase; letter-spacing: .04em; margin: 0 0 12px; }
.footer-col ul { list-style: none; margin: 0; padding: 0; }
.footer-col li { margin-bottom: 8px; }
.footer-col a { color: #b9cbe0; text-decoration: none; font-size: 13.5px; transition: color .15s var(--ease), padding-left .15s var(--ease); }
.footer-col a:hover { color: #fff; padding-left: 3px; }
.footer-name { color: #fff; font-weight: 700; font-size: 15.5px; margin: 0 0 6px; }
.footer-contact li { display: flex; align-items: center; gap: 8px; font-size: 13.5px; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.12); padding: 13px 20px; font-size: 12.5px; }

@media (max-width: 900px) {
  .nav-toggle { display: block; }
  .site-nav { display: none; width: 100%; }
  .site-nav.open { display: block; }
  .site-nav ul { flex-direction: column; align-items: stretch; }
  .has-dropdown { display: flex; flex-direction: column; }
  .dropdown-toggle {
    display: flex; align-items: center; justify-content: space-between; width: 100%;
    background: none; border: none; color: var(--navy); text-align: left;
    padding: 12px 13px; font-size: 14.5px; font-weight: 600; font-family: inherit; cursor: pointer;
  }
  .dropdown-link { display: none; }
  .mega { position: static; box-shadow: none; grid-template-columns: 1fr; display: none; border: none; padding: 4px 0 4px 10px; }
  .has-dropdown:hover .mega { display: none; }
  .has-dropdown.open .mega { display: grid; }
  .offer-grid, .about-split, .contact-grid, .test-detail { grid-template-columns: 1fr; }
  .about-split-photo { min-height: 200px; order: -1; }
  .test-detail-photo { position: static; min-height: 180px; }
  .hero-inner { padding: 36px 20px; }
  .hero-lead { max-width: none; }
  .gallery-strip { grid-template-columns: repeat(2, 1fr); }
  .gallery-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .offer-list { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .footer-grid { grid-template-columns: 1fr; }
  .top-bar-inner { flex-wrap: wrap; row-gap: 2px; }
  .top-bar-loc { margin-left: 0; }
  .gallery-strip, .gallery-grid { grid-template-columns: 1fr 1fr; }
  .hero { min-height: 460px; }
}
