:root {
  color-scheme: light dark;
  --font-sans: "DM Sans", system-ui, -apple-system, Segoe UI, sans-serif;
  --font-serif: "Instrument Serif", Georgia, serif;
  --text: #0f172a;
  --logo-head: #111111;
  --text-muted: #475569;
  --bg: #f8fafc;
  --bg-muted: #eef2f7;
  --border: #cbd5e1;
  --accent: #0f766e;
  --accent-hover: #115e59;
  --on-accent: #ffffff;
  --header-bg: rgba(248, 250, 252, 0.85);
}

@media (prefers-color-scheme: dark) {
  :root {
    --text: #e2e8f0;
    --logo-head: #e6fffa;
    --text-muted: #94a3b8;
    --bg: #0b1120;
    --bg-muted: #111827;
    --border: #334155;
    --accent: #2dd4bf;
    --accent-hover: #5eead4;
    --on-accent: #042f2e;
    --header-bg: rgba(11, 17, 32, 0.9);
  }
}

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

html {
  scroll-behavior: smooth;
}

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

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

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

a:hover {
  color: var(--accent-hover);
}

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

.container {
  width: min(1120px, 100% - 2rem);
  margin-inline: auto;
}

.narrow {
  max-width: 42rem;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  padding: 0.75rem 1rem;
  background: var(--accent);
  color: var(--on-accent);
  z-index: 100;
}

.skip-link:focus {
  left: 1rem;
  top: 1rem;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(10px);
  background: var(--header-bg);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 0;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.02em;
}

.logo-mark {
  width: 1.8rem;
  height: auto;
  flex: none;
  color: var(--logo-head);
}

/* Teal check = verification (#0f766e light, #2dd4bf dark via --accent). */
.logo-mark .logo-check {
  stroke: var(--accent);
}

.nav-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-list a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
}

.nav-list a:hover {
  color: var(--text);
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent);
  margin: 0 0 1rem;
}

h1 {
  font-family: var(--font-serif);
  font-size: clamp(2.35rem, 5vw, 3.35rem);
  font-weight: 400;
  line-height: 1.12;
  margin: 0 0 1.25rem;
  letter-spacing: -0.02em;
}

.lead {
  font-size: 1.15rem;
  color: var(--text-muted);
  margin: 0 0 0.85rem;
  max-width: 40rem;
}

h2 {
  font-family: var(--font-serif);
  font-size: clamp(1.85rem, 3.5vw, 2.35rem);
  font-weight: 400;
  margin: 0 0 1rem;
}

h3 {
  font-size: 1.15rem;
  margin: 0 0 0.5rem;
}

.text-link {
  font-weight: 600;
}

.text-link::after {
  content: " →";
  display: inline-block;
  transition: transform 160ms ease;
}

.text-link:hover::after {
  transform: translateX(0.2rem);
}

.site-footer {
  border-top: 1px solid var(--border);
  padding: 2rem 0 2.5rem;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.footer-inner p {
  margin: 0;
}

.footer-links {
  display: flex;
  gap: 1rem;
}

.footer-links a {
  color: var(--text-muted);
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--accent);
}

.legal-main {
  padding: 3rem 0 4.5rem;
}

.legal-main h1 {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: clamp(2.1rem, 4vw, 2.8rem);
  line-height: 1.15;
  margin: 0 0 0.4rem;
}

.legal-date {
  margin: 0;
  color: var(--text-muted);
}

.draft-note {
  margin: 1.5rem 0 0;
  padding: 1rem 1.15rem;
  border: 1px solid var(--border);
  border-radius: 0.85rem;
  background: var(--bg-muted);
}

.legal-main h2 {
  margin-top: 2.4rem;
}

.legal-main h3 {
  margin-top: 1.35rem;
}

.legal-main ul {
  margin: 0 0 1rem;
  padding-left: 1.2rem;
}

.legal-main li + li {
  margin-top: 0.35rem;
}

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

[id] {
  scroll-margin-top: 5rem;
}

.nav-toggle {
  display: none;
}

