:root {
  color-scheme: light;
  --paper: #f7f5ed;
  --surface: #fcfbf7;
  --ink: #172f25;
  --muted: #526359;
  --green: #245845;
  --line: #d4d9cc;
  --light: #e6eee0;
  --sans: "Avenir Next", Avenir, system-ui, sans-serif;
  --serif: Georgia, "Times New Roman", serif;
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 16px/1.65 var(--sans); }
a { color: inherit; text-underline-offset: 4px; }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 3px solid #995128; outline-offset: 3px; }
section, main { scroll-margin-top: 90px; }
.skip { position: fixed; z-index: 5; top: 0; left: 0; padding: 10px 20px; background: white; transform: translateY(-120%); }
.skip:focus { transform: translateY(0); }
.topbar { height: 70px; position: sticky; top: 0; z-index: 3; background: var(--paper); border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; padding: 0 max(4vw, 24px); }
.brand, .download { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; font-weight: 700; }
.download { background: var(--green); color: white; padding: 8px 15px; border-radius: 7px; font-size: .86rem; }
.download:hover, .primary:hover { background: #163c2e; }
.mark { width: 29px; color: var(--green); display: grid; gap: 3px; align-content: center; }
.mark i { display: block; margin-inline: auto; height: 4px; border-radius: 8px; background: currentColor; width: 100%; }
.mark i:first-child { width: 58%; }
.mark i:nth-child(2) { width: 78%; }
.layout { width: min(100%, 1440px); margin: auto; display: grid; grid-template-columns: 210px minmax(0, 1fr); }
.sidebar { border-right: 1px solid var(--line); padding: 48px 21px 0 27px; }
.sidebar nav { position: sticky; top: 109px; display: grid; gap: 6px; }
.nav-label, .eyebrow, .diagram-label { font-family: var(--sans); font-size: .72rem; font-weight: 750; letter-spacing: .105em; text-transform: uppercase; }
.nav-label { color: var(--muted); margin: 0 0 8px 10px; }
.sidebar a { font-size: .9rem; font-weight: 600; text-decoration: none; padding: 5px 10px; border-radius: 5px; }
.sidebar a:hover { background: var(--light); }
main { min-width: 0; padding: 0 clamp(25px, 5vw, 78px); }
.eyebrow { color: var(--green); }
h1, h2, h3 { font-family: var(--serif); font-weight: normal; line-height: 1.1; letter-spacing: -.04em; }
h1 { margin: 10px 0 20px; font-size: clamp(2.35rem, 5vw, 5.1rem); }
h1 em { color: var(--green); font-weight: normal; }
h2 { margin: 0; font-size: clamp(2rem, 3.45vw, 3.45rem); }
h3 { font-size: 1.75rem; }
.primary { display: inline-flex; margin-top: 12px; align-items: center; gap: 13px; color: white; background: var(--green); padding: 10px 15px; border-radius: 7px; text-decoration: none; font-weight: 650; font-size: .87rem; }
.stack-figure { margin: 0; min-height: 318px; padding: 20px; border: 1px solid #d0d9c8; border-radius: 16px; background-color: var(--light); background-image: radial-gradient(#b6c8b3 1px, transparent 1px); background-size: 13px 13px; }
.diagram-label { width: fit-content; background: var(--light); }
.stack { display: grid; justify-items: center; gap: 5px; padding: 22px 4px; }
.stack span { width: min(96%, 228px); transform: translateX(var(--offset)); padding: 5px 12px; background: var(--surface); border: 1px solid #8ea48d; border-radius: 6px; font-size: .83rem; font-weight: 680; box-shadow: 3px 3px #c2cfbc; }
.stack b { margin-right: 10px; color: #526359; font: 600 .72rem ui-monospace, monospace; }
.stack span:nth-child(1) { --offset: -17px; }
.stack span:nth-child(2) { --offset: -8px; background: #f1f4e8; }
.stack span:nth-child(3) { --offset: 0px; background: #d6e5d4; }
.section { padding: 38px 0 47px; border-top: 1px solid var(--line); }
.section-head { margin-bottom: 21px; }
.section-head p { margin: 8px 0 0; color: var(--muted); }
.layer-browser { display: grid; grid-template-columns: 1.3fr 1fr; gap: 17px; }
.layer-buttons { display: grid; gap: 6px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.layer-buttons button { display: flex; align-items: baseline; text-align: left; gap: 9px; border: 1px solid var(--line); background: var(--surface); border-radius: 6px; padding: 8px 10px; font-size: .83rem; line-height: 1.45; font-weight: 650; }
.layer-buttons button span { font: 500 .74rem ui-monospace, monospace; }
.layer-buttons button:hover, .switch button:hover { background: var(--light); }
.layer-buttons button[aria-pressed="true"], .switch button[aria-pressed="true"] { background: var(--green); border-color: var(--green); color: white; }
.layer-detail { background: var(--light); border: 1px solid #d0d9c8; border-radius: 12px; padding: 17px 22px; }
.layer-detail h3 { margin: 6px 0; }
.layer-detail p { margin: 4px 0 8px; }
.check { border-top: 1px solid #abbda9; margin-top: 14px; padding-top: 10px; }
.failover-panel { border: 1px solid var(--line); border-radius: 14px; padding: 19px; background: var(--surface); text-align: center; }
.switch { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.switch button { border: 1px solid var(--line); border-radius: 7px; padding: 6px 12px; background: var(--paper); font-weight: 650; font-size: .85rem; }
.flow { max-width: 590px; margin: 21px auto 12px; display: grid; justify-items: center; gap: 4px; }
.node { background: var(--light); border: 1px solid #aabca8; border-radius: 8px; padding: 8px 12px; width: min(100%, 310px); }
.node strong, .node small { display: block; }
.node small { color: var(--muted); }
.arrow { line-height: 1.4; color: var(--green); }
.branches { display: grid; width: min(100%, 400px); grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.branches .node { background: var(--paper); border-color: var(--line); }
.flow[data-active="primary"] .primary-node, .flow[data-active="backup"] .backup-node { background: var(--green); color: white; border-color: var(--green); }
.flow[data-active="primary"] .primary-node small, .flow[data-active="backup"] .backup-node small { color: white; }
.flow[data-active="backup"] .primary-node { background: #f7eadb; border-color: #caa988; }
#flow-note { color: var(--muted); margin: 16px auto 0; max-width: 62ch; }
.prose > p, .prose > ul { max-width: 72ch; }
.prose h3, .prose h4 { margin: 24px 0 8px; }
.prose h4 { font: normal 1.5rem/1.15 var(--serif); }
.prose ul { padding-left: 21px; }
.prose li { margin: 5px 0; }
.example { display: flex; gap: 13px; align-items: center; justify-content: space-between; border-radius: 8px; padding: 13px; background: var(--light); }
.example code { font-size: .85rem; }
.example button { flex-shrink: 0; border: 1px solid #aabca8; background: var(--surface); border-radius: 6px; padding: 6px 10px; font-size: .83rem; }
.skill-doc { margin-top: 24px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: clamp(14px, 3vw, 36px); }
.skill-doc h3:first-child { margin-top: 0; }
table { border-collapse: collapse; width: 100%; font-size: .93rem; }
th, td { border-bottom: 1px solid var(--line); padding: 10px; text-align: left; vertical-align: top; overflow-wrap: break-word; }
th { background: var(--light); }
td:first-child { font-weight: 670; width: 24%; }
footer { border-top: 1px solid var(--line); color: var(--muted); display: flex; justify-content: space-between; gap: 10px; padding: 20px 0 26px; font-size: .85rem; }
@media (max-width: 1000px) {
  .layout { grid-template-columns: 155px minmax(0, 1fr); }
  .sidebar { padding-left: 12px; padding-right: 10px; }
  main { padding-inline: 25px; }
}
@media (max-width: 800px) {
  .layout { display: block; }
  .sidebar { padding: 9px 20px; border-right: 0; border-bottom: 1px solid var(--line); }
  .sidebar nav { position: static; display: flex; align-items: center; flex-wrap: wrap; }
  .nav-label { margin: 0 4px; }
  .sidebar a { padding: 2px 5px; font-size: .82rem; }
}
@media (max-width: 580px) {
  .topbar { padding-inline: 15px; gap: 8px; height: 60px; }
  .brand { gap: 7px; font-size: .86rem; line-height: 1.2; }
  .mark { width: 18px; flex: 0 0 18px; }
  .download { gap: 6px; padding: 7px 8px; font-size: .75rem; flex-shrink: 0; }
  main { padding-inline: 16px; }
  .layer-browser { grid-template-columns: 1fr; }
  .stack-figure { min-height: 0; }
  .section { padding: 28px 0 34px; }
  .example { align-items: flex-start; flex-direction: column; }
  th, td { padding: 8px 5px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
[hidden] { display: none !important; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.toplink { color: var(--green); font-size: .87rem; font-weight: 700; text-decoration: none; white-space: nowrap; }
.toplink span, .card-actions span { margin-left: .35em; }
.toplink:hover, .card-actions a:hover, .skill-card h3 a:hover { text-decoration: underline; }
.catalog { max-width: 1230px; margin-inline: auto; }
.catalog-hero { min-height: 380px; display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(250px, .85fr); align-items: center; gap: 34px; padding: 48px 0 44px; }
.catalog-hero p { margin: 0; color: var(--muted); max-width: 42ch; }
.library-figure { min-height: 0; padding: 22px; }
.library-figure .stack { padding: 23px 4px 11px; }
.library-figure .stack span:last-child { --offset: 10px; background: var(--green); color: white; }
.library-figure .stack span:last-child b { color: white; }
.catalog-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; }
.search { display: grid; gap: 4px; font-size: .83rem; font-weight: 680; width: min(100%, 280px); }
.search input { width: 100%; min-height: 41px; border-radius: 7px; border: 1px solid #9cab9b; padding: 6px 10px; background: var(--surface); color: var(--ink); font: inherit; font-weight: 500; }
.skill-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 275px), 1fr)); gap: 14px; }
.skill-card { display: flex; flex-direction: column; padding: 20px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.skill-card > p { margin: 0 0 12px; color: var(--muted); }
.skill-card .eyebrow { letter-spacing: .04em; text-transform: none; }
.skill-card h3 { margin: 0 0 9px; }
.skill-card h3 a { text-decoration: none; }
.card-actions { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; border-top: 1px solid var(--line); margin-top: auto; padding-top: 10px; }
.card-actions a { font-size: .85rem; color: var(--green); font-weight: 700; text-decoration: none; }
.skill-intro { padding: 38px 0 34px; }
.skill-intro h1 { margin-bottom: 10px; }
.skill-intro p:not(.eyebrow) { color: var(--muted); max-width: 65ch; }
.skill-intro .eyebrow { text-transform: none; }
.prose img { max-width: 100%; height: auto; }
.prose pre { overflow-x: auto; padding: 12px; background: var(--light); }
.prose a { overflow-wrap: anywhere; }
@media (max-width: 580px) {
  .catalog-hero { min-height: 0; grid-template-columns: 1fr; gap: 20px; padding: 32px 0; }
  .catalog-head { align-items: stretch; flex-direction: column; }
  .search { width: 100%; }
}
