/* ==========================================================================
   Smart Automation Solutions — site stylesheet
   Brand: SAS Network Brand Pack (BrandingPack/00_Brand_Guidelines)
   Hierarchy per the guidelines: headings Bold in SAS Black, small uppercase
   labels in SAS Red with wide letter-spacing, body Regular in Graphite.
   ========================================================================== */

:root {
  /* --- Brand palette (exact values from the guidelines) --- */
  --sas-black:     #111111;  /* Primary · text, wordmark, dark surfaces */
  --sas-red:       #E11D2E;  /* Primary accent · the mark, highlights */
  --sas-carbon:    #161616;  /* Dark backgrounds, social, covers */
  --sas-light-red: #F0384A;  /* Red text on dark backgrounds */
  --sas-graphite:  #4A4F57;  /* Body text, secondary text */
  --sas-cloud:     #F5F5F6;  /* Light backgrounds, table rows */
  --sas-ash:       #A3A8AF;  /* Rules, dividers, muted graphics */
  --sas-amber:     #F2A93B;  /* Rare highlight · alerts, callouts */
  --sas-white:     #FFFFFF;

  /* --- Brand type --- */
  --sas-font-head: "Montserrat", "Helvetica Neue", Arial, sans-serif;
  --sas-font:      "Inter", Arial, Helvetica, sans-serif;

  /* --- Site-level additions, derived from the palette --- */
  --sas-red-dark:   #B5121F;   /* hover / pressed */
  --sas-line:       #E4E5E8;   /* hairline rules — Ash is too heavy at 1px */
  --sas-line-dark:  #2A2A2A;   /* rules on Carbon */
  --sas-panel-dark: #1D1D1D;   /* cards on Carbon */
  --sas-body-dark:  #B8BDC4;   /* body text on Carbon */
  --sas-radius: 8px;
  --sas-node: 9px;             /* the node panel's corner dot */
  --sas-shadow: 0 1px 2px rgba(17, 17, 17, .06), 0 8px 24px rgba(17, 17, 17, .07);
  --sas-shadow-lift: 0 2px 4px rgba(17, 17, 17, .08), 0 16px 40px rgba(17, 17, 17, .12);
  --sas-gutter: 16px;
  --sas-max: 1140px;
  /* The lockup is 2:1 and must render at least 160px wide, so it needs 80px of
     height — which sets the header height, not the other way round. */
  --sas-header-h: 96px;
  --sas-logo-h: 80px;
}

/* --------------------------------------------------------------- Reset --- */

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

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

body {
  margin: 0;
  font-family: var(--sas-font);
  font-size: 1rem;
  line-height: 1.65;
  color: var(--sas-graphite);
  background: var(--sas-white);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

h1, h2, h3, h4 {
  font-family: var(--sas-font-head);
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1.16;
  color: var(--sas-black);
  margin: 0 0 .5em;
}
h1 { font-size: clamp(2rem, 5vw, 3.2rem); }
h2 { font-size: clamp(1.55rem, 3.5vw, 2.2rem); }
h3 { font-size: 1.12rem; }
p  { margin: 0 0 1rem; }
a  { color: var(--sas-red); }

code { font-size: .92em; color: var(--sas-black); background: var(--sas-cloud);
  padding: .1em .35em; border-radius: 4px; }

:focus-visible { outline: 3px solid var(--sas-red); outline-offset: 3px; border-radius: 4px; }

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 200;
  background: var(--sas-black); color: var(--sas-white);
  padding: .75rem 1rem; border-radius: 0 0 var(--sas-radius) 0;
}
.skip-link:focus { left: 0; }

/* ------------------------------------------------------------- Layout --- */

.wrap { max-width: var(--sas-max); margin-inline: auto; padding-inline: var(--sas-gutter); }
.wrap--narrow { max-width: 760px; }

.section { padding: clamp(3.5rem, 8vw, 6rem) 0; }
.section--mist { background: var(--sas-cloud); }
.section--dark { background: var(--sas-carbon); color: var(--sas-body-dark); }
.section--dark h2, .section--dark h3 { color: var(--sas-white); }
.section--dark p { color: var(--sas-body-dark); }
.section--dark a { color: var(--sas-light-red); }
.section--dark code { background: rgba(255, 255, 255, .08); color: var(--sas-light-red); }

.section-head { max-width: 680px; margin-bottom: 2.5rem; }
.section-head p { color: var(--sas-graphite); font-size: 1.05rem; }
.section--dark .section-head p { color: var(--sas-body-dark); }

/* Small uppercase label in SAS Red, tracked wide — as the hierarchy specifies. */
.eyebrow {
  font-family: var(--sas-font-head);
  font-weight: 600; font-size: .76rem; letter-spacing: .2em;
  text-transform: uppercase; color: var(--sas-red);
  margin: 0 0 .75rem; display: block;
}
.section--dark .eyebrow, .hero .eyebrow { color: var(--sas-light-red); }