@media (max-width: 820px) {
  .site-header {
    position: static;
  }

  .header-inner {
    flex-wrap: wrap;
  }

  .site-header.has-menu {
    position: sticky;
  }

  .has-menu .nav-toggle {
    display: inline-flex;
    align-items: center;
    min-height: 2.5rem;
    padding: 0.35rem 0.9rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: transparent;
    color: var(--text);
    font: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
  }

  .has-menu .nav-toggle:focus-visible {
    outline: 3px solid var(--accent);
    outline-offset: 2px;
  }

  .has-menu .primary-nav {
    display: none;
    flex-basis: 100%;
  }

  .has-menu.menu-open .primary-nav {
    display: block;
  }

  .header-inner {
    padding: 0.6rem 0;
  }

  .nav-list {
    flex-direction: column;
    gap: 0;
  }

  .nav-list a {
    display: block;
    padding: 0.55rem 0;
  }

  [id] {
    scroll-margin-top: 4.5rem;
  }
}

.legal-main .not-found-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.legal-main .not-found-links li + li {
  margin-top: 0;
}

/* Homepage: dark navy / teal direction. Scoped so privacy, terms, and 404 keep the shared legal styles. */
body.home {
  --home-bg: #051722;
  --home-fg: #eff5f2;
  --home-muted: #9dafb5;
  --home-teal: #64dfc7;
  --home-label: #83aaa9;
  margin: 0;
  color: var(--home-fg);
  color-scheme: dark;
  background: var(--home-bg);
  background-image: radial-gradient(ellipse at 80% 20%, #0a2b352f, transparent 55%);
  font-family: "DM Sans", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

body.home a {
  color: inherit;
  text-decoration: none;
}

body.home a:hover {
  color: var(--home-teal);
}

body.home a:focus-visible {
  outline: 2px solid var(--home-teal);
  outline-offset: 4px;
  border-radius: 2px;
}

body.home .skip-link {
  background: var(--home-teal);
  color: #042f2e;
}

body.home .shell {
  max-width: 1360px;
  margin-inline: auto;
  padding: 0 64px;
}

body.home .home-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 104px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.055);
}

body.home .brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 20px;
  font-weight: 500;
  letter-spacing: -0.5px;
}

body.home .brand img {
  width: 43px;
  height: 43px;
  max-width: none;
  border-radius: 50%;
  object-fit: cover;
}

body.home .brand b {
  font-weight: 500;
  color: var(--home-teal);
}

body.home .note {
  margin: 0;
  font-size: 11px;
  letter-spacing: 0.25px;
  color: var(--home-muted);
}

body.home .hero {
  display: grid;
  grid-template-columns: 1.13fr 1fr;
  align-items: center;
  min-height: 365px;
  padding: 0;
  background: none;
}

body.home .intro {
  padding: 35px 0;
}

body.home .eyebrow {
  margin: 0;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1.8px;
  text-transform: uppercase;
  color: var(--home-teal);
}

body.home h1 {
  margin: 23px 0 21px;
  /* Kept from the old .hero h1 rule, which still won the cascade. */
  max-width: 16em;
  font-family: inherit;
  font-size: clamp(48px, 5.1vw, 73px);
  font-weight: 500;
  line-height: 1.07;
  letter-spacing: -3.6px;
}

body.home h1 em {
  font-style: normal;
  color: var(--home-teal);
}

body.home .intro p {
  max-width: 415px;
  margin: 0;
  font-size: 16px;
  line-height: 1.65;
  color: var(--home-muted);
}

body.home .art {
  width: 100%;
  max-width: 460px;
  justify-self: end;
  margin: -5px 0 0;
}

body.home .art svg {
  display: block;
  width: 100%;
  height: 325px;
}

body.home .art-label {
  margin: -5px 0 0;
  text-align: center;
  font-size: 8px;
  letter-spacing: 1.9px;
  text-transform: uppercase;
  color: #74969d;
}

body.home .routes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin: 9px 0 0;
}

