/* Вдсиана - see selfsteal-site/DESIGN.md */
@font-face { font-family: "Unbounded"; 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-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: "Onest"; font-weight: 400 700; font-display: swap;
  src: url(fonts/onest-cyrillic.woff2) format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Onest"; font-weight: 400 700; font-display: swap;
  src: url(fonts/onest-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; }

:root {
  --paper: #EEF0EA;
  --ink: #22357F;
  --fluo: #FF4FA3;
  --ink-soft: #5A6699;
  --rule: #C9CDDA;
  --white: #FFFFFF;
  --display: "Unbounded", "Arial Black", system-ui, sans-serif;
  --text: "Onest", system-ui, -apple-system, "Segoe UI", sans-serif;
  --gutter: clamp(16px, 4vw, 48px);
  --max: 1240px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 400 16px/1.55 var(--text); font-feature-settings: "kern", "liga";
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
button, input, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--fluo); outline-offset: 3px; border-radius: 2px; }
.wrap { max-width: var(--max); margin: 0 auto; padding-inline: var(--gutter); }
[hidden] { display: none !important; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* --- header ---------------------------------------------------------------- */
.site-head { border-bottom: 1px solid var(--rule); }
.site-head .wrap { display: flex; align-items: center; gap: 32px; min-height: 72px; flex-wrap: wrap; }
.logo { font: 800 22px/1 var(--display); text-decoration: none; letter-spacing: -0.02em; display: flex; align-items: center; gap: 10px; }
.logo svg { width: 30px; height: 30px; }
.site-nav { display: flex; gap: 24px; margin-right: auto; }
.site-nav a { text-decoration: none; font-weight: 500; padding-block: 6px; border-bottom: 2px solid transparent; }
.site-nav a:hover { border-bottom-color: currentColor; }

.btn {
  display: inline-flex; align-items: center; gap: 10px; cursor: pointer;
  font-weight: 600; text-decoration: none; border-radius: 999px;
  padding: 12px 22px; border: 2px solid var(--ink); background: var(--ink); color: var(--paper);
}
.btn:hover { background: #1a2966; border-color: #1a2966; }
.btn.ghost { background: transparent; color: var(--ink); }
.btn.ghost:hover { background: rgba(34, 53, 127, .07); }

/* --- hero -------------------------------------------------------------------- */
.hero .wrap { display: grid; grid-template-columns: 5fr 7fr; gap: clamp(24px, 4vw, 64px); align-items: center; padding-block: clamp(40px, 7vw, 96px); }
.hero h1 {
  font: 800 clamp(34px, 5.2vw, 61px)/1.04 var(--display); letter-spacing: -0.03em; margin: 0 0 24px;
}
.hero p { font-size: 20px; max-width: 34ch; margin: 0 0 32px; color: var(--ink-soft); }
.hero .actions { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-cover { position: relative; display: block; width: 100%; text-decoration: none; color: inherit; }
.hero-cover .cover { border-radius: 6px; box-shadow: 0 1px 0 var(--rule); }
.hero-cover .caption { display: flex; justify-content: space-between; gap: 16px; margin-top: 14px; }
.hero-cover .caption strong { font-weight: 600; font-size: 18px; }
.hero-cover .caption span { color: var(--ink-soft); white-space: nowrap; }

/* --- covers ------------------------------------------------------------------- */
.cover { position: relative; aspect-ratio: 16 / 9; overflow: hidden; background: var(--white); border-radius: 4px; }
.cover svg { width: 100%; height: 100%; }
.cover .dur {
  position: absolute; right: 8px; bottom: 8px; padding: 2px 7px; border-radius: 4px;
  background: rgba(20, 28, 66, .86); color: #fff; font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums;
}
.cover .bar { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: rgba(34, 53, 127, .18); }
.cover .bar i { display: block; height: 100%; background: var(--fluo); }
.cover .play {
  position: absolute; inset: 0; margin: auto; width: 64px; height: 64px; border-radius: 50%;
  background: rgba(255, 255, 255, .92); display: grid; place-items: center; opacity: 0; transition: opacity .15s;
}
.cover .play svg { width: 26px; height: 26px; margin-left: 4px; }
.tile:hover .play, .tile:focus-visible .play, .hero-cover:hover .play, .hero-cover:focus-visible .play { opacity: 1; }
.hero-cover .play { opacity: 1; width: 84px; height: 84px; }

/* the one orchestrated moment: plates come into register on load */
@media (prefers-reduced-motion: no-preference) {
  .hero-cover .plate-fluo { animation: register 1.1s cubic-bezier(.2, .7, .2, 1) .15s both; }
  @keyframes register { from { transform: translate(-14px, 9px); } }
}

/* --- sections ----------------------------------------------------------------- */
.section { padding-block: clamp(40px, 6vw, 72px); border-top: 1px solid var(--rule); }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 28px; }
.section h2 { font: 700 clamp(25px, 3vw, 31px)/1.15 var(--display); letter-spacing: -0.02em; margin: 0; }
.section-head p { margin: 6px 0 0; color: var(--ink-soft); max-width: 60ch; }

/* playlists: stacked sheets */
.shelf { -webkit-mask-image: linear-gradient(90deg, #000 88%, transparent); mask-image: linear-gradient(90deg, #000 88%, transparent); display: grid; grid-auto-flow: column; grid-auto-columns: minmax(260px, 1fr); gap: 28px; overflow-x: auto; padding: 10px 4px 18px; scroll-snap-type: x mandatory; }
.stack { scroll-snap-align: start; cursor: pointer; display: block; text-decoration: none; color: inherit; }
.stack .sheets { position: relative; padding-top: 10px; }
.stack .sheets::before, .stack .sheets::after {
  content: ""; position: absolute; left: 8%; right: 8%; top: 4px; height: 20px; border-radius: 4px 4px 0 0;
  background: var(--white); border: 1px solid var(--rule); border-bottom: 0;
}
.stack .sheets::before { left: 4%; right: 4%; top: 7px; }
.stack .sheets::after { top: 1px; left: 12%; right: 12%; z-index: -1; }
.stack .cover { z-index: 1; border: 1px solid var(--rule); }
.stack .count {
  position: absolute; right: 0; top: 10px; bottom: 0; width: 34%; z-index: 2;
  background: rgba(34, 53, 127, .9); color: #fff; display: grid; place-content: center; text-align: center; border-radius: 0 4px 4px 0;
}
.stack .count b { font: 800 28px/1 var(--display); }
.stack .count span { font-size: 13px; }
.stack h3 { font-size: 17px; font-weight: 600; margin: 12px 0 2px; line-height: 1.3; }
.stack p { margin: 0; color: var(--ink-soft); font-size: 14px; }

/* filter */
.filters { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  border: 1.5px solid var(--ink); background: transparent; border-radius: 999px; padding: 7px 16px; cursor: pointer; font-weight: 500;
}
.chip[aria-pressed="true"] { background: var(--ink); color: var(--paper); }

/* lesson grid */
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 36px 28px; }
.tile { cursor: pointer; display: block; width: 100%; text-decoration: none; color: inherit; }
.tile h3 { font-size: 17px; font-weight: 600; line-height: 1.3; margin: 12px 0 6px; }
.tile .meta { display: flex; gap: 14px; flex-wrap: wrap; font-size: 14px; color: var(--ink-soft); }
.tile .meta .from { color: var(--ink); }
.tile[hidden], .stack[hidden] { display: none; }
.tile:hover h3, .stack:hover h3 { text-decoration: underline; text-underline-offset: 3px; }

/* steps */
.steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; counter-reset: s; }
.steps li { counter-increment: s; border-top: 3px solid var(--ink); padding-top: 18px; }
.steps li::before { content: counter(s); font: 800 39px/1 var(--display); display: block; margin-bottom: 12px; }
.steps h3 { margin: 0 0 6px; font-size: 20px; font-weight: 600; }
.steps p { margin: 0; color: var(--ink-soft); max-width: 36ch; }

.offline { display: grid; grid-template-columns: 7fr 5fr; gap: 32px; align-items: center; }
.offline p { font-size: 20px; margin: 0; max-width: 46ch; }
.offline .btn { justify-self: start; }

.faq details { border-top: 1px solid var(--rule); padding-block: 14px; max-width: 760px; }
.faq details:last-child { border-bottom: 1px solid var(--rule); }
.faq summary { cursor: pointer; font-weight: 600; font-size: 17px; }
.faq details p { margin: 10px 0 0; color: var(--ink-soft); max-width: 66ch; }

.site-foot { border-top: 1px solid var(--rule); padding-block: 28px 40px; color: var(--ink-soft); font-size: 14px; }
.site-foot .wrap { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

/* --- access dialog -------------------------------------------------------------- */
dialog.access {
  border: 0; padding: 0; border-radius: 10px; width: min(880px, calc(100vw - 32px)); max-height: calc(100dvh - 32px);
  background: var(--paper); color: var(--ink); box-shadow: 0 30px 80px rgba(20, 28, 66, .35);
}
dialog.access::backdrop { background: rgba(20, 28, 66, .55); }
.access-body { display: grid; grid-template-columns: 1fr 1fr; }
.access-preview { padding: 24px; background: var(--white); border-right: 1px solid var(--rule); }
.access-preview .cover { position: relative; }
.access-preview .lock {
  position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 8px;
  background: rgba(238, 240, 234, .78); color: var(--ink); font-weight: 600; text-align: center; padding: 12px;
}
.access-preview .lock svg { width: 34px; height: 34px; }
.access-preview h2 { font: 700 20px/1.25 var(--display); margin: 18px 0 6px; letter-spacing: -0.01em; }
.access-preview p { margin: 0; color: var(--ink-soft); font-size: 14px; }
.access-form { padding: 24px; position: relative; }
/* sticky, so it stays reachable while a tall dialog scrolls on phones */
.access-close { position: sticky; top: 10px; margin: 10px 10px -50px auto; z-index: 3; border: 0; background: var(--paper); cursor: pointer; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; }
.access-close:hover { background: #e2e5ef; }
.access-list { margin-top: 20px; border-top: 1px solid var(--rule); padding-top: 14px; }
.access-list h3 { font-size: 14px; font-weight: 600; margin: 0 0 8px; }
.access-list ol { list-style: none; margin: 0; padding: 0; font-size: 14px; }
.access-list li { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; color: var(--ink-soft); }
.access-list li span:last-child { font-variant-numeric: tabular-nums; white-space: nowrap; }
.access-list li[aria-current="true"] { color: var(--ink); font-weight: 600; }
.access-list p { margin: 6px 0 0; font-size: 14px; color: var(--ink-soft); }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--rule); margin: 0 44px 20px 0; }
.tabs button { white-space: nowrap; }
.tabs button { border: 0; background: none; cursor: pointer; padding: 10px 2px; margin-right: 18px; font-weight: 600; color: var(--ink-soft); border-bottom: 3px solid transparent; margin-bottom: -1px; }
.tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--ink); }
.panel[hidden] { display: none; }
.panel .lead { margin: 0 0 16px; }
label { display: block; font-weight: 600; font-size: 14px; margin: 0 0 6px; }
.hint { font-weight: 400; color: var(--ink-soft); }
input[type="text"], textarea {
  width: 100%; border: 1.5px solid var(--rule); border-radius: 6px; background: var(--white); padding: 11px 12px; margin-bottom: 16px;
}
input[type="text"]:focus, textarea:focus { border-color: var(--ink); outline: none; box-shadow: 0 0 0 3px rgba(255, 79, 163, .35); }
textarea { min-height: 110px; resize: vertical; }
#code { font: 600 20px/1.2 var(--text); letter-spacing: .12em; text-transform: uppercase; }
.status { margin: 14px 0 0; font-weight: 500; min-height: 1.5em; }
.status.ok { color: #1d6b45; }
.status.err { color: #a3123f; }
.form-note { font-size: 14px; color: var(--ink-soft); margin: 14px 0 0; }

/* --- responsive ----------------------------------------------------------------- */
/* --- shared page bits ------------------------------------------------------ */
.head-login { text-decoration: none; font-weight: 500; }
.head-login:hover { text-decoration: underline; }
.site-nav a[aria-current="page"] { border-bottom-color: currentColor; }
.section.first { border-top: 0; }
.page-title { font: 800 clamp(31px, 4.2vw, 49px)/1.08 var(--display); letter-spacing: -0.03em; margin: 0; }
.more { font-weight: 600; text-decoration: none; border-bottom: 2px solid currentColor; padding-bottom: 2px; }
.lead-text { font-size: 18px; color: var(--ink-soft); max-width: 62ch; margin: 14px 0 0; }
.offline-text { margin-top: 14px; }
.narrow { max-width: 640px; }
.course-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 40px 28px; }
.crumbs { display: flex; flex-wrap: wrap; gap: 8px; font-size: 14px; color: var(--ink-soft); padding-block: 24px 18px; }
.crumbs a { color: var(--ink); }

/* player */
.player { position: relative; border-radius: 6px; overflow: hidden; background: #141c42; }
.player .cover { border-radius: 0; }
.player video { display: block; width: 100%; aspect-ratio: 16 / 9; background: #000; }
.player-play {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); border: 0; cursor: pointer;
  display: flex; align-items: center; gap: 12px; padding: 14px 22px 14px 18px; border-radius: 999px;
  background: rgba(255, 255, 255, .94); color: var(--ink); font-weight: 600; box-shadow: 0 6px 24px rgba(20, 28, 66, .25);
}
.player-play svg { width: 22px; height: 22px; fill: var(--ink); }
.player-play:hover { background: #fff; }
.player-lock {
  position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 10px; text-align: center; padding: 16px;
  background: rgba(20, 28, 66, .82); color: #fff;
}
.player-lock[hidden] { display: none; }
.player-lock svg { width: 38px; height: 38px; }
.player-lock p { margin: 0; font-weight: 600; font-size: 18px; }
.player-lock .actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.player-lock .btn { background: #fff; color: var(--ink); border-color: #fff; }
.btn.ghost.light { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .8); }
.btn.ghost.light:hover { background: rgba(255, 255, 255, .12); }

/* course page */
.course-head { display: grid; grid-template-columns: 7fr 5fr; gap: clamp(24px, 4vw, 56px); align-items: center; padding-bottom: clamp(32px, 5vw, 64px); }
.course-info h1 { font: 800 clamp(30px, 3.6vw, 45px)/1.08 var(--display); letter-spacing: -0.03em; margin: 0; }
.facts { display: flex; gap: 28px; flex-wrap: wrap; margin: 22px 0 26px; }
.facts div { border-left: 3px solid var(--ink); padding-left: 12px; }
.facts dt { font-size: 14px; color: var(--ink-soft); }
.facts dd { margin: 2px 0 0; font-weight: 600; font-size: 18px; }
.course-info .actions { display: flex; gap: 12px; flex-wrap: wrap; }
.two-col { display: grid; grid-template-columns: 8fr 4fr; gap: 48px; align-items: start; }
.two-col h2 { margin-bottom: 18px; }
.side-note { border-top: 3px solid var(--ink); padding-top: 16px; }
.side-note h2 { font-size: 20px; }
.side-note p { color: var(--ink-soft); margin: 0; }
.program { list-style: none; margin: 0; padding: 0; }
.program li { display: grid; grid-template-columns: 34px 1fr auto; gap: 12px; align-items: baseline; padding: 12px 0; border-top: 1px solid var(--rule); }
.program li:last-child { border-bottom: 1px solid var(--rule); }
.program .n { font: 700 16px/1 var(--display); color: var(--ink-soft); }
.program .d { color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.program a { text-decoration-thickness: 1px; text-underline-offset: 3px; }
.program li[aria-current="true"] { font-weight: 600; }
.program li[aria-current="true"] .n { color: var(--ink); }

/* lesson page */
.lesson-layout { display: grid; grid-template-columns: 8fr 4fr; gap: 40px; align-items: start; padding-bottom: clamp(32px, 5vw, 64px); }
.lesson-title { font: 700 clamp(25px, 2.6vw, 33px)/1.15 var(--display); letter-spacing: -0.02em; margin: 22px 0 10px; }
.lesson-meta { display: flex; gap: 16px; flex-wrap: wrap; color: var(--ink-soft); font-size: 15px; }
.lesson-meta a { color: var(--ink); }
.sub { font-size: 18px; font-weight: 600; margin: 26px 0 8px; }
.points { margin: 0; padding-left: 20px; }
.points li { margin: 4px 0; }
.lesson-side h2 { font-size: 17px; font-weight: 600; margin: 0 0 8px; }
.lesson-side .program li { padding: 9px 0; font-size: 15px; grid-template-columns: 26px 1fr auto; }
.trailer-link { display: inline-block; margin-top: 16px; font-weight: 600; }

/* login */
.login-form { margin-top: 28px; max-width: 420px; }

@media (max-width: 980px) {
  .course-head, .two-col, .lesson-layout { grid-template-columns: 1fr; }
  .course-grid { grid-template-columns: repeat(2, 1fr); }
  .grid { grid-template-columns: repeat(2, 1fr); }
  .hero .wrap { grid-template-columns: 1fr; }
  .hero p { max-width: 46ch; }
  .offline { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .site-nav { display: none; }
  .head-login { margin-left: auto; }
  .site-head .wrap { gap: 14px; min-height: 60px; flex-wrap: nowrap; }
  .logo { font-size: 19px; }
  .site-head .btn { padding: 8px 14px; font-size: 14px; white-space: nowrap; }
  .player-lock { gap: 6px; padding: 8px; }
  .player-lock svg { width: 24px; height: 24px; }
  .player-lock p { font-size: 15px; }
  .player-lock .actions { gap: 8px; flex-wrap: nowrap; }
  .player-lock .btn { padding: 8px 14px; font-size: 14px; white-space: nowrap; }
  .course-grid { grid-template-columns: 1fr; }
  .player-play span { display: none; }
  .player-play { padding: 16px; }
  .grid, .steps { grid-template-columns: 1fr; }
  .access-body { grid-template-columns: 1fr; }
  .access-preview { border-right: 0; border-bottom: 1px solid var(--rule); padding: 16px; }
  .access-preview .lock span { font-size: 14px; }
  .access-form { padding: 16px; }
  .access-list { display: none; }
  .tabs { margin-right: 0; }
  .tabs button { margin-right: 14px; font-size: 15px; }
  .hero p { font-size: 18px; }
}
