/* Davidson Engineering
   Duck-egg and white wave textures from the original site; ink, graphite and one blue accent. */

:root {
  --paper: #ffffff;
  --duck: #c2cbd6;
  --surface: #ffffff;
  --ink: #1c232c;
  --graphite: #56606c;
  --line: #9aa6b4;
  --rule: rgb(28 35 44 / 0.16);
  --accent: #264a6e;
  --night: #1c232c;
  --night-text: #e3e8ee;
  --night-muted: #a9b4c0;
  --logo-fill: #ffffff;

  --wide: "wdth" 125;
  --semi: "wdth" 112;
  --measure: 66ch;
  --gutter: clamp(16px, 4vw, 48px);
  --max: 1200px;
  --radius: 3px;
  color-scheme: light;
}

/* Dark theme: off for now (light only). To follow the visitor's system setting
   again, wrap this block in @media (prefers-color-scheme: dark) and use :root. */
:root[data-theme="dark"] {
  --paper: #14191f;
  --duck: #1f2831;
  --surface: #1b222a;
  --ink: #e3e8ee;
  --graphite: #a2adb9;
  --line: #56626f;
  --rule: rgb(227 232 238 / 0.14);
  --accent: #a9c6e4;
  --night: #0f1318;
  --logo-fill: #1b222a;
  color-scheme: dark;
}

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

html { scroll-behavior: smooth; scroll-padding-top: 72px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  /* The original light wave texture, tiling down the page (its top and bottom edges match). */
  background: var(--paper) url("bg/waves-light.webp") top center / max(100%, 1400px) auto repeat-y;
  color: var(--ink);
  font-family: "Archivo", system-ui, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.6;
  font-variation-settings: "wdth" 100;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

a { color: var(--accent); text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }

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

h1, h2, h3 { margin: 0; font-weight: 300; line-height: 1.1; letter-spacing: -0.01em; text-wrap: balance; }
h1 { font-variation-settings: var(--wide); font-size: clamp(2.5rem, 6.2vw, 5rem); }
h2 { font-variation-settings: var(--wide); font-size: clamp(1.9rem, 3.6vw, 2.9rem); }
h3 { font-variation-settings: var(--semi); font-size: 1.2rem; font-weight: 500; line-height: 1.25; letter-spacing: 0; }
p { margin: 0 0 1em; }
ul { margin: 0; padding-left: 1.1em; }
li + li { margin-top: 0.35em; }

.wrap { max-width: var(--max); margin-inline: auto; padding-inline: var(--gutter); }
.section { padding-block: clamp(64px, 10vw, 128px); }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 16px; top: 16px; z-index: 100; background: var(--surface); padding: 8px 12px; }

/* ---------- Top bar ---------- */

.topbar {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--rule);
}
.topbar .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-variation-settings: var(--wide); font-weight: 500; letter-spacing: 0.02em; white-space: nowrap; }
.brand svg { width: 30px; height: 30px; }
.topbar nav ul { display: flex; gap: clamp(14px, 2.5vw, 32px); list-style: none; padding: 0; margin: 0; }
.topbar nav li + li { margin: 0; }
.topbar nav a { color: var(--ink); text-decoration: none; font-size: 0.95rem; }
.topbar nav a:hover { color: var(--accent); }
@media (max-width: 640px) {
  .brand { font-size: 0.95rem; }
  .topbar nav a { font-size: 0.9rem; }
}

/* ---------- Logo (inline) ---------- */

.logo .band { fill: var(--ink); fill-opacity: 0.55; }
.logo .square { fill: var(--logo-fill); stroke: var(--ink); stroke-linejoin: round; fill-rule: evenodd; }
.logo .spine { stroke: var(--ink); stroke-linecap: round; }
.logo .square, .logo .spine { vector-effect: non-scaling-stroke; stroke-width: 1.4; }

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

/* Graphite darkened on duck-egg to keep small text above 4.5:1 contrast. */
.hero { --graphite: #454e59; position: relative; overflow: hidden; background: var(--duck) url("bg/waves-duck.webp") center / cover; border-bottom: 1px solid var(--rule); }
.hero .wrap {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  grid-template-areas: "text mark" "links block";
  column-gap: clamp(24px, 5vw, 72px);
  row-gap: 40px;
  padding-block: clamp(56px, 9vw, 120px) clamp(40px, 6vw, 72px);
}
.hero-text { grid-area: text; align-self: center; }
.hero h1 small { display: block; font-size: 0.34em; font-variation-settings: var(--wide); font-weight: 400; letter-spacing: 0.04em; margin-top: 0.9em; color: var(--graphite); }
.hero .lead { font-size: clamp(1.1rem, 1.6vw, 1.3rem); line-height: 1.55; max-width: 34em; margin: 1.6rem 0 0; }
.hero-mark { grid-area: mark; align-self: center; justify-self: center; width: min(100%, 400px); }
.hero-mark img { width: 100%; height: auto; }
.hero-links { grid-area: links; align-self: start; display: flex; flex-wrap: wrap; gap: 12px 28px; }

.button {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 20px;
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  color: var(--ink);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  background: transparent;
  transition: background-color 0.15s, color 0.15s;
}
.button:hover { background: var(--ink); color: var(--paper); }
.button.primary { background: var(--ink); color: var(--paper); }
.button.primary:hover { background: var(--accent); border-color: var(--accent); color: var(--paper); }
.textlink { align-self: center; color: var(--ink); font-size: 0.95rem; }


/* Title block, as on a drawing sheet */
.titleblock {
  grid-area: block;
  align-self: start;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border: 1.5px solid var(--ink);
  background: color-mix(in srgb, var(--paper) 55%, transparent);
  margin: 0;
  font-size: 0.9rem;
}
.titleblock div { padding: 8px 12px 9px; border-right: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.titleblock div:nth-child(2n) { border-right: 0; }
.titleblock div:nth-last-child(-n + 2) { border-bottom: 0; }
.titleblock dt { color: var(--graphite); font-size: 0.78rem; line-height: 1.3; }
.titleblock dd { margin: 0; line-height: 1.35; }

@media (max-width: 860px) {
  .hero .wrap { grid-template-columns: 1fr; grid-template-areas: "mark" "text" "links" "block"; row-gap: 32px; }
  .hero-mark { justify-self: start; width: 120px; }
}

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

.contact h2 { margin-bottom: 1.2rem; }
.contact p { max-width: 40em; font-size: 1.1rem; }
.contact .email {
  display: inline-block;
  margin: 0.4rem 0 2rem;
  font-variation-settings: var(--wide);
  font-size: clamp(1.3rem, 3.4vw, 2.4rem);
  font-weight: 300;
  color: var(--ink);
  text-decoration-thickness: 1px;
  overflow-wrap: anywhere;
}
.contact .email:hover { color: var(--accent); }

footer.site { border-top: 1px solid var(--rule); padding-block: 28px 40px; color: var(--graphite); font-size: 0.85rem; }
footer.site .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 32px; }
footer.site p { margin: 0; max-width: 70ch; }
