/* ============================================================================
   base.css · reset, typography, and base elements. Calm defaults.
   ========================================================================== */

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}

body {
  font-family: var(--sans);
  font-size: var(--step-0);
  line-height: 1.6;
  color: var(--ink);
  background-color: var(--paper);
  background-image: var(--page-bg);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
}

img, svg, video { display: block; max-width: 100%; height: auto; }

h1, h2, h3, h4 {
  font-family: var(--serif);
  font-weight: 500;
  line-height: 1.08;
  letter-spacing: -0.015em;
  color: var(--ink);
  text-wrap: balance;
}
h1 { font-size: var(--step-5); }
h2 { font-size: var(--step-3); }
h3 { font-size: var(--step-2); }
h4 { font-size: var(--step-1); }

p { text-wrap: pretty; }

em { font-style: italic; }
strong, b { font-weight: 600; }

a {
  color: var(--accent-ink);
  text-decoration-color: color-mix(in srgb, var(--accent-ink) 40%, transparent);
  text-underline-offset: 0.18em;
  transition: text-decoration-color 0.2s var(--ease), color 0.2s var(--ease);
}
a:hover { text-decoration-color: var(--accent-ink); }

/* Visible, calm focus ring for keyboard users. */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

/* Utility: skip link */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ink);
  color: #fff;
  padding: 0.75rem 1.25rem;
  border-radius: 0 0 var(--radius-sm) 0;
  z-index: 100;
  font-weight: 600;
}
.skip-link:focus { left: 0; }

/* Visually-hidden but available to assistive tech. */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* Buttons and links styled as buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: var(--sans);
  font-size: var(--step-0);
  font-weight: 600;
  line-height: 1;
  padding: 0.9rem 1.5rem;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.18s var(--ease), background-color 0.2s var(--ease), box-shadow 0.2s var(--ease), border-color 0.2s var(--ease);
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn--primary {
  background: var(--ink);
  color: #fff;
  box-shadow: var(--shadow-soft);
}
.btn--primary:hover { background: #322d26; }

.btn--ghost {
  background: rgba(255,255,255,0.6);
  color: var(--ink-soft);
  border-color: var(--line);
  backdrop-filter: blur(4px);
}
.btn--ghost:hover { border-color: var(--accent); color: var(--ink); }

.btn--quiet {
  background: transparent;
  color: var(--accent-ink);
  padding-left: 0;
  padding-right: 0;
}
