/* Shared chrome — matches the landing-page header and footer. */

:root {
  --navy: #0b2545;
  --navy-2: #123763;
  --navy-3: #1d4d8a;
  --teal: #0e9e9e;
  --teal-text: #0a6e6e;
  --teal-soft: #e2f4f4;
  --ink: #0f2340;
  --text: #2b3a55;
  --muted: #5a6a85;
  --line: #e3e9f2;
  --line-2: #eef2f8;
  --bg: #ffffff;
  --surface: #ffffff;
  --band-2: #f6f9fd;
  --shadow-sm: 0 1px 2px rgba(11, 37, 69, 0.05), 0 4px 12px rgba(11, 37, 69, 0.05);
  --shadow: 0 1px 2px rgba(11, 37, 69, 0.05), 0 10px 30px rgba(11, 37, 69, 0.08);
  --shadow-lg: 0 2px 4px rgba(11, 37, 69, 0.06), 0 22px 60px rgba(11, 37, 69, 0.16);
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --gutter: clamp(1.1rem, 4vw, 2.75rem);
  --maxw: 1220px;
  --radius-lg: 20px;
  --ring: var(--teal);
  --border-w: 1px;
}

html[data-theme="dark"] {
  --navy: #e8eef8;
  --navy-2: #d5e3f5;
  --teal: #44c9c1;
  --teal-text: #9af0e6;
  --teal-soft: #13453f;
  --ink: #f8fafc;
  --text: #e8eef8;
  --muted: #b7c4d8;
  --line: #2a4060;
  --line-2: #1a2b41;
  --bg: #081524;
  --surface: #0e2033;
  --band-2: #0c1e31;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 22px 60px rgba(0, 0, 0, 0.6);
  --ring: #44c9c1;
  color-scheme: dark;
}

html[data-theme="dark"] body {
  background: var(--bg);
  color: var(--ink);
}

html[data-theme="dark"] .reader {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--line);
}

html[data-theme="dark"] .reader h4,
html[data-theme="dark"] .reader-label,
html[data-theme="dark"] .switch-row .t {
  color: #f8fafc;
}

html[data-theme="dark"] .reader .hint,
html[data-theme="dark"] .switch-row .d {
  color: #b7c4d8;
}

html[data-theme="dark"] .seg {
  background: #081524;
  border-color: #2a4060;
}

html[data-theme="dark"] .seg button {
  color: #e8eef8;
}

html[data-theme="dark"] .site-foot {
  background: #06101c;
  color: #f8fafc;
  border-top-color: #2a4060;
}

html[data-theme="dark"] .site-foot a,
html[data-theme="dark"] .site-foot p,
html[data-theme="dark"] .site-foot .foot-title {
  color: #e8eef8;
}

html[data-theme="dark"] .m-menu,
html[data-theme="dark"] .m-panel {
  background: #0e2033;
  color: #f8fafc;
}

html[data-theme="dark"] .m-link,
html[data-theme="dark"] .m-close {
  color: #f8fafc;
}

html[data-theme="contrast"] {
  --navy: #000;
  --navy-2: #000;
  --teal: #000;
  --teal-text: #000;
  --ink: #000;
  --text: #000;
  --muted: #1a1a1a;
  --line: #000;
  --line-2: #000;
  --bg: #fff;
  --surface: #fff;
  --band-2: #fff;
  --shadow-sm: none;
  --shadow: none;
  --shadow-lg: none;
  --ring: #000;
  --border-w: 2px;
}

html {
  font-size: var(--step, 16px);
}

.skip {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 100;
  padding: 0.7rem 1.1rem;
  border-radius: 10px;
  background: #0b2545;
  color: #fff;
  font-weight: 600;
  text-decoration: none;
  transition: top 0.18s ease;
}

html[data-theme="contrast"] .skip {
  background: #000;
  border: 2px solid #fff;
}

.skip:focus {
  top: 1rem;
}

#site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.3) blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease, background 0.2s ease;
}

#site-header.scrolled {
  border-bottom-color: var(--line);
}

html[data-theme="contrast"] #site-header {
  background: #fff;
  border-bottom: 2px solid #000;
}

