:root {
  --bg: #F5F2EB;
  --ink: #28383A;
  --paper: #FFFEFA;
  --accent: #B96B4F;
  --sage: #6F9086;
  --panel: #293B40;
  --line: #D8D4CA;
  --mute: #747E7B;
  --mark: #E8D9B6;
  --serif: Georgia, "Times New Roman", serif;
  --sans: "Segoe UI", system-ui, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", Consolas, monospace;
  --max: 1240px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; overflow-x: hidden; }
img, svg, video { max-width: 100%; height: auto; }

body {
  margin: 0;
  color: var(--ink);
  font-family: var(--sans);
  line-height: 1.55;
  overflow-wrap: break-word;
  background-color: var(--bg);
  background-image:
    repeating-linear-gradient(to bottom, transparent 0, transparent 27px, rgba(40, 56, 58, 0.035) 28px);
}

body::before,
body::after {
  content: "";
  position: fixed;
  width: 12px;
  height: 12px;
  background: url("../svg/register.svg") center / 12px no-repeat;
  opacity: 0.25;
  pointer-events: none;
}
body::before { top: 10px; left: 10px; }
body::after { content: "p. 01"; bottom: 16px; right: 16px; width: auto; height: auto; background: none; font-family: var(--mono); font-size: 10px; letter-spacing: 0.12em; color: var(--mute); }

a { color: var(--accent); text-underline-offset: 3px; }
a:hover { color: var(--panel); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.skip { position: absolute; left: -999px; top: 8px; }
.skip:focus { left: 8px; z-index: 40; background: var(--paper); padding: 8px 12px; }

.wrap {
  width: min(var(--max), calc(100% - 32px));
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.site-header {
  height: 68px;
  border-bottom: 1px solid var(--line);
  background: rgba(245, 242, 235, 0.94);
  position: sticky;
  top: 0;
  z-index: 12;
}
.site-header .wrap {
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.wordmark {
  display: flex;
  flex-direction: column;
  line-height: 1.05;
  color: var(--ink);
  text-decoration: none;
  font-family: var(--serif);
  font-weight: 700;
  letter-spacing: 0.1em;
}
.wordmark span:first-child { font-size: 12px; }
.wordmark span:last-child { font-size: 16px; }

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 16px;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.site-nav a { color: var(--ink); text-decoration: none; border-bottom: 1px solid transparent; }
.site-nav a:hover,
.site-nav a[aria-current="page"] { border-bottom-color: var(--accent); }
[data-nav-toggle] { display: none; }

.kicker {
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--mute);
  margin: 0 0 8px;
}

h1, h2, h3 { font-family: var(--serif); font-weight: 700; line-height: 1.15; margin: 0 0 12px; }
h1 { font-size: clamp(28px, 4vw, 42px); }
h2 { font-size: clamp(22px, 3vw, 30px); }
h3 { font-size: 20px; }

.lede { max-width: 64ch; margin: 0 0 18px; }
.muted { color: var(--mute); }
.section { padding: 40px 0; border-top: 1px solid var(--line); }
.section-tight { padding: 28px 0; }

.desk {
  display: grid;
  grid-template-columns: 8fr 4fr;
  gap: 24px;
  align-items: start;
}

label, .lbl {
  display: block;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin: 10px 0 6px;
}

.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.checks label { display: flex; gap: 8px; align-items: center; text-transform: none; letter-spacing: 0; font-size: 14px; margin: 8px 0; }
input[type="number"], input[type="text"], select {
  max-width: 320px;
  min-height: 42px;
  font: 16px/1.3 var(--mono);
  padding: 8px 10px;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
}

.btn, button.btn, a.btn {
  appearance: none;
  border: 1px solid var(--panel);
  background: var(--panel);
  color: var(--paper);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 11px 13px;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}
.btn-ghost, a.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line);
}
.btn.is-active { background: var(--accent); border-color: var(--accent); color: #fff; }

.margin-panel {
  background: var(--panel);
  color: #F5F2EB;
  padding: 18px 16px 22px;
  border-left: 3px solid var(--mark);
}
.margin-panel .method,
.margin-panel [data-method] {
  font-size: 12px;
  color: #c5cecb;
  line-height: 1.5;
  margin-top: 12px;
}
.metric {
  border-top: 1px solid rgba(255, 254, 250, 0.12);
  padding: 10px 0;
}
.metric .lbl { color: #c5cecb; margin: 0; }
.metric b {
  display: block;
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-size: 28px;
  font-weight: 600;
}

.limit-bar {
  height: 8px;
  background: #e7e2d8;
  margin: 10px 0;
}
.limit-bar span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--sage);
}
.limit-bar[data-state="near"] span { background: #c9a227; }
.limit-bar[data-state="over"] span { background: var(--accent); }
.limit-bar[data-state="ok"] span { background: var(--sage); }

.time-strip {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.sheet {
  background: var(--paper);
  border: 1px solid var(--line);
  padding: 16px;
  min-height: 140px;
  white-space: pre-wrap;
  font-family: var(--serif);
  font-size: 16px;
}

.freq-wrap { overflow-x: auto; }
table.freq { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
table.freq th, table.freq td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); }
table.freq th { font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; }

.example-row {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  gap: 8px 16px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
}
.example-row h3, .example-row p { grid-column: 2; }
.example-row .btn { grid-column: 3; grid-row: 1 / span 3; align-self: center; }

.ref-note { padding: 16px 0; border-top: 1px solid var(--line); }
.article-body { max-width: 68ch; }
.article-body p { margin: 0 0 14px; }
.article-body h2 { margin-top: 28px; }
.article-body h3 { margin-top: 20px; }
.article-body ul, .article-body ol { margin: 0 0 14px; padding-left: 1.2em; }
.article-body li { margin: 0 0 6px; }
.article-body code { font-family: var(--mono); font-size: 0.92em; }
.faq details { border-top: 1px solid var(--line); padding: 10px 0; }
.faq summary { cursor: pointer; font-family: var(--serif); font-weight: 700; }

.site-footer { border-top: 1px solid var(--line); padding: 22px 0 40px; font-size: 14px; }
.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  margin: 10px 0;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.site-footer a { color: var(--ink); text-decoration: none; }
.site-footer a:hover { color: var(--accent); }

.live { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.address { font-style: normal; line-height: 1.7; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; animation: none !important; }
}

@media (max-width: 760px) {
  .site-header { height: auto; }
  .site-header .wrap { height: auto; min-height: 68px; padding: 10px 0; }
  [data-nav-toggle] { display: inline-block; }
  .site-nav { display: none; width: 100%; flex-direction: column; padding-bottom: 12px; }
  .site-nav.is-open { display: flex; }
  .desk, .time-strip, .example-row { grid-template-columns: 1fr; }
  .example-row h3, .example-row p, .example-row .btn { grid-column: 1; grid-row: auto; }
  .btn { width: 100%; text-align: center; min-height: 44px; }
  .wrap { width: min(var(--max), calc(100% - 20px)); }
  .margin-panel {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 12px;
  }
  .margin-panel h2,
  .margin-panel .method,
  .margin-panel [data-method] { grid-column: 1 / -1; }
}

@media (max-width: 320px) {
  .wrap { width: calc(100% - 16px); }
  .metric b { font-size: 22px; }
  input[type="number"], input[type="text"], select { max-width: 100%; }
}
