/* ========================================
   Fairy Life Sciences — Reset & Typography
   ======================================== */

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

/* Reset margins */
body, h1, h2, h3, h4, h5, h6,
p, blockquote, figure, pre,
dl, dd, ol, ul, li,
fieldset, legend, button, input, select, textarea {
  margin: 0;
  padding: 0;
}

/* Smooth rendering */
html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  font-size: var(--text-body);
  line-height: var(--leading-normal);
  color: var(--text-primary);
  background: var(--surface-page);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* Remove default list styles */
ul, ol {
  list-style: none;
}

/* Make images responsive */
img, svg, video {
  display: block;
  max-width: 100%;
  height: auto;
}

/* Inherit form elements */
button, input, select, textarea {
  font: inherit;
  color: inherit;
}

/* Remove button defaults */
button {
  background: none;
  border: none;
  cursor: pointer;
}

/* Remove fieldset defaults */
fieldset {
  border: none;
}

/* Table basics */
table {
  border-collapse: collapse;
  border-spacing: 0;
}

/* Links */
a {
  color: inherit;
  text-decoration: none;
}

/* Remove tap highlight on mobile */
a, button {
  -webkit-tap-highlight-color: transparent;
}

/* ===== TYPOGRAPHY UTILITIES ===== */

/* Display headings */
.t-display {
  font-size: var(--text-display);
  font-weight: var(--weight-bold);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
  color: var(--text-primary);
}

.t-h1, h1 {
  font-size: var(--text-h1);
  font-weight: var(--weight-bold);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
  color: var(--text-primary);
}

.t-h2, h2 {
  font-size: var(--text-h2);
  font-weight: var(--weight-semibold);
  line-height: var(--leading-snug);
  letter-spacing: calc(var(--tracking-tight) * 0.5);
  color: var(--text-primary);
}

.t-h3, h3 {
  font-size: var(--text-h3);
  font-weight: var(--weight-semibold);
  line-height: var(--leading-snug);
  letter-spacing: var(--tracking-normal);
  color: var(--text-primary);
}

.t-h4, h4 {
  font-size: var(--text-h4);
  font-weight: var(--weight-medium);
  line-height: var(--leading-normal);
  color: var(--text-primary);
}

.t-body {
  font-size: var(--text-body);
  line-height: var(--leading-normal);
  color: var(--text-secondary);
}

.t-lead {
  font-size: var(--text-lead);
  line-height: var(--leading-relaxed);
  color: var(--text-secondary);
}

.t-small {
  font-size: var(--text-small);
  line-height: var(--leading-normal);
  color: var(--text-muted);
}

.t-xs {
  font-size: var(--text-xs);
  line-height: var(--leading-normal);
  color: var(--text-muted);
}

.t-overline {
  font-size: var(--text-overline);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-widest);
  text-transform: uppercase;
  color: var(--text-muted);
}

/* Text colors */
.t-primary { color: var(--text-primary); }
.t-secondary { color: var(--text-secondary); }
.t-muted { color: var(--text-muted); }
.t-inverse { color: var(--text-inverse); }
.t-accent { color: var(--accent); }
.t-brand { color: var(--brand-500); }
.t-jewel { color: var(--jewel-500); }

/* Font weights */
.t-regular { font-weight: var(--weight-regular); }
.t-medium { font-weight: var(--weight-medium); }
.t-semibold { font-weight: var(--weight-semibold); }
.t-bold { font-weight: var(--weight-bold); }
.t-extrabold { font-weight: var(--weight-extrabold); }

/* Monospace */
.t-mono {
  font-family: var(--font-mono);
  font-feature-settings: 'tnum' 1, 'liga' 0;
}

/* ===== LAYOUT UTILITIES ===== */

.container {
  width: min(var(--container-max), 94%);
  margin-inline: auto;
}

.container-narrow {
  width: min(var(--container-narrow), 94%);
  margin-inline: auto;
}

.container-text {
  width: min(var(--container-text), 94%);
  margin-inline: auto;
}

/* ===== FOCUS VISIBLE ===== */

:focus-visible {
  outline: none;
  box-shadow: var(--ring-focus);
}

/* ===== SELECTION ===== */

::selection {
  background: var(--brand-200);
  color: var(--brand-900);
}

/* ===== SCROLLBAR (webkit) ===== */

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bone-100);
}

::-webkit-scrollbar-thumb {
  background: var(--bone-300);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--titan-600);
}

/* ===== REDUCED MOTION ===== */

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