/* ============================================================
   Euderzr® FFKM Prototype — Base / Reset / Typography / Layout
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  line-height: var(--lh-normal);
  color: var(--color-text);
  background: var(--color-bg);
}

/* ---- Headings ---- */
h1, h2, h3, h4, h5 {
  margin: 0 0 var(--space-4);
  line-height: var(--lh-snug);
  font-weight: var(--fw-bold);
  color: var(--color-text);
  letter-spacing: -0.01em;
}
h1 { font-size: var(--fs-3xl); line-height: var(--lh-tight); }
h2 { font-size: var(--fs-2xl); }
h3 { font-size: var(--fs-xl); }
h4 { font-size: var(--fs-lg); }
h5 { font-size: var(--fs-md); }
p { margin: 0 0 var(--space-4); }
p:last-child { margin-bottom: 0; }

/* ---- Links ---- */
a { color: var(--color-brand-700); text-decoration: none; }
a:hover { color: var(--color-brand-500); text-decoration: underline; }

/* ---- Lists ---- */
ul, ol { margin: 0 0 var(--space-4); padding-left: var(--space-5); }
li { margin-bottom: var(--space-2); }

/* ---- Images / SVG ---- */
img, svg { max-width: 100%; height: auto; display: block; }

/* ---- Form elements base ---- */
button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}
button { cursor: pointer; }

/* ---- Skip link (a11y) ---- */
.skip-link {
  position: absolute;
  left: var(--space-4);
  top: -60px;
  z-index: var(--z-toast);
  background: var(--color-bg-dark);
  color: #fff;
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  transition: top var(--dur) var(--ease);
}
.skip-link:focus { top: var(--space-4); color: #fff; text-decoration: none; }

/* ---- Focus visibility (a11y, WCAG 2.1 AA) ---- */
:focus-visible {
  outline: 3px solid var(--color-brand-500);
  outline-offset: 2px;
  border-radius: 2px;
}

/* ============================================================
   Layout primitives
   ============================================================ */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--space-5);
}
.container--narrow { max-width: var(--container-narrow); }

.section { padding-block: var(--space-8); }
.section--sm { padding-block: var(--space-7); }
.section--alt { background: var(--color-bg-alt); }
.section--dark {
  background: var(--color-bg-dark);
  color: var(--color-text-on-dark);
}
.section--dark h1, .section--dark h2, .section--dark h3,
.section--dark h4, .section--dark h5 { color: #fff; }

.section__head { max-width: 760px; margin-bottom: var(--space-6); }
.section__head--center { margin-inline: auto; text-align: center; }
.section__eyebrow {
  display: inline-block;
  font-size: var(--fs-xs);
  font-weight: var(--fw-bold);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-brand-600);
  margin-bottom: var(--space-3);
}
.section__title { margin-bottom: var(--space-3); }
.section__lede { font-size: var(--fs-md); color: var(--color-text-muted); margin: 0; }
.section--dark .section__lede { color: var(--color-text-on-dark-muted); }

/* Grid helpers */
.grid { display: grid; gap: var(--space-5); }
.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }
.grid--auto { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }

/* Utility */
.text-muted { color: var(--color-text-muted); }
.text-center { text-align: center; }
.text-sm { font-size: var(--fs-sm); }
.text-xs { font-size: var(--fs-xs); }
.mono { font-family: var(--font-mono); }
.mt-0 { margin-top: 0; } .mb-0 { margin-bottom: 0; }
.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;
}

/* Divider */
.divider { height: 1px; background: var(--color-border); border: 0; margin: 0; }

/* ============================================================
   Responsive — 3 tiers: desktop ≥1024 / tablet 768 / mobile 375
   ============================================================ */
@media (max-width: 1023px) {
  :root { --space-8: 56px; }
  h1 { font-size: var(--fs-2xl); }
  h2 { font-size: var(--fs-xl); }
  h3 { font-size: var(--fs-lg); }
  .grid--4 { grid-template-columns: repeat(2, 1fr); }
  .grid--3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 767px) {
  :root { --space-8: 44px; --space-7: 36px; }
  .container { padding-inline: var(--space-4); }
  h1 { font-size: var(--fs-xl); }
  .grid--2, .grid--3, .grid--4 { grid-template-columns: 1fr; }
  .section--dark .grid--2, .section--dark .grid--3 { grid-template-columns: 1fr; }
}