.grid { display: grid; gap: 1.25rem; }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grid--4 { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }

/* ------------------------------------------------------------ Buttons --- */

.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .8rem 1.4rem; border-radius: var(--sas-radius);
  font-family: var(--sas-font-head);
  font-weight: 600; font-size: .94rem; text-decoration: none;
  background: var(--sas-red); color: var(--sas-white);
  border: 2px solid var(--sas-red);
  transition: background .18s ease, border-color .18s ease, transform .18s ease;
  cursor: pointer;
}
.btn:hover { background: var(--sas-red-dark); border-color: var(--sas-red-dark); transform: translateY(-1px); }
.btn--dark { background: var(--sas-black); border-color: var(--sas-black); }
.btn--dark:hover { background: var(--sas-carbon); border-color: var(--sas-carbon); }
.btn--ghost { background: transparent; color: var(--sas-black); border-color: var(--sas-line); }
.btn--ghost:hover { background: var(--sas-white); border-color: var(--sas-black); color: var(--sas-black); }
.section--dark .btn--ghost,
.hero .btn--ghost { color: var(--sas-white); border-color: rgba(255, 255, 255, .28); }
.section--dark .btn--ghost:hover,
.hero .btn--ghost:hover { background: rgba(225, 29, 46, .14); border-color: var(--sas-red); color: var(--sas-white); }

.btn-row { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.75rem; }

/* ------------------------------------------------------------- Header --- */

.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255, 255, 255, .94);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--sas-line);
}
.header-inner {
  min-height: var(--sas-header-h);
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
.brand { display: flex; align-items: center; text-decoration: none; }
/* 80px high renders the 2:1 lockup at 160px wide — the guidelines' screen
   minimum for the horizontal logo. Do not go smaller. */
.brand img { height: var(--sas-logo-h); width: auto; }

.nav-toggle {
  display: none; background: none; border: 0; padding: .5rem;
  color: var(--sas-black); cursor: pointer;
}
.nav-toggle svg { width: 26px; height: 26px; }

.nav { display: flex; align-items: center; gap: .3rem; }
.nav a {
  padding: .5rem .75rem; border-radius: 6px;
  color: var(--sas-black); text-decoration: none;
  font-family: var(--sas-font-head);
  font-weight: 600; font-size: .9rem;
  transition: color .15s ease, background .15s ease;
}
.nav a:hover { color: var(--sas-red); background: var(--sas-cloud); }
.nav a[aria-current="page"]:not(.btn) { color: var(--sas-red); }
.nav .btn { margin-left: .5rem; padding: .6rem 1.1rem; color: var(--sas-white); }
.nav .btn:hover { color: var(--sas-white); background: var(--sas-red-dark); }

@media (max-width: 900px) {
  .nav-toggle { display: block; }
  .nav {
    position: fixed; inset: var(--sas-header-h) 0 auto 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--sas-white);
    border-bottom: 1px solid var(--sas-line);
    padding: .5rem var(--sas-gutter) 1.25rem;
    box-shadow: var(--sas-shadow);
    display: none;
  }
  .nav.is-open { display: flex; }
  .nav a { padding: .85rem .25rem; border-bottom: 1px solid var(--sas-line); border-radius: 0; }
  .nav a:hover { background: transparent; }
  .nav .btn { margin: 1rem 0 0; justify-content: center; border-bottom: 0; }
}

@media (max-width: 420px) {
  /* On the narrowest phones the full-size lockup crowds the menu button. 68px
     still renders it 136px wide, so pair it with the mark-only fallback if the
     wordmark ever needs to go smaller than this. */
  :root { --sas-header-h: 84px; --sas-logo-h: 68px; }
}

/* --------------------------------------------------------------- Hero --- */

.hero {
  background: var(--sas-carbon);
  color: var(--sas-body-dark);
  position: relative;
  overflow: hidden;
  padding: clamp(4rem, 10vw, 6.5rem) 0;
}
/* Network pattern: nodes with links running between them, at the 5–8%
   strength the guidelines allow. */
.hero::before {
  content: ""; position: absolute; inset: 0;
  background-image:
    radial-gradient(circle at center, rgba(255, 255, 255, .55) 2px, transparent 2.2px),
    repeating-linear-gradient(45deg,  rgba(255, 255, 255, .22) 0 1px, transparent 1px 46px),
    repeating-linear-gradient(-45deg, rgba(255, 255, 255, .22) 0 1px, transparent 1px 46px);
  background-size: 64px 64px, auto, auto;
  opacity: .07;
  pointer-events: none;
}
.hero::after {
  content: ""; position: absolute; inset: auto -10% -45% auto;
  width: 620px; height: 620px; border-radius: 50%;
  background: radial-gradient(circle, rgba(225, 29, 46, .26), transparent 68%);
  pointer-events: none;
}
.hero .wrap { position: relative; z-index: 1; }
.hero h1 { color: var(--sas-white); max-width: 16ch; }
.hero .lede { color: var(--sas-body-dark); font-size: clamp(1.05rem, 2.2vw, 1.2rem); max-width: 56ch; }
.hero .lede a { color: var(--sas-light-red); }

