/* base.css: shared reset, design tokens and structural utilities.
 *
 * polished.css scopes everything under <html data-mode="polished">.
 * Anything here applies globally.
 */

/* ---------- Tokens (spacing + motion are shared, colors/fonts per mode) ---- */
:root {
  /* 4px-based spacing scale */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;
  --space-8: 4rem;
  --space-9: 6rem;
  --space-10: 8rem;

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring: cubic-bezier(0.22, 1.25, 0.36, 1);

  --gutter: clamp(1rem, 4vw, 2rem);
  --container: 70rem;
}

/* Fallbacks so the page is never unstyled before a mode stylesheet rule matches. */
:root {
  --bg: #ffffff;
  --fg: #111111;
}

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

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

body,
h1,
h2,
h3,
h4,
p,
ul,
ol,
dl,
dd,
figure {
  margin: 0;
}

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

img,
svg {
  display: block;
}

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

button {
  cursor: pointer;
}

a {
  color: inherit;
}

[hidden] {
  display: none !important;
}

/* ---------- Utilities ------------------------------------------------------ */
.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: var(--space-4);
  top: var(--space-2);
  z-index: 1000;
  padding: var(--space-2) var(--space-4);
  background: #000;
  color: #fff;
  font: 600 1rem/1.2 system-ui, sans-serif;
  transform: translateY(-300%);
}

.skip-link:focus {
  transform: none;
}

.container {
  width: min(100% - 2 * var(--gutter), var(--container));
  margin-inline: auto;
}

/* ---------- Reduced motion: no ambient animation anywhere ------------------ */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto !important;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    animation-delay: 0s !important;
    transition-duration: 0.001ms !important;
    transition-delay: 0s !important;
  }
}
