/* Base: reset, typography, layout primitives */

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 1ms !important; transition-duration: 1ms !important; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: var(--fs-base);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* Paints the phone status-bar band above the sticky header */
body::before {
  content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 60;
  background: var(--chalk);
}

img, svg, video { display: block; max-width: 100%; height: auto; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--link); text-underline-offset: 3px; }
a:hover { color: var(--indigo); }

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

h1, h2, h3, h4 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  line-height: var(--lh-tight);
  color: var(--indigo);
  text-wrap: balance;
}
h1 { font-size: var(--fs-3xl); }
h2 { font-size: var(--fs-2xl); }
h3 { font-size: var(--fs-xl); line-height: var(--lh-snug); }
h4 { font-size: var(--fs-lg); line-height: var(--lh-snug); }
p { margin: 0; text-wrap: pretty; }
ul, ol { margin: 0; padding: 0; }

.skip-link {
  position: absolute; left: var(--s-4); top: -100px; z-index: 100;
  background: var(--indigo); color: var(--white); padding: var(--s-2) var(--s-4); border-radius: var(--r-sm);
}
.skip-link:focus { top: var(--s-4); color: var(--white); }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* Layout primitives */
.wrap {
  width: 100%;
  max-width: calc(var(--wrap) + var(--gutter) + var(--gutter-r));
  margin-inline: auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter-r);
}
.section { padding-block: var(--section); }
.section--dune { background: var(--dune); }
.section--night {
  background: var(--indigo) var(--lattice-light);
  color: rgb(255 255 255 / .82);
}
.section--night h2, .section--night h3 { color: var(--white); }

.stack { display: flex; flex-direction: column; gap: var(--s-4); }
.cluster { display: flex; flex-wrap: wrap; gap: var(--s-3); align-items: center; }

/* Section heading block: eyebrow + title + lead, optional action on the right */
.section-head {
  display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between;
  gap: var(--s-5); margin-bottom: var(--s-7);
}
.section-head > div { max-width: var(--wrap-text); min-width: 0; display: grid; gap: var(--s-3); }

.eyebrow {
  display: inline-flex; align-items: center; gap: var(--s-2);
  font-size: var(--fs-xs); font-weight: 700; letter-spacing: var(--tracking-label);
  text-transform: uppercase; color: var(--henna);
}
.eyebrow::before {
  content: ""; width: 10px; height: 13px; background: currentColor;
  border-radius: 5px 5px 0 0;  /* tiny arch */
}
.section--night .eyebrow { color: var(--saffron); }

.lead { font-size: var(--fs-lg); line-height: 1.55; color: var(--muted); }
.section--night .lead { color: rgb(255 255 255 / .72); }

figure { margin: 0; }

/* Small utilities (the Content-Security-Policy forbids inline style attributes) */
.mt-2 { margin-top: var(--s-2); }
.mt-3 { margin-top: var(--s-3); }
.mt-4 { margin-top: var(--s-4); }
.mt-5 { margin-top: var(--s-5); }
.mt-6 { margin-top: var(--s-6); }
.text-muted { color: var(--muted); }
.text-sm { font-size: var(--fs-sm); }
.measure { max-width: var(--wrap-text); }

/* Reveal: content is visible at rest; JS adds .is-armed only when it can animate it in */
.reveal.is-armed { opacity: 0; transform: translateY(18px); }
.reveal.is-in { opacity: 1; transform: none; transition: opacity .7s var(--ease), transform .7s var(--ease); }
