/* ==========================================================================
   Layout — container, grid, section rhythm, shared UI primitives.
   ========================================================================== */

.container {
  width: 100%;
  max-width: var(--page-max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.grid {
  display: grid;
  grid-template-columns: repeat(var(--columns), minmax(0, 1fr));
  column-gap: var(--col-gap);
}

.section {
  padding-block: var(--space-section);
  border-top: 1px solid var(--rule);
}

/* ---- Section head: small numbered label above the headline ----------- */
.section-head {
  display: grid;
  gap: var(--space-3);
  max-width: 46rem;
  margin-bottom: var(--space-7);
}
.section-head__title {
  font-size: var(--step-3);
  line-height: 1.06;
  letter-spacing: var(--tracking-tight);
}
.section-head__sub {
  font-size: var(--step-1);
  line-height: 1.4;
}

/* ---- Split: headline left, content right; stacks on narrow screens --- */
.split {
  display: grid;
  grid-template-columns: repeat(var(--columns), minmax(0, 1fr));
  column-gap: var(--col-gap);
  row-gap: var(--space-6);
  align-items: start;
}
.split > .section-head { grid-column: 1 / span 6; margin-bottom: 0; }
.split__body {
  grid-column: 8 / -1;
  /* start level with the headline, not the label above it */
  padding-top: calc(1.3 * var(--step--1) + var(--space-3));
}
.split__full { grid-column: 1 / -1; }

@media (max-width: 960px) {
  .split > .section-head,
  .split__body { grid-column: 1 / -1; }
  .split__body { padding-top: 0; }
}

/* ---- Prose ----------------------------------------------------------- */
.prose p { font-size: var(--step-1); line-height: 1.5; }
.prose p + p { margin-top: var(--space-4); }
.lead {
  font-size: var(--step-2);
  line-height: 1.3;
  letter-spacing: -0.015em;
}
.prose .lead { font-size: var(--step-2); line-height: 1.3; margin-bottom: var(--space-5); }
.prose .lead + p { margin-top: 0; }

/* Parenthetical asides: same voice, one step quieter, on their own line under
   the sentence they comment on. Never broken inside unless a phone is simply
   too narrow, then two balanced lines. Footer and captions keep them inline. */
.aside { display: block; width: fit-content; color: var(--ink-soft); text-wrap: balance; }
.site-footer .aside,
.exhibit__caption .aside { display: inline; }

/* ---- Text primitives ------------------------------------------------- */
.label {
  font-size: var(--step--1);
  font-weight: 500;
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--ink-soft);
  line-height: 1.3;
}

/* Section labels: number and name at the same, larger size */
.section-head > .label {
  font-size: calc(var(--step--1) * 1.75);
  line-height: 1.1;
  letter-spacing: 0.04em;
}
.index {
  font-variant-numeric: tabular-nums;       /* plain zero, not the mono slashed one */
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--accent);
  margin-right: var(--space-2);
}

em {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  letter-spacing: -0.01em;
}

/* ---- Buttons & links ------------------------------------------------- */
.button {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 0.9em 1.4em;
  background: var(--ink);
  color: var(--paper);
  border-radius: var(--radius);
  font-weight: 500;
  line-height: 1;
  transition: background var(--dur-fast) var(--ease-out);
}
.button:hover { background: var(--accent); color: var(--accent-ink); }

/* Primary: accent fill */
.button--accent { background: var(--accent); color: var(--accent-ink); }
.button--accent:hover { background: var(--ink); color: var(--paper); }

/* Secondary: hairline outline */
.button--ghost {
  background: transparent;
  color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--ink);
}
.button--ghost:hover { background: var(--ink); color: var(--paper); }

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  font-weight: 500;
  background-image: linear-gradient(currentColor, currentColor);
  background-size: 100% 1px;
  background-position: 0 100%;
  background-repeat: no-repeat;
  padding-bottom: 2px;
  transition: color var(--dur-fast) var(--ease-out);
}
.link-arrow::after {
  content: "→";
  transition: transform var(--dur-fast) var(--ease-out);
}
.link-arrow:hover { color: var(--accent); }
.link-arrow:hover::after { transform: translateX(3px); }
.link-arrow--up::after { content: "↑"; }
.link-arrow--up:hover::after { transform: translateY(-3px); }

.link-cta {
  font-weight: 500;
  color: var(--accent);
}
.link-cta:hover { text-decoration: underline; text-underline-offset: 4px; }

/* ---- Form fields: hairline underline, label above --------------------- */
.field { display: grid; gap: var(--space-2); }
.field input,
.field textarea {
  width: 100%;
  font: inherit;
  font-size: var(--step-1);
  color: var(--ink);
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--ink-soft);
  border-radius: 0;
  padding: 0.35em 0 0.5em;
  transition: border-color var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);
}
.field textarea { resize: vertical; min-height: 7.5em; line-height: 1.5; }
.field input:focus,
.field textarea:focus {
  outline: none;
  border-bottom-color: var(--accent);
  box-shadow: 0 1px 0 var(--accent);
}

/* ---- Media placeholder ---------------------------------------------- */
.media {
  position: relative;
  aspect-ratio: var(--ratio, 4/3);
  background: var(--paper-deep);
  border-radius: var(--radius);
  overflow: hidden;
  display: grid;
  place-items: center;
}
.media img { width: 100%; height: 100%; object-fit: cover; }
.media__mark {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: var(--step-2);
  color: var(--ink-soft);
}

/* ---- Scroll reveal (only when JS is running) ------------------------ */
.js [data-reveal] {
  opacity: 0;
  transform: translateY(16px);
  transition:
    opacity var(--dur-slow) var(--ease-out),
    transform var(--dur-slow) var(--ease-out);
}
.js [data-reveal].is-visible {
  opacity: 1;
  transform: none;
}
@media (prefers-reduced-motion: reduce) {
  .js [data-reveal] { opacity: 1; transform: none; }
}
