/* Doric Technologies — site styles
   Every text/background pair below meets WCAG 2.1 AA contrast (4.5:1 body, 3:1 large/UI).
   Checked pairs are noted next to the tokens. */

:root {
  --marble: #f7f4ee;      /* page background */
  --stone: #ebe5d9;       /* alt section background */
  --ink: #1b2433;         /* body text — 14.9:1 on marble */
  --ink-soft: #46505f;    /* secondary text — 7.6:1 on marble */
  --navy: #1f3a5f;        /* headings, buttons — 10.4:1 on marble */
  --navy-deep: #142840;
  --terracotta: #a3432a;  /* accent text/links — 5.6:1 on marble, 5.1:1 on stone */
  --gold: #e0b45c;        /* accent on navy only — 6.6:1 on navy */
  --white: #ffffff;
  --focus: #b3261e;

  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --measure: 68ch;
  --wrap: 72rem;
  --radius: 4px;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--marble);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.65;
}

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

h1, h2, h3 {
  font-family: var(--serif);
  color: var(--navy);
  line-height: 1.2;
  font-weight: 600;
  margin: 0 0 .5em;
}
h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); letter-spacing: -.01em; }
h2 { font-size: clamp(1.6rem, 3vw, 2.3rem); }
h3 { font-size: 1.3rem; }

p, ul, ol { margin: 0 0 1em; }
p, li { max-width: var(--measure); }

a { color: var(--terracotta); text-underline-offset: .18em; text-decoration-thickness: .08em; }
a:hover { color: var(--navy); }

/* Focus is always visible, never removed */
:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
  border-radius: 2px;
}

.wrap { width: min(100% - 2.5rem, var(--wrap)); margin-inline: auto; }

/* Skip link */
.skip-link {
  position: absolute;
  left: 1rem;
  top: -100px;
  background: var(--navy);
  color: var(--white);
  padding: .75rem 1rem;
  z-index: 100;
  border-radius: var(--radius);
}
.skip-link:focus { top: 1rem; color: var(--white); }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

/* ---------- Deadline bar ---------- */
.deadline-bar {
  background: var(--navy-deep);
  color: var(--white);
  font-size: .95rem;
  text-align: center;
  padding: .55rem 1rem;
}
.deadline-bar strong { color: var(--gold); }
.deadline-bar a { color: var(--white); }

/* ---------- Header ---------- */
.site-header {
  border-bottom: 1px solid #d8d0c0;
  background: var(--marble);
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 1rem;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  text-decoration: none;
  color: var(--navy);
  font-family: var(--serif);
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: .02em;
}
.brand svg { width: 34px; height: 40px; flex: none; }
.brand span small {
  display: block;
  font-family: var(--sans);
  font-size: .7rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--ink-soft);
  font-weight: 500;
}

.nav-toggle {
  display: none;
  font: inherit;
  background: transparent;
  color: var(--navy);
  border: 2px solid var(--navy);
  border-radius: var(--radius);
  padding: .45rem .8rem;
  cursor: pointer;
}

.site-nav ul {
  list-style: none;
  display: flex;
  gap: .25rem;
  margin: 0;
  padding: 0;
}
.site-nav a {
  display: block;
  padding: .55rem .8rem;
  color: var(--ink);
  text-decoration: none;
  border-radius: var(--radius);
  font-weight: 500;
}
.site-nav a:hover { background: var(--stone); color: var(--navy); }
.site-nav a[aria-current="page"] {
  color: var(--navy);
  box-shadow: inset 0 -3px 0 var(--terracotta);
}
.site-nav .nav-cta a {
  background: var(--navy);
  color: var(--white);
}
.site-nav .nav-cta a:hover { background: var(--navy-deep); color: var(--white); }

