/*
 * EGE-School: fonts, design tokens, reset, typography, grid.
 * Design B. Fonts are local (assets/fonts), no requests to Google.
 */

/* Manrope: variable, 400-800 */
@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url(../fonts/manrope-cyrillic.woff2) format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url(../fonts/manrope-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Manrope: ruble sign and right arrow (absent from the latin/cyrillic subsets) */
@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url(../fonts/manrope-symbols.woff2) format('woff2');
  unicode-range: U+20BD, U+2192;
}

/* Unbounded: variable, used at 500, 700, 800 */
@font-face {
  font-family: 'Unbounded';
  font-style: normal;
  font-weight: 500 800;
  font-display: swap;
  src: url(../fonts/unbounded-cyrillic.woff2) format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Unbounded';
  font-style: normal;
  font-weight: 500 800;
  font-display: swap;
  src: url(../fonts/unbounded-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Unbounded';
  font-style: normal;
  font-weight: 500 800;
  font-display: swap;
  src: url(../fonts/unbounded-symbols.woff2) format('woff2');
  unicode-range: U+20BD, U+2192;
}

:root {
  /* palette B */
  --es-ink: #1E1446;
  --es-ground: #F6F4EE;
  --es-acc: #FFD25E;
  --es-acc-h: #FFDD80;
  --es-link-h: #5B2BE0;
  --es-muted: #6B6290;
  --es-muted-2: #4A4170;
  --es-article: #2A2350;
  --es-on-dark: #CFC8F0;
  --es-line: #DDD8EA;
  --es-line-2: #EDEAF7;
  --es-white: #FFFFFF;

  /* subjects (by slug of predmety-obucheniia) */
  --es-subj-obshhestvoznanie: #FFB8D9;
  --es-subj-profilnaya-matematika: #B8E3FF;
  --es-subj-russkij-yazyk: #FFF0A0;
  --es-subj-himiya: #BFF0D4;
  --es-subj-anglijskij-yazyk: #D9CCFF;
  --es-subj-istoriya: #FFD3A8;
  --es-subj-default: #FFFFFF;

  /* radii (no shadows in design B) */
  --es-r-sm: 14px;
  --es-r-md: 22px;
  --es-r-lg: 28px;
  --es-r-xl: 32px;
  --es-r-pill: 999px;

  /* spacing scale */
  --es-s-1: 4px;
  --es-s-2: 8px;
  --es-s-3: 12px;
  --es-s-4: 16px;
  --es-s-6: 24px;
  --es-s-8: 32px;
  --es-s-12: 48px;
  --es-s-16: 64px;

  /* fonts */
  --es-font-display: 'Unbounded', system-ui, sans-serif;
  --es-font-text: 'Manrope', system-ui, sans-serif;

  /* layout */
  --es-container: 1200px;
  --es-gutter: 32px;
}

@media (max-width: 640px) {
  :root {
    --es-gutter: 16px;
  }
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

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

ul,
ol {
  padding: 0;
}

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

img {
  height: auto;
}

body {
  background: var(--es-ground);
  color: var(--es-ink);
  font-family: var(--es-font-text);
  font-size: 16px;
  line-height: 1.5;
  overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
}

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

a:hover {
  color: var(--es-link-h);
}

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

/* headings */
.es-h1,
.es-h2,
.es-h3 {
  font-family: var(--es-font-display);
  font-weight: 800;
  color: var(--es-ink);
}

.es-h1 {
  font-size: clamp(28px, 4.06vw, 52px);
  line-height: 1.06;
  letter-spacing: -0.03em;
}

.es-h2 {
  font-size: clamp(24px, 1.2rem + 1.6vw, 40px);
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.es-h3 {
  font-size: clamp(18px, 1rem + 0.6vw, 22px);
  line-height: 1.25;
}

/* grid */
.es-wrap {
  width: 100%;
  max-width: calc(var(--es-container) + 2 * var(--es-gutter));
  margin-inline: auto;
  padding-inline: var(--es-gutter);
}

/* accessibility */
:focus-visible {
  outline: 3px solid var(--es-link-h);
  outline-offset: 2px;
}

.screen-reader-text {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.es-skip-link {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 1000;
  padding: 12px 20px;
  border-radius: var(--es-r-pill);
  background: var(--es-acc);
  color: var(--es-ink);
  font-weight: 800;
  transform: translateY(-200%);
}

.es-skip-link:focus {
  transform: none;
  color: var(--es-ink);
}

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