/* Med-Compas Base — minimal reset + typography defaults + helpers */

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  scroll-behavior: smooth;
}

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

/* Typography defaults */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: var(--lh-tight);
  margin: 0 0 var(--space-md);
  color: var(--color-text);
}
h1 { font-size: var(--fs-4xl); }
h2 { font-size: var(--fs-3xl); }
h3 { font-size: var(--fs-2xl); }
h4 { font-size: var(--fs-xl); }
h5 { font-size: var(--fs-lg); }
h6 { font-size: var(--fs-base); }

@media (min-width: 1024px) {
  h1 { font-size: var(--fs-5xl); }
}

p { margin: 0 0 var(--space-md); }
ul, ol { margin: 0 0 var(--space-md); padding-left: var(--space-lg); }
a { color: var(--color-primary); text-decoration: none; transition: color var(--dur-base) var(--ease-out); }
a:hover { color: var(--color-primary-hover); text-decoration: underline; }

/* Images: fluid by default */
img, svg, video {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Form elements inherit fonts */
button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

/* Skip link — visible only on focus, a11y critical */
.skip-link {
  position: absolute;
  top: var(--space-sm);
  left: var(--space-md);
  transform: translateY(calc(-100% - var(--space-sm) - 4px));
  background: var(--color-primary);
  color: #fff;
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-md);
  text-decoration: none;
  font-weight: 600;
  z-index: var(--z-modal);
  transition: transform var(--dur-base) var(--ease-out);
}
.skip-link:focus,
.skip-link:focus-visible {
  transform: translateY(0);
  outline: 3px solid var(--color-primary-soft);
  color: #fff;
}

/* Focus-visible: единое правило по skill ux-Guidelines */
*:focus-visible {
  outline: 3px solid var(--color-primary-soft);
  outline-offset: 2px;
  border-radius: var(--radius-xs);
}

/* Layout helpers */
.container {
  width: 100%;
  max-width: var(--mw-wide);
  margin-inline: auto;
  padding-inline: var(--space-md);
}
@media (min-width: 768px)  { .container { padding-inline: var(--space-lg); } }
@media (min-width: 1024px) { .container { padding-inline: var(--space-xl); } }

.section {
  padding-block: var(--space-xl);
}
@media (min-width: 768px)  { .section { padding-block: var(--space-2xl); } }
@media (min-width: 1024px) { .section { padding-block: var(--space-3xl); } }

main { display: block; min-height: 60vh; }

/* Visually-hidden a11y helper */
.visually-hidden,
.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;
}

/* Lucide icons sizing */
[data-lucide], .lucide {
  display: inline-block;
  width: var(--icon-sm);
  height: var(--icon-sm);
  flex-shrink: 0;
  stroke-width: 2;
}

/* Selection */
::selection { background: var(--color-primary-soft); color: var(--color-text); }
