/* American Engineering Solutions — site styles
   Desktop layout (≥1100px) follows the approved 1536px design; the hero scales
   proportionally. Below 1100px the site switches to the approved mobile layout. */

@font-face {
  font-family: "Montserrat";
  src: url("../fonts/montserrat-var.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --navy: #052745;
  --navy-2: #0C2F52;
  --navy-mob: #032950;
  --head: #163A63;
  --head-2: #1E4470;
  --red: #C8161E;
  --red-edge: #E0454C;
  --text: #1B2230;
  --gray: #5E6875;
  --muted: #7B8592;
  --line: #D9DCE1;
  --font: "Montserrat", "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; font-family: var(--font); color: var(--text); background: #fff; line-height: 1.4; }
img, svg { display: block; max-width: 100%; }
a { color: var(--navy-2); text-decoration: none; }
a:hover { color: var(--red); }
:focus-visible { outline: 3px solid #F2A900; outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 12px; top: -60px; z-index: 100; background: #fff; padding: 10px 14px; border-radius: 3px; font-weight: 600; }
.skip-link:focus { top: 12px; }
.icon { width: 1em; height: 1em; flex-shrink: 0; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 12px; font-weight: 600; border-radius: 3px; white-space: nowrap; line-height: 1; }
.btn--red { background: var(--red); border: 1px solid var(--red-edge); color: #fff; box-shadow: 0 2px 6px rgba(200, 22, 30, .25); }
.btn--red:hover { background: #A81219; color: #fff; }
.btn--ghost { border: 1.5px solid rgba(255, 255, 255, .85); color: #fff; }
.btn--ghost:hover { background: rgba(255, 255, 255, .1); color: #fff; }

/* ---------- Header (desktop) ---------- */
.site-header { position: relative; z-index: 20; height: 117px; display: flex; align-items: center; padding: 0 50px 0 45px; background: #fff; box-shadow: 0 1px 0 rgba(12, 47, 82, .08); }
.brand { position: absolute; left: 45px; top: 2px; width: 140px; height: 140px; border-radius: 50%; background: #fff; box-shadow: 0 6px 18px rgba(8, 26, 48, .25); }
.brand img { width: 100%; height: 100%; }
.brand-name { display: none; }
.header-tagline { margin-left: 197px; height: 62px; padding-left: 40px; border-left: 1px solid #D5D9DF; display: flex; flex-direction: column; justify-content: center; gap: 5px; font-size: 13.5px; font-weight: 500; letter-spacing: .24em; line-height: 1.15; color: #7E8793; }
.primary-nav { margin-left: auto; display: flex; align-items: center; gap: 32px; font-size: 15.5px; }
.primary-nav a:not(.btn) { padding: 10px 0; color: #2A3547; font-weight: 500; border-bottom: 2.5px solid transparent; }
.primary-nav a[aria-current="page"] { color: var(--navy-2); border-bottom-color: var(--red); }
.primary-nav a:not(.btn):hover { color: var(--red); }
.primary-nav .btn { margin-left: 6px; height: 46px; padding: 0 34px 0 26px; font-size: 16px; gap: 14px; }
.primary-nav .btn .icon { font-size: 20px; }
.menu-toggle { display: none; }

@media (max-width: 1379px) {
  .header-tagline { display: none; }
  .primary-nav { gap: 24px; }
}

/* ---------- Hero (desktop, proportional) ---------- */
.hero { container-type: inline-size; position: relative; overflow: hidden; background: var(--navy); color: #fff; }
.hero-stage { --u: min(1px, calc(100cqw / 1536)); position: relative; height: max(calc(414 * var(--u)), 340px); }
.hero-photo img { position: absolute; right: 0; top: calc(-3 * var(--u)); width: calc(900 * var(--u)); height: calc(600 * var(--u)); max-width: none; }
.hero-fade { position: absolute; top: 0; bottom: 0; left: calc(100% - 936 * var(--u)); width: calc(180 * var(--u)); background: linear-gradient(90deg, var(--navy) 20%, rgba(5, 39, 69, 0) 100%); }
.hero-emblem { position: absolute; top: calc(6 * var(--u)); right: calc(364 * var(--u)); width: calc(280 * var(--u)); height: calc(280 * var(--u)); border-radius: 50%; background: #fff; box-shadow: 0 0 0 calc(7 * var(--u)) rgba(255, 255, 255, .18), 0 16px 44px rgba(0, 0, 0, .5); }
.hero-emblem img { width: 100%; height: 100%; }
.hero-copy { position: absolute; left: calc(80 * var(--u)); top: calc(58 * var(--u)); width: calc(600 * var(--u)); }
.eyebrow { display: block; font-size: calc(14 * var(--u)); font-weight: 500; letter-spacing: .38em; color: #B8C3D1; }
.hero h1 { margin: calc(16 * var(--u)) 0 0; font-size: calc(50 * var(--u)); font-weight: 700; line-height: 1.06; letter-spacing: -.005em; }
.hero h1 .dot { color: var(--red); }
.hero-lede { margin: calc(18 * var(--u)) 0 0; max-width: max(calc(490 * var(--u)), 440px); font-size: max(calc(18 * var(--u)), 14px); line-height: 1.5; color: #E2E8EF; }
.hero-actions { margin-top: calc(30 * var(--u)); display: flex; gap: calc(24 * var(--u)); }
.hero-actions .btn { height: max(calc(46 * var(--u)), 40px); padding: 0 max(calc(22 * var(--u)), 16px); font-size: max(calc(16 * var(--u)), 14px); gap: max(calc(14 * var(--u)), 10px); }
.hero-actions .btn .icon { font-size: max(calc(20 * var(--u)), 17px); }
.hero-actions .btn .chev { font-size: max(calc(14 * var(--u)), 12px); }
.hero-steps { position: absolute; left: calc(100% - 274 * var(--u)); top: calc(30 * var(--u)); margin: 0; padding: 0; list-style: none; text-shadow: 0 1px 4px rgba(0, 0, 0, .8), 0 0 12px rgba(0, 0, 0, .5); }
.hero-steps ol { margin: 0; padding: 0 0 0 calc(18 * var(--u)); list-style: none; border-left: 2px solid var(--red); display: flex; flex-direction: column; gap: calc(10 * var(--u)); font-size: calc(15 * var(--u)); letter-spacing: .26em; line-height: 1.24; color: #DCE3EB; }
.hero-steps p { margin: calc(34 * var(--u)) 0 0 2px; font-size: calc(11 * var(--u)); font-weight: 500; letter-spacing: .2em; line-height: 1.6; color: #AFBCCC; }

/* ---------- Services strip (desktop) ---------- */
.services { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); background: linear-gradient(180deg, #F4F4F5 0%, #ECEDEF 100%); border-bottom: 1px solid #E1E3E7; margin: 0; padding: 0; list-style: none; }
.service { display: flex; flex-direction: column; align-items: center; gap: 10px; margin: 10px 0; padding: 12px 8px 14px; text-align: center; border-right: 1px solid var(--line); }
.service:last-child { border-right: 0; }
.service svg { width: 46px; height: 46px; color: var(--head); }
.service h3 { margin: 4px 0 0; font-size: 17px; font-weight: 600; line-height: 1.22; color: var(--head); text-wrap: balance; }
.service p { margin: 0; font-size: 13.5px; line-height: 1.38; color: var(--gray); text-wrap: balance; }

/* ---------- Trusted / industries (desktop) ---------- */
.industries { display: grid; grid-template-columns: minmax(380px, 590px) 1fr; gap: 24px; padding: 12px 22px 18px 47px; background: linear-gradient(90deg, #fff 0%, #F6F7F9 100%); }
.industries-copy { padding-top: 14px; }
.industries h2 { margin: 0; font-size: 33px; font-weight: 700; line-height: 1.02; color: var(--head-2); }
.industries-rule { display: none; }
.industries-copy > p { margin: 18px 0 0; font-size: 14px; line-height: 1.38; color: var(--muted); }
.industries-steps { display: none; }
.values { margin: 22px 0 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 14px 16px; }
.values li { display: flex; align-items: center; gap: 9px; }
.values svg { width: 28px; height: 28px; color: #6D7F96; }
.values strong { display: block; font-size: 12px; font-weight: 600; color: #2A3F5C; white-space: nowrap; }
.values span { display: block; font-size: 11px; color: #7C8692; white-space: nowrap; }
.cards { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 11px; }
.card { position: relative; height: 213px; border-radius: 3px; overflow: hidden; box-shadow: 0 4px 14px rgba(8, 26, 48, .22); background: var(--navy); }
.card img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.card-caption { position: absolute; left: 0; right: 0; bottom: 0; min-height: 96px; padding: 0 16px 18px; display: flex; flex-direction: column; justify-content: flex-end; gap: 9px; background: linear-gradient(180deg, rgba(5, 39, 69, 0) 0%, rgba(5, 39, 69, .82) 50%, rgba(5, 39, 69, .95) 100%); color: #fff; }
.card-caption strong { font-size: 13.5px; font-weight: 600; letter-spacing: .05em; }
.card-caption span { font-size: 10px; font-weight: 500; letter-spacing: .06em; color: #C9D2DD; white-space: nowrap; }
.card-caption .chev { display: none; }

/* ---------- Footer ---------- */
.site-footer { display: flex; align-items: center; justify-content: space-between; gap: 24px; min-height: 74px; padding: 14px 48px; background: linear-gradient(90deg, #0A2746 0%, #12345A 50%, #0A2746 100%); color: #D0D8E2; }
.footer-id strong { display: block; font-size: 13px; font-weight: 500; letter-spacing: .32em; color: #C0CAD6; }
.footer-loc { display: block; margin-top: 8px; font-size: 14px; }
.footer-id a { color: #D0D8E2; }
.footer-id a:hover { color: #fff; }
.sep { margin: 0 8px; opacity: .6; }
.footer-tagline { padding-left: 18px; border-left: 2px solid var(--red); font-size: 12px; font-weight: 500; letter-spacing: .18em; color: #A3B1C2; }
.footer-tagline span + span { margin-left: .6em; }
.footer-legal { display: block; margin-top: 6px; font-size: 11px; letter-spacing: .04em; color: #8FA0B4; }
.footer-legal a { color: #8FA0B4; text-decoration: underline; }

/* =====================================================================
   Compact layout (< 1100px) — the approved mobile design, scaled fluidly
   ===================================================================== */
@media (max-width: 1099px) {
  .site-header { height: auto; min-height: 74px; padding: 8px 10px 8px 16px; gap: 9px; box-shadow: none; }
  .brand { position: static; display: flex; align-items: center; gap: 8px; width: auto; height: auto; border-radius: 0; background: none; box-shadow: none; }
  .brand img { width: clamp(58px, 9vw, 76px); height: clamp(58px, 9vw, 76px); filter: drop-shadow(0 2px 3px rgba(8, 26, 48, .25)); }
  .brand-name { display: block; font-size: clamp(11px, 2.2vw, 15px); font-weight: 800; line-height: 1.06; color: var(--head); }
  .header-tagline { display: flex; margin-left: 0; height: 34px; padding-left: 9px; gap: 2px; font-size: clamp(7px, 1.4vw, 10px); letter-spacing: .14em; line-height: 1.2; }
  .menu-toggle { display: flex; align-items: center; justify-content: center; margin-left: auto; width: 44px; height: 44px; border: 0; background: transparent; color: var(--navy-2); cursor: pointer; border-radius: 4px; }
  .menu-toggle svg { width: 26px; height: 26px; }
  .primary-nav { display: none; position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; align-items: stretch; gap: 0; padding: 8px 16px 16px; background: #fff; box-shadow: 0 10px 20px rgba(8, 26, 48, .18); font-size: 16px; }
  .primary-nav.is-open { display: flex; }
  .primary-nav a:not(.btn) { padding: 13px 4px; border-bottom: 1px solid #E6E9EE; }
  .primary-nav a[aria-current="page"] { border-bottom-color: #E6E9EE; color: var(--red); }
  .primary-nav .btn { margin: 14px 0 0; height: 48px; }

  .hero { min-height: clamp(312px, 62vw, 560px); }
  .hero-stage { position: static; height: auto; }
  .hero-photo img { top: 0; right: 0; width: min(70%, 620px); height: 100%; object-fit: cover; object-position: 100% 35%; }
  .hero-fade { left: auto; right: calc(min(70%, 620px) - 90px); width: 90px; }
  .hero-emblem { display: none; }
  .hero-copy { position: relative; left: auto; top: auto; width: min(66%, 520px); padding: 18px 0 18px clamp(20px, 6vw, 56px); }
  .eyebrow { font-size: clamp(8px, 1.8vw, 12px); letter-spacing: .34em; white-space: nowrap; }
  .hero h1 { margin-top: 8px; font-size: clamp(31px, 7.6vw, 58px); line-height: 1; }
  .hero-lede { margin-top: 10px; font-size: clamp(12px, 2.4vw, 18px); line-height: 1.35; max-width: 34ch; }
  .hero-actions { margin-top: 14px; flex-direction: column; gap: 8px; width: clamp(190px, 44vw, 320px); }
  .hero-actions .btn { height: 44px; padding: 0 14px; font-size: clamp(12.5px, 2vw, 16px); justify-content: space-between; }
  .hero-actions .btn--ghost { height: 40px; justify-content: center; }
  .hero-actions .btn .icon { font-size: 17px; }
  .hero-actions .btn .chev { font-size: 11px; }
  .hero-steps { display: none; }

  .services { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; padding: 9px 10px; background: #F4F5F7; border: 0; }
  .service { margin: 0; padding: 11px 5px 12px; gap: 5px; background: #fff; border: 1px solid #E1E4E9; border-radius: 5px; }
  .service:last-child { border-right: 1px solid #E1E4E9; }
  .service svg { width: clamp(30px, 6vw, 40px); height: clamp(30px, 6vw, 40px); }
  .service h3 { margin-top: 2px; font-size: clamp(12px, 2.2vw, 15px); }
  .service p { font-size: clamp(11px, 1.9vw, 13px); line-height: 1.3; }
  .service br { display: none; }
  .service--extra { display: none; }

  .industries { position: relative; grid-template-columns: 1fr; gap: 12px; padding: 16px 10px 12px 17px; background: linear-gradient(180deg, #F3F6FA 0%, #EEF2F7 100%); overflow: hidden; }
  .industries::after { content: ""; position: absolute; right: -70px; top: 64px; width: 200px; height: 60px; background: url("../img/tech-drawing.svg") center / contain no-repeat; opacity: .06; pointer-events: none; }
  .industries-copy { position: relative; z-index: 1; display: grid; grid-template-columns: 1fr auto; column-gap: 14px; padding-top: 0; }
  .industries-copy > * { grid-column: 1; }
  .industries h2 { font-size: clamp(15px, 3.4vw, 26px); line-height: 1.14; color: var(--head); }
  .industries-rule { display: block; width: 28px; height: 2px; margin-top: 8px; background: var(--red); }
  .industries-copy > p { margin-top: 8px; font-size: clamp(11px, 2vw, 14px); line-height: 1.38; color: #626C79; }
  .industries-steps { display: block; grid-column: 2; grid-row: 1 / span 4; padding-top: 2px; }
  .industries-steps ol { margin: 0; padding: 0 0 0 9px; list-style: none; border-left: 1.5px solid var(--red); display: flex; flex-direction: column; gap: 3px; font-size: clamp(9px, 1.7vw, 13px); letter-spacing: .24em; line-height: 1.3; color: #5F6B7A; }
  .industries-steps p { margin: 12px 0 0; font-size: clamp(8px, 1.4vw, 11px); font-weight: 500; letter-spacing: .18em; line-height: 1.5; color: #5F6B7A; white-space: nowrap; }
  .values { display: none; }
  .cards { gap: 4px; margin-left: -7px; }
  .card { height: clamp(116px, 26vw, 220px); border-radius: 4px; }
  .card-caption { min-height: 0; padding: 18px 16px 8px 7px; gap: 3px; background: linear-gradient(180deg, rgba(5, 39, 69, 0) 0%, rgba(5, 39, 69, .86) 40%, rgba(5, 39, 69, .96) 100%); }
  .card-caption strong { font-size: clamp(9px, 1.9vw, 14px); font-weight: 700; letter-spacing: .02em; line-height: 1.15; }
  .card-caption span { font-size: clamp(8px, 1.5vw, 11px); letter-spacing: .03em; white-space: normal; line-height: 1.3; }
  .card-caption .chev { display: block; position: absolute; right: 4px; bottom: 22px; font-size: 10px; }

  .site-footer { align-items: flex-start; padding: 16px 16px 18px 24px; }
  .footer-id strong { font-size: clamp(9px, 1.6vw, 12px); letter-spacing: .26em; }
  .footer-loc { margin-top: 5px; font-size: clamp(10px, 1.8vw, 13px); }
  .footer-tagline { padding-left: 8px; border-left-width: 1.5px; font-size: clamp(8px, 1.4vw, 11px); letter-spacing: .14em; line-height: 1.4; display: flex; flex-direction: column; }
  .footer-tagline span + span { margin-left: 0; }
}

@media (min-width: 600px) and (max-width: 1099px) {
  .services { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .service--extra { display: flex; }
  .values { display: flex; }
}

@media (max-width: 420px) {
  .header-tagline { letter-spacing: .1em; }
}
@media (max-width: 350px) {
  .header-tagline { display: none; }
}

/* ---------- Inner pages (quote, privacy, 404) ---------- */
.page-band { position: relative; padding: 80px 80px 64px; color: #fff; background-color: #0C2C4A; background-image: linear-gradient(rgba(255, 255, 255, .035) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .035) 1px, transparent 1px); background-size: 36px 36px; }
.page-band .crumbs { font-size: 13px; letter-spacing: .2em; color: #B9C6DA; }
.page-band .crumbs a { color: #B9C6DA; }
.page-band h1 { margin: 16px 0 0; font-size: clamp(34px, 5vw, 54px); font-weight: 700; line-height: 1.05; }
.page-band h1 .dot { color: var(--red); }
.page-band p { margin: 16px 0 0; max-width: 640px; font-size: clamp(16px, 1.6vw, 19px); line-height: 1.55; color: #DCE3EE; }
.page-body { background: #F4F5F7; padding: 72px 80px; }
.prose { max-width: 760px; font-size: 16px; line-height: 1.65; color: #2E3746; }
.prose h2 { margin: 32px 0 8px; font-size: 20px; color: var(--head); }

.quote-layout { display: grid; grid-template-columns: 1.75fr 1fr; gap: 64px; align-items: start; max-width: 1376px; }
.quote-form { display: flex; flex-direction: column; gap: 24px; }
.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.field { display: flex; flex-direction: column; gap: 8px; font-size: 14px; font-weight: 600; color: var(--navy-2); }
.field small { font-weight: 400; color: var(--gray); font-size: 13px; }
.field input, .field select, .field textarea { font: inherit; font-weight: 400; font-size: 15px; color: var(--text); background: #fff; border: 1px solid #BFB8AB; border-radius: 3px; }
.field input, .field select { height: 52px; padding: 0 14px; }
.field textarea { min-height: 150px; padding: 14px; line-height: 1.5; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid var(--navy-2); outline-offset: 1px; }
fieldset.stage { margin: 0; padding: 0; border: 0; }
fieldset.stage legend { padding: 0 0 10px; font-size: 14px; font-weight: 600; color: var(--navy-2); }
.stage-options { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.stage-options label { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 16px; background: #fff; border: 1px solid #BFB8AB; border-radius: 3px; font-size: 15px; cursor: pointer; }
.stage-options input { width: 18px; height: 18px; accent-color: var(--navy-2); }
.upload { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; padding: 24px; border: 1.5px dashed #9A9284; border-radius: 4px; background: #FBFAF8; }
.upload svg { width: 32px; height: 32px; color: var(--navy-2); }
.upload strong { display: block; font-size: 15px; color: var(--navy-2); }
.upload span { display: block; margin-top: 4px; font-size: 14px; color: var(--gray); }
.upload input { margin-left: auto; font-size: 14px; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.form-actions { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.form-actions .btn { height: 58px; padding: 0 36px; font-size: 17px; border: 0; cursor: pointer; font-family: inherit; }
.form-actions .btn[disabled] { opacity: .6; cursor: progress; }
.form-actions small { font-size: 14px; color: var(--gray); }
.form-status { display: none; padding: 16px 20px; border-radius: 3px; font-size: 15px; }
.form-status.is-ok { display: block; background: #E6F0E8; border: 1px solid #9CC3A5; color: #1E4D2B; }
.form-status.is-err { display: block; background: #FBE9EA; border: 1px solid #E3A1A5; color: #7A1419; }
.quote-aside { display: flex; flex-direction: column; gap: 28px; padding: 40px 36px; background: var(--navy-2); border-radius: 4px; color: #C8D2E2; }
.quote-aside h2 { margin: 0; font-size: 13px; font-weight: 500; letter-spacing: .2em; color: #B9C6DA; }
.quote-aside ol { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 24px; counter-reset: s; }
.quote-aside li { display: grid; grid-template-columns: 28px 1fr; counter-increment: s; }
.quote-aside li::before { content: "0" counter(s); font-size: 13px; color: #F2A0A6; padding-top: 5px; }
.quote-aside li strong { display: block; font-size: 21px; color: #fff; }
.quote-aside li span { display: block; margin-top: 6px; font-size: 15px; line-height: 1.55; }
.quote-aside .contact { padding-top: 24px; border-top: 1px solid rgba(255, 255, 255, .18); font-size: 15px; line-height: 1.8; }
.quote-aside .contact strong { color: #fff; }
.quote-aside .contact a { color: #fff; text-decoration: underline; }

@media (max-width: 1099px) {
  .page-band { padding: 48px clamp(20px, 5vw, 48px) 40px; }
  .page-body { padding: 40px clamp(16px, 5vw, 48px); }
  .quote-layout { grid-template-columns: 1fr; gap: 32px; }
}
@media (max-width: 640px) {
  .field-grid { grid-template-columns: 1fr; }
  .stage-options { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .upload input { margin-left: 0; }
}

@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
.btn--lg { height: 48px; padding: 0 24px; font-size: 16px; }

/* Smaller desktops (1100–1379px) */
@media (min-width: 1100px) and (max-width: 1379px) {
  .service h3 { font-size: 15px; }
  .service p { font-size: 12.5px; }
  .service br { display: none; }
  .industries { grid-template-columns: minmax(340px, 1fr) 1.3fr; }
  .card-caption strong { font-size: 12.5px; }
  .card-caption span { white-space: normal; line-height: 1.35; }
}
@media (min-width: 1100px) and (max-width: 1379px) { .industries h2 br { display: none; } }