#site-header .wrap,
.site-foot .wrap {
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

#site-header .nav {
  display: grid;
  /* Mobile/tablet: logo left, actions flush right (nav-links are hidden). */
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.75rem;
  padding-block: 0.8rem;
}

@media (min-width: 1040px) {
  #site-header .nav {
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    gap: 1.5rem;
  }
}

#site-header .brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.15rem;
  min-width: 0;
  justify-self: start;
  text-decoration: none;
  color: inherit;
}

#site-header .brand-logo,
.site-foot .brand-logo {
  height: 38px;
  width: auto;
  max-width: 168px;
  display: block;
}

html[data-theme="dark"] #site-header .brand-logo,
html[data-theme="dark"] .site-foot .brand-logo {
  filter: brightness(0) invert(1) sepia(0.2) saturate(2) hue-rotate(150deg);
}

html[data-theme="contrast"] #site-header .brand-logo,
html[data-theme="contrast"] .site-foot .brand-logo {
  filter: grayscale(1) brightness(0);
}

#site-header .brand-tag {
  font-family: var(--serif);
  font-size: 0.66rem;
  color: var(--navy);
  font-weight: 500;
  letter-spacing: 0.005em;
  line-height: 1;
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 720px) {
  #site-header .brand-tag {
    display: none;
  }

  #site-header .brand-logo,
  .site-foot .brand-logo {
    height: 32px;
    max-width: 132px;
  }

  #site-header .nav {
    gap: 0.65rem;
    padding-block: 0.55rem;
  }

  #site-header .nav-right {
    gap: 0.4rem;
  }

  #site-header .icon-btn {
    min-height: 40px;
    width: 40px;
    padding: 0;
  }

  #site-header .hamburger {
    width: 40px;
    height: 40px;
  }
}

#site-header .tm {
  font-size: 0.5em;
  vertical-align: super;
  font-weight: 400;
  margin-left: 0.05em;
}

#site-header .nav-links {
  display: none;
  justify-self: center;
  justify-content: center;
  align-items: center;
  gap: 2.1rem;
  min-width: 0;
}

#site-header .nav-links a,
#site-header .nav-links button {
  font-size: 0.94rem;
  color: var(--ink);
  font-weight: 500;
  position: relative;
  padding: 0.4rem 0;
  white-space: nowrap;
  text-decoration: none;
  background: none;
  border: 0;
  cursor: pointer;
  font-family: inherit;
}

#site-header .nav-links button {
  color: var(--muted);
}

#site-header .nav-links form {
  margin: 0;
  display: inline-flex;
}

#site-header .nav-links a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 100%;
  bottom: 0;
  height: 2px;
  background: var(--teal);
  border-radius: 2px;
  transition: right 0.2s ease;
}

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

#site-header .nav-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.7rem;
  justify-self: end;
  grid-column: -1;
  min-width: 0;
}

#site-header .nav-text {
  font-size: 0.94rem;
  font-weight: 500;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
  padding: 0.4rem 0.35rem;
}

#site-header .nav-text:hover {
  color: var(--navy);
}

@media (min-width: 1040px) {
  #site-header .nav-links {
    display: flex;
  }
}

#site-header .icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: 44px;
  padding: 0 0.95rem;
  border-radius: 999px;
  border: var(--border-w) solid var(--line);
  color: var(--navy);
  font-size: 0.82rem;
  font-weight: 600;
  background: var(--surface);
  transition: border-color 0.2s ease, background 0.2s ease;
}

#site-header .icon-btn:hover {
  border-color: var(--navy);
}

#site-header .icon-btn svg {
  width: 22px;
  height: 18px;
  flex: 0 0 auto;
  overflow: visible;
}

#site-header .icon-btn svg.icon-aa {
  width: 24px;
  height: 18px;
}

#site-header .icon-btn .label {
  display: none;
}

@media (min-width: 700px) {
  #site-header .icon-btn .label {
    display: inline;
  }
}

#site-header .hamburger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  color: var(--navy);
  border: var(--border-w) solid var(--line);
  background: var(--surface);
}

@media (min-width: 1040px) {
  #site-header .hamburger {
    display: none;
  }
}

