/* ============================================================
   Attieh & Chebli — base.css
   Element defaults + the type system (§3.2).
   Load order: tokens → fonts → base → layout → components → utilities.
   ============================================================ */

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

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

body {
  font-family: var(--font-text);
  font-size: var(--size-body);
  line-height: var(--leading-body);
  font-weight: 400;
  background-color: var(--surface);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

/* ---- Headings: the display face does the luxury work ---- */

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: var(--weight-display);
  color: var(--text);
  text-wrap: balance;
}

h1 { font-size: var(--size-h1); line-height: var(--leading-h1); }
h2 { font-size: var(--size-h2); line-height: var(--leading-h2); }
h3 { font-size: var(--size-h3); line-height: var(--leading-h3); }

h4 {
  font-family: var(--font-text);
  font-weight: 600;
  font-size: var(--size-h4);
  line-height: var(--leading-h4);
}

.type-display {
  font-family: var(--font-display);
  font-weight: var(--weight-display);
  font-size: var(--size-display);
  line-height: var(--leading-display);
}

.lead {
  font-size: var(--size-lead);
  line-height: var(--leading-lead);
  max-inline-size: var(--measure-lead);
}

p {
  max-inline-size: var(--measure-body);
}

/* ---- The overline: the system's signature device ---- */

.overline {
  display: block;
  font-family: var(--font-text);
  font-size: var(--size-overline);
  line-height: var(--leading-overline);
  letter-spacing: var(--tracking-overline);
  text-transform: uppercase;
  font-weight: 500;
  color: var(--accent);
}

/* An overline used as a link (e.g. a discipline page's back link)
   would otherwise inherit the base `a` underline; suppressed here
   so a linked overline still reads like a plain overline. */
a.overline,
a.overline:hover {
  text-decoration: none;
}

/* ---- Inline links: always underlined (§3.3) ---- */

a {
  color: inherit;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  text-decoration-color: color-mix(in srgb, currentColor 40%, transparent);
  transition: text-decoration-color var(--motion-fast) var(--ease-standard),
              color var(--motion-fast) var(--ease-standard);
}

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

/* ---- Focus: never removed, always visible ---- */

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

/* ---- Media ---- */

img, svg, video {
  display: block;
  max-inline-size: 100%;
  block-size: auto;
}

/* ---- Text elements ---- */

strong { font-weight: 600; }

blockquote { max-inline-size: var(--measure-body); }

address { font-style: normal; }

hr {
  border: 0;
  block-size: var(--rule-width);
  background-color: var(--rule);
}

/* Buttons and form controls inherit the type system */
button, input, select, textarea {
  font: inherit;
  color: inherit;
}

/* ---- Reduced motion: opacity-only, near-instant (§3.2) ---- */

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