@import url("/css/fonts.css");

/* ---------------------------------------------------------------- tokens */
:root {
  /* Brand palette, sampled from the Fidelis Machines logo */
  --charcoal:    #292928;
  --charcoal-2:  #33332f;
  --gold:        #ac872d;
  /* The logo gold is only 3.36:1 on white and 4.35:1 on charcoal, so small
     text uses a shifted shade that clears WCAG AA on each background. */
  --gold-on-light: #917226;
  --gold-on-dark:  #b08a2e;
  --paper:       #ffffff;
  --bone:        #f4f4f3;
  --ink:         #232322;
  --ink-muted:   #5f5f5b;
  --rule:        rgba(41, 41, 40, 0.14);
  --rule-dark:   rgba(244, 244, 243, 0.16);

  --font: "Poppins", "Helvetica Neue", Arial, sans-serif;

  --wide:   1200px;
  --narrow: 740px;
  --gutter: clamp(1.25rem, 5vw, 4rem);
  --step:   clamp(3.5rem, 8vw, 6.5rem);
  --radius: 3px;
  --ease:   cubic-bezier(0.2, 0.7, 0.3, 1);
}

/* ---------------------------------------------------------------- reset */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; 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;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: clamp(1rem, 0.96rem + 0.18vw, 1.08rem);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
img, picture, video { max-width: 100%; height: auto; display: block; }
a { color: var(--gold-on-light); text-underline-offset: 3px; }
a:hover { color: var(--charcoal); }

h1, h2, h3, h4 {
  font-weight: 700; line-height: 1.14; letter-spacing: -0.015em;
  color: var(--charcoal); margin: 0 0 .6em; text-wrap: balance;
}
h1 { font-size: clamp(2.1rem, 1.4rem + 3.2vw, 3.7rem); }
h2 { font-size: clamp(1.6rem, 1.15rem + 2vw, 2.5rem); }
h3 { font-size: clamp(1.15rem, 1rem + 0.7vw, 1.45rem); font-weight: 600; letter-spacing: -0.01em; }
h4 { font-size: .95rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
p  { margin: 0 0 1.1em; text-wrap: pretty; }
p:last-child, ul:last-child, ol:last-child { margin-bottom: 0; }
ul, ol { margin: 0 0 1.1em; padding-left: 1.25em; }
li { margin-bottom: .4em; }
li::marker { color: var(--gold); }
strong { color: var(--charcoal); font-weight: 600; }
hr { border: 0; border-top: 1px solid var(--rule); margin: 2.5rem 0; }

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

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 200;
  background: var(--charcoal); color: #fff; padding: .8rem 1.2rem; font-size: .9rem;
}
.skip-link:focus { left: 0; color: #fff; }

/* ---------------------------------------------------------------- layout */
.wrap        { width: min(100% - var(--gutter) * 2, var(--wide));   margin-inline: auto; }
.wrap--narrow{ width: min(100% - var(--gutter) * 2, var(--narrow)); margin-inline: auto; }

.section { padding-block: var(--step); }
.section--bone { background: var(--bone); }
.section--soft { background: var(--bone); }
.section--sand { background: var(--bone); }
.section--dark { background: var(--charcoal); color: rgba(244,244,243,.88); }
.section--dark h1, .section--dark h2, .section--dark h3,
.section--dark h4, .section--dark strong { color: var(--paper); }
.section--dark a:not(.btn) { color: var(--gold-on-dark); }
.section--tight { padding-block: calc(var(--step) * .6); }

.section__head { max-width: 46rem; margin-bottom: 2.5rem; }
.section__head--center { margin-inline: auto; text-align: center; }

.eyebrow {
  font-size: .74rem; font-weight: 600; letter-spacing: .18em;
  text-transform: uppercase; color: var(--gold-on-light); margin: 0 0 .9rem;
}
.section--dark .eyebrow { color: var(--gold-on-dark); }

/* ---------------------------------------------------------------- buttons */
.btn {
  display: inline-block; font-size: .8rem; font-weight: 600;
  letter-spacing: .1em; text-transform: uppercase; text-decoration: none;
  padding: .95rem 1.9rem; border: 2px solid var(--charcoal); border-radius: var(--radius);
  background: var(--charcoal); color: var(--paper);
  transition: background .25s var(--ease), color .25s var(--ease), border-color .25s var(--ease);
}
.btn:hover { background: var(--gold); border-color: var(--gold); color: var(--charcoal); }
.btn--solid { /* default treatment; named so content can ask for it */ }
.btn--ghost { background: transparent; color: var(--charcoal); }
.btn--ghost:hover { background: var(--charcoal); border-color: var(--charcoal); color: var(--paper); }
.btn--light { background: var(--paper); border-color: var(--paper); color: var(--charcoal); }
.btn--light:hover { background: var(--gold); border-color: var(--gold); color: var(--charcoal); }
.btn-row { display: flex; flex-wrap: wrap; gap: 1rem; margin-top: 2rem; }
.btn-row--center { justify-content: center; }

/* ---------------------------------------------------------------- header */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255,255,255,.94); backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--rule);
}
.site-header__inner { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; min-height: 78px; }
.brand { display: flex; align-items: center; text-decoration: none; }
.brand img { height: 42px; width: auto; }

