/* advancedengineeringservices.org
   Look: drafting paper and ink. Warm paper with a faint graph grid, near-black ink, and the three
   colors of the AES gears (oxblood, navy, olive) as the only accents, shown together as the
   three-bar stripe. Type is IBM Plex Sans and Plex Mono (OFL, self-hosted in fonts/). */

@font-face { font-family: "Plex Sans"; src: url(fonts/ibm-plex-sans-latin-400-normal.woff2) format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Plex Sans"; src: url(fonts/ibm-plex-sans-latin-400-italic.woff2) format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Plex Sans"; src: url(fonts/ibm-plex-sans-latin-500-normal.woff2) format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Plex Sans"; src: url(fonts/ibm-plex-sans-latin-600-normal.woff2) format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "Plex Mono"; src: url(fonts/ibm-plex-mono-latin-500-normal.woff2) format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }

:root {
  --paper: #f4f1e9;
  --surface: #fffdf8;
  --ink: #1a1c21;
  --muted: #575a62;
  --line: #d9d2c2;
  --grid: rgba(26, 28, 33, 0.055);
  --red: #7d1d13;
  --navy: #2a2785;
  --olive: #6a5e10;
  --link: #2a2785;
  --band: #17191e;
  --band-ink: #e7e4db;
  --band-muted: #a9a8a2;
  --sans: "Plex Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono: "Plex Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
  --wrap: 1120px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #121417;
    --surface: #191c20;
    --ink: #ebe9e3;
    --muted: #a5a7ac;
    --line: #2e3238;
    --grid: rgba(235, 233, 227, 0.045);
    --red: #e58c80;
    --navy: #aeabff;
    --olive: #d4c56f;
    --link: #b9b6ff;
    --band: #0c0d10;
    --band-ink: #e7e4db;
    --band-muted: #9a9993;
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--surface);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.7;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; height: auto; }
a { color: var(--link); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--navy); outline-offset: 3px; border-radius: 2px; }
h1, h2 { font-weight: 600; letter-spacing: -0.02em; line-height: 1.1; margin: 0; }
p { margin: 0 0 1.1em; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 16px; }
@media (min-width: 720px) { .wrap { padding: 0 32px; } }

.skip { position: absolute; left: 16px; top: -60px; background: var(--ink); color: var(--surface); padding: 8px 14px; z-index: 10; }
.skip:focus { top: 12px; }

/* The three-bar stripe: the gears' three colors, used as the site's mark. */
.stripe { display: flex; gap: 6px; }
.stripe i { display: block; width: 40px; height: 5px; border-radius: 1px; }
.stripe i:nth-child(1) { background: var(--red); }
.stripe i:nth-child(2) { background: var(--navy); }
.stripe i:nth-child(3) { background: var(--olive); }

/* Header */
.site-header { background: var(--surface); border-bottom: 1px solid var(--line); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 72px; }
.brand { display: flex; align-items: center; gap: 12px; color: var(--ink); text-decoration: none; font-weight: 600; letter-spacing: -0.01em; font-size: 1.05rem; line-height: 1.2; }
.brand img { display: block; width: 24px; height: auto; }
.brand-short { display: none; font-family: var(--mono); letter-spacing: 0.08em; }
@media (max-width: 640px) {
  .brand-long { display: none; }
  .brand-short { display: inline; }
}
.nav { display: flex; gap: 4px; list-style: none; margin: 0; padding: 0; }
.nav a {
  display: block; padding: 8px 12px; color: var(--muted); text-decoration: none;
  font-size: 0.95rem; font-weight: 500; border-bottom: 2px solid transparent;
}
.nav a:hover { color: var(--ink); border-bottom-color: var(--line); }
.nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--navy); }
@media (max-width: 400px) { .nav a { padding: 8px 8px; font-size: 0.9rem; } }

/* Graph-paper grounds: the home banner and every page's title band */
.hero, .page-band {
  background-color: var(--paper);
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 28px 28px;
  border-bottom: 1px solid var(--line);
}

/* Home banner */
.hero { padding: 72px 0 80px; overflow: hidden; }
.hero-grid { display: grid; grid-template-columns: 1fr; gap: 48px; align-items: center; }
@media (min-width: 860px) { .hero-grid { grid-template-columns: 1.5fr 1fr; } }
.hero h1 { font-size: clamp(2.9rem, 8.5vw, 5.6rem); line-height: 0.98; letter-spacing: -0.035em; margin-bottom: 28px; }
.hero h1 span { display: block; }
.jump { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 36px; }
.jump a {
  font-family: var(--mono); font-weight: 500; font-size: 0.8rem; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--ink); text-decoration: none; padding: 8px 14px; border: 1px solid var(--line);
  background: var(--surface); border-radius: 2px;
}
.jump a:hover { border-color: var(--ink); }

/* The gears inside a drafting circle with center lines */
.hero-art { position: relative; width: min(100%, 360px); aspect-ratio: 1; margin: 0 auto; display: grid; place-items: center; }
.hero-art::before {
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  border: 1px dashed var(--muted); opacity: 0.45;
}
.hero-art::after {
  content: ""; position: absolute; inset: -6%;
  background:
    linear-gradient(var(--muted), var(--muted)) center / 1px 100% no-repeat,
    linear-gradient(var(--muted), var(--muted)) center / 100% 1px no-repeat;
  opacity: 0.18;
}
.hero-art img { position: relative; z-index: 1; width: 60%; height: auto; display: block; }
@media (max-width: 859px) { .hero-art { width: min(70%, 260px); } }