#site-header .bars {
  position: relative;
  width: 20px;
  height: 14px;
}

#site-header .bars span {
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
  transition: transform 0.25s ease, top 0.25s ease, opacity 0.2s ease;
}

#site-header .bars span:nth-child(1) { top: 0; }
#site-header .bars span:nth-child(2) { top: 6px; }
#site-header .bars span:nth-child(3) { top: 12px; }

#site-header .hamburger.is-open .bars span:nth-child(1) {
  top: 6px;
  transform: rotate(45deg);
}

#site-header .hamburger.is-open .bars span:nth-child(2) {
  opacity: 0;
}

#site-header .hamburger.is-open .bars span:nth-child(3) {
  top: 6px;
  transform: rotate(-45deg);
}

#site-header .btn,
.m-menu .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  padding: 0.85rem 1.35rem;
  min-height: 48px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  line-height: 1.3;
  text-align: center;
  text-decoration: none;
  border: var(--border-w) solid transparent;
  width: auto;
}

/* Keep CTAs out of the top bar on small screens — they live in the hamburger menu.
   Must follow #site-header .btn so display:none wins on mobile. */
#site-header .nav-cta,
#site-header a.nav-cta.btn,
#site-header .nav-text {
  display: none;
}

@media (min-width: 1040px) {
  #site-header .nav-cta,
  #site-header a.nav-cta.btn,
  #site-header .nav-text {
    display: inline-flex;
  }
}

#site-header .btn-primary,
.m-menu .btn-primary {
  background: var(--navy);
  color: var(--bg);
  box-shadow: var(--shadow-sm);
}

#site-header .btn-primary:hover,
.m-menu .btn-primary:hover {
  background: var(--navy-2);
}

html[data-theme="dark"] #site-header .btn-primary,
html[data-theme="dark"] .m-menu .btn-primary {
  background: var(--teal);
  color: #04141f;
}

html[data-theme="contrast"] #site-header .btn-primary,
html[data-theme="contrast"] .m-menu .btn-primary {
  background: #000;
  color: #fff;
  border-color: #000;
}

#site-header .btn-secondary,
.m-menu .btn-secondary {
  background: var(--surface);
  color: var(--navy);
  border-color: var(--line);
}

#site-header .arrow,
.m-menu .arrow {
  display: inline-block;
}

.reader-wrap {
  position: relative;
}

.reader {
  position: absolute;
  right: 0;
  top: calc(100% + 0.7rem);
  z-index: 70;
  width: min(92vw, 21.5rem);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow-lg);
  padding: 0;
  opacity: 0;
  transform: translateY(-8px) scale(0.98);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  overflow: hidden;
}

