/* ==========================================================================
   PizzaScience — Base Styles
   Modern reset, global typography, form normalization.
   ========================================================================== */

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

html {
  color-scheme: light;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  -moz-tab-size: 4;
  tab-size: 4;
  scroll-behavior: smooth;
}

body {
  min-block-size: 100dvh;
  font-family: var(--font-body);
  font-size: var(--fs-body);
  font-weight: var(--fw-regular);
  letter-spacing: var(--ls-normal);
  line-height: var(--lh-normal);
  color: var(--color-text);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* -----------------------------------------------------------------------
   Typography
   ----------------------------------------------------------------------- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: var(--fw-bold);
  line-height: var(--lh-snug);
  text-wrap: balance;
}

h1 { font-size: var(--fs-h1); letter-spacing: var(--ls-tight); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); }

p {
  text-wrap: pretty;
}

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

small {
  font-size: var(--fs-caption);
}

/* -----------------------------------------------------------------------
   Links
   ----------------------------------------------------------------------- */
a {
  color: var(--color-accent);
  text-decoration: none;
  transition: color var(--duration-fast) var(--ease-default);
}

a:hover {
  color: var(--color-accent-hover);
}

/* -----------------------------------------------------------------------
   Images & Media
   ----------------------------------------------------------------------- */
img, svg, video, canvas {
  display: block;
  max-inline-size: 100%;
  block-size: auto;
}

/* -----------------------------------------------------------------------
   Lists
   ----------------------------------------------------------------------- */
ul, ol {
  list-style: none;
}

/* -----------------------------------------------------------------------
   Buttons
   ----------------------------------------------------------------------- */
button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

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

/* -----------------------------------------------------------------------
   Form Elements
   ----------------------------------------------------------------------- */
input, select, textarea {
  font: inherit;
  color: inherit;
}

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  cursor: pointer;
}

/* -----------------------------------------------------------------------
   Dialog
   ----------------------------------------------------------------------- */
dialog {
  border: none;
  padding: 0;
  max-inline-size: min(90vw, 480px);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
}

dialog::backdrop {
  background: var(--color-surface-overlay);
  backdrop-filter: blur(4px);
}

/* -----------------------------------------------------------------------
   Utilities
   ----------------------------------------------------------------------- */
.sr-only {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Label styles */
.label-caps {
  font-size: var(--fs-caption);
  font-weight: var(--fw-semibold);
  letter-spacing: var(--ls-wide);
  text-transform: uppercase;
  color: var(--color-text-secondary);
}

/* Numeric display */
.numeric-display {
  font-family: var(--font-numeric);
  font-size: var(--fs-numeric);
  font-weight: var(--fw-bold);
  letter-spacing: var(--ls-tight);
  line-height: 1;
}

.numeric-unit {
  font-size: var(--fs-h3);
  font-weight: var(--fw-semibold);
  margin-inline-start: var(--space-2xs);
}
