/* Southern Automated Systems, Inc. */

:root {
  --maroon: #6e0c21;
  --green: #06703a;
  --green-bright: #2fae6a;
  --white: #fff;
  --text: #444a47;
  --muted: #5f6662;
  --headings: #1b1d1c;
  --background: #fff;
  --alt: #f2f4f3;
  --border: #dfe4e1;
  --ink: #1b1d1c;
  --ink-deep: #111312;
  --on-dark: #d5dbd8;

  --font-body: "Open Sans", Helvetica, Arial, sans-serif;
  --font-heading: "Oswald", "Arial Narrow", Helvetica, sans-serif;

  --container: 1160px;
  --gutter: clamp(1.25rem, 4vw, 2rem);
  --section-padding: clamp(4rem, 9vw, 7rem);
  --header-height: 4.5rem;
  --radius: 18px;
  --shadow: 0 1px 2px rgb(17 19 18 / 0.06), 0 12px 32px -12px rgb(17 19 18 / 0.18);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-height) + 1rem);
}
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  /* Keep the footer at the bottom of short pages */
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100svh;
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.7;
  color: var(--text);
  background: var(--background);
  -webkit-font-smoothing: antialiased;
}
main { flex: 1; }

h1, h2, h3 {
  margin: 0;
  font-family: var(--font-heading);
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  color: var(--headings);
  text-wrap: balance;
}
h1 { font-size: clamp(2rem, 1.3rem + 2.9vw, 3.6rem); }
h2 { font-size: clamp(1.9rem, 1.4rem + 1.8vw, 2.9rem); }
h3 { font-size: 1.25rem; }

p { margin: 0; text-wrap: pretty; }
p + p { margin-top: 1rem; }

a { color: var(--green); text-underline-offset: 0.2em; }
a:hover { color: var(--maroon); }

:focus-visible { outline: 3px solid var(--green-bright); outline-offset: 4px; border-radius: 6px; }

img { max-width: 100%; height: auto; display: block; }

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

svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.container {
  width: 100%;
  max-width: calc(var(--container) + var(--gutter) * 2);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.skip-link {
  position: absolute;
  top: -4rem;
  left: 1rem;
  z-index: 100;
  padding: 0.6rem 1rem;
  border-radius: 8px;
  background: var(--white);
  color: var(--ink);
  font-weight: 700;
}
.skip-link:focus { top: 1rem; }

/* Header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgb(17 19 18 / 0.94);
  color: var(--white);
  box-shadow: 0 1px 0 rgb(255 255 255 / 0.08);
}
@supports (backdrop-filter: blur(1px)) {
  .site-header { background: rgb(17 19 18 / 0.92); backdrop-filter: blur(14px) saturate(1.4); }
}

.top-bar { border-bottom: 1px solid rgb(255 255 255 / 0.08); font-size: 0.8125rem; }
.top-bar-inner { display: flex; justify-content: flex-end; gap: 0.25rem 1.5rem; flex-wrap: wrap; padding-top: 0.3rem; padding-bottom: 0.3rem; }
.top-bar a {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 24px;
  color: var(--on-dark);
  text-decoration: none;
  transition: color 200ms;
}
.top-bar a:hover { color: var(--white); }
.top-bar svg { width: 14px; height: 14px; color: var(--green-bright); }

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  min-height: var(--header-height);
}
.brand { display: block; flex: none; padding: 0.35rem 0; border-radius: 8px; }
.brand img { width: 128px; }

/* The menu is a popover (no JS needed): the toggle opens it as a side drawer on narrow screens,
   and Escape, the close button or a click outside closes it. On wide screens it's a row of links. */
.site-nav ul { display: flex; gap: 0.25rem; }
.site-nav a {
  display: block;
  padding: 0.5rem 0.85rem;
  border-radius: 999px;
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--white);
  text-decoration: none;
  transition: background-color 200ms, color 200ms;
}
.site-nav a:hover { background: rgb(255 255 255 / 0.1); color: var(--white); }
.site-nav li:last-child a { margin-left: 0.5rem; background: var(--green); }
.site-nav li:last-child a:hover { background: #0a8546; }

.nav-toggle, .nav-close {
  display: none;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: rgb(255 255 255 / 0.08);
  color: var(--white);
  cursor: pointer;
}
.nav-close svg { width: 24px; height: 24px; }

@media (min-width: 1024px) {
  /* Undo the browser's popover styles so the menu shows inline */
  #nav-menu[popover] {
    display: block;
    position: static;
    inset: auto;
    width: auto;
    height: auto;
    margin: 0;
    padding: 0;
    overflow: visible;
    border: 0;
    background: none;
    color: inherit;
  }
}

