*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 8px); -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 400 1rem/1.65 var(--font-body); overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
body.no-scroll, body:has(dialog[open]) { overflow: hidden; }
img, svg { display: block; max-width: 100%; height: auto; }
h1, h2, h3, h4 { font-family: var(--font-head); font-weight: 400; line-height: 1.08; margin: 0 0 var(--s4); letter-spacing: -0.01em; text-wrap: balance; }
h1 { font-size: clamp(2.1rem, 7.4vw, 6rem); line-height: 1.02; }
h2 { font-size: clamp(2rem, 4.8vw, 3.9rem); }
h3 { font-size: clamp(1.25rem, 1.8vw, 1.5rem); line-height: 1.2; }
p { margin: 0 0 var(--s4); text-wrap: pretty; }
ul, ol { margin: 0; padding: 0; list-style: none; }
a { color: var(--accent); text-underline-offset: 4px; text-decoration-thickness: 1px; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
address { font-style: normal; }
::selection { background: var(--accent); color: #fff; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: var(--r); }
.on-ink :focus-visible, .on-ink:focus-visible { outline-color: var(--accent-on-ink); }

.container { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); }
.container--narrow { max-width: 980px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: var(--s4); top: -100px; z-index: 100; background: var(--ink); color: var(--on-ink); padding: var(--s3) var(--s4); }
.skip:focus { top: var(--s2); }

/* Метки «(01) Калькулятор» */
.label {
  font: 500 0.78rem/1.3 var(--font-body); text-transform: uppercase; letter-spacing: 0.14em;
  color: var(--muted); margin: 0 0 var(--s4);
}

/* 12-колоночная сетка */
.grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gap); }
.grid > * { grid-column: 1 / -1; }

/* Секции */
.section { padding-block: var(--section); }
.section--stone { background: var(--stone); }
.section--stone .label, .section--stone .muted { color: var(--muted-stone); }
.section--ink, .on-ink { background: var(--ink); color: var(--on-ink); }
.section--ink .label { color: var(--on-ink-muted); }
.section--ink a { color: var(--on-ink); }

/* Шапка секции: метка слева, заголовок со сдвигом */
.shead { margin-bottom: clamp(2.5rem, 6vw, 5rem); row-gap: var(--s2); }
.shead h2 { margin: 0; }
.shead__lead { color: var(--muted); max-width: 46ch; margin: var(--s4) 0 0; }
.section--stone .shead__lead { color: var(--muted-stone); }
.section--ink .shead__lead { color: var(--on-ink-muted); }
@media (min-width: 900px) {
  .shead > .label { grid-column: 1 / 4; padding-top: 0.9em; }
  .shead > h2 { grid-column: 4 / 12; }
  .shead > .shead__lead { grid-column: 4 / 10; }
}

/* Появление: текст поднимается, фото раскрывается шторкой */
.js .reveal { opacity: 0; transform: translateY(28px); transition: opacity var(--t-slow) var(--ease), transform var(--t-slow) var(--ease); }
.js .reveal.is-in { opacity: 1; transform: none; }
.js .reveal-img { clip-path: inset(0 0 100% 0); transition: clip-path 1.1s var(--ease); }
.js .reveal-img.is-in { clip-path: inset(0 0 0 0); }

/* Лёгкий zoom фото при наведении */
.zoom { overflow: hidden; }
.zoom img { transition: transform var(--t-slow) var(--ease); }
@media (hover: hover) { .zoom:hover img, a:hover > .zoom img, button:hover > .zoom img { transform: scale(1.04); } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
  .js .reveal, .js .reveal-img { opacity: 1; transform: none; clip-path: none; }
}
