/* perepalka.com — the landing, privacy and support pages (ADR-036).
 *
 * Plain CSS, no build step. Colours are the app's own: indigo from
 * `ThemeData(colorSchemeSeed: Colors.indigo)` and the amber of the second wedge
 * in the mark. Unbounded is the display face and is served from this domain;
 * running text uses the reader's system face, which covers Cyrillic everywhere.
 */

@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;
}

:root {
  --paper: #fbf8ff;
  --card: #ffffff;
  --ink: #1b1b24;
  --muted: #565970;
  --line: #e4e2f0;
  --brand: #3f51b5;
  --brand-hover: #34449e;
  --brand-soft: #e9ebf9;
  --on-brand: #ffffff;
  --amber: #ffc857;
  --amber-soft: #fff4db;
  --ok: #1d7a46;
  --ok-soft: #e2f3e9;
  --bad: #b93127;
  --bad-soft: #fbe7e5;

  --display: "Unbounded", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --text: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --radius: 18px;
  --gutter: max(20px, env(safe-area-inset-left, 0px));
  --gutter-r: max(20px, env(safe-area-inset-right, 0px));
  --measure: 62ch;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #12131b;
    --card: #1b1d29;
    --ink: #ecebf6;
    --muted: #a6a8bd;
    --line: #2d2f41;
    --brand: #9aa8ff;
    --brand-hover: #b4beff;
    --brand-soft: #232849;
    --on-brand: #11131c;
    --amber-soft: #3a3020;
    --ok: #74d39c;
    --ok-soft: #1c3326;
    --bad: #ff9c90;
    --bad-soft: #3c2224;
    color-scheme: dark;
  }
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 17px/1.6 var(--text);
}

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

a {
  color: var(--brand);
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--brand-hover);
}

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

h1,
h2,
h3 {
  font-family: var(--display);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.02em;
  text-wrap: balance;
  margin: 0;
}

h1 {
  font-size: clamp(2rem, 1.2rem + 2.6vw, 3.25rem);
}

h2 {
  font-size: clamp(1.6rem, 1.2rem + 1.7vw, 2.4rem);
}

h3 {
  font-size: 1.15rem;
  letter-spacing: -0.01em;
}

p {
  margin: 0;
}

.skip {
  position: absolute;
  left: -9999px;
}

.skip:focus {
  left: var(--gutter);
  top: 12px;
  z-index: 10;
  background: var(--card);
  padding: 8px 12px;
}

.wrap {
  max-width: 1120px;
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter-r);
}

/* ── Header ─────────────────────────────────────────────────────────────── */

.site-header .wrap {
  display: flex;
  align-items: center;
  gap: 24px;
  padding-block: 18px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.01em;
}

.brand svg {
  width: 34px;
  height: 34px;
}

.brand:hover {
  color: var(--ink);
}

.site-nav {
  display: flex;
  gap: 22px;
  margin-left: auto;
  font-size: 0.95rem;
}

.site-nav a {
  color: var(--muted);
  text-decoration: none;
}

.site-nav a:hover {
  color: var(--ink);
}

@media (max-width: 760px) {
  .site-nav {
    display: none;
  }

  .site-header .btn {
    margin-left: auto;
  }
}

/* ── Buttons ─────────────────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 999px;
  padding: 14px 26px;
  font: 600 1rem/1.2 var(--text);
  text-decoration: none;
  background: var(--brand);
  color: var(--on-brand);
  transition: background-color 140ms ease;
}

.btn:hover {
  background: var(--brand-hover);
  color: var(--on-brand);
}

.btn.small {
  padding: 9px 18px;
  font-size: 0.92rem;
}

.btn svg {
  width: 18px;
  height: 18px;
}

/* ── Hero ────────────────────────────────────────────────────────────────── */

.hero .wrap {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: clamp(32px, 6vw, 72px);
  align-items: center;
  padding-block: clamp(28px, 6vw, 72px) clamp(48px, 8vw, 96px);
}

.hero-copy {
  display: grid;
  gap: 22px;
  justify-items: start;
}

.hero-copy .lead {
  font-size: clamp(1.05rem, 0.98rem + 0.35vw, 1.2rem);
  color: var(--muted);
  max-width: 34rem;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  font-size: 0.9rem;
  color: var(--muted);
}

.hero-meta span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.hero-meta span::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--amber);
}

