/* =============================================================
   base.css — reset, typography, layout primitives
   ============================================================= */
*, *::before, *::after { box-sizing: border-box; }

* { margin: 0; padding: 0; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  min-height: var(--vh);
  max-width: 100%;
  font-family: var(--font-sans);
  font-size: var(--font-size-base);
  line-height: var(--line-height-body);
  color: var(--color-text);
  background: var(--gradient-page);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

img, picture, video, svg { display: block; max-width: 100%; }
input, button, textarea, select { font: inherit; color: inherit; }
button { -webkit-appearance: none; touch-action: manipulation; }
p, h1, h2, h3, h4, h5, h6 {
  overflow-wrap: break-word;
  text-wrap: pretty;
}

h1, h2, h3, h4 {
  hyphens: auto;
  -webkit-hyphens: auto;
}
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  line-height: var(--line-height-heading);
  letter-spacing: var(--letter-spacing-tight);
  font-weight: var(--font-weight-heading);
}

h1 { font-size: var(--font-size-2xl); }
h2 { font-size: var(--font-size-xl); }
h3 { font-size: var(--font-size-lg); }

@media (min-width: 1024px) {
  h1 { font-size: var(--font-size-3xl); }
  h2 { font-size: var(--font-size-2xl); }
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--color-accent);
  color: var(--color-text-inverse);
  padding: var(--space-sm) var(--space-md);
  z-index: var(--z-modal);
}
.skip-link:focus { left: var(--space-sm); }

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

.page-wrapper {
  display: flex;
  flex-direction: column;
  min-height: var(--vh);
}

.page-main { flex: 1; }

.section {
  padding-block: var(--space-section);
}

.section--muted {
  background: color-mix(in srgb, var(--color-bg-muted) 42%, var(--color-bg));
}

/* Soft band without hard edges (about certificates / cases) */
.section--soft {
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--color-surface) 28%, var(--color-bg)) 0%,
    color-mix(in srgb, var(--color-bg-muted) 18%, var(--color-bg)) 50%,
    color-mix(in srgb, var(--color-surface) 22%, var(--color-bg)) 100%
  );
}

.section__head {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  margin-bottom: var(--space-xl);
}

.section__eyebrow {
  font-size: var(--font-size-sm);
  text-transform: uppercase;
  letter-spacing: var(--letter-spacing-wide);
  color: var(--color-text-muted);
  font-weight: 500;
}

.text-muted { color: var(--color-text-muted); }

.stack > * + * { margin-top: var(--space-md); }

.visually-hidden-mobile {
  display: none;
}
@media (min-width: 768px) {
  .visually-hidden-mobile { display: initial; }
}

/* --- Reveal (motion) --- */
.reveal {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity var(--duration-base) var(--ease-out),
              transform var(--duration-base) var(--ease-out);
}
.reveal.is-visible { opacity: 1; transform: translateY(0); }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}

/* --- iOS Safari input fix --- */
input, select, textarea {
  font-size: 16px; /* без цього Safari робить авто-zoom */
  -webkit-appearance: none;
  border-radius: var(--radius-sm);
}
