:root {
  --navy: #0a2540;
  --navy-deep: #06182b;
  --sky: #5ec8f2;
  --ink: #122033;
  --muted: #5b6b7c;
  --line: #d7e2ee;
  --paper: #ffffff;
  --wash: #f3f7fb;
  --sand: #eef4f8;
  --danger: #9b2226;
  --radius: 14px;
  --shadow: 0 14px 40px rgba(10, 37, 64, 0.08);
  --font-display: "Libre Baskerville", Georgia, "Times New Roman", serif;
  --font-body: "Source Sans 3", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(1200px 500px at 10% -10%, #d9eef9 0%, transparent 55%),
    linear-gradient(180deg, #f7fafc 0%, var(--wash) 100%);
  font-family: var(--font-body);
  line-height: 1.55;
}

.wrap {
  width: min(1120px, calc(100% - 2rem));
  margin: 0 auto;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
}
.skip-link:focus {
  left: 1rem;
  top: 1rem;
  z-index: 300;
  background: #fff;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
}

.site-header {
  background: linear-gradient(120deg, var(--navy-deep), var(--navy) 55%, #12385c);
  color: #fff;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  position: sticky;
  top: 0;
  z-index: 200;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 0;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  color: inherit;
  text-decoration: none;
}

.brand {
  display: block;
  font-family: var(--font-display);
  font-size: 1.2rem;
  letter-spacing: 0.01em;
}

.brand-sub {
  display: block;
  font-size: 0.78rem;
  opacity: 0.85;
  color: var(--sky);
}

.primary-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.primary-nav a {
  color: #e8f4fc;
  text-decoration: none;
  padding: 0.4rem 0.7rem;
  border-radius: 999px;
  font-size: 0.92rem;
  font-weight: 600;
}

.primary-nav a:hover,
.primary-nav a[aria-current="page"] {
  background: rgba(255,255,255,0.12);
  color: #fff;
}

.hero {
  padding: 2.2rem 0 1rem;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--navy);
  margin: 0 0 0.6rem;
}

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 3vw, 2.5rem);
  line-height: 1.2;
  margin: 0 0 0.8rem;
  max-width: 18ch;
}

.lede {
  max-width: 62ch;
  color: var(--muted);
  font-size: 1.05rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1.1rem;
}

.btn,
button {
  font: inherit;
  border-radius: 10px;
  border: 1px solid var(--navy);
  background: var(--navy);
  color: #fff;
  padding: 0.65rem 0.95rem;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
}

.btn-secondary {
  background: #fff;
  color: var(--navy);
}

button:hover, .btn:hover { filter: brightness(1.05); }
button:disabled { opacity: 0.5; cursor: not-allowed; filter: none; }
button.danger { background: var(--danger); border-color: var(--danger); }

.section-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  position: sticky;
  top: 64px;
  z-index: 150;
  padding: 0.7rem 0;
  background: rgba(243, 247, 251, 0.92);
  backdrop-filter: blur(8px);
}

.section-nav a {
  text-decoration: none;
  color: var(--navy);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.4rem 0.75rem;
  font-size: 0.9rem;
  font-weight: 600;
}

.section-nav a.active,
.section-nav a:hover {
  background: var(--navy);
  color: #fff;
  border-color: var(--navy);
}

.panel {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.35rem;
  margin: 1rem 0 1.35rem;
  scroll-margin-top: 8rem;
}

.section-head h2 {
  font-family: var(--font-display);
  margin: 0 0 0.35rem;
  font-size: 1.45rem;
}

.small-note, .muted { color: var(--muted); font-size: 0.95rem; }

.hero-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.8rem;
  margin-bottom: 1.2rem;
}

