/* ============================================================
   Clauzy — base.css
   Reset, document rhythm, typography, layout primitives.
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body, h1, h2, h3, h4, p, figure, blockquote, dl, dd, ul, ol { margin: 0; padding: 0; }
ul[class], ol[class] { list-style: none; }
img, svg { display: block; max-width: 100%; }
input, button, textarea, select { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; }
table { border-collapse: collapse; width: 100%; }

body {
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  color: var(--text-body);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

h1, h2, h3, h4 { color: var(--text); font-weight: 640; line-height: var(--lh-head); letter-spacing: var(--tr-head); }
h1 { font-size: var(--fs-h1); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); }
h4 { font-size: var(--fs-h4); }

a { color: var(--c-signal); text-decoration: none; }
a:hover { color: var(--c-signal-press); }
strong { color: var(--text); font-weight: 620; }

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

::selection { background: var(--c-acid); color: var(--n-900); }

/* ---- Layout primitives ---- */
.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }
.wrap--narrow { max-width: 880px; }
.section { padding-block: var(--sec-pad); }
.section--tight { padding-block: var(--sec-pad-sm); }
.section--ground { background: var(--ground); color: var(--text-invert-2); }
.section--ground h2, .section--ground h3, .section--ground h4 { color: var(--text-invert); }
.section--paper { background: var(--bg-alt); }
.section--surface { background: var(--surface); }
.ruled-top { border-top: 1px solid var(--rule); }
.ruled-bottom { border-bottom: 1px solid var(--rule); }

.mono {
  font-family: var(--font-mono);
  font-size: var(--fs-mono);
  letter-spacing: var(--tr-mono);
  text-transform: uppercase;
  color: var(--text-muted);
}
.mono--acid { color: var(--n-900); background: var(--c-acid); padding: 2px 6px; border-radius: 3px; }
.mono--invert { color: rgba(255,255,255,.62); }

.lead { font-size: var(--fs-lead); line-height: var(--lh-loose); color: var(--text-muted); max-width: var(--measure); }
.prose { max-width: 72ch; }
.prose p { margin-block: 0 var(--s-4); }
.prose h2 { margin-block: var(--s-7) var(--s-3); }
.prose h3 { margin-block: var(--s-6) var(--s-2); }
.prose ul, .prose ol { margin: 0 0 var(--s-4) 1.15rem; }
.prose li { margin-bottom: var(--s-2); }
.prose blockquote {
  margin: var(--s-6) 0;
  padding: var(--s-2) 0 var(--s-2) var(--s-5);
  border-left: 3px solid var(--c-acid);
  font-size: var(--fs-lead);
  color: var(--text);
}
.prose hr { border: 0; border-top: 1px solid var(--rule); margin-block: var(--s-7); }

/* Section head: hairline label rail + heading */
.sec-head { display: grid; grid-template-columns: 128px minmax(0,1fr); gap: var(--s-5); align-items: start; }
.sec-head__label { padding-top: 7px; border-top: 2px solid var(--n-900); }
.sec-head__body { max-width: 62ch; }
.sec-head__body p { margin-top: var(--s-3); color: var(--text-muted); }
.section--ground .sec-head__label { border-top-color: var(--c-acid); }
.section--ground .sec-head__body p { color: var(--text-invert-2); }
@media (max-width: 760px) { .sec-head { grid-template-columns: 1fr; gap: var(--s-3); } }

.skip {
  position: absolute; left: var(--s-4); top: -60px; z-index: 999;
  background: var(--n-900); color: #fff; padding: 10px 16px; border-radius: var(--r-1);
  transition: top var(--dur-fast) var(--ease-out-premium);
}
.skip:focus { top: var(--s-4); color: #fff; }

.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;
}