@media (max-width: 1023px) {
  .nav-toggle, .nav-close { display: grid; }
  .nav-toggle span,
  .nav-toggle span::before,
  .nav-toggle span::after {
    display: block;
    width: 22px;
    height: 2px;
    border-radius: 2px;
    background: var(--white);
  }
  .nav-toggle span { position: relative; }
  .nav-toggle span::before, .nav-toggle span::after { content: ""; position: absolute; left: 0; }
  .nav-toggle span::before { top: -7px; }
  .nav-toggle span::after { top: 7px; }

  #nav-menu[popover] {
    inset: 0 0 0 auto;
    width: min(21rem, 86vw);
    height: 100dvh;
    max-height: none;
    margin: 0;
    padding: 0.85rem var(--gutter) 2rem;
    overflow-y: auto;
    border: 0;
    background: var(--ink-deep);
    color: var(--white);
    box-shadow: -24px 0 48px -16px rgb(0 0 0 / 0.5);
  }
  #nav-menu::backdrop { background: rgb(17 19 18 / 0.55); }
  .nav-close { margin-left: auto; }
  .site-nav ul { flex-direction: column; gap: 0.25rem; margin-top: 1.25rem; }
  .site-nav a { padding: 0.75rem 1rem; border-radius: 10px; font-size: 1.125rem; }
  .site-nav li:last-child a { margin: 0.5rem 0 0; text-align: center; }
}

@media (max-width: 1023px) and (prefers-reduced-motion: no-preference) {
  #nav-menu[popover],
  #nav-menu::backdrop {
    transition: translate 300ms var(--ease), opacity 300ms var(--ease), display 300ms allow-discrete, overlay 300ms allow-discrete;
  }
  #nav-menu[popover]:not(:popover-open) { translate: 100% 0; }
  #nav-menu:not(:popover-open)::backdrop { opacity: 0; }
  @starting-style {
    #nav-menu[popover]:popover-open { translate: 100% 0; }
    #nav-menu:popover-open::backdrop { opacity: 0; }
  }
}

@media (max-width: 559px) {
  .top-bar-inner { justify-content: center; }
}

/* Hero */

