/* ==========================================================================
   Civilis — design system
   A static, dependency-free stylesheet. Every value used in the site is
   declared once below and referenced by variable everywhere else.
   ========================================================================== */

/* -------------------------------- Fonts -------------------------------- */
@import url('https://fonts.googleapis.com/css2?family=Newsreader:ital,wght@0,400;0,500;0,600;1,400;1,500&family=IBM+Plex+Sans:wght@400;500;600&display=swap');

/* -------------------------------- Tokens -------------------------------- */
:root {
  /* Color — derived from the Civilis mark (#0A264B) */
  --navy-950: #071B33;
  /* deepest ink, body copy on paper, dark-on-dark text */
  --navy-900: #0A264B;
  /* brand primary — header, footer, primary buttons */
  --navy-800: #123159;
  --navy-700: #1D3F6E;
  /* secondary surfaces, hover states */
  --blue-500: #3E6EA5;
  /* links, mid accents */
  --blue-300: #93AFD1;
  /* borders, quiet icons, disabled */
  --blue-150: #C9D9EC;
  --blue-100: #E3EBF5;
  /* light section backgrounds */
  --paper: #FBFCFE;
  /* base page background */
  --white: #FFFFFF;

  /* Type */
  --font-display: 'Newsreader', 'Iowan Old Style', Georgia, serif;
  --font-body: 'IBM Plex Sans', 'Segoe UI', system-ui, sans-serif;

  --fs-100: 0.8125rem;
  /* 13px — fine print */
  --fs-200: 0.9375rem;
  /* 15px — small body */
  --fs-300: 1.0625rem;
  /* 17px — base body */
  --fs-400: 1.25rem;
  /* 20px — lede / subhead */
  --fs-500: 1.625rem;
  /* 26px — h3 */
  --fs-600: 2.125rem;
  /* 34px — h2 */
  --fs-700: 2.75rem;
  /* 44px — h1, mobile */
  --fs-800: 3.75rem;
  /* 60px — h1, desktop */

  --lh-body: 1.62;
  --lh-display: 1.14;

  /* Space — 8px rhythm */
  --space-1: 0.5rem;
  --space-2: 1rem;
  --space-3: 1.5rem;
  --space-4: 2rem;
  --space-5: 3rem;
  --space-6: 4rem;
  --space-7: 6rem;
  --space-8: 8rem;
  --space-9: 11rem;

  /* Radius — exactly three values, used by role, never arbitrarily */
  --radius-sm: 6px;
  /* inputs, chips, small controls */
  --radius-md: 14px;
  /* cards, media frames */
  --radius-lg: 28px;
  /* large panels, hero frame */

  /* Motion */
  --ease-standard: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in: cubic-bezier(0.5, 0, 0.75, 0);
  --dur-fast: 180ms;
  --dur-med: 420ms;
  --dur-slow: 820ms;

  /* Layout */
  --content-max: 74rem;
  --measure: 38rem;
  /* ~62 characters at fs-300 */
  --nav-height: 4.75rem;
}

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

html {
  scroll-behavior: auto;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--navy-950);
  font-family: var(--font-body);
  font-size: var(--fs-300);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
}

button {
  font-family: inherit;
}

ul,
ol {
  padding-left: 1.15em;
}

p {
  margin: 0 0 var(--space-3);
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  line-height: var(--lh-display);
  font-weight: 500;
  margin: 0 0 var(--space-3);
  color: var(--navy-900);
  text-wrap: balance;
}

h1 {
  font-size: var(--fs-700);
  font-weight: 500;
}

h2 {
  font-size: var(--fs-600);
}

h3 {
  font-size: var(--fs-500);
}

h4 {
  font-size: var(--fs-400);
  font-weight: 600;
  font-family: var(--font-body);
}

@media (min-width:64rem) {
  h1 {
    font-size: var(--fs-800);
  }
}

/* For headings whose copy runs long — keeps the serif display treatment
   without letting a wordy line wrap past four or five lines. */
.h1-md {
  font-size: var(--fs-700);
}

.measure {
  max-width: var(--measure);
}

.lede {
  font-size: var(--fs-400);
  color: var(--navy-800);
}

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

@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* -------------------------------- Layout -------------------------------- */
.wrap {
  max-width: var(--content-max);
  margin-inline: auto;
  padding-inline: var(--space-3);
}

