:root {
  color-scheme: light;
  --paper: #f7f8f4;
  --sheet: #ffffff;
  --ink: #17201e;
  --muted: #65706c;
  --blue: #185adb;
  --blue-dark: #1046ad;
  --blue-wash: #e9f0ff;
  --coral: #e85d4a;
  --rule: #d8deda;
  --content: 1600px;
  --sans: "DM Sans", sans-serif;
  --serif: "Newsreader", serif;
  --mono: "IBM Plex Mono", monospace;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #111513;
  --sheet: #191e1b;
  --ink: #f1f4ef;
  --muted: #a6b0aa;
  --blue: #6f9dff;
  --blue-dark: #a9c3ff;
  --blue-wash: #202d48;
  --coral: #ff8170;
  --rule: #343c37;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  overflow-wrap: break-word;
}

button, input, textarea { font: inherit; }
button, a, summary, label { touch-action: manipulation; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .44; }
a { color: inherit; text-underline-offset: .2em; }

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

.skip-link {
  position: fixed;
  z-index: 20;
  top: 12px;
  left: 12px;
  padding: 10px 14px;
  background: var(--ink);
  color: white;
  transform: translateY(-150%);
}
.skip-link:focus { transform: translateY(0); }

.site-header, main, .site-footer {
  width: min(calc(100% - 40px), var(--content));
  margin-inline: auto;
}

.site-header {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--rule);
}

