/* =========================================================
   Advanced Technological Systems, Inc. — ats-fl.com
   Palette carried over from the original site:
   ATS crimson #A71E26 · charcoal grey #3a3f45 · white (navy retired Nov 2026)
   ========================================================= */
:root {
  --red: #A71E26;
  --red-600: #8E1820;
  --red-300: #e4848a;
  --navy: #3a3f45;      /* charcoal (was navy #072C53) */
  --navy-900: #2c3035;
  --navy-700: #4a5058;
  --navy-200: #d3d7dc;
  --ink: #13202f;
  --muted: #536274;
  --paper: #f5f3ef;
  --line: #dfe3e8;
  --white: #fff;
  --radius: 6px;
  --shadow: 0 18px 40px -18px rgba(32, 35, 39, .45);
  --head: "Archivo", "Arial Narrow", Arial, sans-serif;
  --body: "Source Sans 3", "Segoe UI", system-ui, sans-serif;
  --wrap: 1180px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 96px; -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 400 1.0625rem/1.65 var(--body); color: var(--ink); background: var(--white); }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--red); text-underline-offset: 3px; }
a:hover { color: var(--red-600); }
h1, h2, h3, h4 { font-family: var(--head); font-stretch: 88%; line-height: 1.08; margin: 0 0 .5em; letter-spacing: -.01em; }
h2 { font-size: clamp(1.9rem, 3.4vw, 2.75rem); font-weight: 800; color: var(--navy); }
h3 { font-size: 1.6rem; font-weight: 800; color: var(--navy); }
p { margin: 0 0 1em; }
.wrap { width: min(100% - 32px, var(--wrap)); margin-inline: auto; }
.sr, .hp { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.hp { left: -9999px; }
.skip { position: absolute; left: 8px; top: -60px; background: var(--navy); color: #fff; padding: 10px 14px; z-index: 100; border-radius: var(--radius); }
.skip:focus { top: 8px; }
:focus-visible { outline: 3px solid #FDB813; outline-offset: 2px; }

.eyebrow { font: 700 .8rem/1 var(--head); font-stretch: 110%; letter-spacing: .16em; text-transform: uppercase; color: var(--red); margin-bottom: 14px; display: flex; align-items: center; gap: 10px; }
.eyebrow::before { content: ""; width: 28px; height: 3px; background: currentColor; }
.eyebrow--light { color: var(--red-300); }

/* Buttons */
.btn { --bg: var(--red); display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: 700 1rem/1 var(--head); font-stretch: 100%; letter-spacing: .02em; padding: 16px 26px; border-radius: var(--radius); border: 2px solid var(--bg); background: var(--bg); color: #fff; text-decoration: none; cursor: pointer; transition: background .2s, border-color .2s, transform .2s; }
.btn:hover { color: #fff; transform: translateY(-1px); }
.btn--red:hover { --bg: var(--red-600); }
.btn--navy { --bg: var(--navy); }
.btn--navy:hover { --bg: var(--navy-700); }
.btn--ghost { background: transparent; border-color: rgba(255,255,255,.55); }
.btn--ghost:hover { background: rgba(255,255,255,.1); border-color: #fff; }
.btn--sm { padding: 11px 18px; font-size: .95rem; }
.btn--block { width: 100%; }
.btn[disabled] { opacity: .65; cursor: wait; transform: none; }

/* Top bar + header */
.topbar { background: var(--navy-900); color: var(--navy-200); font-size: .875rem; }
.topbar__in { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 8px 0; }
.topbar__phone { color: #fff; font-weight: 700; text-decoration: none; white-space: nowrap; }
.site-header { position: sticky; top: 0; z-index: 50; background: rgba(255,255,255,.97); backdrop-filter: blur(8px); transition: box-shadow .25s; }
.site-header.is-stuck { box-shadow: 0 6px 24px -12px rgba(32,35,39,.4); }
.header__in { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 12px 0; }
.brand img { width: clamp(200px, 26vw, 300px); }
.nav { display: flex; align-items: center; gap: 30px; }
.nav a:not(.btn) { font: 700 .95rem/1 var(--head); font-stretch: 105%; letter-spacing: .06em; text-transform: uppercase; color: var(--navy); text-decoration: none; position: relative; padding: 8px 0; }
.nav a:not(.btn)::after { content: ""; position: absolute; left: 0; right: 100%; bottom: 0; height: 3px; background: var(--red); transition: right .25s; }
.nav a:not(.btn):hover::after, .nav a.is-active::after { right: 0; }
.nav-toggle { display: none; background: none; border: 0; padding: 10px; cursor: pointer; }
.nav-toggle span:not(.sr) { display: block; width: 26px; height: 3px; background: var(--navy); margin: 5px 0; transition: transform .25s, opacity .25s; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

/* Single crimson rule under the header / above the footer */
.rule { height: 5px; background: var(--red); }

/* Hero / About */
.hero { position: relative; overflow: hidden; background: radial-gradient(1200px 600px at 85% 10%, var(--navy-700), transparent 60%), var(--navy); color: #dbe5f0; padding: clamp(56px, 8vw, 104px) 0 0; }
.hero__lines { position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background: repeating-linear-gradient(180deg, transparent 0 46px, rgba(255,255,255,.06) 46px 48px);
  mask-image: linear-gradient(90deg, #000 0%, transparent 70%); -webkit-mask-image: linear-gradient(90deg, #000 0%, transparent 70%); }
.hero__grid { position: relative; display: grid; grid-template-columns: 1.15fr .85fr; gap: clamp(32px, 5vw, 72px); align-items: center; }
.hero h1 { color: #fff; font-size: clamp(2.4rem, 5.6vw, 4.4rem); font-weight: 900; font-style: italic; font-stretch: 80%; text-transform: uppercase; letter-spacing: -.005em; line-height: .98; margin-bottom: 26px; }
.hero h1 em { color: var(--red-300); font-style: italic; }
.hero .lead { font-size: 1.22rem; color: #fff; }
.hero__copy > p:not(.eyebrow) { max-width: 62ch; }
.hero__cta { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 30px; }
.hero__media { position: relative; height: 520px; }
.ph { position: absolute; margin: 0; border: 6px solid #fff; border-radius: 4px; box-shadow: var(--shadow); overflow: hidden; background: #fff; }
.ph img { width: 100%; height: 100%; object-fit: cover; }
.ph--a { width: 58%; aspect-ratio: 3/4; right: 4%; top: 0; z-index: 2; transform: rotate(2deg); }
.ph--b { width: 44%; aspect-ratio: 3/4; left: 0; top: 16%; transform: rotate(-4deg); }
.ph--c { width: 42%; aspect-ratio: 3/4; right: 30%; bottom: -2%; z-index: 3; transform: rotate(-1deg); }
.ph::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 6px; background: var(--red); }

.facts { list-style: none; margin: clamp(48px, 6vw, 80px) 0 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); background: #fff; border-radius: var(--radius) var(--radius) 0 0; box-shadow: var(--shadow); position: relative; }
.facts li { padding: 26px 24px; border-left: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px; }
.facts li:first-child { border-left: 0; }
.facts strong { font: 900 1.45rem/1 var(--head); font-stretch: 85%; font-style: italic; color: var(--red); text-transform: uppercase; }
.facts span { color: var(--muted); font-size: .95rem; line-height: 1.35; }

/* Why */
.why { background: var(--paper); padding: clamp(56px, 7vw, 88px) 0; border-bottom: 1px solid var(--line); }
.why__grid { display: grid; grid-template-columns: 1fr 1.1fr; gap: clamp(28px, 5vw, 72px); align-items: start; }
.why h2 { margin: 0; }
.why__text p { font-size: 1.1rem; }
.why__text p:first-child { border-left: 4px solid var(--red); padding-left: 20px; }

/* Services */
.services { padding: clamp(64px, 8vw, 112px) 0; }
.section-head { max-width: 720px; margin-bottom: clamp(36px, 5vw, 64px); }
.section-head > p:last-child { color: var(--muted); font-size: 1.12rem; }
.section-head--light h2 { color: #fff; }
.section-head--light > p:last-child { color: var(--navy-200); }
.step { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(28px, 5vw, 72px); align-items: center; padding: clamp(28px, 4vw, 44px) 0; border-top: 1px solid var(--line); }
.step--flip .step__media { order: 2; }
.step__media { position: relative; }
.step__media img { width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: var(--radius); box-shadow: var(--shadow); }
.step__media img.tall { object-position: center 45%; }
.step__media::before { content: ""; position: absolute; inset: 14px -14px -14px 14px; border: 2px solid var(--red); border-radius: var(--radius); z-index: -1; }
.step--flip .step__media::before { inset: 14px 14px -14px -14px; }
.step__num { font: 900 4.5rem/1 var(--head); font-stretch: 75%; font-style: italic; color: transparent; -webkit-text-stroke: 2px var(--red); display: block; margin-bottom: 4px; }
.step__tag { font: 700 .78rem/1 var(--head); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }
.ticks { list-style: none; padding: 0; margin: 18px 0 0; display: grid; gap: 10px; }
.ticks li { position: relative; padding-left: 30px; }
.ticks li::before { content: ""; position: absolute; left: 0; top: .45em; width: 16px; height: 9px; border-left: 3px solid var(--red); border-bottom: 3px solid var(--red); transform: rotate(-45deg); }

/* Projects */
.projects { background: var(--navy); padding: clamp(40px, 5vw, 64px) 0; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 28px; }
.filters button { font: 700 .85rem/1 var(--head); letter-spacing: .08em; text-transform: uppercase; color: var(--navy-200); background: transparent; border: 1px solid rgba(211,215,220,.35); padding: 11px 16px; border-radius: 999px; cursor: pointer; transition: all .2s; }
.filters button:hover { color: #fff; border-color: #fff; }
.filters button[aria-selected="true"] { background: var(--red); border-color: var(--red); color: #fff; }
.gallery { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.gallery li.is-hidden { display: none; }
.gallery__item { position: relative; display: block; width: 100%; padding: 0; border: 0; border-radius: var(--radius); overflow: hidden; cursor: zoom-in; background: #000; aspect-ratio: 4/3; }
.gallery__item img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s, opacity .3s; opacity: .92; }
.gallery__item:hover img, .gallery__item:focus-visible img { transform: scale(1.05); opacity: 1; }
.gallery__cap { position: absolute; left: 0; right: 0; bottom: 0; padding: 36px 14px 12px; text-align: left; color: #fff; font-size: .92rem; line-height: 1.3; background: linear-gradient(transparent, rgba(32,35,39,.92)); }

/* Lightbox */
.lightbox { border: 0; padding: 0; background: transparent; max-width: min(1000px, 94vw); width: 100%; overflow: visible; }
.lightbox::backdrop { background: rgba(32,35,39,.92); }
.lightbox figure { margin: 0; }
.lightbox img { width: 100%; max-height: 80vh; object-fit: contain; border-radius: var(--radius); }
.lightbox figcaption { color: #fff; text-align: center; padding-top: 12px; }
.lightbox__close, .lightbox__nav { position: absolute; background: rgba(255,255,255,.12); color: #fff; border: 0; width: 48px; height: 48px; border-radius: 50%; font-size: 2rem; line-height: 1; cursor: pointer; }
.lightbox__close:hover, .lightbox__nav:hover { background: var(--red); }
.lightbox__close { top: -58px; right: 0; }
.lightbox__nav { top: 50%; transform: translateY(-50%); }
.lightbox__prev { left: -62px; }
.lightbox__next { right: -62px; }

/* Mission */
.mission { background: var(--red); padding: clamp(56px, 7vw, 88px) 0; position: relative; overflow: hidden; }
.mission::after { content: "ATS"; position: absolute; right: -2%; bottom: -30%; font: 900 clamp(10rem, 24vw, 20rem)/1 var(--head); font-style: italic; font-stretch: 75%; color: rgba(255,255,255,.07); pointer-events: none; }
.mission .eyebrow { color: #fff; }
.mission blockquote { margin: 0; max-width: 900px; font: 700 clamp(1.5rem, 3vw, 2.25rem)/1.25 var(--head); font-stretch: 90%; color: #fff; position: relative; z-index: 1; }

/* Location */
.location { padding: clamp(64px, 8vw, 104px) 0; background: var(--paper); }
.location__grid { display: grid; grid-template-columns: .8fr 1.2fr; gap: 0; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); background: #fff; }
.location__card { padding: clamp(28px, 4vw, 48px); }
.location__card h2 { font-size: clamp(1.6rem, 2.6vw, 2.1rem); }
address { font-style: normal; font-size: 1.1rem; margin: 20px 0; }
.contact-list { margin: 0 0 26px; display: grid; gap: 8px; }
.contact-list div { display: flex; gap: 12px; }
.contact-list dt { font-weight: 700; color: var(--muted); min-width: 56px; }
.contact-list dd { margin: 0; }
.location__map { min-height: 420px; }
.location__map iframe { width: 100%; height: 100%; min-height: 420px; border: 0; display: block; filter: saturate(.85); }

/* Contact */
.contact { position: relative; background: var(--navy); color: var(--navy-200); padding: clamp(64px, 8vw, 112px) 0; overflow: hidden; }
.contact__grid { position: relative; display: grid; grid-template-columns: .8fr 1.2fr; gap: clamp(32px, 5vw, 72px); align-items: start; }
.contact h2 { color: #fff; }
.contact__intro p { font-size: 1.1rem; }
.big-phone { display: inline-block; font: 900 clamp(1.8rem, 3vw, 2.4rem)/1 var(--head); font-style: italic; font-stretch: 85%; color: #fff; text-decoration: none; margin: 10px 0 24px; border-bottom: 3px solid var(--red); padding-bottom: 6px; }
.big-phone:hover { color: var(--red-300); }
.small { font-size: .92rem; }
.req { color: var(--red); font-weight: 700; }
.contact .req { color: var(--red-300); }

.form { background: #fff; color: var(--ink); border-radius: var(--radius); padding: clamp(22px, 3.5vw, 40px); box-shadow: 0 30px 60px -20px rgba(0,0,0,.5); display: grid; grid-template-columns: 1fr 1fr; gap: 6px 20px; border-top: 6px solid var(--red); }
.field { display: flex; flex-direction: column; min-width: 0; }
.field--full, .form__status { grid-column: 1 / -1; }
.field label { font: 700 .82rem/1.2 var(--head); letter-spacing: .08em; text-transform: uppercase; color: var(--navy); margin-bottom: 7px; }
.field input, .field select, .field textarea { font: inherit; font-size: 1rem; color: var(--ink); width: 100%; padding: 13px 14px; border: 1.5px solid #c8d0da; border-radius: var(--radius); background: #fbfcfd; transition: border-color .2s, box-shadow .2s; }
.field textarea { resize: vertical; min-height: 130px; }
.field select { margin-bottom: 18px; appearance: auto; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--navy); box-shadow: 0 0 0 4px rgba(58,63,69,.12); background: #fff; }
.field.has-error input, .field.has-error select, .field.has-error textarea { border-color: var(--red); box-shadow: 0 0 0 4px rgba(167,30,38,.1); }
.field__err { min-height: 1.3em; margin: 5px 0 6px; font-size: .86rem; color: var(--red); }
.field__count { margin: 5px 0 6px; font-size: .8rem; color: var(--muted); text-align: right; }
.form__status { padding: 14px 16px; border-radius: var(--radius); font-weight: 600; margin-bottom: 12px; }
.form__status.is-ok { background: #e6f4ea; color: #1d6b34; border-left: 4px solid #2E9B47; }
.form__status.is-err { background: #fbeaeb; color: var(--red-600); border-left: 4px solid var(--red); }

/* Footer */
.site-footer { background: var(--navy-900); color: var(--navy-200); font-size: .95rem; }
.footer__grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr; gap: 32px; padding: 56px 0 36px; }
.footer__logo { width: 260px; margin-bottom: 18px; }
.site-footer h4 { color: #fff; font-size: .8rem; letter-spacing: .14em; text-transform: uppercase; margin-bottom: 14px; }
.site-footer a { color: #fff; text-decoration: none; }
.site-footer a:hover { color: var(--red-300); }
.footer__base { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px 24px; border-top: 1px solid rgba(211,215,220,.15); padding: 20px 0 28px; font-size: .85rem; }
.footer__base p { margin: 0; }

/* Reveal on scroll */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s ease, transform .7s ease; }
.reveal.is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  * { transition-duration: 0s !important; }
}

/* Responsive */
@media (max-width: 1080px) {
  .lightbox__prev { left: 6px; } .lightbox__next { right: 6px; }
}
@media (max-width: 960px) {
  .hero__grid, .why__grid, .contact__grid, .location__grid { grid-template-columns: 1fr; }
  .hero__media { height: 420px; max-width: 520px; width: 100%; margin: 0 auto; }
  .facts { grid-template-columns: repeat(2, 1fr); }
  .facts li:nth-child(3) { border-left: 0; }
  .facts li:nth-child(n+3) { border-top: 1px solid var(--line); }
  .step, .step--flip { grid-template-columns: 1fr; }
  .step--flip .step__media { order: 0; }
  .footer__grid { grid-template-columns: 1fr 1fr; }
  .location__map, .location__map iframe { min-height: 340px; }
}
@media (max-width: 820px) {
  .nav-toggle { display: block; }
  .nav { position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; align-items: stretch; gap: 0; background: #fff; padding: 8px 16px 20px; box-shadow: 0 20px 30px -20px rgba(32,35,39,.4); display: none; }
  .nav.is-open { display: flex; }
  .nav a:not(.btn) { padding: 16px 0; border-bottom: 1px solid var(--line); }
  .nav .btn { margin-top: 16px; }
  .topbar__in > span { display: none; }
  .topbar__in { justify-content: flex-end; }
}
@media (max-width: 600px) {
  body { font-size: 1rem; }
  .form { grid-template-columns: 1fr; }
  .hero__media { height: 340px; }
  .facts { grid-template-columns: 1fr; }
  .facts li { border-left: 0 !important; border-top: 1px solid var(--line); }
  .facts li:first-child { border-top: 0; }
  .footer__grid { grid-template-columns: 1fr; }
  .hero__cta .btn { flex: 1 1 100%; }
  .step__media::before { display: none; }
}
@media print {
  .topbar, .site-header, .hero__media, .projects, .contact, .lightbox, .apwa { display: none !important; }
  .hero { background: none; color: #000; } .hero h1 { color: #000; }
}
