:root {
  color-scheme: light;
  --paper: #f4f0e7;
  --paper-deep: #e8e0d1;
  --ink: #132238;
  --ink-soft: #3f4d5f;
  --teal: #0b6865;
  --teal-soft: #d9ece8;
  --amber: #a85f00;
  --amber-soft: #f5e3bd;
  --red: #a63e37;
  --red-soft: #f4dbd7;
  --white: #fffdf8;
  --line: #cfc5b3;
  --shadow: 0 18px 60px rgb(19 34 56 / 10%);
  --radius: 1.25rem;
  --sans: Inter, Aptos, "Segoe UI", system-ui, -apple-system, sans-serif;
  --serif: Fraunces, Iowan Old Style, Palatino Linotype, Book Antiqua, Georgia, serif;
  --mono: "JetBrains Mono", "Cascadia Code", Consolas, monospace;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--paper);
  color: var(--ink);
  scroll-behavior: smooth;
  scroll-padding-top: 6rem;
}

body {
  margin: 0;
  min-width: 280px;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 4% 12%, rgb(11 104 101 / 8%), transparent 26rem),
    linear-gradient(90deg, transparent 0, transparent calc(100% - 1px), rgb(19 34 56 / 3%) calc(100% - 1px)) 0 0 / 32px 32px,
    var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.68;
  -webkit-font-smoothing: antialiased;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180' viewBox='0 0 180 180'%3E%3Cfilter id='n'%3E%3CfeTurbulence baseFrequency='.72' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.025'/%3E%3C/svg%3E");
  content: "";
  pointer-events: none;
}

a {
  color: var(--teal);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.18em;
}

a:hover {
  color: #064c4a;
}

a:focus-visible,
button:focus-visible,
summary:focus-visible,
[tabindex="0"]:focus-visible {
  outline: 3px solid #006e68;
  outline-offset: 4px;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

button,
input,
textarea,
select {
  font: inherit;
}

.skip-link {
  position: fixed;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 100;
  padding: 0.75rem 1rem;
  transform: translateY(-180%);
  border-radius: 0.5rem;
  background: var(--ink);
  color: white;
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  border-bottom: 1px solid rgb(19 34 56 / 14%);
  background: rgb(244 240 231 / 94%);
  backdrop-filter: blur(16px);
}

.header-inner {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  width: min(94%, 1380px);
  min-height: 5rem;
  margin: 0 auto;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--ink);
  font-size: 0.79rem;
  font-weight: 550;
  line-height: 1.02;
  letter-spacing: 0.04em;
  text-decoration: none;
  text-transform: uppercase;
}

.brand strong {
  color: var(--teal);
  font-weight: 800;
}

.brand-mark {
  display: grid;
  grid-template-columns: repeat(3, 0.28rem);
  align-items: end;
  gap: 0.18rem;
  width: 1.1rem;
  height: 1.5rem;
}

.brand-mark i {
  display: block;
  height: 55%;
  border-radius: 999px;
  background: var(--teal);
}

.brand-mark i:nth-child(2) {
  height: 100%;
  background: var(--amber);
}

.brand-mark i:nth-child(3) {
  height: 74%;
  background: var(--red);
}

.desktop-nav {
  display: flex;
  justify-content: center;
  gap: clamp(1rem, 2.6vw, 2.6rem);
}

.desktop-nav a,
.help-link {
  padding: 0.75rem 0;
  color: var(--ink);
  font-size: 0.91rem;
  font-weight: 720;
  text-decoration: none;
}

.desktop-nav a:hover,
.help-link:hover {
  color: var(--teal);
}

.help-link {
  position: relative;
  padding-right: 1.35rem;
}

.help-link::after {
  position: absolute;
  top: 50%;
  right: 0;
  width: 0.6rem;
  height: 0.6rem;
  transform: translateY(-50%);
  border-radius: 50%;
  background: var(--red);
  content: "";
}

.menu-button {
  display: none;
  min-width: 2.75rem;
  min-height: 2.75rem;
  padding: 0.7rem;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
}

