/* ---------- Tokens ---------- */

:root {
  --bg: #fbfbfa;
  --fg: #1e1e1e;
  --fg-muted: rgb(30 30 30 / 0.62);
  --fg-subtle: rgb(30 30 30 / 0.45);
  --rule: rgb(30 30 30 / 0.12);
  --selection: rgb(30 30 30 / 0.1);

  --font-sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "Geist Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  --gutter: clamp(20px, 4vw, 48px);
  --max: 1200px;
  --label-col: 220px;
  --measure: 640px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111111;
    --fg: #ededeb;
    --fg-muted: rgb(237 237 235 / 0.64);
    --fg-subtle: rgb(237 237 235 / 0.42);
    --rule: rgb(237 237 235 / 0.14);
    --selection: rgb(237 237 235 / 0.16);
  }
}

/* ---------- Base ---------- */

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

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

::selection {
  background: var(--selection);
}

h1,
h2,
h3,
p,
ol {
  margin: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

:focus-visible {
  outline: 1px solid var(--fg);
  outline-offset: 4px;
  border-radius: 2px;
}

.skip-link {
  position: absolute;
  left: var(--gutter);
  top: -100px;
  font-family: var(--font-mono);
  font-size: 12px;
}

.skip-link:focus {
  top: 16px;
}

/* ---------- Header ---------- */

.menu-bar-container {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.menu-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: var(--max);
  height: 64px;
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.wordmark {
  display: block;
}

.wordmark img {
  display: block;
  width: auto;
  height: 22px;
}

.menu-bar-items {
  display: flex;
  gap: 28px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.menu-bar-items a,
.meta,
.section-label,
.index,
.site-footer {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.menu-bar-items a {
  color: var(--fg-muted);
  transition: color 150ms ease;
}

.menu-bar-items a:hover {
  color: var(--fg);
}

/* ---------- Article ---------- */

.content-area {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.content-area-header {
  padding: clamp(96px, 18vh, 200px) 0 clamp(56px, 9vh, 112px);
}

.meta {
  display: flex;
  gap: 16px;
  color: var(--fg-subtle);
  margin-bottom: 28px;
}

.meta span::after {
  content: "/";
  margin-left: 16px;
}

.title {
  font-size: clamp(48px, 9vw, 112px);
  font-weight: 500;
  line-height: 0.98;
  letter-spacing: -0.045em;
  max-width: 12ch;
}

.title-tagline {
  max-width: 36ch;
  margin-top: clamp(28px, 4vw, 44px);
  font-size: clamp(21px, 2.3vw, 28px);
  line-height: 1.3;
  letter-spacing: -0.015em;
  color: var(--fg-muted);
}

/* Break the tagline only between its three clauses */
.title-tagline span {
  white-space: nowrap;
}

/* Image plate */

.plate {
  margin: 0 0 clamp(72px, 10vw, 120px);
}

.plate img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 21 / 9;
  object-fit: cover;
  object-position: 50% 45%;
  background: var(--rule);
}

.plate figcaption {
  margin-top: 12px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--fg-subtle);
}

/* Sections: mono label in a narrow left column, content on the right */

.section {
  display: grid;
  grid-template-columns: var(--label-col) minmax(0, 1fr);
  column-gap: 32px;
  padding: 40px 0 clamp(72px, 10vw, 120px);
  border-top: 1px solid var(--rule);
}

.section-label {
  color: var(--fg-subtle);
  padding-top: 6px;
}

.prose {
  max-width: var(--measure);
}

.prose p {
  color: var(--fg-muted);
  text-wrap: pretty;
}

.prose p + p {
  margin-top: 1.2em;
}

.prose .lead {
  color: var(--fg);
  font-size: clamp(20px, 2vw, 24px);
  line-height: 1.45;
  letter-spacing: -0.012em;
  text-wrap: pretty;
}

.prose .lead + p {
  margin-top: 1.4em;
}

/* Principles */

.principles {
  max-width: var(--measure);
  padding: 0;
  list-style: none;
}

.principles li {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  row-gap: 8px;
  padding: 28px 0;
  border-top: 1px solid var(--rule);
}

.principles li:first-child {
  padding-top: 0;
  border-top: 0;
}

.principles li:last-child {
  padding-bottom: 0;
}

.index {
  grid-row: span 2;
  padding-top: 6px;
  color: var(--fg-subtle);
}

.principles h3 {
  font-size: clamp(20px, 2vw, 24px);
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: -0.015em;
}

.principles p {
  color: var(--fg-muted);
  text-wrap: pretty;
}

/* ---------- Footer ---------- */

.site-footer {
  display: flex;
  justify-content: space-between;
  width: calc(100% - 2 * var(--gutter));
  max-width: calc(var(--max) - 2 * var(--gutter));
  margin: 0 auto;
  padding: 24px 0 40px;
  border-top: 1px solid var(--rule);
  color: var(--fg-subtle);
}

.site-footer a {
  transition: color 150ms ease;
}

.site-footer a:hover {
  color: var(--fg);
}

/* ---------- Small screens ---------- */

@media (max-width: 760px) {
  body {
    font-size: 16px;
  }

  .menu-bar {
    height: 56px;
  }

  .menu-bar-items {
    gap: 20px;
  }

  .section {
    grid-template-columns: minmax(0, 1fr);
    row-gap: 28px;
    padding-top: 24px;
  }

  .principles li {
    grid-template-columns: 40px minmax(0, 1fr);
  }

  .plate img {
    aspect-ratio: 4 / 3;
  }
}
