/* ── base element defaults + layout utilities ───────────────────────────────
   Consumers link styles.css and get correct defaults for raw HTML. Utilities
   are prefixed sc- and cover only layout and the type scale; anything visual
   beyond that belongs in a component.                                        */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--surface-page);
  color: var(--text-primary);
  font-family: var(--font-core);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  font-weight: var(--fw-body);
  font-synthesis-weight: none;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, h4 { margin: 0; font-weight: 500; letter-spacing: -0.02em; line-height: var(--lh-snug); text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
ul, ol { margin: 0; padding: 0; list-style: none; }
hr { border: 0; border-top: var(--hairline); margin: 0; }
code, kbd, samp, pre { font-family: var(--font-mono); font-size: 0.92em; }
table { border-collapse: collapse; }
img, svg { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
::selection { background: var(--accent); color: var(--paper); }
[data-surface="ink"] ::selection { background: var(--accent); color: var(--ink-900); }

a { color: var(--text-primary); text-decoration: none; border-bottom: 1px solid var(--accent); padding-bottom: 1px; transition: color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease), background-color var(--dur-fast) var(--ease); }
a:hover { color: var(--accent); border-bottom-color: var(--accent); }
a:active { color: var(--accent); background: var(--hover-tint); }
[data-surface="ink"] a { color: var(--text-on-ink); }
[data-surface="ink"] a:hover { color: var(--accent); }
[data-surface="ink"] a:active { background: var(--hover-tint-on-ink); }

/* Focus is one treatment everywhere: a 2px ink rule, offset, square. */
:focus-visible { outline: var(--focus-w) solid var(--focus-ring); outline-offset: var(--focus-offset); border-radius: 0; }
:focus:not(:focus-visible) { outline: none; }

/* layout utilities */
.sc-container { width: 100%; max-width: var(--content-max); margin-inline: auto; padding-inline: var(--page-margin); }
.sc-grid { display: grid; grid-template-columns: repeat(var(--grid-cols), minmax(0, 1fr)); gap: var(--grid-gutter); }
.sc-stack { display: flex; flex-direction: column; gap: var(--stack-gap); }
.sc-row { display: flex; align-items: center; gap: var(--sp-3); flex-wrap: wrap; }
.sc-measure { max-width: var(--measure); }
.sc-section { padding-block: var(--section-gap); }
.sc-ink { background: var(--surface-ink); color: var(--text-on-ink); }

/* type utilities */
.sc-d1 { font-size: var(--fs-d1); line-height: var(--lh-d1); letter-spacing: var(--tr-d1); font-weight: var(--fw-d1); }
.sc-d2 { font-size: var(--fs-d2); line-height: var(--lh-d2); letter-spacing: var(--tr-d2); font-weight: var(--fw-d2); }
.sc-t1 { font-size: var(--fs-t1); line-height: var(--lh-t1); letter-spacing: var(--tr-t1); font-weight: var(--fw-t1); }
.sc-t2 { font-size: var(--fs-t2); line-height: var(--lh-t2); letter-spacing: var(--tr-t2); font-weight: var(--fw-t2); }
.sc-t3 { font-size: var(--fs-t3); line-height: var(--lh-t3); letter-spacing: var(--tr-t3); font-weight: var(--fw-t3); }
.sc-body-lg { font-size: var(--fs-body-lg); line-height: var(--lh-body-lg); }
.sc-body { font-size: var(--fs-body); line-height: var(--lh-body); }
.sc-small { font-size: var(--fs-small); line-height: var(--lh-small); }
.sc-meta { font-family: var(--font-mono); font-size: var(--fs-meta); line-height: var(--lh-meta); letter-spacing: var(--tr-meta); font-weight: var(--fw-meta); font-variant-numeric: tabular-nums; }
.sc-micro { font-family: var(--font-mono); font-size: var(--fs-micro); line-height: var(--lh-micro); letter-spacing: var(--tr-micro); font-weight: var(--fw-micro); font-variant-numeric: tabular-nums; }
.sc-dim { color: var(--text-secondary); }
[data-surface="ink"] .sc-dim { color: var(--text-on-ink-dim); }
.sc-num { font-variant-numeric: tabular-nums; }

/* the one orchestrated load reveal */
@keyframes sc-reveal { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.sc-reveal { animation: sc-reveal var(--dur-reveal) var(--ease-out) both; }