.menu-button span {
  display: block;
  width: 1.1rem;
  height: 2px;
  margin: 0.22rem auto;
  background: var(--ink);
}

.mobile-menu {
  width: min(100%, 34rem);
  max-width: none;
  height: 100dvh;
  max-height: none;
  margin: 0 0 0 auto;
  padding: 1.25rem;
  border: 0;
  background: var(--paper);
  color: var(--ink);
}

.mobile-menu::backdrop {
  background: rgb(19 34 56 / 60%);
}

.mobile-menu-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--line);
}

.menu-title {
  font-family: var(--serif);
  font-size: 1.35rem;
  font-weight: 700;
}

.menu-close {
  min-height: 2.75rem;
  padding: 0.5rem 0.9rem;
  border: 1px solid var(--ink);
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
}

.mobile-menu nav {
  display: grid;
  gap: 0.75rem;
  padding: 1.5rem 0;
}

.mobile-nav-card {
  display: grid;
  gap: 0.25rem;
  min-height: 5.5rem;
  padding: 1rem 3rem 1rem 1rem;
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: var(--white);
  color: var(--ink);
  text-decoration: none;
}

.mobile-nav-card span {
  font-family: var(--serif);
  font-size: 1.35rem;
  font-weight: 700;
}

.mobile-nav-card small {
  color: var(--ink-soft);
}

.mobile-support {
  margin-top: auto;
  padding: 1.15rem;
  border-left: 4px solid var(--red);
  background: var(--red-soft);
}

.mobile-support p {
  margin: 0 0 0.3rem;
  font-weight: 700;
}

main {
  display: block;
  width: min(94%, 1380px);
  margin: 0 auto;
}

.home-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(20rem, 0.95fr);
  min-height: calc(100dvh - 5rem);
  padding: clamp(3.5rem, 8vw, 8rem) 0 clamp(3rem, 6vw, 6rem);
  gap: clamp(2.5rem, 7vw, 7rem);
  align-items: center;
}