@media (min-width:48rem) {
  .wrap {
    padding-inline: var(--space-5);
  }
}

.section {
  padding-block: var(--space-7);
}

.section--tight {
  padding-block: var(--space-5);
}

.section--navy {
  background: var(--navy-900);
  color: var(--blue-100);
}

.section--navy h1,
.section--navy h2,
.section--navy h3,
.section--navy h4 {
  color: var(--white);
}

.section--pale {
  background: var(--blue-100);
}

.grid-2 {
  display: grid;
  gap: var(--space-6);
}

@media (min-width:56rem) {
  .grid-2 {
    grid-template-columns: 1.1fr 0.9fr;
    align-items: center;
  }

  .grid-2.reverse {
    grid-template-columns: 0.9fr 1.1fr;
  }

  .grid-2.reverse>*:first-child {
    order: 2;
  }
}

.grid-3 {
  display: grid;
  gap: var(--space-4);
  grid-template-columns: 1fr;
}

@media (min-width:44rem) {
  .grid-3 {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ------------------------------- Skip link ------------------------------ */
.skip-link {
  position: absolute;
  left: var(--space-2);
  top: -4rem;
  background: var(--navy-900);
  color: var(--white);
  padding: 0.75em 1.1em;
  border-radius: var(--radius-sm);
  z-index: 100;
  transition: top var(--dur-fast) var(--ease-standard);
}

.skip-link:focus {
  top: var(--space-2);
}

/* --------------------------------- Nav ----------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--nav-height);
  display: flex;
  align-items: center;
  background: rgba(251, 252, 254, 0.86);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--blue-150);
}

.site-header .wrap {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.65em;
  text-decoration: none;
  color: var(--navy-900);
}

.brand img {
  width: 2.05rem;
  height: 2.05rem;
  border-radius: 50%;
}

.brand span {
  font-family: var(--font-display);
  font-size: 1.28rem;
  font-weight: 500;
  letter-spacing: 0.01em;
}

.nav-links {
  display: none;
  align-items: center;
  gap: var(--space-4);
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  text-decoration: none;
  font-size: var(--fs-200);
  color: var(--navy-800);
  padding: 0.4em 0.1em;
  position: relative;
}

.nav-links a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 100%;
  bottom: -2px;
  height: 2px;
  background: var(--navy-900);
  transition: right var(--dur-fast) var(--ease-standard);
}

.nav-links a:hover::after,
.nav-links a[aria-current="page"]::after {
  right: 0;
}

.nav-links a[aria-current="page"] {
  color: var(--navy-950);
  font-weight: 600;
}

.nav-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--blue-150);
  background: var(--white);
  cursor: pointer;
}

.nav-toggle svg {
  width: 1.15rem;
  height: 1.15rem;
}

@media (min-width:56rem) {
  .nav-links {
    display: flex;
  }

  .nav-toggle {
    display: none;
  }
}

.mobile-panel {
  position: fixed;
  inset: var(--nav-height) 0 0 0;
  background: var(--paper);
  z-index: 49;
  padding: var(--space-4) var(--space-3);
  transform: translateY(-8px);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--dur-fast) var(--ease-standard), transform var(--dur-fast) var(--ease-standard);
}

.mobile-panel.is-open {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.mobile-panel ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.mobile-panel a {
  text-decoration: none;
  color: var(--navy-950);
  font-family: var(--font-display);
  font-size: var(--fs-500);
  display: block;
  padding: var(--space-1) 0;
  border-bottom: 1px solid var(--blue-150);
}

/* -------------------------------- Buttons -------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  font-size: var(--fs-200);
  font-weight: 600;
  padding: 0.85em 1.4em;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  text-decoration: none;
  cursor: pointer;
  transition: transform var(--dur-fast) var(--ease-standard), background var(--dur-fast) var(--ease-standard), box-shadow var(--dur-fast) var(--ease-standard);
}

.btn:active {
  transform: translateY(0);
}

.btn-primary {
  background: var(--navy-900);
  color: var(--white);
}

.btn-primary:hover {
  background: var(--navy-800);
  transform: translateY(-2px);
}

.btn-ghost {
  background: transparent;
  color: var(--navy-900);
  border-color: var(--blue-300);
}

.btn-ghost:hover {
  border-color: var(--navy-900);
  transform: translateY(-2px);
}

.btn-on-navy {
  background: var(--white);
  color: var(--navy-900);
}

.btn-on-navy:hover {
  background: var(--blue-100);
  transform: translateY(-2px);
}

.btn[disabled] {
  opacity: 0.6;
  cursor: progress;
  transform: none;
}

.btn .spinner {
  width: 1em;
  height: 1em;
  border-radius: 50%;
  border: 2px solid currentColor;
  border-right-color: transparent;
  animation: spin 700ms linear infinite;
  display: none;
}

.btn.is-loading .spinner {
  display: inline-block;
}

.btn.is-loading .btn-label {
  opacity: 0.85;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* -------------------------------- Star mark ------------------------------ */
/* The recurring structural device, drawn from the mark's own sparkle.
   Used only as a functional marker: dividers, list bullets, quote glyphs —
   never as decoration inside headings. */
.star-mark {
  display: inline-block;
  width: 0.6em;
  height: 0.6em;
  vertical-align: middle;
}

.divider {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--blue-300);
  margin-block: var(--space-5);
}

.divider::before,
.divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--blue-150);
}