.nav { display: flex; align-items: center; gap: 1.9rem; }
.nav a {
  font-size: .78rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase;
  text-decoration: none; color: var(--charcoal); padding: .35rem 0; position: relative;
}
.nav a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 2px;
  background: var(--gold); transform: scaleX(0); transform-origin: left;
  transition: transform .25s var(--ease);
}
.nav a:hover::after, .nav a[aria-current="page"]::after { transform: scaleX(1); }

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

@media (max-width: 880px) {
  .nav-toggle { display: block; }
  .nav {
    position: fixed; inset: 78px 0 auto; flex-direction: column; gap: 0;
    background: var(--paper); border-bottom: 1px solid var(--rule);
    padding: .5rem var(--gutter) 1.5rem;
    transform: translateY(-120%); transition: transform .3s var(--ease);
    max-height: calc(100dvh - 78px); overflow-y: auto;
  }
  .nav[data-open="true"] { transform: translateY(0); }
  .nav a { width: 100%; padding: 1rem 0; border-bottom: 1px solid var(--rule); font-size: .92rem; }
  .nav a::after { display: none; }
}

/* ---------------------------------------------------------------- hero */
.hero { position: relative; display: grid; place-items: center; isolation: isolate; text-align: center; }
.hero--tall  { min-height: min(84dvh, 720px); }
.hero--short { min-height: min(48dvh, 420px); }
.hero__media { position: absolute; inset: 0; z-index: -2; }
.hero__media img { width: 100%; height: 100%; object-fit: cover; }
.hero::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(180deg, rgba(23,23,22,.74) 0%, rgba(23,23,22,.58) 45%, rgba(23,23,22,.84) 100%);
}
.hero__inner { padding: clamp(4rem, 12vw, 7rem) var(--gutter); color: var(--paper); max-width: 58rem; }
.hero h1 { color: var(--paper); text-shadow: 0 2px 24px rgba(0,0,0,.35); }
.hero p { color: rgba(255,255,255,.92); font-size: 1.15em; max-width: 42rem; margin-inline: auto; }
.hero .eyebrow { color: var(--gold-on-dark); }

.page-banner { background: var(--charcoal); color: var(--paper); padding-block: clamp(3rem, 8vw, 5rem); text-align: center; }
.page-banner h1 { color: var(--paper); margin-bottom: 0; }
.page-banner p { color: rgba(244,244,243,.82); margin: 1rem auto 0; max-width: 44rem; }
/* `.page-banner p` outranks `.eyebrow`, so the kicker needs the banner scope. */
.page-banner .eyebrow { color: var(--gold-on-dark); }

/* ---------------------------------------------------------------- split */
.split { display: grid; gap: clamp(2rem, 5vw, 4rem); align-items: center; grid-template-columns: 1fr; }
@media (min-width: 900px) {
  .split { grid-template-columns: 1fr 1fr; }
  .split--reverse > .split__media { order: 2; }
}
.split + .split { margin-top: var(--step); }
.split__media img { width: 100%; border-radius: var(--radius); box-shadow: 0 18px 50px -26px rgba(41,41,40,.55); }
.split__media--plain img { box-shadow: none; border-radius: 0; width: auto; max-width: 100%; margin-inline: auto; }
.split .prose > h2, .split .prose > .eyebrow + h2 { margin-top: 0; }

/* ---------------------------------------------------------------- grids */
.grid { display: grid; gap: clamp(1.25rem, 3vw, 2rem); }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); }
.grid--4 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); }
.grid img { width: 100%; border-radius: var(--radius); }
.showcase img { aspect-ratio: 4 / 3; object-fit: cover; box-shadow: 0 18px 50px -28px rgba(41,41,40,.55); }
.showcase--contain img { object-fit: contain; box-shadow: none; }
.showcase--natural img { aspect-ratio: auto; object-fit: initial; box-shadow: none; }

/* feature cards */
.features { display: grid; gap: 1.75rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); align-items: start; list-style: none; padding: 0; margin: 0; }
.feature { background: var(--paper); border: 1px solid var(--rule); border-radius: var(--radius); padding: 1.9rem; }
.section--dark .feature { background: var(--charcoal-2); border-color: var(--rule-dark); }
.feature__icon { width: 56px; height: 56px; object-fit: contain; margin-bottom: 1.1rem; }
.feature h3 { font-size: 1.05rem; }
.feature p:last-child { margin-bottom: 0; }

/* key/value data — federal contracting identifiers */
.datalist { display: grid; gap: 1.5rem 2.5rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); margin: 0; }
.datalist dt { font-size: .72rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--gold-on-light); }
.section--dark .datalist dt { color: var(--gold-on-dark); }
.datalist dd { margin: .3rem 0 0; font-size: 1.15rem; font-weight: 600; color: var(--charcoal); }
.section--dark .datalist dd { color: var(--paper); }

