/* ==========================================================================
   Sandalo — base: reset, typography, layout primitives
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scrollbar-gutter: stable; } /* no sideways jump when the scrollbar appears */
body {
  margin: 0;
  background: var(--cream);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg, video { display: block; max-width: 100%; height: auto; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; }
h1, h2, h3, h4, p, ul, ol, figure, blockquote { margin: 0; }
h1, h2, h3, h4 { font-weight: 400; }          /* no browser-default bold anywhere */
strong, b { font-weight: 600; }

/* Dark surfaces re-map the text roles, so headings and copy stay legible there
   without per-section colour rules. */
[data-header-overlay], .factory, .project-hero, .site-footer, .lightbox {
  --text-strong: var(--cream);
  --text: var(--cream);
  --text-muted: rgba(245,242,235,0.78);
}
ul[role="list"], ol[role="list"] { list-style: none; padding: 0; }
[hidden] { display: none !important; }

/* ---- Type styles (spec section 2) ------------------------------------- */
.t-display, .t-h1, .t-h2 {
  font-family: var(--font-serif);
  font-weight: 400;              /* regular only — placeholder rules */
  color: var(--text-strong);
  text-wrap: balance;
}
.t-display { font-size: var(--fs-display); line-height: var(--lh-display); letter-spacing: -0.015em; }
.t-h1      { font-size: var(--fs-h1);      line-height: var(--lh-h1);      letter-spacing: -0.01em; }
.t-h2      { font-size: var(--fs-h2);      line-height: var(--lh-h2);      letter-spacing: -0.005em; }
.t-h3      { font-family: var(--font-sans); font-weight: 400; font-size: var(--fs-h3); line-height: var(--lh-h3); letter-spacing: -0.005em; color: var(--text-strong); }
.t-lead    { font-size: var(--fs-lead); line-height: var(--lh-lead); }
.t-small   { font-size: var(--fs-small); line-height: 1.5; letter-spacing: 0.005em; color: var(--text-muted); }
/* Eyebrow: a quiet sentence-case label in olive (was 12 px / 600 / uppercase / 0.14em). */
.t-eyebrow {
  font-family: var(--font-sans);
  font-size: var(--fs-eyebrow);
  line-height: 1.3;
  letter-spacing: 0.01em;
  font-weight: 500;
  color: var(--olive-500);
}
.t-stat { font-family: var(--font-serif); font-size: var(--fs-stat); line-height: 1; letter-spacing: -0.02em; color: var(--olive-500); }
.measure { max-width: 34em; } /* ~60–70 characters */

/* ---- Container & grid ------------------------------------------------- */
.container {
  width: 100%;
  max-width: calc(var(--container-max) + 2 * var(--margin));
  margin-inline: auto;
  padding-inline: var(--margin);
}
.grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  column-gap: var(--gutter);
}
@media (min-width: 1024px) {
  .grid { grid-template-columns: repeat(12, minmax(0, 1fr)); }
}
.section { padding-block: var(--section-y); }
.section--stone { background: var(--stone); }
.section--olive-100 { background: var(--olive-100); }
.hairline { border: 0; border-top: var(--hairline); margin: 0; }

/* ---- Accessibility ---------------------------------------------------- */
:focus-visible {
  outline: 2px solid var(--olive-500);
  outline-offset: 2px;
  border-radius: var(--radius);
}
.visually-hidden {
  position: absolute !important; 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; left: var(--margin); top: -100px; z-index: 100;
  background: var(--olive-500); color: var(--white); padding: 12px 16px; text-decoration: none;
}
.skip-link:focus { top: 12px; }

/* Conditional content (spec section 5, "Conditional sections"):
   elements marked data-requires are hidden unless content.js supplies the data
   or preview mode is on. Without JS they stay hidden: no empty shells. */
[data-requires]:not(.is-available) { display: none !important; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 1ms !important;
    transition-duration: 150ms !important;
  }
}