.section--navy .divider::before,
.section--navy .divider::after {
  background: var(--navy-700);
}

.section--navy .divider {
  color: var(--blue-300);
}

.kicker {
  display: flex;
  align-items: center;
  gap: 0.55em;
  color: var(--blue-500);
  font-size: var(--fs-200);
  font-weight: 500;
  margin-bottom: var(--space-2);
}

.kicker .star-mark path {
  fill: var(--blue-500);
}

.section--navy .kicker {
  color: var(--blue-300);
}

.section--navy .kicker .star-mark path {
  fill: var(--blue-300);
}

/* -------------------------------- Cards ---------------------------------- */
.card {
  background: var(--white);
  border: 1px solid var(--blue-150);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  transition: transform var(--dur-fast) var(--ease-standard), border-color var(--dur-fast) var(--ease-standard);
}

.card:hover {
  transform: translateY(-3px);
  border-color: var(--blue-300);
}

.card h3 {
  font-size: var(--fs-400);
  margin-bottom: var(--space-1);
}

.card .star-mark {
  margin-bottom: var(--space-2);
}

.principle-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--blue-150);
}

.section--navy .principle-list {
  border-color: var(--navy-700);
}

.principle-list li {
  display: grid;
  grid-template-columns: 2.75rem 1fr;
  gap: var(--space-3);
  padding-block: var(--space-4);
  border-bottom: 1px solid var(--blue-150);
}

.section--navy .principle-list li {
  border-color: var(--navy-700);
}

.principle-list .num {
  font-family: var(--font-display);
  font-style: italic;
  color: var(--blue-500);
  font-size: var(--fs-400);
}

.section--navy .principle-list .num {
  color: var(--blue-300);
}

/* ------------------------------- Hero canvas ------------------------------ */
.hero {
  padding-block: var(--space-6) var(--space-7);
}

.hero-copy .kicker {
  margin-bottom: var(--space-3);
}

.hero h1 {
  margin-bottom: var(--space-4);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-4);
}

.field-frame {
  position: relative;
  aspect-ratio: 1/1;
  max-width: 30rem;
  margin-inline: auto;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--navy-900);
}

.field-frame canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.field-frame figcaption {
  position: absolute;
  left: var(--space-2);
  bottom: var(--space-2);
  font-size: var(--fs-100);
  color: var(--blue-300);
  margin: 0;
}

/* ------------------------------- Reveal-on-view ---------------------------
   Progressive enhancement only: content is fully visible by default so it
   never depends on JavaScript to appear. The hidden pre-state is scoped to
   html.js, a class added by an inline script in <head> — if JS is blocked,
   disabled, or IntersectionObserver is unsupported, everything just shows. */
.js .reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity var(--dur-med) var(--ease-standard), transform var(--dur-med) var(--ease-standard);
}

.js .reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* -------------------------------- Footer ---------------------------------- */
.site-footer {
  background: var(--navy-900);
  color: var(--blue-150);
  padding-block: var(--space-6) var(--space-4);
  position: relative;
  overflow: hidden;
}

