/**
 * ECH — Base styles: reset, typography, layout
 */

/* Minimal reset */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; padding: 0; }
img, picture, video, canvas, svg { display: block; max-width: 100%; }
input, button, textarea, select { font: inherit; color: inherit; }
p, h1, h2, h3, h4, h5, h6 { overflow-wrap: break-word; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
a:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

/* Skip link */
.skip-link {
  position: absolute;
  top: -100%;
  left: var(--space-4);
  z-index: 10000;
  padding: var(--space-2) var(--space-4);
  background: var(--brand);
  color: var(--surface);
  font-weight: 600;
  border-radius: var(--radius);
  transition: top var(--ease);
}
.skip-link:focus {
  top: var(--space-4);
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

/* Base typography */
body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-serif);
  font-weight: 600;
  line-height: 1.25;
  color: var(--text);
}

h1 { font-size: var(--text-hero); }
h2 { font-size: clamp(1.5rem, 2.5vw + 0.5rem, 2.125rem); margin-top: var(--space-6); margin-bottom: var(--space-3); }
h3 { font-size: clamp(1.25rem, 1.5vw + 0.5rem, 1.5rem); margin-top: var(--space-5); margin-bottom: var(--space-2); }
h4, h5, h6 { font-size: var(--text-lg); margin-top: var(--space-4); margin-bottom: var(--space-2); }

p { margin: 0 0 var(--space-4); }
p:last-child { margin-bottom: 0; }

small, .text-small { font-size: var(--text-sm); color: var(--muted); }

/* Layout */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--space-4);
  padding-right: var(--space-4);
}

.container--wide { max-width: var(--container-wide); }

@media (min-width: 768px) {
  .container { padding-left: var(--space-6); padding-right: var(--space-6); }
}

@media (min-width: 1024px) {
  .container { padding-left: var(--space-8); padding-right: var(--space-8); }
}

/* Section spacing */
.section { padding-top: var(--space-8); padding-bottom: var(--space-8); }
.section--tight { padding-top: var(--space-6); padding-bottom: var(--space-6); }
.section--loose { padding-top: var(--space-10); padding-bottom: var(--space-10); }

/* Focus visible (accessibility) */
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

/* Utility */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