.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background: var(--ink-deep) url("/assets/img/header-bg.webp") center / cover;
  color: var(--white);
  text-align: center;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse 60% 55% at 50% 45%, rgb(17 19 18 / 0.55), rgb(17 19 18 / 0.2)),
    linear-gradient(180deg, rgb(17 19 18 / 0.15), rgb(17 19 18 / 0.75));
}
.hero-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: min(82svh, 820px);
  justify-content: center;
  padding-top: clamp(4rem, 10vw, 7rem);
  padding-bottom: clamp(4rem, 10vw, 7rem);
}
.hero-logo { width: min(460px, 82vw); filter: drop-shadow(0 10px 30px rgb(0 0 0 / 0.45)); }
.hero h1 { max-width: 26ch; margin-top: clamp(2rem, 4vw, 3rem); color: var(--white); }
.hero p { max-width: 62ch; margin-top: 1.25rem; font-size: clamp(1.0625rem, 1rem + 0.3vw, 1.2rem); color: #e4e9e6; }

.isn-badge {
  display: inline-block;
  margin-top: 2.25rem;
  padding: 0.6rem 0.9rem;
  border-radius: 14px;
  background: var(--white);
  box-shadow: var(--shadow);
  transition: transform 300ms var(--ease), box-shadow 300ms var(--ease);
}
.isn-badge:hover { transform: translateY(-3px); box-shadow: 0 18px 40px -14px rgb(0 0 0 / 0.45); }
.isn-badge img { width: 190px; }

/* Feature sections */

.section { padding: var(--section-padding) 0; }
.section--alt { background: var(--alt); }

.feature-grid {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(2.5rem, 6vw, 5rem);
  align-items: center;
}
#comprehensive-services .feature-grid { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); row-gap: clamp(1.5rem, 3vw, 2.5rem); }
#comprehensive-services .feature-icon { order: 2; }

.feature-icon { display: flex; justify-content: center; color: var(--maroon); }
.feature-icon svg { width: min(100%, 240px); height: auto; aspect-ratio: 1; overflow: visible; fill: currentColor; stroke: none; }
.feature-icon--green { color: var(--green); }
.feature-icon--dark { color: var(--ink); }

.feature-text h2 { margin-bottom: 1.25rem; }
.feature-text h2::before {
  content: "";
  display: block;
  width: 3rem;
  height: 4px;
  margin-bottom: 1.1rem;
  border-radius: 2px;
  background: var(--green);
}
.feature-text .rely { margin-top: 1.75rem; font-family: var(--font-heading); font-size: 1.15rem; letter-spacing: 0.04em; text-transform: uppercase; }
.feature-text .rely strong { font-weight: 500; color: var(--headings); }

/* Checklist: two columns of rows separated by hairlines */
.services {
  order: 3;
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: clamp(2rem, 5vw, 4rem);
  border-bottom: 1px solid var(--border);
}
.services li {
  display: flex;
  gap: 1rem;
  padding: 1.35rem 0;
  border-top: 1px solid var(--border);
}
.services svg { flex: none; width: 28px; height: 28px; margin-top: 0.1rem; color: var(--green); }
.services strong { color: var(--headings); }

/* Safety */

.safety-grid {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: clamp(2.5rem, 6vw, 5rem);
  align-items: center;
}
.safety-badge { display: flex; justify-content: center; }
.safety-badge .isn-badge { margin: 0; padding: 0; background: none; box-shadow: none; }
.safety-badge img { width: 300px; }

/* Clientele */

.clientele {
  position: relative;
  isolation: isolate;
  background: var(--ink-deep) url("/assets/img/header-bg.webp") center / cover;
  text-align: center;
}
.clientele::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(180deg, rgb(17 19 18 / 0.8), rgb(17 19 18 / 0.55) 50%, rgb(17 19 18 / 0.85));
}
.clientele h2 { color: var(--white); }
.clientele-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(2rem, 4vw, 3rem) clamp(1rem, 3vw, 2rem);
  margin-top: clamp(2.5rem, 5vw, 3.5rem);
}
.clientele-grid img { width: min(150px, 75%); margin: 0 auto 1.25rem; }
.clientele h3 { color: var(--white); font-weight: 500; letter-spacing: 0.06em; }

/* Contact */

.contact { background: var(--ink); color: var(--on-dark); text-align: center; }
.contact h2 { color: var(--white); }
.contact-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: clamp(2rem, 4vw, 3rem);
  font-style: normal;
}
.contact-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  padding: 0.5rem 1.5rem;
  color: var(--white);
  text-decoration: none;
}
.contact-item + .contact-item { border-left: 1px solid rgb(255 255 255 / 0.14); }
a.contact-item span { font-family: var(--font-heading); font-size: 1.35rem; line-height: 1.4; letter-spacing: 0.03em; text-decoration: underline transparent; text-underline-offset: 0.25em; transition: text-decoration-color 200ms; }
a.contact-item:hover { color: var(--white); }
a.contact-item:hover span { text-decoration-color: var(--green-bright); }
.contact-item svg { width: 40px; height: 40px; stroke-width: 1.75; color: var(--green-bright); }