body.home .routes article {
  padding: 23px 28px 25px;
  border: 1px solid #24404b;
  border-radius: 4px;
  background: linear-gradient(115deg, #102b3640, #091f2a40);
}

body.home .routes article + article {
  background: linear-gradient(120deg, #0b303340, #0a222c40);
}

body.home .top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--home-label);
}

body.home .top p {
  margin: 0;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 1.4px;
  text-transform: uppercase;
}

body.home .corner-icon {
  width: 22px;
  height: 22px;
  color: var(--home-teal);
}

body.home h2 {
  margin: 17px 0 12px;
  font-family: inherit;
  font-size: 25px;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -0.8px;
}

body.home .routes p {
  min-height: 42px;
  margin: 0;
  font-size: 13px;
  line-height: 1.6;
  color: var(--home-muted);
}

body.home .links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  margin-top: 21px;
}

body.home .links a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  font-size: 12px;
  font-weight: 500;
}

body.home .li-mark,
body.home .mail-icon,
body.home .doc-icon {
  width: 16px;
  height: 16px;
  flex: none;
}

body.home .mail-icon,
body.home .doc-icon {
  color: var(--home-teal);
}

body.home .ext {
  color: var(--home-teal);
  font-size: 12px;
  line-height: 1;
}

body.home .home-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
  margin-top: 10px;
  padding: 27px 0;
  color: #6e858e;
  font-size: 10px;
}

body.home .home-footer p {
  margin: 0;
}

body.home .legal-links {
  display: flex;
  gap: 16px;
}

body.home .legal-links a:hover {
  color: var(--home-teal);
}

@media (min-width: 1500px) {
  body.home .hero {
    min-height: 440px;
  }

  body.home .art svg {
    height: 390px;
  }
}

@media (max-width: 800px) {
  body.home .routes {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 650px) {
  body.home .shell {
    padding: 0 24px;
  }

  body.home .home-header {
    height: 82px;
  }

  body.home .brand {
    font-size: 18px;
    gap: 10px;
  }

  body.home .brand img {
    width: 35px;
    height: 35px;
  }

  body.home .note {
    display: none;
  }

  body.home .hero {
    display: block;
    min-height: 0;
  }

  body.home .intro {
    padding: 42px 0 0;
  }

  body.home .eyebrow {
    font-size: 9px;
    letter-spacing: 1.5px;
  }

  body.home h1 {
    margin: 20px 0 19px;
    font-size: 49px;
    letter-spacing: -2.5px;
  }

  body.home .intro p {
    max-width: 310px;
    font-size: 14px;
    line-height: 1.7;
  }

  body.home .art {
    width: 100%;
    max-width: 330px;
    margin: 4px auto 10px;
  }

  body.home .art svg {
    height: 210px;
  }

  body.home .art-label {
    margin-top: -4px;
    font-size: 7px;
    letter-spacing: 1.1px;
  }

  body.home .routes {
    gap: 14px;
    margin-top: 23px;
  }

  body.home .routes article {
    padding: 22px 23px 25px;
  }

  body.home h2 {
    margin-top: 16px;
    font-size: 25px;
  }

  body.home .routes p {
    min-height: 0;
  }

  body.home .links {
    gap: 4px 20px;
    margin-top: 14px;
  }

  body.home .home-footer {
    flex-wrap: wrap;
    margin-top: 6px;
    padding: 24px 0 25px;
    font-size: 9px;
  }
}

/* Traceable feedback lifecycle. Sits between the hero and the route cards. */
body.home .lifecycle {
  margin: 18px 0 12px;
  padding: 22px 28px 16px;
  border: 1px solid #24404b;
  border-radius: 4px;
  background: linear-gradient(115deg, #102b3640, #091f2a40);
}

body.home .lifecycle h2 {
  margin: 12px 0 20px;
}

body.home .lifecycle-body {
  position: relative;
  padding-bottom: 34px;
}

body.home .lifecycle-stages {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 28px 32px;
  list-style: none;
  margin: 0;
  padding: 0;
}

body.home .lifecycle-stage {
  position: relative;
  min-width: 0;
}

body.home .lifecycle h3 {
  margin: 0 0 12px;
  font-family: inherit;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.25;
  letter-spacing: -0.2px;
}

body.home .lifecycle-stage img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border: 1px solid #24404b;
  border-radius: 4px;
  background: #061826;
}

body.home .lifecycle-caption {
  margin: 10px 0 0;
  font-size: 13px;
  line-height: 1.45;
  color: var(--home-muted);
}

body.home .lifecycle-next {
  position: absolute;
  top: 0;
  right: -24px;
  width: 16px;
  color: var(--home-teal);
  font-size: 16px;
  font-weight: 500;
  line-height: 1.25;
  text-align: center;
  pointer-events: none;
}

body.home .lifecycle-next::before {
  content: "→";
}

body.home .lifecycle-return {
  pointer-events: none;
}

body.home .lifecycle-loop-desktop {
  position: absolute;
  left: -16px;
  right: -16px;
  top: 15px;
  bottom: 8px;
  border: 2px dashed #64dfc7aa;
  border-top: 0;
}

body.home .lifecycle-arrowhead-up {
  position: absolute;
  top: -10px;
  left: -6px;
  width: 0;
  height: 0;
  border-left: 7px solid transparent;
  border-right: 7px solid transparent;
  border-bottom: 10px solid var(--home-teal);
}

body.home .lifecycle-return-marks {
  position: absolute;
  left: 3%;
  right: 3%;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transform: translateY(50%);
}

body.home .lifecycle-return-label {
  padding: 0 12px;
  background: #081c27;
  color: var(--home-teal);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1.6px;
  line-height: 1;
  text-transform: uppercase;
  white-space: nowrap;
}

body.home .lifecycle-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 3px 4px;
  background: #081c27;
}

