/* ============================================================
   LSI BASE — resets, typography, layout primitives
   ============================================================ */

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 88px; /* clear sticky header */
}

body {
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  line-height: var(--lh-normal);
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

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

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

a {
  color: var(--color-text);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  text-decoration-color: var(--ls-gray-300);
  transition: color var(--dur-fast) var(--ease-out), text-decoration-color var(--dur-fast) var(--ease-out);
}
a:hover { color: var(--color-accent-hover); text-decoration-color: currentColor; }

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

::selection {
  background: var(--ls-teal-200);
  color: var(--ls-navy-900);
}

/* ---------- Skip link ---------- */
.skip-link {
  position: absolute;
  top: -100px;
  left: var(--space-4);
  padding: var(--space-3) var(--space-5);
  background: var(--ls-navy-900);
  color: var(--ls-white);
  text-decoration: none;
  border-radius: var(--radius-md);
  z-index: var(--z-modal);
  font-weight: var(--fw-semibold);
}
.skip-link:focus { top: var(--space-4); }

/* ---------- Typography primitives ---------- */
.display {
  font-family: var(--font-sans);
  font-weight: var(--fw-regular);
  line-height: var(--lh-tight);
  letter-spacing: var(--tracking-tight);
}

h1, .h1 {
  font-family: var(--font-sans);
  font-weight: var(--fw-regular);
  font-size: var(--fs-4xl);
  line-height: var(--lh-tight);
  letter-spacing: var(--tracking-tight);
  color: var(--color-text);
}

h2, .h2 {
  font-family: var(--font-sans);
  font-weight: var(--fw-regular);
  font-size: var(--fs-3xl);
  line-height: var(--lh-snug);
  letter-spacing: var(--tracking-snug);
}

h3, .h3 {
  font-family: var(--font-sans);
  font-weight: var(--fw-medium);
  font-size: var(--fs-2xl);
  line-height: var(--lh-snug);
  letter-spacing: var(--tracking-snug);
}

h4, .h4 {
  font-family: var(--font-sans);
  font-weight: var(--fw-medium);
  font-size: var(--fs-xl);
  line-height: var(--lh-snug);
}

h5, .h5 {
  font-family: var(--font-sans);
  font-weight: var(--fw-semibold);
  font-size: var(--fs-base);
  line-height: var(--lh-snug);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
}

p { line-height: var(--lh-relaxed); }

.lead {
  font-size: var(--fs-lg);
  line-height: var(--lh-relaxed);
  color: var(--color-text-muted);
  max-width: 60ch;
}

.eyebrow {
  display: inline-block;
  font-family: var(--font-sans);
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  letter-spacing: var(--tracking-widest);
  text-transform: uppercase;
  color: var(--color-accent-hover);
}

.meta {
  font-size: var(--fs-sm);
  color: var(--color-text-muted);
}

/* ---------- Serif body (long-form publication content) ---------- */
.prose {
  font-family: var(--font-serif);
  font-size: var(--fs-body);
  line-height: var(--lh-loose);
  color: var(--color-text);
  max-width: var(--container-narrow);
}

.prose > * + * { margin-top: 1.5em; }
/* Vertical rhythm for block-level siblings INSIDE nested <section>s too
   (the .prose > * + * rule above only applies to direct children). */
.prose section > * + * { margin-top: 1.5em; }
.prose section + section { margin-top: 2.5em; }
/* Ensure paragraphs after sup/aside sibling chunks still space correctly */
.prose p + p,
.prose p + ul,
.prose p + ol,
.prose ul + p,
.prose ol + p,
.prose p + blockquote,
.prose blockquote + p,
.prose p + figure,
.prose figure + p,
.prose p + div,
.prose div + p { margin-top: 1.5em; }
.prose h2, .prose h3, .prose h4 { font-family: var(--font-sans); }
.prose h2 { font-size: var(--fs-2xl); margin-top: 2.25em; }
.prose h3 { font-size: var(--fs-xl); margin-top: 1.75em; }
.prose h4 { font-size: var(--fs-lg); margin-top: 1.5em; }
/* Section h2/h3 already have section gap above them */
.prose section > h2:first-child,
.prose section > h3:first-child { margin-top: 0; }
.prose p { line-height: var(--lh-loose); }
.prose a {
  color: var(--color-text);
  text-decoration-color: var(--color-accent);
  text-decoration-thickness: 1.5px;
}
.prose a:hover { color: var(--color-accent-hover); }
.prose strong { font-weight: var(--fw-semibold); }
.prose em { font-style: italic; }
.prose blockquote {
  padding-left: var(--space-6);
  border-left: 3px solid var(--color-accent);
  font-size: var(--fs-lg);
  line-height: var(--lh-relaxed);
  color: var(--color-text);
  font-style: normal;
}
.prose figure figcaption,
.prose .prose__figcaption {
  font-family: var(--font-sans);
  font-size: var(--fs-sm);
  color: var(--color-text-muted);
  margin-top: var(--space-3);
}
.prose .prose__figure {
  margin-block: var(--space-7);
}
.prose .prose__figure .photo-brand { width: 100%; }
.prose ul, .prose ol { padding-left: 1.5em; }
.prose li + li { margin-top: 0.5em; }
.prose sup {
  font-size: 0.75em;
  vertical-align: super;
  line-height: 0;
}
.prose sup a {
  color: var(--color-accent-hover);
  font-family: var(--font-sans);
  text-decoration: none;
  font-weight: var(--fw-semibold);
  padding: 0 0.15em;
}

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

.section { padding-block: var(--section-y); }
.section--lg { padding-block: var(--section-y-lg); }
.section--tight { padding-block: var(--space-8); }

.section--dark {
  background: var(--ls-navy-900);
  color: var(--color-text-inverse);
}
.section--dark .eyebrow { color: var(--ls-teal-400); }
.section--dark a { color: var(--color-text-inverse); text-decoration-color: rgba(255,255,255,.25); }
.section--dark a:hover { color: var(--ls-teal-400); }

.section--subtle { background: var(--color-bg-subtle); }

/* ---------- Grid utilities ---------- */
.grid { display: grid; gap: var(--space-6); }
.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)); }
.grid-2-1 { grid-template-columns: 2fr 1fr; }

@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-2-1 { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
}

/* ---------- Flex utilities ---------- */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }

/* ---------- Text utilities ---------- */
.text-center { text-align: center; }
.text-muted { color: var(--color-text-muted); }
.text-inverse { color: var(--color-text-inverse); }
.text-accent { color: var(--color-accent-hover); }

.max-60 { max-width: 60ch; }
.max-prose { max-width: var(--container-narrow); }
.mx-auto { margin-inline: auto; }

/* ---------- Dividers ---------- */
.hr {
  border: 0;
  border-top: 1px solid var(--color-border);
  margin-block: var(--space-8);
}
.hr--inverse { border-top-color: var(--color-border-inverse); }

/* ---------- Visually-hidden (a11y) ---------- */
.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;
}

/* ---------- Responsive headline sizing ---------- */
@media (max-width: 720px) {
  :root {
    --fs-5xl: 3rem;
    --fs-4xl: 2.5rem;
    --fs-3xl: 2rem;
    --fs-2xl: 1.5rem;
  }
}