.hero--page { padding: clamp(3rem, 7vw, 4.5rem) 0; }
.hero--page h1 { max-width: 22ch; }

.hero-stats {
  display: flex; flex-wrap: wrap; gap: 2.5rem;
  margin-top: 3rem; padding-top: 2rem;
  border-top: 1px solid var(--sas-line-dark);
}
.hero-stats div strong {
  display: block; font-family: var(--sas-font-head); font-size: 1.9rem; font-weight: 700;
  color: var(--sas-white); line-height: 1.1;
}
.hero-stats div span { font-size: .85rem; color: var(--sas-ash); letter-spacing: .04em; }

/* -------------------------------------------------------------- Cards --- */
/* The guidelines' "node panel": thin border, a single red dot in the top
   corner. Used for service lists, stats and steps. */

.card {
  position: relative;
  background: var(--sas-white);
  border: 1px solid var(--sas-line);
  border-radius: var(--sas-radius);
  padding: 2.3rem 1.6rem 1.6rem;
  box-shadow: var(--sas-shadow);
  transition: transform .2s ease, box-shadow .2s ease;
}
.card::before {
  content: ""; position: absolute; top: 1.15rem; left: 1.6rem;
  width: var(--sas-node); height: var(--sas-node);
  border-radius: 50%; background: var(--sas-red);
}
.card:hover { transform: translateY(-3px); box-shadow: var(--sas-shadow-lift); }
.card h3 { margin-bottom: .4rem; }
.card p { color: var(--sas-graphite); font-size: .95rem; margin-bottom: 0; }
.card--flat:hover { transform: none; box-shadow: var(--sas-shadow); }

.card-icon {
  width: 44px; height: 44px; border-radius: var(--sas-radius);
  background: rgba(225, 29, 46, .09); color: var(--sas-red);
  display: grid; place-items: center; margin: 0 0 1rem;
}
.card-icon svg { width: 22px; height: 22px; }

.section--dark .card {
  background: var(--sas-panel-dark); border-color: var(--sas-line-dark); box-shadow: none;
}
.section--dark .card::before { background: var(--sas-light-red); }
.section--dark .card p { color: var(--sas-body-dark); }
.section--dark .card-icon { background: rgba(240, 56, 74, .14); color: var(--sas-light-red); }

/* --------------------------------------------------------- Pillar rows --- */

.pillar { display: grid; gap: 2.5rem; align-items: start; }
@media (min-width: 900px) { .pillar { grid-template-columns: 1fr 1fr; gap: 4rem; } }

.feature-list { list-style: none; margin: 1.25rem 0 0; padding: 0; }
.feature-list li {
  position: relative; padding: .55rem 0 .55rem 1.9rem;
  color: var(--sas-graphite); font-size: .97rem;
  border-bottom: 1px solid var(--sas-line);
}
.feature-list li:last-child { border-bottom: 0; }
/* A node, not a bullet. */
.feature-list li::before {
  content: ""; position: absolute; left: .4rem; top: 1.15rem;
  width: 7px; height: 7px; border-radius: 50%; background: var(--sas-red);
}
.feature-list li strong { color: var(--sas-black); }
.section--dark .feature-list li { color: var(--sas-body-dark); border-color: var(--sas-line-dark); }
.section--dark .feature-list li::before { background: var(--sas-light-red); }
.section--dark .feature-list li strong { color: var(--sas-white); }

/* ---------------------------------------------------------- Flow steps --- */

.steps { counter-reset: step; display: grid; gap: 1rem; }
.step {
  position: relative; padding: 1.4rem 1.4rem 1.4rem 4.2rem;
  background: var(--sas-white); border: 1px solid var(--sas-line);
  border-radius: var(--sas-radius);
}
.step::before {
  counter-increment: step; content: counter(step);
  position: absolute; left: 1.3rem; top: 1.35rem;
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--sas-red); color: var(--sas-white);
  font-family: var(--sas-font-head); font-weight: 700; font-size: .92rem;
  display: grid; place-items: center;
}
.step h3 { margin-bottom: .25rem; font-size: 1.02rem; }
.step p { margin: 0; color: var(--sas-graphite); font-size: .95rem; }

/* --------------------------------------------------------------- Table --- */

