/* Skazki Design System — base layer (reset, document typography, focus, print).
   Requires tokens.css. Mobile-first: every rule targets 360px first. */

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--sk-size-appbar) + var(--sk-space-4));
}
body {
  min-height: 100dvh;
  background: var(--sk-color-bg);
  color: var(--sk-color-text);
  font-family: var(--sk-font-ui);
  font-size: var(--sk-type-body-size);
  line-height: var(--sk-type-body-line);
  font-weight: var(--sk-type-body-weight);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background-color var(--sk-motion-duration-slow) var(--sk-motion-ease-standard),
              color var(--sk-motion-duration-slow) var(--sk-motion-ease-standard);
}
img, svg, video, canvas, audio, iframe { display: block; max-width: 100%; }
img, video { height: auto; }
input, button, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
p, h1, h2, h3, h4 { overflow-wrap: break-word; }
h1, h2, h3, h4 { text-wrap: balance; hyphens: auto; -webkit-hyphens: auto; }
p { text-wrap: pretty; }

h1, .sk-h1 { font-size: var(--sk-type-h1-size); line-height: var(--sk-type-h1-line); font-weight: var(--sk-type-h1-weight); letter-spacing: var(--sk-type-h1-tracking); }
h2, .sk-h2 { font-size: var(--sk-type-h2-size); line-height: var(--sk-type-h2-line); font-weight: var(--sk-type-h2-weight); letter-spacing: var(--sk-type-h2-tracking); }
h3, .sk-h3 { font-size: var(--sk-type-h3-size); line-height: var(--sk-type-h3-line); font-weight: var(--sk-type-h3-weight); }
h4, .sk-h4 { font-size: var(--sk-type-h4-size); line-height: var(--sk-type-h4-line); font-weight: var(--sk-type-h4-weight); }
.sk-display { font-size: var(--sk-type-display-size); line-height: var(--sk-type-display-line); font-weight: var(--sk-type-display-weight); letter-spacing: var(--sk-type-display-tracking); }
.sk-lead { font-size: var(--sk-type-lead-size); line-height: var(--sk-type-lead-line); color: var(--sk-color-text-muted); }
.sk-small { font-size: var(--sk-type-small-size); line-height: var(--sk-type-small-line); font-weight: var(--sk-type-small-weight); }
.sk-caption { font-size: var(--sk-type-caption-size); line-height: var(--sk-type-caption-line); font-weight: var(--sk-type-caption-weight); letter-spacing: var(--sk-type-caption-tracking); text-transform: uppercase; }
.sk-muted { color: var(--sk-color-text-muted); }

a { color: var(--sk-color-link); text-decoration-thickness: 0.08em; text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 0.14em; }

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

::selection { background: var(--sk-color-accent); color: var(--sk-color-on-accent); }

.sk-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;
}

.sk-skip-link {
  position: absolute; left: var(--sk-space-4); top: -100px; z-index: var(--sk-z-toast);
  padding: var(--sk-space-3) var(--sk-space-4); border-radius: var(--sk-radius-md);
  background: var(--sk-color-primary); color: var(--sk-color-on-primary); font-weight: 800;
}
.sk-skip-link:focus { top: var(--sk-space-4); }

/* Layout primitives */
.sk-container { width: 100%; max-width: var(--sk-size-container); margin-inline: auto; padding-inline: var(--sk-size-gutter); }
.sk-stack { min-width: 0; display: flex; flex-direction: column; gap: var(--sk-stack-gap, var(--sk-space-4)); }
.sk-cluster { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sk-cluster-gap, var(--sk-space-3)); }
.sk-grid {
  display: grid; gap: var(--sk-grid-gap, var(--sk-space-4));
  grid-template-columns: repeat(auto-fill, minmax(min(var(--sk-grid-min, 150px), 100%), 1fr));
}
.sk-measure { max-width: var(--sk-size-measure); }

@media print {
  :root { --sk-color-bg: #fff; --sk-color-text: #000; }
  body { background: #fff; color: #000; }
  .sk-no-print, .sk-appbar, .sk-tabbar, .sk-player, .sk-promo, .sk-social { display: none !important; }
  a { color: inherit; text-decoration: none; }
}
