/* ==========================================================================
   Ekoya — Base / reset / typography / layout primitives / accessibility
   ========================================================================== */

*, *::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;
  font-family: var(--ek-font-sans);
  font-size: var(--ek-fs-400);
  line-height: var(--ek-lh-body);
  color: var(--ek-ink);
  background: var(--ek-bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

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

h1, h2, h3, h4 {
  font-family: var(--ek-font-serif);
  font-weight: 560;
  line-height: var(--ek-lh-snug);
  color: var(--ek-evergreen-900);
  margin: 0 0 var(--ek-4);
  font-optical-sizing: auto;
}
h1 { font-size: var(--ek-fs-800); line-height: var(--ek-lh-tight); letter-spacing: -0.01em; }
h2 { font-size: var(--ek-fs-700); letter-spacing: -0.01em; }
h3 { font-size: var(--ek-fs-600); }
h4 { font-size: var(--ek-fs-500); font-weight: 600; }

p { margin: 0 0 var(--ek-4); max-width: 68ch; }

a { color: var(--ek-evergreen-700); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--ek-clay-600); }

strong { font-weight: 650; color: var(--ek-ink); }

ul, ol { margin: 0 0 var(--ek-4); padding-left: 1.25rem; }
li { margin-bottom: var(--ek-2); }

hr { border: 0; border-top: 1px solid var(--ek-line); margin: var(--ek-6) 0; }

blockquote {
  margin: 0 0 var(--ek-4);
  padding-left: var(--ek-4);
  border-left: 3px solid var(--ek-moss);
  color: var(--ek-ink-2);
  font-style: italic;
}

code, kbd, samp {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.9em;
  background: var(--ek-bg-2);
  padding: 0.1em 0.35em;
  border-radius: var(--ek-r-xs);
}

/* ---- Focus visibility ---- */
:focus-visible {
  outline: 3px solid var(--ek-focus);
  outline-offset: 2px;
  border-radius: var(--ek-r-xs);
}
.section--dark :focus-visible,
.footer :focus-visible { outline-color: var(--ek-focus-dark); }

/* ---- Skip link ---- */
.skip-link {
  position: absolute;
  left: var(--ek-4);
  top: -100px;
  z-index: 200;
  background: var(--ek-evergreen);
  color: var(--ek-on-dark);
  padding: 0.6rem 1rem;
  border-radius: var(--ek-r-sm);
  text-decoration: none;
  font-weight: 600;
  transition: top var(--ek-dur) var(--ek-ease);
}
.skip-link:focus { top: var(--ek-3); color: var(--ek-on-dark); }

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

/* ---- Layout primitives ---- */
.container {
  width: 100%;
  max-width: var(--ek-maxw);
  margin-inline: auto;
  padding-inline: var(--ek-gutter);
}
.container--narrow { max-width: var(--ek-maxw-narrow); }
.container--wide { max-width: var(--ek-maxw-wide); }

.section { padding-block: var(--ek-section-y); }
.section--tight { padding-block: clamp(2.5rem, 2rem + 2vw, 4rem); }
.section--flush-top { padding-top: 0; }

.section--muted { background: var(--ek-bg-2); }
.section--surface { background: var(--ek-surface); }
.section--dark {
  background: var(--ek-evergreen-900);
  color: var(--ek-on-dark);
}
.section--dark h1, .section--dark h2, .section--dark h3, .section--dark h4 { color: #fff; }
.section--dark p { color: var(--ek-on-dark-2); }
.section--dark a { color: #fff; }

/* Eyebrow / kicker label */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--ek-2);
  font-family: var(--ek-font-sans);
  font-size: var(--ek-fs-200);
  font-weight: 650;
  letter-spacing: var(--ek-ls-caps);
  text-transform: uppercase;
  color: var(--ek-clay-600);
  margin-bottom: var(--ek-3);
}
.eyebrow::before {
  content: "";
  width: 1.6rem; height: 2px;
  background: var(--ek-clay); border-radius: 2px;
}
.section--dark .eyebrow { color: var(--ek-clay-200); }
.section--dark .eyebrow::before { background: var(--ek-clay-200); }

.lead {
  font-size: var(--ek-fs-500);
  line-height: 1.55;
  color: var(--ek-ink-2);
  max-width: 60ch;
}
.section--dark .lead { color: var(--ek-on-dark-2); }

.section-head { max-width: 62ch; margin-bottom: var(--ek-7); }
.section-head--center { margin-inline: auto; text-align: center; }
.section-head--center .eyebrow { justify-content: center; }

/* Utility */
.text-center { text-align: center; }
.mt-0 { margin-top: 0; } .mb-0 { margin-bottom: 0; }
.grid { display: grid; gap: var(--ek-5); }
.flow > * + * { margin-top: var(--ek-4); }

/* Grid helpers */
.cols-2 { grid-template-columns: repeat(2, 1fr); }
.cols-3 { grid-template-columns: repeat(3, 1fr); }
.cols-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) {
  .cols-3, .cols-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 620px) {
  .cols-2, .cols-3, .cols-4 { grid-template-columns: 1fr; }
}

/* Reveal-on-scroll (progressive; content visible if JS/observer absent) */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity var(--ek-dur-slow) var(--ek-ease), transform var(--ek-dur-slow) var(--ek-ease); }
.reveal.is-visible { opacity: 1; transform: none; }
.no-js .reveal { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1 !important; transform: none !important; transition: none; }
}
