:root {
  color-scheme: light;
  --paper: #f7f3ea;
  --paper-deep: #eee8dc;
  --ink: #15212a;
  --muted: #58656d;
  --line: #d8d0c2;
  --blue: #1859d1;
  --blue-dark: #0c3f9e;
  --blue-soft: #e7efff;
  --white: #fffdf8;
  --green: #166534;
  --orange: #9a4c08;
  --shadow: 0 18px 50px rgba(37, 47, 54, .08);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  line-height: 1.75;
}
a { color: var(--blue-dark); text-underline-offset: .18em; }
a:hover { color: var(--blue); }
button, input, textarea { font: inherit; }
button, .button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: .68rem 1rem;
  border: 1px solid var(--ink);
  border-radius: .45rem;
  color: var(--white);
  background: var(--ink);
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}
button:hover, .button:hover { color: var(--white); background: var(--blue-dark); border-color: var(--blue-dark); }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, [tabindex]:focus-visible {
  outline: 3px solid #ffb000;
  outline-offset: 3px;
}
.button.secondary { color: var(--ink); background: transparent; border-color: var(--line); }
.button.secondary:hover { color: var(--blue-dark); background: var(--blue-soft); border-color: var(--blue); }
.skip-link { position: fixed; z-index: 50; top: .5rem; left: .5rem; transform: translateY(-150%); }
.skip-link:focus { transform: none; }
.site-header {
  position: sticky;
  z-index: 20;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 64px;
  padding: .7rem clamp(1rem, 4vw, 4rem);
  border-bottom: 1px solid rgba(21, 33, 42, .12);
  background: rgba(247, 243, 234, .94);
  backdrop-filter: blur(12px);
}
.brand { color: var(--ink); font-weight: 850; text-decoration: none; letter-spacing: -.02em; }
.header-note { color: var(--muted); font-size: .82rem; }
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(260px, .65fr);
  gap: clamp(2rem, 6vw, 6rem);
  align-items: end;
  max-width: 1220px;
  margin: 0 auto;
  padding: clamp(4rem, 10vw, 8.5rem) clamp(1rem, 4vw, 4rem) 4rem;
}
.eyebrow { margin: 0 0 .75rem; color: var(--blue-dark); font-size: .78rem; font-weight: 850; letter-spacing: .13em; text-transform: uppercase; }
h1, h2, h3, h4 { line-height: 1.2; letter-spacing: -.025em; text-wrap: balance; }
h1 { max-width: 840px; margin: 0; font-family: Georgia, "Songti SC", serif; font-size: clamp(2.75rem, 7vw, 6.8rem); font-weight: 600; }
.hero-lead { max-width: 720px; margin: 1.4rem 0 0; color: #35434c; font-size: clamp(1.05rem, 2vw, 1.3rem); }
.hero-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.8rem; }
.proof-box { padding: 1.5rem; border-top: 4px solid var(--blue); background: var(--white); box-shadow: var(--shadow); }
.proof-box h2 { margin-top: 0; font-size: 1.15rem; }
.proof-list { padding: 0; margin: 1rem 0 0; list-style: none; }
.proof-list li { padding: .55rem 0; border-top: 1px solid var(--line); }
.status { display: inline-block; margin-right: .45rem; font-size: .75rem; font-weight: 850; }
.status.ok { color: var(--green); }
.status.wait { color: var(--orange); }
.flow-wrap { max-width: 1220px; margin: 0 auto 4rem; padding: 0 clamp(1rem, 4vw, 4rem); }
.flow {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr;
  gap: 1rem;
  align-items: center;
  padding: 1.2rem;
  border: 1px solid var(--line);
  background: var(--paper-deep);
}
.flow-node { padding: 1rem; background: var(--white); text-align: center; font-weight: 750; }
.flow-arrow { color: var(--blue); font-size: 1.5rem; font-weight: 900; }
.workspace {
  display: grid;
  grid-template-columns: minmax(240px, 290px) minmax(0, 1fr);
  max-width: 1440px;
  min-height: 75vh;
  margin: 0 auto;
  border-top: 1px solid var(--line);
}
.sidebar { position: sticky; top: 64px; align-self: start; max-height: calc(100vh - 64px); overflow: auto; padding: 2rem 1.4rem 3rem clamp(1rem, 4vw, 3rem); border-right: 1px solid var(--line); }
.sidebar h2 { margin: 0 0 1rem; font-size: .8rem; letter-spacing: .12em; text-transform: uppercase; }
.search-label { display: block; margin-bottom: .35rem; font-size: .82rem; font-weight: 750; }
.search { width: 100%; min-height: 44px; padding: .65rem .75rem; border: 1px solid #a9a296; border-radius: .35rem; background: var(--white); color: var(--ink); }
.search-results { padding: 0; margin: .65rem 0 1rem; list-style: none; }
.search-results a { display: block; padding: .6rem; border-bottom: 1px solid var(--line); font-size: .86rem; text-decoration: none; }
.doc-nav { display: grid; gap: .2rem; padding: 0; margin: 1rem 0 0; list-style: none; }
.doc-nav button { justify-content: flex-start; width: 100%; min-height: 40px; padding: .55rem .65rem; border: 0; border-radius: .25rem; color: var(--ink); background: transparent; font-size: .9rem; text-align: left; }
.doc-nav button:hover, .doc-nav button[aria-selected="true"] { color: var(--blue-dark); background: var(--blue-soft); }
.reading-pane { min-width: 0; padding: clamp(2rem, 5vw, 5rem) clamp(1rem, 7vw, 7rem) 6rem; background: var(--white); }
.document { display: none; max-width: 820px; margin: 0 auto; }
.document.active { display: block; }
.document > :first-child { margin-top: 0; }
.document h1 { margin: 0 0 1.5rem; font-family: Georgia, "Songti SC", serif; font-size: clamp(2.1rem, 5vw, 4rem); }
.document h2 { margin-top: 3rem; padding-top: 1rem; border-top: 1px solid var(--line); font-size: clamp(1.55rem, 3vw, 2.2rem); }
.document h3 { margin-top: 2rem; font-size: 1.3rem; }
.document img { max-width: 100%; height: auto; }
.document table { display: block; width: 100%; overflow-x: auto; border-collapse: collapse; }
.document th, .document td { padding: .6rem .75rem; border: 1px solid var(--line); text-align: left; }
.document blockquote { margin: 1.5rem 0; padding: .6rem 1.1rem; border-left: 4px solid var(--blue); color: #34434d; background: var(--blue-soft); }
.document code { padding: .15em .32em; border-radius: .2rem; background: var(--paper-deep); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .88em; }
.document pre { max-width: 100%; padding: 1rem; overflow-x: auto; border-radius: .35rem; color: #edf3f6; background: #15212a; }
.document pre code { padding: 0; color: inherit; background: transparent; }
.document a[href^="http"]::after { content: " ↗"; font-size: .75em; }
.toolbox { max-width: 1220px; margin: 0 auto; padding: 5rem clamp(1rem, 4vw, 4rem); }
.toolbox h2 { margin: 0; font-family: Georgia, "Songti SC", serif; font-size: clamp(2rem, 4vw, 3.5rem); }
.toolbox-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; margin-top: 2rem; }
.tool { min-width: 0; padding: 1.4rem; border-top: 3px solid var(--ink); background: var(--white); }
.tool h3 { margin-top: 0; }
.tool p { color: var(--muted); }
.local-note { margin: 1.5rem 0; padding: .75rem 1rem; border-left: 4px solid var(--orange); background: #fff4df; font-size: .9rem; }
.checklist { padding: 1rem; border: 1px solid var(--line); background: var(--white); }
.checklist label { display: flex; gap: .7rem; align-items: flex-start; padding: .6rem 0; border-top: 1px solid var(--line); }
.checklist label:first-of-type { border-top: 0; }
.checklist input { margin-top: .4rem; accent-color: var(--blue); }
.site-footer { padding: 2rem clamp(1rem, 4vw, 4rem); border-top: 1px solid var(--line); color: var(--muted); font-size: .88rem; }
.copy-fallback { width: min(640px, calc(100vw - 2rem)); padding: 1.2rem; border: 0; box-shadow: var(--shadow); }
.copy-fallback::backdrop { background: rgba(21, 33, 42, .65); }
.copy-fallback textarea { width: 100%; min-height: 220px; padding: .7rem; }
.dialog-actions { display: flex; justify-content: flex-end; margin-top: .75rem; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

@media (max-width: 800px) {
  .site-header { position: static; }
  .header-note { display: none; }
  .hero { grid-template-columns: 1fr; padding-top: 3.5rem; }
  .flow { grid-template-columns: 1fr; }
  .flow-arrow { transform: rotate(90deg); text-align: center; }
  .workspace { grid-template-columns: 1fr; }
  .sidebar { position: static; max-height: none; padding: 1.5rem 1rem; border-right: 0; border-bottom: 1px solid var(--line); }
  .doc-nav { display: flex; margin-inline: -1rem; padding-inline: 1rem; overflow-x: auto; scroll-snap-type: x mandatory; }
  .doc-nav li { flex: 0 0 auto; scroll-snap-align: start; }
  .doc-nav button { white-space: nowrap; }
  .reading-pane { padding-top: 2.5rem; }
  .toolbox-grid { grid-template-columns: 1fr; }
}

@media (max-width: 390px) {
  h1 { font-size: 2.5rem; overflow-wrap: anywhere; }
  .hero-actions, .tool .button, .tool button { width: 100%; }
  .hero-actions > * { width: 100%; }
  .proof-box, .tool { padding: 1rem; }
  .reading-pane { padding-inline: 1rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
}

.brand::before {
  content: "";
  width: 2rem;
  height: 2rem;
  flex: 0 0 auto;
  background: url("/favicon.svg") center / contain no-repeat;
}
