:root {
  color-scheme: light;
  --ink: #15282a;
  --muted: #526467;
  --subtle: #708083;
  --paper: #fbfaf6;
  --canvas: #f1f0e9;
  --panel: #ffffff;
  --line: #d8ddd9;
  --line-strong: #b9c5c1;
  --teal-950: #112c30;
  --teal-900: #173a3e;
  --teal-700: #26676b;
  --teal-600: #2e7f82;
  --teal-100: #d9eeeb;
  --teal-50: #eef8f6;
  --amber-700: #8e5c0c;
  --amber-100: #f7e6ba;
  --amber-50: #fff8e8;
  --code-bg: #102426;
  --code-ink: #e9f5f2;
  --focus: #006fd6;
  --sidebar-width: 19rem;
  --content-width: 51rem;
  --shadow: 0 18px 50px rgb(17 44 48 / 10%);
  --radius-lg: 1.25rem;
  --radius-md: 0.8rem;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  font-synthesis: none;
  line-height: 1.6;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 2rem;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at 85% 0%, rgb(217 238 235 / 60%), transparent 28rem),
    var(--canvas);
  color: var(--ink);
}

a {
  color: var(--teal-700);
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--teal-900);
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  z-index: 1000;
  top: 0.75rem;
  left: 0.75rem;
  padding: 0.65rem 0.85rem;
  border-radius: 0.5rem;
  background: var(--panel);
  box-shadow: var(--shadow);
  transform: translateY(-180%);
}

.skip-link:focus {
  transform: translateY(0);
}

.reading-progress {
  position: fixed;
  z-index: 100;
  inset: 0 0 auto;
  height: 3px;
  background: transparent;
}

.reading-progress span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--teal-600);
}

.page-shell {
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: relative;
  z-index: 20;
  background: var(--teal-950);
  color: #e6f0ee;
}

.sidebar-inner {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
  padding: 1.6rem 1.25rem 1rem;
  overflow-y: auto;
  scrollbar-color: #55787a transparent;
  scrollbar-width: thin;
}

.project-mark {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  color: #fff;
  text-decoration: none;
}

.project-mark:hover {
  color: #fff;
}

.project-mark-icon {
  display: grid;
  width: 2.6rem;
  height: 2.6rem;
  place-items: center;
  border: 1px solid rgb(255 255 255 / 24%);
  border-radius: 0.75rem;
  background: rgb(255 255 255 / 8%);
  color: #b9ebe5;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.project-mark strong,
.project-mark small {
  display: block;
}

.project-mark strong {
  line-height: 1.2;
}

.project-mark small {
  margin-top: 0.15rem;
  color: #a9c4c3;
  font-size: 0.78rem;
}

.sidebar-status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 1.4rem 0 1.1rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid rgb(255 255 255 / 12%);
  border-radius: 0.65rem;
  background: rgb(255 255 255 / 5%);
  color: #c7dad8;
  font-size: 0.78rem;
}

.status-dot {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: #64d6a5;
  box-shadow: 0 0 0 3px rgb(100 214 165 / 15%);
}

.toc h2 {
  margin: 0 0 0.55rem;
  color: #8eafae;
  font-size: 0.68rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.toc ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

.toc-item a {
  display: grid;
  grid-template-columns: 2.2rem minmax(0, 1fr);
  gap: 0.35rem;
  align-items: baseline;
  padding: 0.36rem 0.5rem;
  border-radius: 0.45rem;
  color: #b8cdcb;
  font-size: 0.79rem;
  line-height: 1.35;
  text-decoration: none;
}

.toc-item a:hover {
  background: rgb(255 255 255 / 7%);
  color: #fff;
}

.toc-item a.is-active {
  background: #24575b;
  color: #fff;
}

.toc-number {
  color: #78aaa7;
  font-variant-numeric: tabular-nums;
}

.toc-level-3 a {
  padding-left: 0.75rem;
  font-size: 0.74rem;
}

.toc-level-2:not(:first-child) {
  margin-top: 0.32rem;
}

.sidebar-footer {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: auto;
  padding: 1rem 0.45rem 0;
  border-top: 1px solid rgb(255 255 255 / 10%);
  color: #8eafae;
  font-size: 0.7rem;
}

.sidebar-footer strong {
  color: #c8dbd9;
  font-weight: 600;
}

.main {
  min-width: 0;
}

.hero,
.mapping-strip,
.guide,
.page-footer {
  width: min(calc(100% - 3rem), var(--content-width));
  margin-inline: auto;
}

.hero {
  padding: clamp(4rem, 8vw, 7.5rem) 0 3.25rem;
}

.hero-kicker,
.eyebrow {
  color: var(--teal-700);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hero h1 {
  max-width: 12ch;
  margin: 0.7rem 0 1rem;
  color: var(--teal-950);
  font-size: clamp(3rem, 7.2vw, 5.8rem);
  font-weight: 760;
  letter-spacing: -0.06em;
  line-height: 0.95;
}

.hero-deck {
  max-width: 44rem;
  margin: 0;
  color: var(--muted);
  font-size: clamp(1.05rem, 2vw, 1.28rem);
  line-height: 1.55;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 1.6rem;
}

.hero-meta span {
  padding: 0.38rem 0.65rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: rgb(255 255 255 / 48%);
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 650;
}

.decision-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.85fr);
  gap: 2rem;
  margin-top: 2rem;
  padding: 1.25rem 1.35rem;
  border: 1px solid #bbd7d3;
  border-radius: var(--radius-lg);
  background: var(--teal-50);
  box-shadow: 0 12px 35px rgb(17 44 48 / 7%);
}