@media (max-width: 860px) {
  .hero .wrap {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* The battle card: what the game looks like the moment after a wrong answer. */
.battle {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: clamp(18px, 3vw, 26px);
  display: grid;
  gap: 18px;
  box-shadow: 0 1px 0 var(--line), 0 24px 48px -28px rgb(40 50 120 / 0.35);
  width: 100%;
  max-width: 440px;
  justify-self: center;
}

.score {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 8px 12px;
  align-items: center;
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
}

.score .who {
  color: var(--muted);
}

.score b {
  font-weight: 700;
  color: var(--ink);
}

.track {
  height: 8px;
  border-radius: 4px;
  background: var(--brand-soft);
  overflow: hidden;
}

.track i {
  display: block;
  height: 100%;
  border-radius: 4px;
  background: var(--brand);
}

.track.them i {
  background: var(--amber);
}

.battle-head {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.timer {
  height: 4px;
  border-radius: 2px;
  background: var(--line);
  overflow: hidden;
}

.timer i {
  display: block;
  width: 38%;
  height: 100%;
  background: var(--ink);
  opacity: 0.55;
}

.word {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.1rem);
  letter-spacing: -0.01em;
  text-align: center;
  padding-block: 6px;
}

.options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.options li {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 13px 12px;
  text-align: center;
  font-weight: 500;
  font-size: 0.98rem;
}

.options .right {
  background: var(--ok-soft);
  border-color: var(--ok);
  color: var(--ok);
}

.options .wrong {
  background: var(--bad-soft);
  border-color: var(--bad);
  color: var(--bad);
  text-decoration: line-through;
  text-decoration-thickness: 1.5px;
}

.explain {
  background: var(--amber-soft);
  border-radius: 14px;
  padding: 12px 14px;
  font-size: 0.92rem;
}

.explain b {
  display: block;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 2px;
}

/* ── Sections ────────────────────────────────────────────────────────────── */

.section {
  padding-block: clamp(56px, 8vw, 104px);
  border-top: 1px solid var(--line);
}

.section-head {
  display: grid;
  gap: 14px;
  max-width: 44rem;
  margin-bottom: clamp(28px, 4vw, 48px);
}

.section-head p {
  color: var(--muted);
  font-size: 1.08rem;
}

.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  counter-reset: step;
}

.steps li {
  counter-increment: step;
  display: grid;
  gap: 10px;
  align-content: start;
  padding-top: 18px;
  border-top: 3px solid var(--brand);
}

.steps li::before {
  content: counter(step);
  font-family: var(--display);
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--brand);
}

.steps p {
  color: var(--muted);
}

@media (max-width: 760px) {
  .steps {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Two scales: the rating moves both ways, the level only up. */
.scales {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.scale {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(20px, 3vw, 28px);
  display: grid;
  gap: 12px;
  align-content: start;
}

.scale .q {
  font-size: 0.95rem;
  color: var(--muted);
}

.scale .fig {
  width: 100%;
  height: 64px;
  margin-top: 6px;
}

.levels {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
  align-items: end;
  height: 64px;
  margin-top: 6px;
}

.levels span {
  display: grid;
  align-items: end;
  justify-items: center;
  border-radius: 8px 8px 4px 4px;
  background: var(--brand-soft);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
  padding-bottom: 4px;
}

.levels span.on {
  background: var(--brand);
  color: var(--on-brand);
}

.levels span:nth-child(1) { height: 36%; }
.levels span:nth-child(2) { height: 52%; }
.levels span:nth-child(3) { height: 68%; }
.levels span:nth-child(4) { height: 84%; }
.levels span:nth-child(5) { height: 100%; }

@media (max-width: 760px) {
  .scales {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Traps: real questions from the courses, each with the option people pick. */
.traps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.trap {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  display: grid;
  gap: 8px;
  align-content: start;
}

.trap .lang {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.trap .w {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: -0.01em;
}

.trap .no {
  color: var(--bad);
  text-decoration: line-through;
}

.trap .yes {
  color: var(--ok);
  font-weight: 600;
}

@media (max-width: 960px) {
  .traps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 480px) {
  .traps {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Courses */
.courses {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.course {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 20px;
  display: grid;
  gap: 4px;
  align-content: start;
}

.course .native {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.3rem;
  letter-spacing: -0.01em;
}

.course .range {
  margin-top: 8px;
  font-size: 0.85rem;
  color: var(--muted);
}

@media (max-width: 960px) {
  .courses {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* FAQ */
.faq {
  display: grid;
  gap: 0;
  max-width: 48rem;
}

.faq details {
  border-bottom: 1px solid var(--line);
  padding-block: 18px;
}

.faq summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 1.05rem;
  list-style: none;
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary::after {
  content: "+";
  font-family: var(--display);
  color: var(--brand);
  transition: transform 160ms ease;
}

.faq details[open] summary::after {
  transform: rotate(45deg);
}

.faq details p {
  margin-top: 10px;
  color: var(--muted);
  max-width: var(--measure);
}

/* Closing call to action */
.closer {
  background: var(--brand);
  color: var(--on-brand);
}

.closer .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding-block: clamp(40px, 6vw, 64px);
}

.closer h2 {
  max-width: 22ch;
}

.closer .btn {
  background: var(--on-brand);
  color: var(--brand);
}

.closer .btn:hover {
  background: var(--amber);
  color: #1b1b24;
}

/* ── Footer ──────────────────────────────────────────────────────────────── */

.site-footer {
  border-top: 1px solid var(--line);
  font-size: 0.92rem;
  color: var(--muted);
}

.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 28px;
  align-items: center;
  padding-block: 28px;
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  margin-left: auto;
}

.site-footer a {
  color: var(--muted);
}

/* ── Text pages: privacy, support ───────────────────────────────────────── */

.page .wrap {
  padding-block: clamp(32px, 6vw, 72px) clamp(56px, 8vw, 96px);
}

.prose {
  max-width: var(--measure);
  display: grid;
  gap: 18px;
}

.prose h1 {
  font-size: clamp(1.9rem, 1.4rem + 2vw, 2.8rem);
}

.prose h2 {
  font-size: 1.25rem;
  margin-top: 18px;
}

.prose .meta {
  color: var(--muted);
  font-size: 0.95rem;
}

.prose ul {
  margin: 0;
  padding-left: 1.2em;
  display: grid;
  gap: 6px;
}

.prose table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.95rem;
}

.prose th,
.prose td {
  text-align: left;
  padding: 10px 12px 10px 0;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.prose th {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  font-weight: 600;
}

.table-scroll {
  overflow-x: auto;
}

.contact {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(1.2rem, 1rem + 1vw, 1.6rem);
  letter-spacing: -0.01em;
  overflow-wrap: anywhere;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  * {
    transition: none !important;
  }
}
