/* ============================================================================
   Nyraa Skin Care — Base
   Reset, semantic elements, and typography. Tokens only (see tokens.css).
   ============================================================================ */

/* ---------- Modern reset ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

* { margin: 0; }

html { -webkit-text-size-adjust: 100%; }

body {
  min-height: 100vh;
  background-color: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  font-weight: var(--fw-regular);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Fluid media — no horizontal scroll (ui-rules 42) */
img, picture, video, canvas, svg {
  display: block;
  max-width: 100%;
  height: auto;
}

input, button, textarea, select { font: inherit; color: inherit; }

p, h1, h2, h3, h4, h5, h6 { overflow-wrap: break-word; }

ul, ol { list-style: none; padding: 0; }

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: var(--transition-color);
}
a:hover { color: var(--primary-700); }

hr {
  border: 0;
  border-top: 1px solid var(--color-divider);
  margin: var(--space-lg) 0;
}

/* ---------- Headings — always Playfair (ui-rules 7) ---------- */
h1, h2, h3, h4 {
  font-family: var(--font-headline);
  color: var(--color-text);
  font-weight: var(--fw-bold);
  line-height: var(--lh-heading);
}
h5, h6 {
  font-family: var(--font-body);
  color: var(--color-text);
  font-weight: var(--fw-semibold);
  line-height: var(--lh-snug);
}

h1 { font-size: var(--fs-h1); line-height: var(--lh-tight); letter-spacing: var(--ls-tight); }
h2 { font-size: var(--fs-h2); letter-spacing: var(--ls-tight); }
h3 { font-size: var(--fs-h3); letter-spacing: var(--ls-tight); }
h4 { font-size: var(--fs-h4); font-weight: var(--fw-semibold); }
h5 { font-size: var(--fs-h5); }
h6 { font-size: var(--fs-h6); letter-spacing: var(--ls-wide); }

p { margin-bottom: var(--space-md); }
p:last-child { margin-bottom: 0; }

small, .text-small { font-size: var(--fs-small); }
.text-muted { color: var(--color-text-muted); }
.text-secondary { color: var(--color-text-secondary); }

strong, b { font-weight: var(--fw-semibold); }

blockquote {
  border-inline-start: 4px solid var(--color-primary);
  padding-inline-start: var(--space-lg);
  font-size: var(--fs-body-lg);
  color: var(--color-text-secondary);
}

code, pre {
  font-family: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace;
  font-size: var(--fs-small);
}
pre {
  background: var(--color-surface);
  padding: var(--space-md);
  border-radius: var(--radius-md);
  overflow-x: auto;
}

/* ---------- Accessibility ---------- */

/* Visible focus everywhere (ui-rules 44) */
:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* Screen-reader-only utility */
.screen-reader-text,
.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Skip link (ui-rules 45) */
.skip-link {
  position: absolute;
  left: -999px;
  top: var(--space-sm);
  z-index: var(--z-tooltip);
  background: var(--color-neutral);
  color: var(--color-text-inverse);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-sm);
}
.skip-link:focus {
  left: var(--space-sm);
  color: var(--color-text-inverse);
}

/* ---------- Utilities ---------- */
.text-center { text-align: center; }
.u-mt-lg { margin-top: var(--space-lg); }
.u-mt-xl { margin-top: var(--space-xl); }
.u-mt-2xl { margin-top: var(--space-2xl); }

/* Respect reduced motion (ui-rules 37) */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