.eyebrow,
.panel-label,
.rail-label {
  margin: 0 0 1rem;
  color: var(--teal);
  font-family: var(--mono);
  font-size: 0.76rem;
  font-weight: 750;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

h1,
h2,
h3,
h4 {
  color: var(--ink);
  font-family: var(--serif);
  font-weight: 720;
  line-height: 1.08;
  text-wrap: balance;
}

h1 {
  max-width: 16ch;
  margin: 0;
  font-size: clamp(3rem, 6vw, 6.7rem);
  letter-spacing: -0.045em;
}

h2 {
  margin: 4.2rem 0 1.25rem;
  font-size: clamp(2rem, 3.4vw, 3.2rem);
  letter-spacing: -0.026em;
}

h3 {
  margin: 2.5rem 0 0.75rem;
  font-size: clamp(1.35rem, 2.2vw, 1.85rem);
}

.lede {
  max-width: 64ch;
  margin: 1.65rem 0 0;
  color: #29384b;
  font-size: clamp(1.12rem, 1.5vw, 1.36rem);
  line-height: 1.58;
}

.hero-copy .lede {
  max-width: 56ch;
}

.route-map {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin-top: clamp(2.5rem, 5vw, 5rem);
}

.route-map::before {
  position: absolute;
  top: 1.03rem;
  right: 10%;
  left: 10%;
  height: 2px;
  background: var(--line);
  content: "";
}

.route-map a {
  position: relative;
  z-index: 1;
  display: grid;
  justify-items: start;
  gap: 0.25rem;
  color: var(--ink);
  text-decoration: none;
}

.route-map a span {
  display: grid;
  width: 2.1rem;
  height: 2.1rem;
  margin-bottom: 0.65rem;
  place-items: center;
  border: 2px solid var(--teal);
  border-radius: 50%;
  background: var(--paper);
  color: var(--teal);
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 800;
}

.route-map a strong {
  font-size: 0.88rem;
}

.route-map a small {
  color: var(--ink-soft);
  font-size: 0.72rem;
}

.route-map a:hover span {
  background: var(--teal);
  color: white;
}

.diagnostic {
  position: relative;
  overflow: hidden;
  padding: clamp(1.5rem, 3.5vw, 2.7rem);
  border: 1px solid #1d3450;
  border-radius: 1.6rem;
  background: var(--ink);
  box-shadow: var(--shadow);
  color: #eef4f6;
}

.diagnostic::before {
  position: absolute;
  top: -5rem;
  right: -5rem;
  width: 13rem;
  height: 13rem;
  border: 1px solid rgb(217 145 36 / 50%);
  border-radius: 50%;
  content: "";
}

.diagnostic .panel-label {
  color: #83d3cd;
}

.diagnostic h2 {
  max-width: 12ch;
  margin: 0 0 1rem;
  color: white;
  font-size: clamp(2rem, 3vw, 3rem);
}

.diagnostic > p:not(.panel-label, .diagnostic-foot) {
  color: #cbd8df;
}

.status-list {
  display: grid;
  margin-top: 1.5rem;
  border-top: 1px solid rgb(255 255 255 / 18%);
}

.status-list a {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  min-height: 5.2rem;
  gap: 0.8rem;
  border-bottom: 1px solid rgb(255 255 255 / 18%);
  color: white;
  text-decoration: none;
}

.status-list a:hover strong {
  color: #88ddd5;
}

.status-list span:nth-child(2) {
  display: grid;
}

.status-list small {
  color: #b6c5cd;
  font-size: 0.77rem;
}

.status-dot {
  width: 0.72rem;
  height: 0.72rem;
  border-radius: 50%;
}

.status-dot.red { background: #e17168; }
.status-dot.amber { background: #f4b548; }
.status-dot.teal { background: #4cc0b8; }

.diagnostic-foot {
  margin: 1.25rem 0 0;
  color: #b6c5cd;
  font-family: var(--mono);
  font-size: 0.69rem;
}

.home-content {
  max-width: 70rem;
  margin: 0 auto;
  padding: 0 0 3rem;
}

.page-frame {
  display: grid;
  grid-template-columns: minmax(0, 52rem) minmax(14rem, 19rem);
  justify-content: center;
  gap: clamp(3rem, 7vw, 7rem);
  padding: 2rem 0 6rem;
}

.breadcrumbs {
  margin: 1rem 0 4rem;
}

.breadcrumbs ol {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.breadcrumbs li {
  color: var(--ink-soft);
  font-family: var(--mono);
  font-size: 0.72rem;
}

.breadcrumbs li + li::before {
  margin-right: 0.45rem;
  color: #7e786d;
  content: "/";
}

.breadcrumbs a {
  color: var(--teal);
}

.article-hero {
  padding-bottom: 2.5rem;
  border-bottom: 1px solid var(--line);
}

.article-hero h1 {
  max-width: 17ch;
  font-size: clamp(2.75rem, 5.2vw, 5.3rem);
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 2rem;
}

.article-meta span {
  padding: 0.38rem 0.65rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink-soft);
  font-family: var(--mono);
  font-size: 0.67rem;
  line-height: 1.3;
}

.context-rail {
  position: sticky;
  top: 7rem;
  align-self: start;
  margin-top: 12rem;
  padding: 1.4rem;
  border-top: 3px solid var(--teal);
  background: rgb(255 253 248 / 70%);
}

.context-rail dl {
  margin: 0;
}

.context-rail dl div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--line);
}

.context-rail dt,
.context-rail dd {
  margin: 0;
  font-size: 0.8rem;
}

.context-rail dt { color: var(--ink-soft); }
.context-rail dd { font-weight: 750; text-align: right; }

.context-rail code {
  font-family: var(--mono);
  font-size: 0.71rem;
}

.context-rail > a {
  display: flex;
  justify-content: space-between;
  margin-top: 1.2rem;
  font-size: 0.82rem;
  font-weight: 750;
}

.article-body {
  color: #29384b;
}

.article-body > p,
.article-body > ul,
.article-body > ol,
.article-body > blockquote {
  max-width: 68ch;
}

.article-body p {
  margin: 1.05rem 0;
}

.article-body ul,
.article-body ol {
  padding-left: 1.35rem;
}

.article-body li {
  margin: 0.6rem 0;
  padding-left: 0.25rem;
}

.article-body li::marker {
  color: var(--teal);
  font-weight: 800;
}

.article-body a {
  font-weight: 650;
}

.article-body code {
  font-family: var(--mono);
  font-size: 0.88em;
}

.answer-block {
  margin: 2rem 0;
  padding: 1.2rem 1.4rem;
  border-left: 4px solid var(--teal);
  background: var(--teal-soft);
  color: var(--ink);
}

.answer-block p {
  margin: 0;
}

.toc {
  margin: 2rem 0 3rem;
  padding: 1.25rem 1.4rem;
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: rgb(255 253 248 / 66%);
}

.toc p {
  margin: 0 0 0.75rem;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.toc ol {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.45rem 2rem;
  margin: 0;
  padding-left: 1.2rem;
}

.toc li {
  margin: 0;
  font-size: 0.82rem;
}

.visual-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 3rem 0 2rem;
  gap: 1rem;
}

.visual-pair figure {
  overflow: hidden;
  margin: 0;
  border-radius: var(--radius);
  background: var(--paper-deep);
}

.visual-pair figure:only-child {
  grid-column: 1 / -1;
}

.visual-pair img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.visual-pair figcaption {
  padding: 0.75rem 0.9rem 0.9rem;
  color: var(--ink-soft);
  font-size: 0.72rem;
  line-height: 1.4;
}

.table-scroll {
  max-width: 100%;
  margin: 1.5rem 0 2.5rem;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 0.9rem;
  background: var(--white);
  -webkit-overflow-scrolling: touch;
}

table {
  width: 100%;
  min-width: 38rem;
  border-collapse: collapse;
  color: var(--ink);
  font-size: 0.87rem;
  line-height: 1.45;
}

caption {
  padding: 0.8rem 1rem;
  border-bottom: 1px solid var(--line);
  color: var(--ink-soft);
  font-family: var(--mono);
  font-size: 0.7rem;
  text-align: left;
  text-transform: uppercase;
}

th,
td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid #ded7ca;
  text-align: left;
  vertical-align: top;
}

thead th {
  background: var(--ink);
  color: white;
  font-size: 0.76rem;
  letter-spacing: 0.02em;
}

tbody th {
  position: sticky;
  left: 0;
  background: var(--white);
  color: var(--teal);
}

tbody tr:last-child th,
tbody tr:last-child td {
  border-bottom: 0;
}

.checklist {
  padding: 1rem 1.2rem !important;
  border: 1px solid var(--line);
  border-radius: 0.9rem;
  background: var(--white);
  list-style: none;
}

.checklist li {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.65rem;
}

.check-mark {
  color: var(--teal);
  font-family: var(--mono);
  font-weight: 800;
}

.related {
  padding: clamp(3rem, 6vw, 6rem) 0;
  border-top: 1px solid var(--line);
}

.related > div:first-child {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
}

.related h2 {
  margin: 0 0 1.5rem;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.85rem;
}

.related-card {
  position: relative;
  display: grid;
  align-content: space-between;
  min-height: 14rem;
  padding: 1.2rem;
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: rgb(255 253 248 / 70%);
  color: var(--ink);
  text-decoration: none;
}

.related-card:hover {
  transform: translateY(-3px);
  border-color: var(--teal);
  color: var(--ink);
}

.related-card span {
  color: var(--teal);
  font-family: var(--mono);
  font-size: 0.68rem;
  text-transform: uppercase;
}

.related-card strong {
  align-self: center;
  font-family: var(--serif);
  font-size: 1.28rem;
  line-height: 1.2;
}

.related-card i {
  justify-self: end;
  font-size: 1.4rem;
  font-style: normal;
}

.site-footer {
  margin-top: 3rem;
  padding: clamp(3rem, 6vw, 6rem) max(3%, calc((100% - 1297px) / 2));
  background: var(--ink);
  color: #c9d4dc;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.35fr 1fr 1fr 0.7fr;
  gap: clamp(2rem, 6vw, 6rem);
}

.brand-footer {
  color: white;
}

.footer-grid > div p {
  max-width: 30ch;
  font-size: 0.86rem;
}

.footer-grid nav {
  display: grid;
  align-content: start;
  gap: 0.5rem;
}

.footer-grid h2 {
  margin: 0 0 0.6rem;
  color: #8ea0ad;
  font-family: var(--mono);
  font-size: 0.69rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.footer-grid nav a {
  color: #e7eef2;
  font-size: 0.82rem;
  text-decoration: none;
}

.footer-grid nav a:hover {
  color: #85d8d1;
  text-decoration: underline;
}

.footer-note {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 4rem;
  padding-top: 1.2rem;
  border-top: 1px solid rgb(255 255 255 / 15%);
  color: #9aabb6;
  font-family: var(--mono);
  font-size: 0.66rem;
}

.error-page main {
  min-height: 65vh;
}

.error-card {
  max-width: 55rem;
  margin: 0 auto;
  padding: clamp(5rem, 11vw, 10rem) 0;
}

.error-card h1 {
  font-size: clamp(3rem, 7vw, 7rem);
}

.error-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 2rem;
}

.error-links a {
  min-height: 2.75rem;
  padding: 0.65rem 1rem;
  border: 1px solid var(--ink);
  border-radius: 999px;
  color: var(--ink);
  font-weight: 750;
  text-decoration: none;
}

@media (max-width: 1050px) {
  .home-hero {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .hero-copy h1 {
    max-width: 14ch;
  }

  .diagnostic {
    max-width: 50rem;
  }

  .page-frame {
    grid-template-columns: minmax(0, 52rem);
  }

  .context-rail {
    position: static;
    margin-top: 0;
  }

  .related-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  .header-inner {
    grid-template-columns: auto 1fr auto;
  }

  .desktop-nav,
  .help-link {
    display: none;
  }

  .menu-button {
    display: block;
    grid-column: 3;
  }

  .route-map {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem 0;
  }

  .route-map::before {
    display: none;
  }

  .route-map a {
    padding-right: 1rem;
  }

  .visual-pair,
  .toc ol {
    grid-template-columns: 1fr;
  }

  .footer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  body {
    font-size: 0.96rem;
  }

  .header-inner,
  main {
    width: min(92%, 1380px);
  }

  .home-hero {
    padding-top: 3.2rem;
    gap: 2.2rem;
  }

  h1 {
    font-size: clamp(2.7rem, 14vw, 4rem);
  }

  .article-hero h1 {
    font-size: clamp(2.5rem, 12vw, 3.7rem);
  }

  h2 {
    margin-top: 3.2rem;
    font-size: 2rem;
  }

  .route-map a small {
    max-width: 12ch;
  }

  .diagnostic {
    padding: 1.35rem;
    border-radius: 1.2rem;
  }

  .status-list a {
    min-height: 5.6rem;
  }

  .breadcrumbs {
    margin-bottom: 2.5rem;
  }

  .article-meta {
    align-items: flex-start;
  }

  .visual-pair {
    margin-top: 2rem;
  }

  .table-scroll {
    margin-right: -4%;
    margin-left: -4%;
    border-right: 0;
    border-left: 0;
    border-radius: 0;
  }

  .related-grid,
  .footer-grid {
    grid-template-columns: 1fr;
  }

  .related-card {
    min-height: 11rem;
  }

  .footer-note {
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: no-preference) {
  a,
  button,
  .related-card,
  .route-map a span {
    transition: color 180ms ease, background-color 180ms ease, border-color 180ms ease, transform 180ms ease;
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

@media print {
  .site-header,
  .site-footer,
  .related,
  .context-rail,
  .toc { display: none !important; }

  body { background: white; color: black; }
  main { width: 100%; }
  a { color: black; }
  .page-frame { display: block; }
}
