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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + var(--s-4));
  max-width: 100%;
  overflow-x: clip;
  overscroll-behavior-x: none;
}

html.is-locked {
  overflow: hidden;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--c-bg);
  color: var(--c-text);
  font-family: var(--f-cond);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
  max-width: 100%;
  overscroll-behavior-x: none;
}

main {
  flex: 1 0 auto;
}

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

img {
  height: auto;
}

h1,
h2,
h3,
h4,
p,
ul,
ol,
figure,
blockquote,
dl,
dd {
  margin: 0;
}

:where(ul[role="list"], ol[role="list"]) {
  list-style: none;
  padding: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  background: none;
  border: 0;
  padding: 0;
}

button:disabled {
  cursor: default;
}

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

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

[hidden] {
  display: none !important;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  top: var(--s-2);
  left: var(--s-2);
  z-index: calc(var(--z-overlay) + 1);
  padding: var(--s-3) var(--s-4);
  background: var(--c-blue);
  color: var(--c-white);
  font-family: var(--f-cond);
  font-size: var(--fs-ui);
  text-transform: uppercase;
  transform: translateY(-200%);
}

.skip-link:focus {
  transform: none;
}

/* Layout */

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

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

.section--ruled {
  border-top: var(--bw) solid var(--c-line);
}

main > section + section {
  border-top: var(--bw) solid var(--c-line);
}

/* Typography */

.display,
.h1 {
  font-family: var(--f-mono);
  font-weight: 700;
  text-transform: uppercase;
  line-height: var(--lh-tight);
  letter-spacing: -0.01em;
}

.display {
  font-size: var(--fs-display);
}

.h1 {
  font-size: var(--fs-h1);
}

.h2 {
  font-family: var(--f-mono);
  font-size: var(--fs-h2);
  font-weight: 500;
  line-height: var(--lh-head);
  letter-spacing: -0.02em;
  text-transform: uppercase;
}

.h3 {
  font-family: var(--f-mono);
  font-size: var(--fs-h3);
  font-weight: 600;
  line-height: 1.2;
}

.label {
  font-family: var(--f-cond);
  font-size: var(--fs-label);
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: var(--ls-mono);
  text-transform: uppercase;
}

.ui {
  font-family: var(--f-cond);
  font-size: var(--fs-ui);
  font-weight: 500;
  letter-spacing: var(--ls-mono);
  text-transform: uppercase;
}

/* Моноширинный пробел (0.6em) визуально рвёт заголовки — приводим к ~0.3em */
.display,
.h1,
.h2,
.h3,
.card__name,
.quiz__q,
.ingredient__title,
.occasion__phrase,
.principle__title,
.pillar__title,
:is(h1, h2, h3, h4, h5, h6):is(.label, .ui) {
  word-spacing: -0.3em;
}

:is(h1, h2, h3, h4, h5, h6):is(.label, .ui) {
  font-family: var(--f-mono);
}

.lead {
  font-size: var(--fs-body);
  max-width: 34em;
}

.text-2 {
  color: var(--c-text-2);
}

.accent {
  color: var(--c-accent);
}

.index {
  font-family: var(--f-cond);
  font-size: var(--fs-ui);
  font-weight: 500;
  color: var(--c-accent);
  letter-spacing: var(--ls-mono);
  white-space: nowrap;
}

/* Section header: [ 01 ] + заголовок + действие справа */

.section-head {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: var(--s-4) var(--s-6);
  margin-bottom: var(--s-7);
}

.section-head__title {
  display: grid;
  gap: var(--s-4);
}

.section-head .lead {
  margin-top: var(--s-1);
}

@media (max-width: 47.99em) {
  .section-head {
    grid-template-columns: 1fr;
    margin-bottom: var(--s-6);
  }
}

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