body.home .lifecycle-mark span {
  width: 0;
  height: 0;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  border-right: 8px solid var(--home-teal);
}

body.home .lifecycle-loop-mobile {
  display: none;
}

@media (max-width: 980px) {
  body.home .lifecycle {
    margin: 20px 0 0;
    padding: 20px 50px 18px 20px;
  }

  body.home .lifecycle h2 {
    margin-bottom: 18px;
  }

  body.home .lifecycle-body {
    padding-bottom: 0;
  }

  body.home .lifecycle-stages {
    grid-template-columns: 1fr;
    gap: 44px;
  }

  body.home .lifecycle-next {
    top: auto;
    right: auto;
    bottom: -32px;
    left: 50%;
    width: auto;
    font-size: 18px;
    line-height: 1;
    transform: translateX(-50%);
  }

  body.home .lifecycle-next::before {
    content: "↓";
  }

  body.home .lifecycle-loop-desktop {
    display: none;
  }

  body.home .lifecycle-loop-mobile {
    display: block;
    position: absolute;
    top: 7px;
    bottom: 2px;
    right: -38px;
    width: 14px;
    border-top: 2px dashed #64dfc7aa;
    border-right: 2px dashed #64dfc7aa;
  }

  body.home .lifecycle-mobile-cap {
    position: absolute;
    top: -6px;
    left: -9px;
    width: 0;
    height: 0;
    border-top: 6px solid transparent;
    border-bottom: 6px solid transparent;
    border-right: 9px solid var(--home-teal);
  }

  body.home .lifecycle-mobile-ups {
    position: absolute;
    top: 28px;
    bottom: 16px;
    right: -8px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    width: 16px;
  }

  body.home .lifecycle-mobile-ups span {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 14px;
    background: #081c27;
  }

  body.home .lifecycle-mobile-ups span::before {
    content: "";
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-bottom: 8px solid var(--home-teal);
  }

  body.home .lifecycle-mobile-label {
    position: absolute;
    top: 0;
    bottom: 0;
    right: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 16px;
  }

  body.home .lifecycle-loop-mobile .lifecycle-return-label {
    padding: 8px 0;
    background: transparent;
    font-size: 10px;
    letter-spacing: 1.3px;
    writing-mode: vertical-rl;
    transform: rotate(180deg);
  }
}