.site-footer::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(1.5px 1.5px at 12% 22%, rgba(255, 255, 255, 0.55) 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 32% 68%, rgba(255, 255, 255, 0.4) 50%, transparent 51%),
    radial-gradient(1px 1px at 52% 30%, rgba(255, 255, 255, 0.5) 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 68% 78%, rgba(255, 255, 255, 0.35) 50%, transparent 51%),
    radial-gradient(1px 1px at 82% 18%, rgba(255, 255, 255, 0.5) 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 91% 55%, rgba(255, 255, 255, 0.4) 50%, transparent 51%),
    radial-gradient(1px 1px at 6% 82%, rgba(255, 255, 255, 0.45) 50%, transparent 51%);
  opacity: 0.9;
  pointer-events: none;
}

.footer-grid {
  position: relative;
  display: grid;
  gap: var(--space-5);
}

@media (min-width:44rem) {
  .footer-grid {
    grid-template-columns: 1.4fr 1fr 1fr;
  }
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 0.65em;
  margin-bottom: var(--space-2);
}

.footer-brand img {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
}

.footer-brand span {
  font-family: var(--font-display);
  font-size: 1.15rem;
  color: var(--white);
}

.footer-col h4 {
  color: var(--white);
  font-size: var(--fs-200);
  text-transform: none;
  margin-bottom: var(--space-2);
}

.footer-col ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.6em;
}

.footer-col a {
  text-decoration: none;
  color: var(--blue-150);
}

.footer-col a:hover {
  color: var(--white);
}

.footer-base {
  position: relative;
  margin-top: var(--space-6);
  padding-top: var(--space-3);
  border-top: 1px solid var(--navy-700);
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  justify-content: space-between;
  font-size: var(--fs-100);
  color: var(--blue-300);
}

/* -------------------------------- Forms ----------------------------------- */
.form-field {
  margin-bottom: var(--space-3);
}

.form-field label {
  display: block;
  font-size: var(--fs-200);
  font-weight: 600;
  margin-bottom: 0.5em;
  color: var(--navy-900);
}

.form-field .hint {
  font-size: var(--fs-100);
  color: var(--navy-700);
  margin-top: 0.4em;
}

.form-field input,
.form-field textarea,
.form-field select {
  width: 100%;
  font: inherit;
  padding: 0.85em 1em;
  border-radius: var(--radius-sm);
  border: 1px solid var(--blue-300);
  background: var(--white);
  color: var(--navy-950);
}

.form-field input:focus,
.form-field textarea:focus,
.form-field select:focus {
  outline: 2px solid var(--navy-900);
  outline-offset: 1px;
  border-color: var(--navy-900);
}

.form-field textarea {
  min-height: 9rem;
  resize: vertical;
}

.form-status {
  margin-top: var(--space-3);
  padding: 0.9em 1.1em;
  border-radius: var(--radius-sm);
  font-size: var(--fs-200);
  display: none;
}

.form-status.is-visible {
  display: block;
}

.form-status.is-success {
  background: var(--blue-100);
  color: var(--navy-900);
  border: 1px solid var(--blue-300);
}

.form-status.is-error {
  background: #F8E9E7;
  color: #7A2E22;
  border: 1px solid #E3B3AA;
}

/* -------------------------------- Legal ----------------------------------- */

.legal-body {
  max-width: 46rem;
  margin-inline: auto;
}

.legal-body section {
  margin-bottom: var(--space-6);
}

.legal-body h2 {
  font-size: var(--fs-500);
  margin-top: var(--space-5);
  margin-bottom: var(--space-2);
  padding-top: var(--space-3);
  border-top: 1px solid var(--blue-150);
}

.legal-body h2:first-of-type {
  border-top: none;
  margin-top: 0;
  padding-top: 0;
}

.legal-body h3 {
  font-size: var(--fs-400);
  margin-top: var(--space-3);
  margin-bottom: var(--space-1);
}

.legal-body ul {
  margin: 0 0 var(--space-3);
  padding-left: 1.25rem;
}

.legal-body li {
  margin-bottom: var(--space-1);
}

.legal-highlight {
  background: var(--blue-100);
  border: 1px solid var(--blue-300);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  margin-bottom: var(--space-5);
}

.legal-highlight p:last-child {
  margin-bottom: 0;
}

/* -------------------------------- Utilities -------------------------------- */
.eyebrow-none {
  /* placeholder to document: no tracked-out caps eyebrows used */
}

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

.text-quiet {
  color: var(--navy-700);
}

.mt-0 {
  margin-top: 0;
}

.stack>*+* {
  margin-top: var(--space-3);
}