/* Reset, typography and global layout primitives. */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 1rem);
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  margin: 0;
  background: var(--limestone);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: 1.65;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

body.menu-open {
  overflow: hidden;
}

/* Subtle film grain for the cinematic direction. */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9998;
  opacity: 0.045;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: multiply;
}

img,
picture,
video,
svg {
  display: block;
  max-width: 100%;
}

img {
  height: auto;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

p {
  margin: 0 0 1.25em;
}

p:last-child {
  margin-bottom: 0;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  font-family: var(--font-serif);
  font-weight: 400;
  line-height: 1.02;
  letter-spacing: var(--tracking-display);
  text-wrap: balance;
}

::selection {
  background: var(--sand);
  color: var(--charcoal);
}

:focus-visible {
  outline: 2px solid var(--cork);
  outline-offset: 4px;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 10000;
  padding: 0.75rem 1rem;
  background: var(--charcoal);
  color: var(--limestone);
  font-size: var(--text-sm);
  letter-spacing: 0.08em;
  transition: top 200ms;
}

.skip-link:focus {
  top: 1rem;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* Type helpers */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.85em;
  font-family: var(--font-sans);
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--ink-muted);
}

.eyebrow::before {
  content: "";
  width: 2.25rem;
  height: 1px;
  background: currentColor;
  opacity: 0.55;
}

.eyebrow--bare::before {
  display: none;
}

.display,
.headline,
.title {
  font-family: var(--font-serif);
  font-weight: 400;
  letter-spacing: var(--tracking-display);
  text-wrap: balance;
}

.display {
  font-size: var(--text-display);
  text-transform: uppercase;
  line-height: 0.92;
}

.headline {
  font-size: var(--text-3xl);
  text-transform: uppercase;
  line-height: 0.98;
}

.headline--sentence {
  text-transform: none;
  line-height: 1.05;
}

.title {
  font-size: var(--text-2xl);
  line-height: 1.05;
}

.subtitle {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: var(--text-xl);
  line-height: 1.2;
  color: var(--cork-deep);
}

.lede {
  font-size: var(--text-lg);
  line-height: 1.55;
  color: var(--ink);
  max-width: 34em;
}

.measure {
  max-width: 38em;
}

.muted {
  color: var(--ink-muted);
}

.serif {
  font-family: var(--font-serif);
}

.italic {
  font-style: italic;
}

/* Layout */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section {
  padding-block: var(--section);
}

.section--sm {
  padding-block: var(--section-sm);
}

.section--flush-top {
  padding-top: 0;
}

.section--flush-bottom {
  padding-bottom: 0;
}

.grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--gap);
  row-gap: calc(var(--gap) * 1.5);
}

.col-3 { grid-column-end: span 3; }
.col-4 { grid-column-end: span 4; }
.col-5 { grid-column-end: span 5; }
.col-6 { grid-column-end: span 6; }
.col-7 { grid-column-end: span 7; }
.col-8 { grid-column-end: span 8; }
.col-10 { grid-column-end: span 10; }
.col-12 { grid-column-end: span 12; }
.col-start-2 { grid-column-start: 2; }
.col-start-3 { grid-column-start: 3; }
.col-start-4 { grid-column-start: 4; }
.col-start-6 { grid-column-start: 6; }
.col-start-7 { grid-column-start: 7; }
.col-start-8 { grid-column-start: 8; }
.col-start-9 { grid-column-start: 9; }
.col-start-10 { grid-column-start: 10; }

@media (max-width: 960px) {
  .col-3,
  .col-4,
  .col-5,
  .col-6,
  .col-7,
  .col-8,
  .col-10 {
    grid-column: 1 / -1;
  }

  .col-start-2,
  .col-start-3,
  .col-start-4,
  .col-start-6,
  .col-start-7,
  .col-start-8,
  .col-start-9,
  .col-start-10 {
    grid-column: 1 / -1;
  }

  .md-col-6 {
    grid-column: auto / span 6;
  }
}

@media (max-width: 600px) {
  .md-col-6 {
    grid-column: 1 / -1;
  }
}

.stack > * + * {
  margin-top: var(--gap);
}

.stack-sm > * + * {
  margin-top: 1rem;
}

.rule {
  border: 0;
  height: 1px;
  background: var(--line);
  margin: 0;
}

/* Theme blocks */
.theme-dark {
  background: var(--charcoal);
  color: var(--limestone);
  --ink: var(--limestone);
  --ink-muted: rgba(244, 239, 230, 0.62);
  --line: var(--line-light);
}

.theme-dark .subtitle {
  color: var(--sand);
}

.theme-olive {
  background: var(--olive);
  color: var(--limestone);
  --ink: var(--limestone);
  --ink-muted: rgba(244, 239, 230, 0.66);
  --line: var(--line-light);
}

.theme-olive .subtitle {
  color: var(--sand-soft);
}

.theme-sand {
  background: var(--sand-soft);
}

.theme-deep {
  background: var(--limestone-deep);
}
