/* ============ Design tokens ============ */
:root {
  --paper: #faf7f2;
  --paper-soft: #f3eee6;
  --ink: #121014;
  --ink-soft: #4a444b;
  --maroon: #6e1423;
  --maroon-deep: #4c0d19;
  --maroon-bright: #93202f;
  --hairline: rgba(18, 16, 20, 0.14);
  --hairline-light: rgba(250, 247, 242, 0.18);

  --font-display: "Fraunces", "Georgia", serif;
  --font-body: "Archivo", "Helvetica Neue", sans-serif;

  --space-section: clamp(6rem, 12vw, 10rem);
  --space-gutter: clamp(1.25rem, 5vw, 5rem);
  --ease-out: cubic-bezier(0.19, 1, 0.22, 1);
}

/* ============ Reset ============ */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

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

ul {
  list-style: none;
}

::selection {
  background: var(--maroon);
  color: var(--paper);
}

/* ============ Shared type styles ============ */
.section-no {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 300;
  font-size: clamp(1rem, 2vw, 1.4rem);
  color: var(--maroon);
}

.section-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2.2rem, 5.5vw, 4.2rem);
  line-height: 1.05;
  letter-spacing: -0.01em;
}

.section-title::after {
  content: "";
  display: block;
  width: 3.5rem;
  height: 2px;
  margin-top: 1.1rem;
  background: var(--maroon);
}

.section-intro {
  max-width: 34rem;
  font-size: clamp(1rem, 1.6vw, 1.2rem);
  color: var(--ink-soft);
  margin-bottom: clamp(2.5rem, 5vw, 4rem);
}

.section-dark .section-intro {
  color: rgba(250, 247, 242, 0.66);
}

em {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
}

/* ============ Grain overlay ============ */
.grain {
  position: fixed;
  inset: 0;
  z-index: 999;
  pointer-events: none;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ============ Reveal animation ============ */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition:
    opacity 0.9s var(--ease-out),
    transform 0.9s var(--ease-out);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .marquee-track {
    animation: none !important;
  }
}
