/* base.css — Mobile-first reset, document defaults, and layout primitives.
 *
 * Mobile (≤480px) is the base layout. Tablet (≥481px) and Desktop (≥1025px)
 * progressively enhance via min-width media queries only. Tokens come from
 * tokens.css; raw values must not appear outside this file.
 *
 * Validates: Requirements 2.1, 2.2, 2.3, 2.4, 2.5
 */

/* Reset */

@font-face {
  font-family: 'Dancingdog';
  src: url('/fonts/Dancingdog.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
}

*,
*::before,
*::after { box-sizing: border-box; }

body, h1, h2, h3, h4, h5, h6, p, ul, ol, dl, dd, figure {
  margin: 0;
  padding: 0;
}

ul, ol { list-style: none; }

img, video, picture {
  max-width: 100%;
  height: auto;
  display: block;
}

button { font: inherit; }

/* Document */

html {
  scroll-behavior: smooth;
  text-size-adjust: 100%;
  -webkit-text-size-adjust: 100%;
  overflow-x: clip;
}

body {
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: var(--line-body);
  color: var(--color-text);
  background: var(--bg-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /* No overflow-x here — `html { overflow-x: clip }` already prevents the
   * page from scrolling sideways, and clipping the body would establish a
   * scroll container that breaks `position: sticky` for descendants
   * (e.g. the sticky application form on /career.html). */
  font-feature-settings: "ss01", "cv11";
}

/* Typography */

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  line-height: var(--line-heading);
  font-weight: 700;
  color: var(--color-text);
  letter-spacing: var(--tracking-tight);
}

h1 { font-size: var(--fs-h1); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); }
h4 { font-size: var(--fs-subhead); font-weight: 600; }

p {
  font-size: var(--fs-body);
  line-height: var(--line-body);
  color: var(--color-text);
}

p + p { margin-top: var(--space-3); }

strong { font-weight: 600; }

small { font-size: var(--fs-caption); }

/* Links */

a {
  color: var(--color-accent);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover,
a:focus-visible { color: var(--color-accent-hover); }

a:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* Layout primitives */

.container {
  width: 100%;
  max-width: 100%;
  padding-inline: var(--space-4);
  margin-inline: auto;
}

.section {
  padding-block: var(--space-7);
}

.section--tight {
  padding-block: var(--space-6);
}

.section--soft {
  background: var(--bg-soft);
}

.grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-5);
}

.stack {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
}

/* Accessibility helpers */

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: -40px;
  left: var(--space-4);
  background: var(--color-accent);
  color: var(--color-accent-contrast);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  z-index: 100;
  transition: top var(--transition);
}

.skip-link:focus { top: var(--space-3); color: var(--color-accent-contrast); }

/* 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;
  }
}

/* Tablet (≥481px) */

@media (min-width: 481px) {
  .container { max-width: 720px; }

  .grid--two   { grid-template-columns: repeat(2, 1fr); }
  .grid--four  { grid-template-columns: repeat(2, 1fr); }
  .grid--three { grid-template-columns: repeat(2, 1fr); }

  body { font-size: 1.0625rem; }
}

/* Desktop (≥1025px) */

@media (min-width: 1025px) {
  .container { max-width: var(--container-max); padding-inline: var(--space-5); }

  .section          { padding-block: var(--space-8); }
  .section--tight   { padding-block: var(--space-7); }

  .grid--two   { grid-template-columns: repeat(2, 1fr); }
  .grid--three { grid-template-columns: repeat(3, 1fr); }
  .grid--four  { grid-template-columns: repeat(4, 1fr); }

  h1 { font-size: 2.75rem; }
  h2 { font-size: 2rem; }
}
