/* Northern Digital Systems - white & cream.
   One stylesheet, no external fonts or assets. */

:root {
  --cream:      #FBF8F1;
  --cream-2:    #F4EEE1;
  --cream-3:    #EDE5D5;
  --white:      #FFFFFF;
  --ink:        #1B1A17;
  --ink-2:      #43403A;
  --muted:      #7C766A;
  --line:       #E6DFCE;
  --line-2:     #D8CFB9;
  --accent:     #8A6A45;
  --accent-2:   #6E5232;
  --accent-soft:#F1E8D9;

  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  --radius: 10px;
  --shadow: 0 1px 2px rgba(27, 26, 23, .04), 0 8px 24px -12px rgba(27, 26, 23, .12);

  /* One column for the whole page. The header, the content and the footer all
     share --shell-w so their edges line up; --measure caps prose so a wide
     column doesn't turn into 100-character lines. */
  --shell-w: 1120px;
  --measure: 72ch;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink-2);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: var(--serif);
  color: var(--ink);
  font-weight: 600;
  line-height: 1.2;
  margin: 0 0 .5em;
  letter-spacing: -.01em;
}
h1 { font-size: clamp(2rem, 4vw, 2.9rem); }
h2 { font-size: clamp(1.4rem, 2.4vw, 1.85rem); margin-top: 1.8em; }
h3 { font-size: 1.15rem; }
p  { margin: 0 0 1.1em; }
a  { color: var(--accent-2); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- shell ---------- */
.shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* ---------- header: brand + Departments dropdown ---------- */
/* The header and footer backgrounds stay full-bleed, but their contents are
   inset to the same column as the content, so the brand lines up with the h1
   instead of being stranded against the edge of a wide monitor. */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px 20px;
  padding: 15px max(40px, calc((100% - var(--shell-w)) / 2));
  background: rgba(251, 248, 241, .9);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 20;
}

.brand { display: flex; align-items: center; gap: 11px; color: inherit; }
.brand:hover { text-decoration: none; }
.brand-mark { display: flex; flex: 0 0 auto; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-name {
  font-family: var(--serif);
  font-size: 1.08rem;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -.01em;
}

.nav {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 15px;
  border-radius: 999px;
  font-size: .92rem;
  font-family: inherit;
  color: var(--ink-2);
  background: none;
  border: 1px solid transparent;
  cursor: pointer;
  white-space: nowrap;
}
a.nav-link:hover, summary.nav-link:hover {
  background: var(--white);
  border-color: var(--line);
  text-decoration: none;
}
a.nav-link[aria-current="page"],
summary.nav-link.is-active {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--cream);
}
a.nav-cta {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 600;
}
a.nav-cta:hover { background: var(--accent-2); border-color: var(--accent-2); }
a.nav-cta[aria-current="page"] { background: var(--accent-2); border-color: var(--accent-2); }

/* the Departments dropdown */
.dropdown { position: relative; }
.dropdown > summary {
  list-style: none;
  display: inline-flex;
}
.dropdown > summary::-webkit-details-marker { display: none; }
.dropdown > summary::after {
  content: "";
  width: 0; height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid currentColor;
  transition: transform .15s ease;
}
.dropdown[open] > summary::after { transform: rotate(180deg); }
.drop-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 290px;
  margin: 0;
  padding: 8px;
  list-style: none;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 16px 40px -16px rgba(27, 26, 23, .28);
  z-index: 30;
}
.drop-menu a {
  display: block;
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--ink-2);
  font-size: .95rem;
  border-left: 2px solid transparent;
}
.drop-menu a:hover { background: var(--cream-2); text-decoration: none; }
.drop-menu a[aria-current="page"] {
  background: var(--accent-soft);
  border-left-color: var(--accent);
  color: var(--ink);
  font-weight: 600;
}
.drop-menu a span {
  display: block;
  font-size: .78rem;
  color: var(--muted);
  font-weight: 400;
}

/* ---------- content ---------- */
.content {
  width: 100%;
  padding: 52px max(40px, calc((100% - var(--shell-w)) / 2)) 80px;
}

/* Prose keeps a comfortable measure now that the column is wider. Cards are
   narrower than the measure so they are unaffected; `.caps` and `.grid` are
   multi-column and fill the width, and the hero keeps its own tighter measure
   because .hero p is more specific than this rule. Matching at any depth, not
   just direct children — the home page wraps its prose in <section>s. */
.content :where(p, ol, ul:not(.caps):not(.grid)) {
  max-width: var(--measure);
}

/* ---------- bits ---------- */
.eyebrow {
  font-size: .74rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 14px;
}
.lede { font-size: 1.1rem; color: var(--ink-2); max-width: 62ch; }

.hero {
  background: linear-gradient(180deg, var(--white), var(--cream-2));
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 42px 40px;
  box-shadow: var(--shadow);
  margin-bottom: 44px;
}
.hero h1 { margin-bottom: .35em; }
.hero p { max-width: 60ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }

.btn {
  display: inline-block;
  padding: 11px 22px;
  border-radius: 8px;
  font-size: .95rem;
  font-weight: 600;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--cream);
  cursor: pointer;
  font-family: inherit;
}
.btn:hover { background: #000; text-decoration: none; }
.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line-2);
}
.btn-ghost:hover { background: var(--white); border-color: var(--accent); }