/* Inner pages (privacy) */

.prose {
  max-width: calc(48rem + var(--gutter) * 2);
  padding-top: clamp(2.5rem, 6vw, 4.5rem);
  padding-bottom: clamp(3rem, 7vw, 5rem);
}
.prose h1 { font-size: clamp(2.25rem, 1.75rem + 2.5vw, 3.5rem); }
.prose h2 { margin: 2.5rem 0 0.75rem; font-size: clamp(1.3rem, 1.15rem + 0.6vw, 1.6rem); }
.prose p, .prose ul, .prose ol { margin: 0 0 1rem; }
.prose ul { padding-left: 1.25rem; list-style: disc; }
.prose ol { padding-left: 1.5rem; }
.prose li { margin-bottom: 0.5rem; }
.prose li > ol { margin-top: 0.5rem; }
.prose strong { color: var(--headings); }
.prose .updated { margin-top: 0.75rem; color: var(--muted); }
.prose a { overflow-wrap: anywhere; }

/* 404 */

.not-found {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  min-height: 50vh;
  padding-top: 4rem;
  padding-bottom: 4rem;
  text-align: center;
}

/* Footer */

.site-footer {
  padding: 1.75rem 0;
  background: var(--ink-deep);
  font-size: 0.875rem;
  color: #a9b1ad;
  text-align: center;
}
.site-footer a { color: var(--on-dark); transition: color 200ms; }
.site-footer a:hover { color: var(--white); }
.site-footer [aria-hidden] { margin: 0 0.85em; opacity: 0.5; }

/* Layout breakpoints */

@media (max-width: 767px) {
  .feature-grid,
  #comprehensive-services .feature-grid,
  .safety-grid { grid-template-columns: minmax(0, 1fr); }
  #comprehensive-services .feature-icon { order: 0; }
  .feature-icon svg { width: 160px; }
  .contact-list { grid-template-columns: minmax(0, 1fr); gap: 2rem; }
  .contact-item + .contact-item { border-left: 0; padding-top: 2rem; border-top: 1px solid rgb(255 255 255 / 0.14); }
  .clientele-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 699px) {
  .services { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 559px) {
  .clientele h3 { font-size: 1.05rem; }
}

/* Set this breakpoint to the width where the footer line starts to wrap */
@media (max-width: 559px) {
  /* Put the link on its own line instead of leaving the divider dangling */
  .site-footer [aria-hidden] { display: none; }
  .site-footer a { display: block; width: fit-content; margin: 0.35rem auto 0; }
}

/* Motion: one-shot load fades and scroll-linked fades only, never looping (WCAG 2.2.2) */

@media (prefers-reduced-motion: no-preference) {
  .hero-inner > * { animation: rise 900ms var(--ease) backwards; }
  .hero-inner > :nth-child(2) { animation-delay: 120ms; }
  .hero-inner > :nth-child(3) { animation-delay: 220ms; }
  .hero-inner > :nth-child(4) { animation-delay: 320ms; }
  .prose, .not-found { animation: rise 800ms var(--ease) backwards; }


  /* Fade in while scrolling into view, without JS; browsers without scroll-driven
     animations just show the content. Uses `translate` so hover `transform`s still work. */
  @supports (animation-timeline: view()) {
    [data-reveal] {
      animation: reveal linear both;
      animation-timeline: view();
      animation-range: entry 0% entry 90%;
    }
  }
}

@keyframes reveal {
  from { opacity: 0; translate: 0 32px; }
}

@keyframes rise {
  from { opacity: 0; transform: translateY(20px); }
}
