/* ============================================================
   Project Drive — Base
   Reset, typography, layout primitives. Loaded after tokens.css.
   ============================================================ */

/* --- Reset --- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
img, svg, video { display: block; max-width: 100%; height: auto; }
input, button, textarea, select { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }

/* --- Document --- */
html {
  font-family: var(--font-family-sans);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: var(--leading-normal);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}
body { font-size: var(--text-base); min-height: 100vh; }

/* --- Headings --- */
h1, h2, h3, h4 {
  color: var(--color-text-strong);
  font-weight: 600;
  letter-spacing: var(--tracking-tight);
  line-height: var(--leading-snug);
}
h1 { font-size: var(--text-3xl); line-height: var(--leading-tight); }
h2 { font-size: var(--text-2xl); }
h3 { font-size: var(--text-xl); }
h4 { font-size: var(--text-lg); letter-spacing: var(--tracking-normal); }

p { line-height: var(--leading-relaxed); }
strong { font-weight: 600; color: var(--color-text-strong); }

/* --- Links --- */
a {
  color: var(--color-brand);
  transition: color var(--dur-fast) var(--ease-out);
}
a:hover { color: var(--color-brand-strong); }

/* --- Focus --- */
:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--color-brand);
  outline-offset: 2px;
  border-radius: 2px;
}

/* --- Selection --- */
::selection {
  background: var(--color-brand-tint);
  color: var(--color-text-strong);
}

/* --- Layout primitives --- */
.container {
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--container-pad);
}
.container--narrow { max-width: 920px; }
.container--reading { max-width: 720px; }

.section { padding-block: var(--space-9); }
.section--tight { padding-block: var(--space-8); }
.section--bg-subtle { background: var(--color-bg-subtle); }
.section--bg-panel  { background: var(--color-bg-panel); }
.section--bg-inverse {
  background: var(--color-bg-inverse);
  color: var(--color-text-inverse);
}
.section--bg-inverse h1,
.section--bg-inverse h2,
.section--bg-inverse h3,
.section--bg-inverse h4 { color: var(--color-text-inverse); }

/* --- Section header --- */
.section-eyebrow {
  display: inline-block;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-brand);
  margin-bottom: var(--space-3);
}
.section-title {
  font-size: var(--text-2xl);
  max-width: 36rem;
  margin-bottom: var(--space-4);
}
.section-title--lg { font-size: var(--text-3xl); }
.section-lede {
  font-size: var(--text-md);
  color: var(--color-text);
  max-width: 42rem;
  line-height: var(--leading-relaxed);
}
.section-header { margin-bottom: var(--space-7); }
.section-header--center {
  text-align: center;
  margin-inline: auto;
}
.section-header--center .section-title,
.section-header--center .section-lede { margin-inline: auto; }

/* --- Skip link --- */
.skip-link {
  position: absolute;
  top: -100px;
  left: var(--space-4);
  background: var(--color-text-strong);
  color: var(--color-text-inverse);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: 600;
  z-index: 1000;
}
.skip-link:focus { top: var(--space-4); color: var(--color-text-inverse); }

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

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

/* --- Mobile typography --- */
@media (max-width: 640px) {
  h1 { font-size: var(--text-2xl); }
  h2 { font-size: var(--text-xl); }
  .section { padding-block: var(--space-7); }
  .section-title--lg { font-size: var(--text-2xl); }
}