.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.spec {
  width: 100%; border-collapse: collapse; font-size: .95rem;
  background: var(--sas-white); min-width: 480px;
}
table.spec th, table.spec td {
  text-align: left; padding: .85rem 1rem;
  border-bottom: 1px solid var(--sas-line); vertical-align: top;
}
table.spec th {
  font-family: var(--sas-font-head); font-weight: 700;
  color: var(--sas-black); background: var(--sas-cloud);
}
table.spec td:first-child { font-weight: 600; color: var(--sas-black); white-space: nowrap; }

/* ----------------------------------------------------------------- CTA --- */

.cta-band { background: var(--sas-red); color: var(--sas-white); }
.cta-band h2 { color: var(--sas-white); }
.cta-band p { color: rgba(255, 255, 255, .9); max-width: 52ch; }
.cta-band .btn { background: var(--sas-white); color: var(--sas-black); border-color: var(--sas-white); }
.cta-band .btn:hover { background: var(--sas-black); color: var(--sas-white); border-color: var(--sas-black); }
.cta-band .btn--ghost { background: transparent; color: var(--sas-white); border-color: rgba(255, 255, 255, .5); }
.cta-band .btn--ghost:hover { background: rgba(255, 255, 255, .14); border-color: var(--sas-white); color: var(--sas-white); }

/* ----------------------------------------------------------------- Form --- */

.form-grid { display: grid; gap: 1.1rem; }
@media (min-width: 640px) { .form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.1rem; } }

.field label {
  display: block; font-weight: 600; font-size: .9rem; margin-bottom: .4rem;
  color: var(--sas-black);
}
.field .hint { font-weight: 400; color: var(--sas-ash); }
.field input, .field select, .field textarea {
  width: 100%; padding: .8rem .9rem;
  font-family: inherit; font-size: 1rem; color: var(--sas-black);
  background: var(--sas-white);
  border: 1px solid var(--sas-line); border-radius: var(--sas-radius);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--sas-red);
  box-shadow: 0 0 0 3px rgba(225, 29, 46, .15);
}
.field textarea { min-height: 150px; resize: vertical; }

/* Honeypot — hidden from people, visible to naive bots */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.form-note { font-size: .85rem; color: var(--sas-graphite); }

.alert {
  padding: 1rem 1.1rem; border-radius: var(--sas-radius);
  border: 1px solid var(--sas-line); background: var(--sas-cloud);
  margin-bottom: 1.5rem; font-size: .95rem;
}
.alert--ok  { border-color: #A7D7B4; background: #EDF8F0; color: #1C5B33; }
.alert--err { border-color: var(--sas-amber); background: #FEF6E9; color: #7A4E07; }

/* ------------------------------------------------------- Contact panel --- */

.contact-list { list-style: none; margin: 0; padding: 0; }
.contact-list li { padding: 1rem 0; border-bottom: 1px solid var(--sas-line); }
.contact-list li:last-child { border-bottom: 0; }
.contact-list strong {
  display: block; font-family: var(--sas-font-head);
  font-size: .76rem; letter-spacing: .14em; font-weight: 600;
  text-transform: uppercase; color: var(--sas-red); margin-bottom: .25rem;
}
.contact-list a { color: var(--sas-black); text-decoration: none; font-weight: 600; }
.contact-list a:hover { color: var(--sas-red); }

.placeholder-flag {
  display: inline-block; margin-left: .4rem; padding: .1rem .45rem;
  font-size: .68rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: #7A4E07; background: rgba(242, 169, 59, .22);
  border-radius: 4px; vertical-align: middle;
}

/* -------------------------------------------------------------- Footer --- */

.site-footer { background: var(--sas-carbon); color: var(--sas-body-dark); padding: 3.5rem 0 1.5rem; }
.footer-grid { display: grid; gap: 2rem; margin-bottom: 2.5rem; }
@media (min-width: 760px) { .footer-grid { grid-template-columns: 1.6fr 1fr 1fr; gap: 3rem; } }

.site-footer img.footer-logo { height: 80px; width: auto; margin-bottom: 1rem; }
.site-footer p { font-size: .92rem; color: var(--sas-body-dark); max-width: 40ch; }
.site-footer h4 {
  font-family: var(--sas-font-head); color: var(--sas-light-red);
  font-size: .76rem; letter-spacing: .14em; font-weight: 600;
  text-transform: uppercase; margin-bottom: .9rem;
}
.footer-links { list-style: none; margin: 0; padding: 0; }
.footer-links li { margin-bottom: .55rem; }
.footer-links a { color: var(--sas-body-dark); text-decoration: none; font-size: .93rem; }
.footer-links a:hover { color: var(--sas-white); }

.footer-bottom {
  border-top: 1px solid var(--sas-line-dark); padding-top: 1.5rem;
  display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; justify-content: space-between;
  font-size: .85rem; color: var(--sas-ash);
}

/* ------------------------------------------------------------ Utility --- */

.text-center { text-align: center; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.muted { color: var(--sas-graphite); }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