/* Two roomy columns rather than three cramped ones: at the old width this fit
   three 288px cards, which left the fourth on a row of its own and squeezed the
   text inside them. Below ~820px it falls back to a single column. */
.grid {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(auto-fit, minmax(min(400px, 100%), 1fr));
  margin: 26px 0 10px;
}
.card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
a.card { display: block; color: inherit; }
a.card:hover {
  text-decoration: none;
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  border-color: var(--line-2);
}
.card h3 { margin-bottom: .35em; }
.card p { font-size: .93rem; margin-bottom: 0; color: var(--muted); }
.card .more { display: inline-block; margin-top: 14px; font-size: .87rem; font-weight: 600; color: var(--accent-2); }

/* Also two columns now that the page is wider. At full width these rows were
   1100px of single-line text — several are multi-sentence, so they need a
   readable measure, not the whole page. start keeps a short row from being
   stretched to the height of a long one beside it. */
.caps {
  list-style: none;
  margin: 22px 0;
  padding: 0;
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(min(400px, 100%), 1fr));
  align-items: start;
}
.caps li {
  position: relative;
  padding: 14px 18px 14px 46px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: .95rem;
}
.caps li::before {
  content: "";
  position: absolute;
  left: 20px;
  top: 50%;
  width: 8px; height: 8px;
  margin-top: -4px;
  border-radius: 50%;
  background: var(--accent);
}
.caps strong { color: var(--ink); }

.quote {
  border-left: 3px solid var(--accent);
  background: var(--accent-soft);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 20px 26px;
  margin: 30px 0;
  font-family: var(--serif);
  font-size: 1.08rem;
  color: var(--ink);
  /* share the reading measure so a long pull-quote doesn't become a full-width
     line of ~115 characters now that the column is wider */
  max-width: var(--measure);
}

.note {
  font-size: .86rem;
  color: var(--muted);
  background: var(--cream-2);
  border: 1px dashed var(--line-2);
  border-radius: var(--radius);
  padding: 12px 16px;
}

/* ---------- contact ---------- */
.contact-layout { display: grid; gap: 30px; grid-template-columns: minmax(0, 1.25fr) minmax(0, .9fr); align-items: start; }
@media (max-width: 780px) { .contact-layout { grid-template-columns: 1fr; } }

.field { margin-bottom: 18px; }
.field label {
  display: block;
  font-size: .85rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 6px;
}
.field .hint { font-weight: 400; color: var(--muted); }
input[type="text"], input[type="email"], select, textarea {
  width: 100%;
  padding: 11px 13px;
  font: inherit;
  font-size: .95rem;
  color: var(--ink);
  background: var(--white);
  border: 1px solid var(--line-2);
  border-radius: 8px;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
textarea { min-height: 150px; resize: vertical; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.banner {
  border-radius: var(--radius);
  padding: 13px 18px;
  margin-bottom: 24px;
  font-size: .93rem;
  border: 1px solid var(--line-2);
  background: var(--cream-2);
  color: var(--ink-2);
}
.banner.ok { border-color: #B9CBA7; background: #EEF4E6; color: #3D4A2E; }
.banner.bad { border-color: #D9B3A6; background: #FBEDE7; color: #6E3826; }
[hidden] { display: none !important; }

.email-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}
.email-card .addr {
  font-family: var(--serif);
  font-size: 1.06rem;
  color: var(--ink);
  word-break: break-all;
}
dl.meta { margin: 0; font-size: .9rem; }
dl.meta dt { color: var(--muted); font-size: .76rem; letter-spacing: .08em; text-transform: uppercase; margin-top: 16px; }
dl.meta dd { margin: 3px 0 0; color: var(--ink-2); }

/* ---------- footer ---------- */
.footer {
  margin-top: auto;
  border-top: 1px solid var(--line);
  padding: 26px max(40px, calc((100% - var(--shell-w)) / 2));
  font-size: .84rem;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  justify-content: space-between;
}

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  /* keep the header and footer inset the same as the content, or their edges
     stop lining up between 721 and 900px */
  .topbar, .footer { padding-inline: 24px; }
  .content { padding: 34px 24px 60px; }
  .hero { padding: 32px 26px; }
}

@media (max-width: 720px) {
  /* brand and nav don't fit on one line here, and wrapping the brand name over
     three lines looks broken — stack them instead. */
  .topbar { padding: 13px 18px; gap: 9px; flex-direction: column; align-items: stretch; }
  .brand-name { white-space: nowrap; }
  .nav { gap: 4px; justify-content: flex-start; }
  .nav-link { padding: 7px 12px; font-size: .88rem; }
  /* At this width the nav wraps, so the dropdown can sit mid-row — anchoring the
     menu to it pushes the menu off-screen. Anchor it to the header instead
     (.topbar is sticky, so it is a containing block once .dropdown is static)
     and let left+right size it to the viewport minus the header padding. */
  .dropdown { position: static; }
  .drop-menu { left: 18px; right: 18px; min-width: 0; }
  .content { padding: 28px 18px 52px; }
  .footer { padding: 22px 18px; }
}

@media (max-width: 430px) {
  .brand-name { font-size: 1rem; }
}