@media (max-width: 52rem) {
  .js .nav-toggle { display: inline-block; }
  .js .site-nav { display: none; width: 100%; }
  .js .site-nav.is-open { display: block; }
  .site-header .wrap { flex-wrap: wrap; }
  .site-nav ul { flex-direction: column; padding-bottom: .5rem; }
  .no-js .site-nav ul { flex-wrap: wrap; flex-direction: row; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  font-weight: 600;
  text-decoration: none;
  padding: .8rem 1.3rem;
  border-radius: var(--radius);
  border: 2px solid var(--navy);
  background: var(--navy);
  color: var(--white);
  line-height: 1.2;
  font-size: 1rem;
  font-family: var(--sans);
  cursor: pointer;
}
.btn:hover { background: var(--navy-deep); border-color: var(--navy-deep); color: var(--white); }
.btn-ghost { background: transparent; color: var(--navy); }
.btn-ghost:hover { background: var(--navy); color: var(--white); }
.btn-row { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.5rem; }

/* ---------- Sections ---------- */
section { padding-block: clamp(3rem, 7vw, 5.5rem); }
.section-alt { background: var(--stone); }
.section-navy { background: var(--navy); color: var(--white); }
.section-navy h2, .section-navy h3 { color: var(--white); }
.section-navy a { color: var(--gold); }
.section-navy p { color: #e6ebf2; }

.eyebrow {
  font-size: .8rem;
  letter-spacing: .2em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--terracotta);
  margin-bottom: .75rem;
}
.section-navy .eyebrow { color: var(--gold); }

.lede { font-size: 1.2rem; color: var(--ink-soft); }

/* Hero */
.hero { padding-block: clamp(3.5rem, 9vw, 7rem); position: relative; overflow: hidden; }
.hero .wrap { display: grid; grid-template-columns: 1.4fr 1fr; gap: 3rem; align-items: center; }
.hero-art { justify-self: center; width: min(100%, 300px); }
@media (max-width: 52rem) {
  .hero .wrap { grid-template-columns: 1fr; }
  .hero-art { display: none; }
}

/* Fluting divider — evokes the column */
.fluting {
  height: 14px;
  background: repeating-linear-gradient(90deg, var(--stone) 0 10px, #dcd3c3 10px 12px);
  border-block: 1px solid #d0c6b3;
}

/* Grids & cards */
.grid { display: grid; gap: 1.5rem; }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(20rem, 1fr)); }

.card {
  background: var(--white);
  border: 1px solid #ddd4c4;
  border-top: 4px solid var(--navy);
  border-radius: var(--radius);
  padding: 1.5rem;
}
.card h3 { margin-top: 0; }
.card p:last-child, .card ul:last-child { margin-bottom: 0; }
.card .tag {
  display: inline-block;
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--terracotta);
  margin-bottom: .5rem;
}

/* Scenario (before/after) */
.scenario { border-top-color: var(--terracotta); }
.scenario dl { margin: 0; }
.scenario dt { font-weight: 700; color: var(--navy); margin-top: .9rem; }
.scenario dt:first-child { margin-top: 0; }
.scenario dd { margin: .15rem 0 0; }

