*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; }
[hidden] { display: none !important; }   /* author display rules must not resurrect hidden sections */

body {
  font: 400 16px/1.65 var(--font-family);
  color: var(--text-primary);
  background: var(--bg-primary) var(--ripple-texture);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { font-weight: 600; letter-spacing: -0.015em; line-height: 1.2; text-wrap: balance; color: var(--text-primary); }
h1 { font-size: clamp(40px, 6vw, 56px); letter-spacing: -0.025em; line-height: 1.05; }
h2 { font-size: clamp(26px, 3.4vw, 32px); }
h3 { font-size: 20px; }
h4 { font-size: 16px; }
h2:focus { outline: none; }

p, li { color: var(--text-secondary); }
strong { color: var(--text-primary); font-weight: 600; }
a { color: var(--accent-signature); text-underline-offset: 3px; }
code, pre, kbd { font-family: var(--font-mono); font-size: 0.88em; }
img { max-width: 100%; height: auto; display: block; }

:focus-visible { outline: 2px solid var(--accent-signature); outline-offset: 2px; }

.micro {
  font: 500 11px/1.4 var(--font-mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px; border-radius: var(--radius-sm);
  font: 500 14px/1.2 var(--font-family); text-decoration: none; white-space: nowrap;
  border: 1px solid transparent; cursor: pointer;
  transition: background-color 0.2s var(--ease-snap), border-color 0.2s var(--ease-snap), transform 0.16s var(--ease-snap);
}
.btn:active, .theme-toggle:active, .sheet-close:active { transform: scale(0.97); }

/* Sliding underline for navigation links; running text keeps a plain underline for readability. */
.topnav a, .footer a, .hero-actions a:not(.btn), .next {
  background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat;
  transition: background-size 0.35s var(--ease-snap), color 0.2s var(--ease-snap);
}
@media (hover: hover) and (pointer: fine) {
  .topnav a:hover, .footer a:hover, .hero-actions a:not(.btn):hover, .next:hover { background-size: 100% 1px; }
}
/* Ember: the single primary action of each view. */
.btn-primary { background: var(--accent-cta); color: var(--accent-cta-on); }
.btn-primary:hover { background: var(--accent-cta-hover); }
.btn-secondary { background: transparent; color: var(--text-primary); border-color: var(--border-light); }
.btn-secondary:hover { border-color: var(--accent-signature); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0s !important; animation: none !important; }
}