/* team */
.team { display: grid; gap: clamp(1.5rem, 3vw, 2.5rem); grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); list-style: none; padding: 0; margin: 0; }
.team figure { margin: 0; text-align: center; }
.team img { aspect-ratio: 1; object-fit: cover; border-radius: 50%; box-shadow: 0 16px 40px -24px rgba(41,41,40,.6); }
.team figcaption { margin-top: 1.1rem; }
.team .name { font-weight: 600; font-size: 1.05rem; color: var(--charcoal); display: block; }
.team .role { font-size: .72rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-muted); display: block; margin-top: .3rem; }

.sources { font-size: .85rem; color: var(--ink-muted); }
.sources h4 { font-size: .7rem; letter-spacing: .14em; color: var(--ink-muted); margin-bottom: .5rem; }
.sources ul { padding-left: 1.1em; margin: 0; }
.sources a { color: inherit; word-break: break-word; }

/* ---------------------------------------------------------------- gallery */
.gallery { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); }
.gallery button { padding: 0; border: 0; background: none; cursor: zoom-in; display: block; border-radius: var(--radius); overflow: hidden; line-height: 0; }
.gallery img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; transition: transform .5s var(--ease); }
.gallery button:hover img { transform: scale(1.04); }
.lightbox { position: fixed; inset: 0; z-index: 300; border: 0; padding: 0; width: 100%; max-width: 100%; height: 100%; max-height: 100%; background: rgba(20,20,19,.96); }
.lightbox::backdrop { background: rgba(20,20,19,.96); }
.lightbox__img { width: 100%; height: 100%; object-fit: contain; padding: clamp(1rem, 4vw, 3.5rem); }
.lightbox__btn { position: absolute; top: 50%; transform: translateY(-50%); background: rgba(255,255,255,.1); color: #fff; border: 1px solid rgba(255,255,255,.35); width: 52px; height: 52px; border-radius: 50%; cursor: pointer; font-size: 1.4rem; line-height: 1; display: grid; place-items: center; }
.lightbox__btn:hover { background: var(--gold); border-color: var(--gold); color: var(--charcoal); }
.lightbox__prev { left: clamp(.5rem, 2vw, 1.5rem); }
.lightbox__next { right: clamp(.5rem, 2vw, 1.5rem); }
.lightbox__close { top: clamp(.5rem, 2vw, 1.5rem); right: clamp(.5rem, 2vw, 1.5rem); transform: none; }
.lightbox__count { position: absolute; bottom: clamp(.75rem, 2vw, 1.5rem); left: 50%; transform: translateX(-50%); color: rgba(255,255,255,.8); font-size: .8rem; letter-spacing: .1em; }

/* ---------------------------------------------------------------- form */
.form { display: grid; gap: 1.3rem; }
.form__row { display: grid; gap: 1.3rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); }
.field { display: grid; gap: .45rem; }
.field label { font-size: .74rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--charcoal); }
.field input, .field textarea {
  font: inherit; font-size: 1rem; color: var(--ink); background: var(--paper);
  border: 1px solid var(--rule); border-radius: var(--radius); padding: .85rem 1rem; width: 100%;
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.field input:focus, .field textarea:focus { outline: 0; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(172,135,45,.22); }
.field textarea { min-height: 170px; resize: vertical; }
.form__note { font-size: .86rem; color: var(--ink-muted); }
.hp { position: absolute; left: -9999px; }

.contact-card { display: grid; gap: 1.4rem; align-content: start; }
.contact-card dt { font-size: .72rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-muted); }
.contact-card dd { margin: .3rem 0 0; font-size: 1.05rem; }
.contact-card dd a { text-decoration: none; }
.contact-card dd a:hover { text-decoration: underline; }

/* ---------------------------------------------------------------- footer */
.site-footer { background: var(--charcoal); color: rgba(244,244,243,.76); padding-block: clamp(3rem, 7vw, 4.25rem); font-size: .94rem; }
.site-footer a { color: rgba(244,244,243,.76); text-decoration: none; }
.site-footer a:hover { color: var(--gold-on-dark); }
.site-footer__grid { display: grid; gap: 2.5rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); }
.site-footer img { height: 46px; width: auto; margin-bottom: 1.1rem; }
.site-footer__tag { max-width: 22rem; }
.site-footer h2 { font-size: .72rem; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--gold-on-dark); margin-bottom: .9rem; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: .55rem; }
.site-footer__bottom { margin-top: 2.75rem; padding-top: 1.6rem; border-top: 1px solid var(--rule-dark); font-size: .82rem; color: rgba(244,244,243,.55); display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; justify-content: space-between; }

/* ---------------------------------------------------------------- prose */
.prose { max-width: 72ch; }
.split .prose, .feature .prose { max-width: none; }
.prose > :first-child { margin-top: 0; }
.prose h2 { margin-top: 2.2em; }
.prose h3 { margin-top: 2em; }
.prose > h2:first-child, .prose > h3:first-child { margin-top: 0; }