/* Steps */
.steps { counter-reset: step; list-style: none; padding: 0; display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); }
.steps li { counter-increment: step; background: var(--white); border: 1px solid #ddd4c4; border-radius: var(--radius); padding: 1.25rem 1.25rem 1.25rem 4rem; position: relative; max-width: none; }
.steps li::before {
  content: counter(step);
  position: absolute; left: 1rem; top: 1.1rem;
  width: 2.2rem; height: 2.2rem;
  border-radius: 50%;
  background: var(--navy); color: var(--white);
  display: grid; place-items: center;
  font-family: var(--serif); font-weight: 700;
}
.steps strong { display: block; color: var(--navy); font-family: var(--serif); font-size: 1.15rem; }

/* Stats */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: 1.5rem; margin: 2rem 0 1rem; }
.stat { border-left: 4px solid var(--gold); padding-left: 1rem; }
.stat .num { display: block; font-family: var(--serif); font-size: 2.4rem; color: var(--white); line-height: 1.1; }
.stat .label { color: #e6ebf2; font-size: .95rem; }
.source-note { font-size: .85rem; color: #d3dbe6; }

/* Tables */
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; background: var(--white); margin: 1rem 0 1.5rem; }
caption { text-align: left; font-weight: 700; color: var(--navy); padding-bottom: .5rem; font-family: var(--serif); font-size: 1.1rem; }
th, td { text-align: left; padding: .8rem 1rem; border: 1px solid #d8cfbf; vertical-align: top; }
thead th { background: var(--navy); color: var(--white); }
tbody th { background: #f2ede3; }

/* Callouts */
.callout {
  background: var(--white);
  border-left: 5px solid var(--terracotta);
  padding: 1.1rem 1.3rem;
  border-radius: 0 var(--radius) var(--radius) 0;
  margin: 1.5rem 0;
  max-width: var(--measure);
}
.callout p:last-child { margin-bottom: 0; }

.check-list { list-style: none; padding: 0; }
.check-list li { padding-left: 1.8rem; position: relative; margin-bottom: .55rem; }
.check-list li::before {
  content: "";
  position: absolute; left: 0; top: .45em;
  width: .9rem; height: .5rem;
  border-left: 3px solid var(--terracotta);
  border-bottom: 3px solid var(--terracotta);
  transform: rotate(-45deg);
}

/* Page header (interior pages) */
.page-head { padding-block: clamp(2.5rem, 6vw, 4.5rem); border-bottom: 1px solid #d8d0c0; }
.page-head .lede { margin-bottom: 0; }

/* Two-column prose with sidebar */
.with-aside { display: grid; grid-template-columns: minmax(0, 1fr) 18rem; gap: 3rem; align-items: start; }
.with-aside aside { position: sticky; top: 1.5rem; }
@media (max-width: 60rem) {
  .with-aside { grid-template-columns: 1fr; }
  .with-aside aside { position: static; }
}
.toc { background: var(--white); border: 1px solid #ddd4c4; border-radius: var(--radius); padding: 1.25rem; }
.toc h2 { font-size: 1.1rem; }
.toc ol { padding-left: 1.2rem; margin: 0; }
.toc li { margin-bottom: .35rem; }

.prose h2 { margin-top: 2.5rem; }
.prose h2:first-child { margin-top: 0; }
.prose h3 { margin-top: 1.75rem; }

/* Forms */
.form { display: grid; gap: 1.2rem; max-width: 40rem; }
.field label, .field legend { display: block; font-weight: 600; margin-bottom: .35rem; color: var(--navy); }
.field .hint { display: block; font-size: .9rem; color: var(--ink-soft); margin-bottom: .35rem; }
.field input, .field select, .field textarea {
  width: 100%;
  font: inherit;
  color: var(--ink);
  background: var(--white);
  border: 2px solid #6b7380; /* 4.8:1 against white — meets 3:1 for UI components */
  border-radius: var(--radius);
  padding: .65rem .75rem;
}
.field textarea { min-height: 9rem; resize: vertical; }
.field fieldset { border: 0; padding: 0; margin: 0; }
.field .choice { display: flex; align-items: center; gap: .5rem; margin-bottom: .35rem; font-weight: 400; color: var(--ink); }
.field .choice input { width: 1.15rem; height: 1.15rem; }
.req { color: var(--terracotta); }
.field-error { color: var(--focus); font-weight: 600; font-size: .95rem; margin-top: .35rem; }
.field-error:empty { display: none; }
[aria-invalid="true"] { border-color: var(--focus) !important; }
.error-summary { border: 3px solid var(--focus); background: #fff5f4; padding: 1rem 1.25rem; border-radius: var(--radius); }
.error-summary h2 { color: var(--focus); font-size: 1.2rem; }
.form-status { font-weight: 600; }

/* Footer */
.site-footer { background: var(--navy-deep); color: #e6ebf2; padding-block: 3rem 2rem; font-size: .95rem; }
.site-footer a { color: var(--white); }
.site-footer h2 { color: var(--white); font-size: 1.05rem; font-family: var(--sans); letter-spacing: .08em; text-transform: uppercase; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 2rem; }
@media (max-width: 45rem) { .footer-grid { grid-template-columns: 1fr; } }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: .4rem; }
.disclaimer { border-top: 1px solid #3a4d68; margin-top: 2rem; padding-top: 1.25rem; font-size: .85rem; color: #c9d2de; max-width: none; }

/* Respect motion preferences */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
  .btn, .site-nav a { transition: background-color .15s ease, color .15s ease; }
}

/* Windows High Contrast / forced colors */
@media (forced-colors: active) {
  .btn, .card, .steps li { border: 2px solid CanvasText; }
  .steps li::before { border: 2px solid CanvasText; }
}

@media print {
  .deadline-bar, .site-nav, .nav-toggle, .skip-link, .btn-row { display: none !important; }
  body { background: #fff; }
  a::after { content: " (" attr(href) ")"; font-size: .85em; }
}
