/* Solim · Концепт B — base styles
 * Reset + типографика + газетный фон
 */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  background: var(--paper);
  overflow-x: hidden;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: var(--lh-normal);
  color: var(--ink);
  background: var(--paper);
  font-feature-settings: "kern", "liga", "calt", "onum";
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Газетная зернистость (subtle) */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.045;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='320' height='320'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.92' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.13  0 0 0 0 0.12  0 0 0 0 0.10  0 0 0 0.75 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}

img, video {
  max-width: 100%;
  height: auto;
  display: block;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
ul, ol { list-style: none; }

/* ===== Типографика ===== */

.display {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: var(--lh-tight);
  letter-spacing: var(--ls-tight);
  color: var(--ink);
}

.display--bold { font-weight: 700; }
.display--italic { font-style: italic; }

/* Sans для UI/метаданных */
.ui {
  font-family: var(--font-ui);
  font-weight: 400;
}

/* Моно — для номеров, дат, eyebrow */
.mono {
  font-family: var(--font-mono);
  font-size: 0.85em;
  letter-spacing: var(--ls-normal);
}

/* Eyebrow — журнальный «РУБРИКА · НОМЕР» */
.eyebrow {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: var(--ls-widest);
  color: var(--graphite);
  font-weight: 500;
}

.eyebrow--ink { color: var(--ink); }
.eyebrow--accent { color: var(--accent); }

/* Caveat для подписей Ольги */
.hand {
  font-family: var(--font-hand);
  font-weight: 500;
  line-height: 1.25;
  color: var(--ink);
}

/* ===== Layout ===== */

.container {
  width: min(100% - 2rem, var(--container));
  margin-inline: auto;
}

.container--wide {
  width: min(100% - 2rem, var(--container-wide));
  margin-inline: auto;
}

.container--narrow {
  width: min(100% - 2rem, var(--container-narrow));
  margin-inline: auto;
}

.container--text {
  width: min(100% - 2rem, var(--container-text));
  margin-inline: auto;
}

.stack > * + * { margin-top: var(--s-4); }
.stack-lg > * + * { margin-top: var(--s-6); }
.stack-xl > * + * { margin-top: var(--s-8); }

section {
  position: relative;
  z-index: 2;
  padding-block: var(--s-8);
}

@media (max-width: 768px) {
  section { padding-block: var(--s-6); }
}

/* ===== Декоративные правила (журнальные «линейки») ===== */

.rule {
  height: 1px;
  background: var(--rule);
  border: 0;
}

.rule--thick {
  height: 3px;
  background: var(--ink);
}

.rule--double {
  height: 6px;
  background:
    linear-gradient(var(--ink), var(--ink)) top/100% 1px no-repeat,
    linear-gradient(var(--ink), var(--ink)) bottom/100% 1px no-repeat;
  background-color: transparent;
}

/* Декоративный орнамент-разделитель ✦ */
.divider-ornament {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-3);
  color: var(--graphite);
  margin-block: var(--s-6);
}

.divider-ornament::before,
.divider-ornament::after {
  content: "";
  flex: 1;
  max-width: 80px;
  height: 1px;
  background: var(--rule);
}

.divider-ornament__symbol {
  font-family: var(--font-display);
  font-size: 1.4rem;
  color: var(--rule);
}

/* ===== Selection / Focus ===== */

::selection {
  background: var(--ink);
  color: var(--paper);
}

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

/* ===== Utilities ===== */

.text-center { text-align: center; }
.text-balance { text-wrap: balance; }
.text-pretty { text-wrap: pretty; }
.accent-color { color: var(--accent); }
.ink-soft-color { color: var(--ink-soft); }

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

/* Skip link */
.skip-link {
  position: absolute;
  top: -200px; left: 0;
  background: var(--ink);
  color: var(--paper);
  padding: var(--s-3) var(--s-5);
  z-index: 999;
}
.skip-link:focus { top: 0; }

/* ===== Reading progress ===== */
.progress-bar {
  position: fixed;
  top: 0; left: 0;
  height: 2px;
  background: var(--accent);
  width: 0;
  z-index: var(--z-header);
  transform-origin: left;
  will-change: transform;
}
