/* Layout: container, header, section head, footer band.
   Breakpoints — mobile ≤ 820 · tablet 821–1023 · laptop 1024–1279 · desktop 1280–1599 · wide ≥ 1600. */

@media (min-width: 821px) {
  :root { --gutter: var(--space-6); }
}

@media (min-width: 1280px) {
  :root { --gutter: var(--space-7); }
}

.container {
  width: 100%;
  max-width: calc(var(--size-content) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.container-pad {
  padding-inline: var(--gutter);
}

/* The reading column: where copy lives while paper shards wander at the edges. */
.column {
  width: 100%;
  max-width: calc(40rem + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.column > * + * {
  margin-top: var(--space-5);
}

/* ─── Section head: eyebrow + title, the italic numeral on the right (design system §2) ─── */

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-5);
}

.section-head__text > .title {
  margin-top: var(--space-4);
}

.section-head--center {
  justify-content: center;
  text-align: center;
}

.section-head--center .section-num {
  display: none;
}

.section-head--center .eyebrow {
  display: inline-flex;
}

.section-head--center .title {
  margin-inline: auto;
}

.eyebrow {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.eyebrow__index {
  color: var(--color-text);
}

.eyebrow__index::after {
  content: "—";
  margin-left: var(--space-2);
  color: var(--color-text-secondary);
}

/* ─── Header ─── */

.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 20;
  background: var(--nav-bg);
  border-bottom: 1px solid var(--color-border);
}

.site-header__inner {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  height: var(--header-height);
  max-width: none;
}

.site-header__brand {
  display: flex;
  align-items: center;
  min-height: var(--size-touch);
  margin-right: auto;
  color: var(--color-text);
}

.logo {
  width: auto;
  height: 2.75rem;
  aspect-ratio: 1480 / 770;
}

.site-nav__list {
  display: flex;
  gap: var(--space-1);
}

.site-nav__list a {
  display: inline-flex;
  align-items: center;
  min-height: var(--size-touch);
  padding-inline: var(--space-3);
  border-radius: var(--radius-sm);
  color: var(--color-text-secondary);
  font-size: var(--text-sm);
  font-weight: 500;
  text-decoration: none;
}

.site-nav__list a:hover {
  background: var(--color-surface-sunken);
  color: var(--color-text);
}

.lang-switch {
  display: flex;
  padding: 2px;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-full);
}

.lang-switch__option {
  min-width: var(--size-touch);
  min-height: var(--size-touch);
  padding: 0 var(--space-3);
  border: 0;
  border-radius: var(--radius-full);
  background: transparent;
  color: var(--color-text-secondary);
  font: 600 var(--text-xs) / 1 var(--font-body);
  letter-spacing: 0.08em;
  cursor: pointer;
}

.lang-switch__option[aria-pressed="true"] {
  background: var(--color-text);
  color: var(--color-bg);
}

.lang-switch__option:hover:not([aria-pressed="true"]) {
  color: var(--color-text);
}

@media (max-width: 1150px) {
  .site-nav {
    display: none;
  }
}

/* ─── Header at rest: before the page moves, only the language switch and the CTA show, laid
   straight on the paper (no bar, no pill fills). The first scroll — or keyboard focus anywhere
   in the header — brings the bar, the logo and the navigation in (HeaderReveal). ─── */

.site-header {
  transition: background-color var(--duration-base) ease, border-color var(--duration-base) ease;
}

.site-header__brand,
.site-nav {
  transition: opacity var(--duration-base) ease, transform var(--duration-base) var(--ease-fold);
}

.lang-switch,
.lang-switch__option {
  transition: background-color var(--duration-base) ease, color var(--duration-base) ease, border-color var(--duration-base) ease, box-shadow var(--duration-base) ease;
}

.site-header[data-state="rest"]:not(:focus-within) {
  background-color: transparent;
  border-bottom-color: transparent;
}

.site-header[data-state="rest"]:not(:focus-within) :is(.site-header__brand, .site-nav) {
  opacity: 0;
  transform: translateY(calc(-1 * var(--space-2)));
  pointer-events: none;
}

.site-header[data-state="rest"]:not(:focus-within) .lang-switch {
  border-color: transparent;
}

.site-header[data-state="rest"]:not(:focus-within) .lang-switch__option[aria-pressed="true"] {
  background: transparent;
  color: var(--color-text);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.45em;
}

.top-sentinel {
  position: absolute;
  top: 0;
  left: 0;
  width: 1px;
  height: var(--space-6);
  pointer-events: none;
  visibility: hidden;
}

/* Phones: no room for the logo and the CTA together. At rest the CTA shows (the dove is the
   brand on screen); once scrolling, the logo takes its place. Keyed to the state only, never to
   focus, so a focused CTA cannot disappear under the keyboard. */
@media (max-width: 820px) {
  .site-header[data-state="rest"] .site-header__brand {
    display: none;
  }

  .site-header[data-state="rest"] .lang-switch {
    margin-left: auto;
  }

  .site-header[data-state="solid"] .site-header__cta {
    display: none;
  }

  .logo {
    height: 2.25rem;
  }
}

/* ─── Sections ─── */

main {
  position: relative;
  z-index: 1;
}

.section {
  position: relative;
  padding-block: var(--space-9) 0;
  scroll-margin-top: var(--header-height);
}

/* ─── Footer: the deliberate dark band (design system "mode sombre") ─── */

.site-footer {
  position: relative;
  z-index: 2;
  padding-block: var(--space-9) var(--space-6);
  background: var(--color-bg);
  color: var(--color-text);
}

.site-footer a:not(.button) {
  color: var(--color-primary);
}

.site-footer a:not(.button):hover {
  color: var(--color-text);
}

.site-footer__top {
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(0, 2fr) minmax(0, 3fr) minmax(0, 3fr);
  gap: var(--space-7);
  padding-bottom: var(--space-8);
}

.site-footer .logo--inverse {
  --logo-mark: var(--fern-300);
  height: 3.75rem;
  color: var(--color-text);
}

.site-footer__tagline {
  margin-top: var(--space-4);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-text-secondary);
}

.site-footer__statement {
  max-width: 16ch;
  margin-top: var(--space-7);
  font-family: var(--font-serif);
  font-size: var(--text-xl);
  font-style: italic;
  line-height: 1.25;
  color: var(--color-text);
}

.site-footer__heading {
  margin-bottom: var(--space-4);
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-accent-text);
}

.site-footer__contact {
  margin-bottom: var(--space-2);
  line-height: 1.6;
}

.site-footer__list li a {
  display: inline-flex;
  align-items: center;
  min-height: var(--size-touch);
}

/* The language pill is as wide as its two options, not the whole column. */
.site-footer .lang-switch {
  width: max-content;
}

.site-footer__cta {
  margin-top: var(--space-6);
  white-space: nowrap;
}

.site-footer__legal {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2) var(--space-6);
  padding-top: var(--space-5);
  border-top: 1px solid var(--color-border);
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
}

.site-footer__legal a {
  display: inline-flex;
  align-items: center;
  min-height: var(--size-touch);
}

@media (max-width: 1023px) {
  .site-footer__top {
    grid-template-columns: 1fr 1fr;
  }

  .site-footer__brand {
    grid-column: 1 / -1;
  }
}

@media (max-width: 560px) {
  .site-footer__top {
    grid-template-columns: 1fr;
  }
}