/* Sections */
.section { padding: 80px 0; }
.section-alt { background: var(--paper); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.split { display: grid; grid-template-columns: 1fr; gap: 24px; }
@media (min-width: 860px) { .split { grid-template-columns: 240px 1fr; gap: 56px; } }
.section-head .num {
  display: block; font-family: var(--mono); font-weight: 500; font-size: 0.8rem; letter-spacing: 0.1em;
  color: var(--muted); margin-bottom: 10px; padding-bottom: 10px; border-bottom: 1px solid var(--line); max-width: 160px;
}
.section-head h2 { font-size: clamp(1.75rem, 3.4vw, 2.25rem); }
@media (min-width: 860px) { .section-head { position: sticky; top: 24px; align-self: start; } }

.prose { max-width: 68ch; }
.prose p:last-child { margin-bottom: 0; }
.lead { font-size: 1.2rem; line-height: 1.65; }
@media (max-width: 640px) { .lead { font-size: 1.1rem; } }

/* Industries */
.industries { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (min-width: 640px) { .industries { grid-template-columns: repeat(3, 1fr); gap: 16px; } }
.industries li {
  background: var(--surface); border: 1px solid var(--line); border-top: 3px solid var(--accent);
  padding: 20px 18px 18px; font-weight: 500; font-size: 1.05rem; line-height: 1.3;
  display: flex; flex-direction: column; gap: 14px;
}
.industries svg { width: 32px; height: 32px; fill: none; stroke: var(--accent); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.c-red { --accent: var(--red); }
.c-navy { --accent: var(--navy); }
.c-olive { --accent: var(--olive); }

/* Services: a ruled, numbered list */
.services { list-style: none; margin: 32px 0 0; padding: 0; counter-reset: svc; display: grid; grid-template-columns: 1fr; column-gap: 40px; }
@media (min-width: 720px) { .services { grid-template-columns: 1fr 1fr; } }
.services li {
  counter-increment: svc; display: flex; gap: 18px; align-items: baseline;
  padding: 16px 0; border-top: 1px solid var(--line); font-weight: 500; line-height: 1.4;
}
.services li::before {
  content: counter(svc, decimal-leading-zero); font-family: var(--mono); font-size: 0.85rem;
  color: var(--red); min-width: 1.8em;
}
.services li:nth-child(3n+2)::before { color: var(--navy); }
.services li:nth-child(3n)::before { color: var(--olive); }
.services li.etc { color: var(--muted); font-weight: 400; grid-column: 1 / -1; }
.services li.etc::before { content: "··"; color: var(--muted); }

/* Large link panels (Learn More, the 404 page) */
.more { display: grid; grid-template-columns: 1fr; gap: 16px; }
@media (min-width: 640px) { .more { grid-template-columns: 1fr 1fr; } }
.more a {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 26px 24px; background: var(--surface); border: 1px solid var(--line);
  color: var(--ink); text-decoration: none; font-size: 1.35rem; font-weight: 600; letter-spacing: -0.01em;
  transition: border-color 0.15s, transform 0.15s;
}
.more a:hover { border-color: var(--ink); }
.more a:hover svg { transform: translateX(4px); }
.more svg { width: 26px; height: 26px; flex: none; fill: none; stroke: var(--navy); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; transition: transform 0.15s; }
.page-prose .more { margin-top: 32px; }
.page-prose .more a { background: var(--paper); }

/* Inner pages */
.page-band { padding: 64px 0 56px; }
.page-band h1 { font-size: clamp(2.4rem, 6vw, 3.75rem); letter-spacing: -0.03em; margin-bottom: 22px; }
.page-prose { margin: 0 auto 0 0; }
.more-info { margin-top: 32px; padding-top: 20px; border-top: 1px solid var(--line); font-weight: 500; overflow-wrap: anywhere; }

.email-card {
  display: inline-flex; align-items: center; gap: 18px; max-width: 100%;
  margin-top: 12px; padding: 22px 26px; background: var(--paper); border: 1px solid var(--line); border-left: 4px solid var(--navy);
  color: var(--ink); text-decoration: none; font-size: clamp(1.05rem, 2.6vw, 1.45rem); font-weight: 500; line-height: 1.3;
}
.email-card span { overflow-wrap: anywhere; }
.email-card:hover { border-color: var(--ink); border-left-color: var(--navy); }
.email-card svg { width: 30px; height: 30px; flex: none; fill: none; stroke: var(--navy); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

/* Footer: always dark, so the lighter gears suit it in both modes */
.site-footer { background: var(--band); color: var(--band-ink); position: relative; padding-top: 48px; }
.site-footer::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 4px;
  background: linear-gradient(90deg, var(--red) 0 33.33%, var(--navy) 33.33% 66.66%, var(--olive) 66.66%);
}
.site-footer a { color: var(--band-ink); }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 28px; padding-bottom: 36px; }
.footer-brand { display: flex; gap: 16px; align-items: center; }
.footer-brand img { width: 28px; height: auto; }
.footer-brand p { margin: 0; overflow-wrap: anywhere; }
.footer-name { font-weight: 600; font-size: 1.1rem; }
.footer-brand a { color: var(--band-muted); text-decoration: none; }
.footer-brand a:hover { color: var(--band-ink); text-decoration: underline; }
.footer-nav { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 24px; }
.footer-nav a { text-decoration: none; font-size: 0.95rem; }
.footer-nav a:hover { text-decoration: underline; }
.footer-base { border-top: 1px solid rgba(231, 228, 219, 0.14); padding-top: 18px; padding-bottom: 24px; }
.footer-base p { margin: 0; font-size: 0.85rem; color: var(--band-muted); }
@media (max-width: 480px) {
  .email-card { padding: 16px 18px; font-size: 1rem; gap: 12px; }
  .email-card svg { display: none; }
}