.decision-label {
  display: block;
  margin-bottom: 0.35rem;
  color: var(--teal-700);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.decision-card strong {
  display: block;
  color: var(--teal-950);
  font-size: 1.03rem;
  line-height: 1.45;
}

.decision-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.decision-card code {
  padding: 0.1em 0.3em;
  border-radius: 0.3rem;
  background: rgb(17 44 48 / 9%);
  font-size: 0.9em;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-top: 1.35rem;
}

.button {
  display: inline-flex;
  min-height: 2.8rem;
  align-items: center;
  justify-content: center;
  padding: 0.72rem 1rem;
  border: 1px solid var(--line-strong);
  border-radius: 0.65rem;
  font-size: 0.84rem;
  font-weight: 720;
  text-decoration: none;
}

.button-primary {
  border-color: var(--teal-950);
  background: var(--teal-950);
  color: #fff;
}

.button-primary:hover {
  background: var(--teal-900);
  color: #fff;
}

.button-secondary {
  background: rgb(255 255 255 / 62%);
  color: var(--teal-900);
}

.button-secondary:hover {
  background: #fff;
}

.mapping-strip {
  padding: 1.4rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.mapping-strip > div:first-child {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.mapping-strip h2 {
  margin: 0;
  color: var(--teal-950);
  font-size: 1.05rem;
}

.mapping-strip dl {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 0.75rem;
}

.mapping-strip dl div {
  padding: 0.8rem;
  border-right: 1px solid var(--line);
  background: var(--paper);
}

.mapping-strip dl div:last-child {
  border-right: 0;
}

.mapping-strip dt {
  color: var(--subtle);
  font-size: 0.7rem;
  font-weight: 650;
}

.mapping-strip dd {
  margin: 0.22rem 0 0;
  color: var(--teal-950);
  font-size: 0.88rem;
  font-weight: 760;
}

.guide {
  padding: 3.5rem 0 5rem;
}

.guide h2,
.guide h3,
.guide h4 {
  color: var(--teal-950);
  line-height: 1.2;
}

.guide h2 {
  margin: 5rem 0 1.1rem;
  padding-top: 0.8rem;
  border-top: 1px solid var(--line-strong);
  font-size: clamp(1.9rem, 4vw, 2.6rem);
  letter-spacing: -0.035em;
}

.guide h2:first-child {
  margin-top: 0;
}

.guide h3 {
  margin: 2.8rem 0 0.85rem;
  font-size: 1.35rem;
  letter-spacing: -0.015em;
}

.guide h4 {
  margin: 2rem 0 0.65rem;
  font-size: 1.05rem;
}

.guide p,
.guide li {
  color: var(--ink);
}

.guide p {
  margin: 0.8rem 0;
}

.guide ul,
.guide ol {
  padding-left: 1.4rem;
}

.guide li {
  margin: 0.32rem 0;
  padding-left: 0.18rem;
}

.guide li::marker {
  color: var(--teal-600);
  font-weight: 700;
}

.guide strong {
  color: var(--teal-950);
}

.guide blockquote {
  margin: 1.25rem 0;
  padding: 0.9rem 1rem;
  border-left: 4px solid var(--amber-700);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  background: var(--amber-50);
  color: #664713;
}

.guide blockquote p {
  margin: 0;
}

.guide :not(pre) > code {
  padding: 0.12em 0.34em;
  border: 1px solid #c9d7d3;
  border-radius: 0.35rem;
  background: var(--teal-50);
  color: #174b4e;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.86em;
  overflow-wrap: anywhere;
}

.code-shell {
  position: relative;
  margin: 1.1rem 0 1.35rem;
  border: 1px solid #2e5153;
  border-radius: var(--radius-md);
  background: var(--code-bg);
  box-shadow: 0 12px 30px rgb(17 44 48 / 11%);
  overflow: hidden;
}

.code-shell pre {
  margin: 0;
  padding: 1.1rem 1rem;
  overflow-x: auto;
  background: transparent;
}

.code-shell code {
  color: var(--code-ink);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.8rem;
  line-height: 1.62;
  tab-size: 4;
}

.copy-button {
  position: absolute;
  z-index: 2;
  top: 0.55rem;
  right: 0.55rem;
  min-width: 4.3rem;
  padding: 0.42rem 0.62rem;
  border: 1px solid rgb(255 255 255 / 20%);
  border-radius: 0.45rem;
  background: #244649;
  color: #eef8f6;
  font: inherit;
  font-size: 0.7rem;
  font-weight: 750;
  cursor: pointer;
}

.copy-button:hover {
  background: #315b5f;
}

.copy-button.is-copied {
  background: #276c52;
}

.table-wrap {
  margin: 1.2rem 0 1.5rem;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--panel);
  box-shadow: 0 8px 24px rgb(17 44 48 / 5%);
}

.table-wrap table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
}

.table-wrap th,
.table-wrap td {
  min-width: 9rem;
  padding: 0.72rem 0.8rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.table-wrap th {
  background: var(--teal-50);
  color: var(--teal-950);
  font-size: 0.72rem;
  letter-spacing: 0.025em;
}

.table-wrap tr:last-child td {
  border-bottom: 0;
}

.guide input[type="checkbox"] {
  width: 1rem;
  height: 1rem;
  margin: 0 0.38rem 0 0;
  accent-color: var(--teal-600);
  vertical-align: -0.15em;
}

.copy-status {
  position: fixed;
  z-index: 200;
  right: 1rem;
  bottom: 1rem;
  max-width: min(22rem, calc(100vw - 2rem));
  padding: 0.7rem 0.9rem;
  border-radius: 0.6rem;
  background: var(--teal-950);
  color: #fff;
  box-shadow: var(--shadow);
  font-size: 0.8rem;
  opacity: 0;
  pointer-events: none;
  transform: translateY(0.5rem);
  transition: opacity 160ms ease, transform 160ms ease;
}

.copy-status.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.page-footer {
  display: flex;
  justify-content: space-between;
  gap: 2rem;
  align-items: center;
  padding: 1.5rem 0 3rem;
  border-top: 1px solid var(--line-strong);
  color: var(--muted);
  font-size: 0.78rem;
}

.page-footer p {
  max-width: 40rem;
  margin: 0;
}

.page-footer a {
  flex: 0 0 auto;
  font-weight: 750;
}

.toc-toggle,
.sidebar-scrim {
  display: none;
}

@media (max-width: 1120px) {
  :root {
    --sidebar-width: 17rem;
  }

  .hero,
  .mapping-strip,
  .guide,
  .page-footer {
    width: min(calc(100% - 2.2rem), var(--content-width));
  }
}

@media (max-width: 880px) {
  body.sidebar-open {
    overflow: hidden;
  }

  .page-shell {
    display: block;
  }

  .sidebar {
    position: fixed;
    z-index: 60;
    inset: 0 auto 0 0;
    width: min(21rem, calc(100vw - 3rem));
    transform: translateX(-105%);
    transition: transform 180ms ease;
  }

  .sidebar.is-open {
    transform: translateX(0);
  }

  .sidebar-scrim {
    position: fixed;
    z-index: 50;
    inset: 0;
    border: 0;
    background: rgb(8 24 27 / 60%);
  }

  .sidebar-scrim.is-visible {
    display: block;
  }

  .toc-toggle {
    position: fixed;
    z-index: 45;
    top: 0.8rem;
    left: 0.8rem;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    min-height: 2.65rem;
    padding: 0.58rem 0.75rem;
    border: 1px solid var(--line-strong);
    border-radius: 0.6rem;
    background: rgb(255 255 255 / 94%);
    color: var(--teal-950);
    box-shadow: 0 8px 24px rgb(17 44 48 / 13%);
    font: inherit;
    font-size: 0.78rem;
    font-weight: 750;
  }

  .hero {
    padding-top: 5.7rem;
  }

  .mapping-strip dl {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .mapping-strip dl div:nth-child(2) {
    border-right: 0;
  }

  .mapping-strip dl div:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }
}

@media (max-width: 620px) {
  .hero,
  .mapping-strip,
  .guide,
  .page-footer {
    width: min(calc(100% - 1.25rem), var(--content-width));
  }

  .hero h1 {
    font-size: clamp(2.8rem, 15vw, 4.2rem);
  }

  .decision-card {
    grid-template-columns: 1fr;
    gap: 0.7rem;
  }

  .hero-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .button {
    width: 100%;
  }

  .mapping-strip {
    padding: 1rem;
  }

  .mapping-strip > div:first-child {
    display: block;
  }

  .mapping-strip .eyebrow {
    display: block;
    margin-bottom: 0.25rem;
  }

  .mapping-strip dl {
    grid-template-columns: 1fr;
  }

  .mapping-strip dl div {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .mapping-strip dl div:last-child {
    border-bottom: 0;
  }

  .guide h2 {
    margin-top: 4rem;
    font-size: 1.9rem;
  }

  .guide h3 {
    font-size: 1.22rem;
  }

  .copy-button {
    position: relative;
    top: auto;
    right: auto;
    float: right;
    margin: 0.5rem 0.5rem 0;
  }

  .code-shell pre {
    clear: both;
    padding-top: 0.7rem;
  }

  .page-footer {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

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

@media print {
  .sidebar,
  .toc-toggle,
  .reading-progress,
  .hero-actions,
  .copy-button,
  .sidebar-scrim {
    display: none !important;
  }

  .page-shell {
    display: block;
  }

  .hero,
  .mapping-strip,
  .guide,
  .page-footer {
    width: 100%;
  }

  body {
    background: #fff;
  }

  .guide h2 {
    break-before: page;
  }

  .code-shell {
    break-inside: avoid;
  }
}
