/* Design tokens, resets, and the handful of type rules everything else builds on. */

:root {
  --accent: #0071e3;
  --bg: #ffffff;
  --fg: #1d1d1f;
  --card: #f7f7f7;
  --surface: #ffffff;
  --text-sub: #6e6e73;
  --text-muted: #86868b;
  --border: rgba(0, 0, 0, 0.06);
  --nav-bg: rgba(255, 255, 255, 0.75);
  --hero-sub: rgba(0, 0, 0, 0.5);

  --radius-lg: 26px;
  --radius-md: 18px;
  --radius-sm: 12px;
  --gap: 16px;
  --page-width: 1120px;

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-inout: cubic-bezier(0.65, 0, 0.25, 1);
}

[data-theme="dark"] {
  --accent: #0a84ff;
  --bg: #0b0b0c;
  --fg: #f5f5f7;
  --card: #17171a;
  --surface: #232327;
  --text-sub: #a1a1a6;
  --text-muted: #8e8e93;
  --border: rgba(255, 255, 255, 0.09);
  --nav-bg: rgba(28, 28, 30, 0.78);
  --hero-sub: rgba(255, 255, 255, 0.55);
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: -apple-system, "SF Pro Text", "SF Pro Display", "Inter", "Helvetica Neue", Helvetica, sans-serif;
  -webkit-font-smoothing: antialiased;
  transition: background 0.45s ease, color 0.45s ease;
}

img {
  display: block;
  max-width: 100%;
}

/* The portrait is a flat line drawing, so it inverts cleanly for dark mode. */
[data-theme="dark"] .avatar {
  filter: invert(1) hue-rotate(180deg);
}

a {
  color: var(--fg);
  text-decoration: none;
  transition: color 0.25s ease;
}

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

button {
  font: inherit;
  color: inherit;
  cursor: pointer;
}

h1,
h2,
h3 {
  margin: 0;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

p {
  margin: 0;
  text-wrap: pretty;
}

/* Small caps label that opens most sections. */
.eyebrow {
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.section-title {
  font-size: clamp(26px, 3vw, 40px);
}

.page-title {
  font-size: clamp(34px, 4vw, 56px);
  letter-spacing: -0.032em;
  line-height: 1.05;
}

.lede {
  font-size: 17px;
  line-height: 1.6;
  color: var(--text-sub);
}

/* Elements fade up as they enter the viewport; see js/modules/reveal.js.
   Only hidden once scripting has confirmed it can reveal them again. */
.js .reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.75s var(--ease-out), transform 0.75s var(--ease-out);
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .js .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}