.wordmark { display: inline-flex; align-items: center; gap: 11px; font-weight: 700; text-decoration: none; }
.wordmark-mark { display: grid; gap: 3px; width: 20px; }
.wordmark-mark i { display: block; height: 2px; background: var(--ink); }
.wordmark-mark i:nth-child(2) { width: 13px; background: var(--coral); }
.wordmark-mark i:nth-child(3) { width: 17px; }
.theme-switch { display: inline-grid; grid-template-columns: repeat(2, 1fr); padding: 3px; border: 1px solid var(--rule); background: var(--sheet); }
.theme-switch button { min-width: 62px; min-height: 31px; padding: 5px 10px; border: 0; background: transparent; color: var(--muted); font-family: var(--mono); font-size: .65rem; font-weight: 500; text-transform: uppercase; }
.theme-switch button[aria-pressed="true"] { background: var(--blue); color: #fff; }
.theme-switch button:focus-visible { position: relative; z-index: 1; outline-offset: 1px; }

.intro { padding: 46px 0 28px; animation: enter .55s ease-out both; }
.eyebrow, .section-index {
  margin: 0 0 13px;
  color: var(--blue);
  font-family: var(--mono);
  font-size: .72rem;
  font-weight: 500;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.intro-grid { display: grid; grid-template-columns: minmax(620px, 1.08fr) minmax(460px, .92fr); align-items: stretch; gap: clamp(42px, 4vw, 64px); }
h1, h2, h3, p { overflow-wrap: break-word; }
h1, h2 { text-wrap: balance; }
h1 { margin: 0; max-width: 940px; font-family: var(--serif); font-weight: 600; letter-spacing: 0; text-wrap: pretty; }
h1 > .title-main { display: flex; flex-direction: column; gap: 13px; font-size: clamp(4.2rem, 6.4vw, 6.25rem); line-height: .78; }
h1 > .title-main > span { display: block; }
h1 em { display: block; margin-top: 18px; color: var(--blue); font-size: clamp(1.8rem, 2.5vw, 2.55rem); line-height: 1; font-weight: 500; white-space: nowrap; }
.intro-side { min-width: 0; display: flex; flex-direction: column; justify-content: space-between; padding-top: 10px; }
.intro-side > p { max-width: 650px; margin: 0; color: var(--muted); font-size: 1.02rem; text-wrap: pretty; }
.hero-proof { position: relative; width: min(100%, 620px); margin: 20px 0 0; background: transparent; }
.hero-proof p { margin: 0; }
.proof-compare { display: grid; grid-template-columns: minmax(0, 1fr) 54px minmax(0, 1fr); align-items: stretch; min-height: 108px; }
.proof-state { display: block; min-width: 0; padding: 17px 18px 16px; }
.proof-state > p { color: var(--muted); font-family: var(--mono); font-size: .61rem; font-weight: 500; letter-spacing: .06em; text-transform: uppercase; }
.proof-state > p span { display: inline; margin-right: 7px; color: var(--coral); font-weight: 700; }
.proof-state code { display: block; min-width: 0; margin-top: 12px; color: var(--ink); font-family: var(--mono); font-size: .86rem; line-height: 1.65; overflow-wrap: anywhere; }
.proof-broken { background: #fff1ee; }
.proof-broken code { color: #5e6864; }
.proof-underline { display: inline; padding-bottom: 2px; background-repeat: repeat-x; background-position: 0 100%; background-size: 8px 2px; }
.proof-broken .proof-underline { background-image: linear-gradient(100deg, transparent 0 8%, var(--coral) 9% 82%, transparent 84% 100%); }
.proof-clean .proof-underline { background-image: linear-gradient(100deg, transparent 0 6%, var(--blue) 7% 86%, transparent 88% 100%); }
.proof-join { display: grid; place-items: center; color: var(--blue); font-family: var(--sans); font-size: 2rem; line-height: 1; font-weight: 600; }
.proof-clean { background: #dfe9ff; }
.proof-clean > p span { color: var(--blue); }
.proof-clean code { color: var(--blue-dark); font-weight: 500; }

:root[data-theme="dark"] .proof-broken { background: #34211f; }
:root[data-theme="dark"] .proof-broken code,
:root[data-theme="dark"] .proof-sheet-before { color: #c1c9c4; }
:root[data-theme="dark"] .proof-clean { background: #1f3154; }
:root[data-theme="dark"] .proof-clean { border-color: #3a527d; }
:root[data-theme="dark"] .workbench { box-shadow: 0 18px 50px rgb(0 0 0 / 24%); }
:root[data-theme="dark"] .mode-picker label:hover span { background: #222925; }
:root[data-theme="dark"] .mode-picker input:checked + span { color: #fff; }
:root[data-theme="dark"] .mode-picker input:checked + span small { color: #e2ebff; }
:root[data-theme="dark"] .custom-control { border-color: #3a527d; background: var(--blue-wash); }
:root[data-theme="dark"] .custom-control > input,
:root[data-theme="dark"] .separator-options button:hover { background: var(--sheet); }
:root[data-theme="dark"] .output-pane textarea { background: #161b18; }
:root[data-theme="dark"] .text-button:hover { background: #222925; }
:root[data-theme="dark"] .method-proof { box-shadow: 0 18px 50px rgb(0 0 0 / 22%); }
:root[data-theme="dark"] .proof-sheet { background: #161b18; }
:root[data-theme="dark"] .proof-sheet-after { background: var(--blue-wash); }
:root[data-theme="dark"] .caution { background: rgb(255 129 112 / 8%); }

.workbench {
  border-top: 5px solid var(--ink);
  background: var(--sheet);
  box-shadow: 0 18px 50px rgb(23 32 30 / 8%);
  animation: enter .55s .12s ease-out both;
}
.workbench-heading { display: flex; justify-content: space-between; align-items: end; gap: 24px; padding: 20px 26px 18px; border-bottom: 1px solid var(--rule); }
.workbench h2, .section-lead h2 { margin: 0; font-family: var(--serif); line-height: 1; font-weight: 600; }
.workbench h2 { font-size: clamp(1.8rem, 2.4vw, 2.35rem); }
.section-lead h2 { font-size: clamp(2rem, 3.6vw, 3.4rem); }
.privacy-stamp { flex: 0 0 auto; margin: 0; color: var(--muted); font-size: .82rem; }
.privacy-stamp span { color: var(--blue); font-weight: 700; }

.mode-picker { display: grid; grid-template-columns: repeat(4, 1fr); margin: 0; padding: 0; border: 0; border-bottom: 1px solid var(--rule); }
.mode-picker legend { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.mode-picker label { position: relative; min-width: 0; border-right: 1px solid var(--rule); cursor: pointer; }
.mode-picker label:last-child { border-right: 0; }
.mode-picker input { position: absolute; opacity: 0; pointer-events: none; }
.mode-picker span { min-height: 72px; display: flex; flex-direction: column; justify-content: center; padding: 12px 18px; font-weight: 600; transition: background-color .18s ease, color .18s ease; }
.mode-picker small { display: block; margin-top: 2px; color: var(--muted); font-family: var(--mono); font-size: .66rem; font-weight: 400; }
.mode-picker label:hover span { background: #f2f5f2; }
.mode-picker input:checked + span { background: var(--blue); color: white; }
.mode-picker input:checked + span small { color: #dbe6ff; }
.mode-picker input:focus-visible + span { outline: 3px solid var(--coral); outline-offset: -4px; }

.custom-control { padding: 18px 26px; background: var(--blue-wash); border-bottom: 1px solid #c9d7f6; }
.custom-control[hidden] { display: none; }
.custom-control > label { display: block; margin-bottom: 7px; font-size: .8rem; font-weight: 700; }
.custom-control > input { width: min(100%, 360px); min-height: 44px; padding: 8px 11px; border: 1px solid #94aad6; border-radius: 3px; background: white; font-family: var(--mono); }
.separator-options { display: inline-flex; flex-wrap: wrap; gap: 6px; margin-left: 8px; vertical-align: top; }
.separator-options button { min-height: 44px; padding: 7px 12px; border: 1px solid #94aad6; border-radius: 3px; background: transparent; color: var(--blue-dark); font-size: .78rem; }
.separator-options button:hover { background: white; }
.field-note { margin: 7px 0 0; color: var(--muted); font-size: .75rem; }

.editor-grid { display: grid; grid-template-columns: minmax(0, 1fr) 96px minmax(0, 1fr); }
.editor-pane { min-width: 0; }
.editor-bar { min-height: 48px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 18px; border-bottom: 1px solid var(--rule); }
.editor-bar label { font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.editor-bar p { margin: 0; color: var(--muted); font-family: var(--mono); font-size: .65rem; font-variant-numeric: tabular-nums; }
textarea { display: block; width: 100%; height: 330px; resize: vertical; padding: 20px; border: 0; border-radius: 0; background: var(--sheet); color: var(--ink); font-family: var(--mono); font-size: 1rem; line-height: 1.7; }
textarea::placeholder { color: #8c9692; }
textarea:focus-visible { position: relative; z-index: 2; outline-offset: -3px; }
.output-pane textarea { background: #fbfcfa; }
.editor-actions { min-height: 60px; display: flex; align-items: center; gap: 9px; padding: 8px 18px; border-top: 1px solid var(--rule); }
.output-actions { justify-content: flex-end; }
.text-button, .copy-button, .process-button { min-height: 44px; border-radius: 3px; font-weight: 700; }
.text-button { padding: 8px 12px; border: 1px solid var(--rule); background: transparent; color: var(--ink); font-size: .78rem; }
.text-button:hover { border-color: var(--ink); background: #f4f6f3; }
.copy-button { padding: 8px 17px; border: 1px solid var(--blue); background: var(--blue); color: white; }
.copy-button:hover, .process-button:hover { background: var(--blue-dark); border-color: var(--blue-dark); }

.binding-rail { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; border-inline: 1px solid var(--rule); background: var(--paper); color: var(--muted); text-align: center; }
.rail-rule { width: 1px; height: 62px; background: repeating-linear-gradient(to bottom, var(--coral) 0 5px, transparent 5px 10px); }
.rail-count strong { display: block; color: var(--blue); font-family: var(--serif); font-size: 2.25rem; line-height: 1; font-variant-numeric: tabular-nums; }
.rail-count span { display: block; margin-top: 5px; font-family: var(--mono); font-size: .6rem; line-height: 1.35; text-transform: uppercase; }
.rail-count.is-updating { animation: count-pop .28s ease-out; }

.workbench-footer { min-height: 74px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 12px 18px 12px 26px; border-top: 1px solid var(--rule); }
.result-status { margin: 0; color: var(--muted); font-size: .8rem; }
.process-button { padding: 11px 20px; border: 1px solid var(--ink); background: var(--ink); color: white; }

.method, .mode-guide, .uses, .faq { padding: 100px 0; border-bottom: 1px solid var(--rule); scroll-margin-top: 24px; }
.section-lead { max-width: 700px; }
.section-lead > p:last-child { color: var(--muted); }
.method-grid { display: grid; grid-template-columns: minmax(420px, .88fr) minmax(440px, 1.12fr); align-items: center; gap: clamp(56px, 8vw, 130px); }
.method-copy { max-width: 660px; }
.method-copy h2 { max-width: 590px; }
.method-copy > p { max-width: 620px; line-height: 1.72; text-wrap: pretty; }
.method-proof { position: relative; margin: 0; padding: 25px; border-top: 4px solid var(--ink); background: var(--sheet); box-shadow: 0 18px 50px rgb(23 32 30 / 8%); transform: rotate(.35deg); }
.method-proof figcaption { display: flex; justify-content: space-between; gap: 20px; margin-bottom: 20px; color: var(--muted); font-family: var(--mono); font-size: .68rem; text-transform: uppercase; }
.method-proof figcaption span { color: var(--blue); font-weight: 700; }
.proof-sheet { padding: 20px 22px; border: 1px solid var(--rule); background: #fbfcfa; }
.proof-sheet p { margin: 0; }
.proof-sheet .proof-label { margin-bottom: 12px; color: var(--muted); font-family: var(--mono); font-size: .6rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.proof-sheet p:last-child { font-family: var(--mono); font-size: .83rem; line-height: 1.75; }
.proof-sheet-before { color: #5f6965; }
.proof-sheet-before br { border-bottom: 1px solid var(--coral); }
.proof-sheet-after { border-color: #b9c9eb; background: var(--blue-wash); color: var(--blue-dark); }
.proof-correction { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; color: var(--coral); font-family: var(--mono); font-size: .66rem; font-weight: 600; text-transform: uppercase; }
.proof-correction::before, .proof-correction::after { content: ""; width: 38px; height: 1px; background: var(--coral); }
.proof-correction span { display: grid; width: 25px; height: 25px; place-items: center; border: 1px solid var(--coral); border-radius: 50%; font-size: .72rem; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); margin: 62px 0 0; padding: 0; list-style: none; border-block: 1px solid var(--ink); }
.steps li { display: grid; grid-template-columns: 32px 1fr; gap: 16px; padding: 23px 3vw 22px 0; border-right: 1px solid var(--rule); }
.steps li + li { padding-left: 2.5vw; }
.steps li:last-child { border-right: 0; }
.steps .step-number { padding-top: 5px; color: var(--coral); font-family: var(--mono); font-size: .68rem; font-weight: 600; }
.steps strong { font-family: var(--serif); font-size: 1.55rem; line-height: 1; }
.steps p { margin: 9px 0 0; color: var(--muted); font-size: .88rem; line-height: 1.55; }

.mode-guide { display: grid; grid-template-columns: minmax(250px, .7fr) minmax(0, 1.3fr); gap: 9vw; }
.mode-ledger { border-top: 3px solid var(--ink); }
.mode-ledger article { display: grid; grid-template-columns: 160px minmax(0, 1fr); gap: 12px 26px; padding: 22px 0; border-bottom: 1px solid var(--rule); }
.mode-ledger h3 { margin: 0; font-family: var(--serif); font-size: 1.35rem; line-height: 1.15; }
.mode-example { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-left: 2px solid var(--rule); }
.mode-example > div { min-width: 0; padding: 2px 16px 4px; }
.mode-example > div + div { border-left: 1px solid var(--rule); }
.mode-example span { display: block; margin-bottom: 5px; color: var(--muted); font-family: var(--mono); font-size: .56rem; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; }
.mode-example code { min-width: 0; color: var(--blue-dark); font-family: var(--mono); font-size: .75rem; line-height: 1.5; overflow-wrap: anywhere; }
.mode-ledger p { grid-column: 2; margin: 0; color: var(--muted); font-size: .9rem; }

.uses { display: grid; grid-template-columns: minmax(250px, .7fr) minmax(0, 1.3fr); gap: 9vw; }
.uses-content { min-width: 0; }
.use-list { border-top: 3px solid var(--ink); }
.use-list article { display: grid; grid-template-columns: 40px 1fr; gap: 20px; padding: 23px 0; border-bottom: 1px solid var(--rule); }
.use-list h3 { margin: 0 0 4px; font-family: var(--serif); font-size: 1.45rem; }
.use-list p { margin: 0; color: var(--muted); }
.use-number { color: var(--coral) !important; font-family: var(--mono); font-size: .8rem; }
.caution { margin: 28px 0 0; padding: 15px 18px; border-left: 3px solid var(--coral); background: rgb(232 93 74 / 5%); color: var(--muted); }
.caution strong { color: var(--ink); }

.faq { display: grid; grid-template-columns: minmax(250px, .7fr) minmax(0, 1.3fr); gap: 9vw; }
.faq-list { border-top: 3px solid var(--ink); }
details { border-bottom: 1px solid var(--rule); }
summary { position: relative; padding: 22px 42px 22px 0; cursor: pointer; font-weight: 700; list-style: none; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; position: absolute; right: 3px; top: 19px; color: var(--blue); font-family: var(--mono); font-size: 1.4rem; }
details[open] summary::after { content: "−"; }
details p { margin: 0; padding: 0 50px 24px 0; color: var(--muted); text-wrap: pretty; }

.site-footer { min-height: 120px; display: flex; align-items: center; justify-content: space-between; gap: 24px; color: var(--muted); font-size: .85rem; }
.site-footer nav { display: flex; gap: 22px; }

.policy-page main { max-width: 760px; padding: 70px 0 110px; }
.policy-page h1 { font-size: clamp(2.7rem, 7vw, 5rem); }
.policy-page h2 { margin-top: 48px; font-family: var(--serif); font-size: 2rem; }
.policy-page .lede { color: var(--muted); font-size: 1.1rem; }

@keyframes enter { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
@keyframes count-pop { 50% { transform: scale(1.12); } }

@media (max-width: 840px) {
  .intro-grid, .method-grid, .mode-guide, .uses, .faq { grid-template-columns: 1fr; gap: 38px; }
  .intro-side { display: block; padding-top: 0; }
  .hero-proof { margin-top: 20px; }
  h1 { font-size: clamp(3rem, 11vw, 5rem); }
  .mode-picker { grid-template-columns: repeat(2, 1fr); }
  .mode-picker label:nth-child(2) { border-right: 0; }
  .mode-picker label:nth-child(-n+2) { border-bottom: 1px solid var(--rule); }
  .editor-grid { grid-template-columns: 1fr; }
  .binding-rail { min-height: 72px; flex-direction: row; border-inline: 0; border-block: 1px solid var(--rule); }
  .rail-rule { width: 64px; height: 1px; background: repeating-linear-gradient(to right, var(--coral) 0 5px, transparent 5px 10px); }
  .rail-count { display: flex; align-items: center; gap: 8px; }
  .rail-count strong { font-size: 1.8rem; }
  .rail-count span { margin: 0; text-align: left; }
  .steps { grid-template-columns: 1fr; }
  .steps li, .steps li + li { padding: 20px 0; border-right: 0; border-bottom: 1px solid var(--rule); }
  .steps li:last-child { border-bottom: 0; }
}

@media (max-width: 560px) {
  .site-header, main, .site-footer { width: min(calc(100% - 28px), var(--content)); }
  .site-header { min-height: 66px; }
  .theme-switch button { min-width: 52px; padding-inline: 7px; }
  .intro { padding: 36px 0 24px; }
  .intro-grid { gap: 18px; }
  .intro-side { display: block; }
  .hero-proof { display: none; }
  h1 > .title-main { gap: 9px; font-size: clamp(3.4rem, 15vw, 4.6rem); }
  h1 em { margin-top: 13px; font-size: clamp(1.35rem, 6.2vw, 1.8rem); white-space: normal; }
  .workbench-heading { align-items: start; padding: 20px 17px; }
  .privacy-stamp { max-width: 120px; text-align: right; }
  .mode-picker span { min-height: 68px; padding-inline: 13px; font-size: .86rem; }
  .custom-control { padding: 16px; }
  .custom-control > input { width: 100%; }
  .separator-options { margin: 8px 0 0; }
  .editor-bar { padding-inline: 13px; }
  .editor-bar p { max-width: 142px; text-align: right; }
  textarea { height: 270px; padding: 16px; }
  .editor-actions { padding-inline: 13px; }
  .workbench-footer { align-items: stretch; flex-direction: column; padding: 14px; }
  .process-button { width: 100%; }
  .method, .mode-guide, .uses, .faq { padding: 74px 0; }
  .mode-ledger article { grid-template-columns: 1fr; }
  .mode-ledger p { grid-column: 1; }
  .site-footer { align-items: flex-start; flex-direction: column; justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}