/* ==========================================================================
   Oria Haven — Reset, typography and 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; }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  font-weight: 400;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

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

h1, h2, h3, h4, h5, p, figure, blockquote, ul, ol, dl, dd { margin: 0; }
ul, ol { padding: 0; list-style: none; }

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

button, input, select, textarea {
  font: inherit;
  color: inherit;
  margin: 0;
}
button { background: none; border: 0; cursor: pointer; }

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
  border-radius: 4px;
}
.on-deep :focus-visible,
.slab :focus-visible { outline-color: var(--focus-on-deep); }

::selection { background: var(--deep); color: var(--white); }

/* --- Headings ------------------------------------------------------- */
.display,
.h1, .h2, .h3 {
  font-family: var(--font-sans);
  font-weight: 500;
  color: var(--ink);
  text-wrap: balance;
}
.display { font-size: var(--fs-display); line-height: var(--lh-tight); letter-spacing: var(--tr-display); }
.h1      { font-size: var(--fs-h1);      line-height: var(--lh-head);  letter-spacing: var(--tr-display); }
.h2      { font-size: var(--fs-h2);      line-height: var(--lh-head);  letter-spacing: var(--tr-head); }
.h3      { font-size: var(--fs-h3);      line-height: 1.25;            letter-spacing: -0.014em; font-weight: 600; }

.on-deep .display, .on-deep .h1, .on-deep .h2, .on-deep .h3 { color: var(--white); }

/* The editorial voice: used only for emphasis inside headings,
   pull-quotes and the wordmark. Never for running text. */
.edit {
  font-family: var(--font-edit);
  font-style: italic;
  font-weight: 400;
  letter-spacing: -0.01em;
}

.lede {
  font-size: clamp(1.0625rem, 1.35vw, 1.2rem);
  line-height: 1.55;
  color: var(--text-soft);
  max-width: 46ch;
}
.on-deep .lede { color: var(--mist); }

.prose p + p { margin-top: var(--s-4); }
.prose { max-width: var(--maxw-text); color: var(--text-soft); }
/* Article body that runs the full content column instead of the reading
   measure — the journal's own layout, where the text lines up with the
   page header and the lead image above it. */
.prose--wide { max-width: none; }

.micro {
  font-size: var(--fs-micro);
  font-weight: 700;
  letter-spacing: var(--tr-micro);
  text-transform: uppercase;
  color: var(--text-faint);
}
.on-deep .micro { color: var(--mist); }

.muted { color: var(--text-soft); }
.on-deep .muted { color: var(--mist); }

/* --- Layout --------------------------------------------------------- */
.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.wrap--narrow { max-width: 940px; }

.section { padding-block: var(--section-y); }
.section--tight { padding-block: clamp(2.5rem, 5vw, 4.5rem); }
.section--top-flush { padding-top: 0; }
.section--bottom-flush { padding-bottom: 0; }

.band-sand  { background: var(--sand); }
.band-paper { background: var(--paper); }

/* A slab is the signature structural device: a full-bleed dark panel
   inset from the page edge with a large radius. */
.slab {
  background: var(--deep);
  color: var(--text-on-deep);
  border-radius: var(--r-2xl);
  margin-inline: var(--gutter);
  overflow: hidden;
  position: relative;
}
@media (max-width: 640px) {
  .slab { border-radius: var(--r-xl); margin-inline: 0.75rem; }
}

.stack > * + * { margin-top: var(--s-4); }
.stack-lg > * + * { margin-top: var(--s-6); }

.grid { display: grid; gap: var(--s-5); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 980px) {
  .grid-3, .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 620px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: minmax(0, 1fr); }
}

.row { display: flex; align-items: center; gap: var(--s-3); }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: var(--s-5); flex-wrap: wrap; }

.hr { height: 1px; background: var(--line); border: 0; }
.on-deep .hr, .slab .hr { background: var(--teal-line); }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; top: -100px; left: var(--s-4); z-index: 999;
  background: var(--white); color: var(--ink);
  padding: var(--s-3) var(--s-5); border-radius: var(--r-pill);
  box-shadow: var(--sh-2);
}
.skip-link:focus { top: var(--s-4); }

/* --- Section headers ------------------------------------------------ */
.sec-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--s-6);
  flex-wrap: wrap;
  margin-bottom: var(--s-7);
}
.sec-head__text { max-width: 34ch; }
.sec-head__aside { max-width: 40ch; }
.sec-head .micro { margin-bottom: var(--s-3); display: block; }

.sec-head--center {
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.sec-head--center .sec-head__text { max-width: 24ch; }

/* --- Scroll reveal -------------------------------------------------- */
.js .reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity var(--t-slow) var(--ease-out),
              transform var(--t-slow) var(--ease-out);
  transition-delay: var(--d, 0ms);
}
.reveal.is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; }
}