.hero-card {
  display: block;
  text-decoration: none;
  color: inherit;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1rem;
  background: linear-gradient(180deg, #fff, var(--sand));
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.hero-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.hero-card h3 {
  margin: 0 0 0.35rem;
  font-family: var(--font-display);
  color: var(--navy);
}

.two-col {
  columns: 2;
  gap: 1.5rem;
}

.callout {
  margin-top: 1rem;
  padding: 0.9rem 1rem;
  border-left: 4px solid var(--sky);
  background: #f3faff;
  border-radius: 0 10px 10px 0;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.8rem;
  margin: 1rem 0;
}

.grid .full { grid-column: 1 / -1; }

label {
  display: grid;
  gap: 0.35rem;
  font-size: 0.92rem;
  font-weight: 600;
}

input, select, textarea {
  font: inherit;
  width: 100%;
  border: 1px solid #b9c9da;
  border-radius: 10px;
  padding: 0.6rem 0.7rem;
  background: #fff;
  font-weight: 400;
}

textarea { resize: vertical; min-height: 5rem; }

.actions { display: flex; flex-wrap: wrap; gap: 0.55rem; margin-bottom: 0.8rem; }

.result {
  min-height: 3rem;
  padding: 0.9rem 1rem;
  border-radius: 10px;
  border: 1px dashed #9eb6cd;
  background: #f8fbff;
}

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td {
  text-align: left;
  padding: 0.55rem 0.4rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  font-size: 0.92rem;
}

.pathway {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0.8rem 0 0.2rem;
}

.pathway span {
  background: var(--sand);
  border: 1px solid var(--line);
  color: var(--navy);
  border-radius: 999px;
  padding: 0.28rem 0.65rem;
  font-size: 0.8rem;
  font-weight: 700;
}

.letter-preview {
  margin-top: 1rem;
  background: var(--wash);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1rem;
}

.letter-sheet {
  background: #fff;
  border: 1px solid #d9e2ec;
  border-radius: 8px;
  padding: 1.4rem 1.5rem;
  max-width: 760px;
  margin: 0 auto;
  font-family: Georgia, "Times New Roman", serif;
  color: #111;
  line-height: 1.5;
}

.letter-brand {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 2px solid var(--navy);
  padding-bottom: 0.55rem;
  margin-bottom: 1rem;
  font-family: var(--font-body);
}

.letter-brand strong {
  color: var(--navy);
  font-size: 1.05rem;
}

.letter-brand span { color: var(--muted); font-size: 0.85rem; }
.letter-meta { color: #333; }
.letter-foot {
  margin-top: 1.4rem;
  padding-top: 0.7rem;
  border-top: 1px solid #ddd;
  font-size: 0.8rem;
  color: #666;
  font-family: var(--font-body);
}

.resource-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 0.9rem;
}

.resource-grid article {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1rem;
  background: linear-gradient(180deg, #fff, #f8fbff);
}

.resource-grid h3 {
  margin-top: 0;
  font-family: var(--font-display);
  font-size: 1.05rem;
  color: var(--navy);
}

.site-footer {
  margin-top: 2rem;
  background: var(--navy-deep);
  color: #d9e8f4;
  padding: 2rem 0;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 1.2rem;
}

.site-footer .brand {
  color: var(--sky);
  margin: 0 0 0.4rem;
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem 0.9rem;
}

.footer-nav a {
  color: #d9e8f4;
  text-decoration: none;
  font-size: 0.92rem;
}

.footer-nav a:hover { color: #fff; text-decoration: underline; }

.print-root { display: none; }

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid #38bdf8;
  outline-offset: 2px;
}

@media (max-width: 800px) {
  .header-inner { flex-direction: column; align-items: flex-start; }
  .two-col { columns: 1; }
  .footer-grid { grid-template-columns: 1fr; }
  .hero h1 { max-width: none; }
}

@media print {
  body * { visibility: hidden; }
  body.printing-letter .print-root,
  body.printing-letter .print-root * {
    visibility: visible;
  }
  body.printing-letter .print-root {
    display: block;
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    padding: 0;
    background: #fff;
  }
  .letter-sheet {
    border: none;
    box-shadow: none;
    max-width: none;
  }
}