.reader::before {
  content: "";
  display: block;
  height: 3px;
  background: linear-gradient(90deg, #236092 0%, #28926d 100%);
}

.reader.open {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

html[data-theme="contrast"] .reader {
  border-width: 2px;
  border-color: #000;
}

html[data-theme="contrast"] .reader::before {
  background: #000;
}

.reader__head {
  padding: 1rem 1.15rem 0.85rem;
}

.reader h4 {
  margin: 0 0 0.25rem;
  font-family: var(--serif);
  font-size: 1.2rem;
  font-weight: 500;
  color: var(--navy);
  letter-spacing: -0.01em;
}

.reader .hint {
  font-size: 0.8rem;
  line-height: 1.45;
  color: var(--muted);
  margin: 0;
}

.reader-group {
  margin: 0;
  padding: 0.85rem 1.15rem;
  border-top: 1px solid var(--line-2);
}

.reader-label {
  display: block;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.55rem;
}

.seg {
  display: flex;
  gap: 0.25rem;
  background: var(--band-2);
  padding: 0.28rem;
  border-radius: 14px;
  border: 1px solid var(--line);
}

.seg--size button:nth-child(1) { font-size: 0.78rem; }
.seg--size button:nth-child(2) { font-size: 0.9rem; }
.seg--size button:nth-child(3) { font-size: 1.02rem; }
.seg--size button:nth-child(4) { font-size: 1.16rem; }

html[data-theme="contrast"] .seg {
  border-color: #000;
}

.seg button {
  flex: 1;
  min-height: 40px;
  border-radius: 11px;
  font-weight: 650;
  color: var(--text);
  background: none;
  border: 0;
  cursor: pointer;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.seg button[aria-pressed="true"] {
  background: #236092;
  color: #fff;
  box-shadow: 0 1px 2px rgba(11, 37, 69, 0.18);
}

html[data-theme="dark"] .seg button[aria-pressed="true"] {
  background: #28926d;
  color: #04141f;
}

html[data-theme="contrast"] .seg button[aria-pressed="true"] {
  background: #000;
  color: #fff;
}

.theme-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.45rem;
}

.theme-chip {
  display: grid;
  gap: 0.4rem;
  justify-items: center;
  min-height: 4.4rem;
  padding: 0.55rem 0.35rem 0.5rem;
  border-radius: 14px;
  border: 1.5px solid var(--line);
  background: var(--band-2);
  color: var(--ink);
  cursor: pointer;
  font-family: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.theme-chip__swatch {
  width: 1.55rem;
  height: 1.55rem;
  border-radius: 999px;
  border: 1.5px solid rgba(15, 23, 42, 0.12);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35);
}

.theme-chip__swatch--light {
  background: linear-gradient(145deg, #ffffff 40%, #e8f0f8 100%);
}

.theme-chip__swatch--dark {
  background: linear-gradient(145deg, #0b2545 30%, #28926d 100%);
}

.theme-chip__swatch--contrast {
  background: linear-gradient(90deg, #000 50%, #fff 50%);
  border-color: #000;
}

.theme-chip__name {
  font-size: 0.68rem;
  font-weight: 650;
  line-height: 1.2;
  text-align: center;
  color: var(--text);
}

.theme-chip[aria-pressed="true"] {
  border-color: #28926d;
  background: color-mix(in srgb, #28926d 10%, var(--surface));
  box-shadow: 0 0 0 3px color-mix(in srgb, #28926d 18%, transparent);
}

html[data-theme="dark"] .theme-chip[aria-pressed="true"] {
  border-color: #44c9c1;
  background: color-mix(in srgb, #44c9c1 14%, var(--surface));
  box-shadow: 0 0 0 3px color-mix(in srgb, #44c9c1 20%, transparent);
}

html[data-theme="contrast"] .theme-chip {
  border-color: #000;
}

html[data-theme="contrast"] .theme-chip[aria-pressed="true"] {
  border-color: #000;
  box-shadow: 0 0 0 3px #000;
  background: #fff;
}

.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.8rem 0.85rem;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, color-mix(in srgb, #28926d 6%, var(--surface)), var(--band-2));
}

.switch-row .t {
  font-size: 0.9rem;
  font-weight: 650;
  color: var(--navy);
}

.switch-row .d {
  font-size: 0.74rem;
  color: var(--muted);
  margin: 0.15rem 0 0;
  line-height: 1.35;
}

.switch {
  position: relative;
  width: 48px;
  height: 28px;
  border-radius: 999px;
  flex: 0 0 auto;
  background: var(--line);
  border: 0;
  cursor: pointer;
  transition: background 0.2s ease;
}

.switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 1px 3px rgba(11, 37, 69, 0.25);
  transition: transform 0.2s ease;
}

.switch[aria-pressed="true"] {
  background: #28926d;
}

.switch[aria-pressed="true"]::after {
  transform: translateX(20px);
}

html[data-theme="contrast"] .switch {
  border: 2px solid #000;
  background: #fff;
}

html[data-theme="contrast"] .switch::after {
  background: #000;
}

html[data-theme="contrast"] .switch[aria-pressed="true"] {
  background: #000;
}

html[data-theme="contrast"] .switch[aria-pressed="true"]::after {
  background: #fff;
}

.reader-reset {
  margin: 0;
  width: 100%;
  min-height: 44px;
  padding: 0.7rem 1.15rem 1rem;
  border: 0;
  border-top: 1px solid var(--line-2);
  border-radius: 0;
  font-size: 0.84rem;
  font-weight: 650;
  color: #236092;
  background: transparent;
  cursor: pointer;
  font-family: inherit;
}

.reader-reset:hover {
  color: #28926d;
  background: color-mix(in srgb, #28926d 6%, transparent);
}

html[data-theme="dark"] .reader-reset {
  color: #9af0e6;
}

html[data-theme="dark"] .reader h4,
html[data-theme="dark"] .reader-label,
html[data-theme="dark"] .switch-row .t,
html[data-theme="dark"] .theme-chip__name {
  color: #f8fafc;
}

html[data-theme="dark"] .reader .hint,
html[data-theme="dark"] .switch-row .d {
  color: #b7c4d8;
}

.m-menu {
  position: fixed;
  inset: 0;
  background: rgba(11, 37, 69, 0.4);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 80;
}

.m-menu.open {
  opacity: 1;
  pointer-events: auto;
}

.m-panel {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(88vw, 360px);
  background: var(--surface);
  padding: 1.25rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  transform: translateX(100%);
  transition: transform 0.25s ease;
  box-shadow: -10px 0 30px rgba(11, 37, 69, 0.18);
}

.m-menu.open .m-panel {
  transform: none;
}

.m-close {
  align-self: flex-end;
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--navy);
  font-size: 1.3rem;
  border-radius: 10px;
  border: var(--border-w) solid var(--line);
  background: none;
  cursor: pointer;
}

.m-link {
  padding: 0.9rem 0.4rem;
  border-bottom: 1px solid var(--line);
  font-size: 1.02rem;
  color: var(--navy);
  font-weight: 500;
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  text-decoration: none;
}

.m-link svg {
  width: 19px;
  height: 19px;
  color: var(--teal);
  flex: 0 0 auto;
}

.m-panel .btn {
  margin-top: 1.1rem;
  width: 100%;
}

.m-panel form {
  margin: 0;
}

.m-panel form .btn {
  width: 100%;
}

.site-foot {
  background: var(--surface);
  border-top: 1px solid var(--line);
  padding-block: 2.25rem 1.75rem;
  color: var(--muted);
  font-size: 0.86rem;
}

.site-foot .foot-top {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.75rem;
  padding-bottom: 1.75rem;
  border-bottom: 1px solid var(--line);
}

@media (min-width: 760px) {
  .site-foot .foot-top {
    grid-template-columns: 1.4fr 1fr 1fr;
    gap: 2.5rem;
  }
}

.site-foot .foot-brand .brand-logo {
  height: 34px;
  margin-bottom: 0.7rem;
}

.site-foot .foot-brand p {
  margin: 0;
  max-width: 34ch;
  font-size: 0.85rem;
  line-height: 1.6;
  color: var(--muted);
}

.site-foot .foot-col h4 {
  font-size: 0.74rem;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--muted);
  font-family: var(--sans);
  font-weight: 700;
  margin: 0 0 0.8rem;
}

.site-foot .foot-col a {
  display: block;
  padding: 0.3rem 0;
  color: var(--navy);
  font-weight: 500;
  font-size: 0.88rem;
  text-decoration: none;
}

.site-foot .foot-col a:hover {
  color: var(--teal);
}

.site-foot .foot-bottom {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  align-items: flex-start;
  justify-content: space-between;
  padding-top: 1.5rem;
}

@media (min-width: 640px) {
  .site-foot .foot-bottom {
    flex-direction: row;
    align-items: center;
  }
}

.site-foot .foot-bottom p {
  margin: 0;
  font-size: 0.8rem;
}

.site-foot .foot-note {
  margin-top: 1.25rem;
  padding: 0.85rem 1rem;
  border-radius: 11px;
  background: var(--band-2);
  border: var(--border-w) solid var(--line-2);
  font-size: 0.79rem;
  color: var(--muted);
  line-height: 1.55;
}

@media (max-width: 720px) {
  .site-foot {
    padding-block: 1.5rem 1.25rem;
  }

  .site-foot .wrap {
    padding-inline: 0.85rem;
  }

  .site-foot .foot-grid {
    gap: 1.25rem;
  }
}

html[data-easy="on"] body {
  letter-spacing: 0.01em;
}

html[data-theme="contrast"] .site-foot a:not(.btn) {
  text-decoration: underline;
  text-underline-offset: 3px;
}
