@font-face {
  font-family: Nunito;
  font-style: normal;
  font-weight: 400 1000;
  font-display: swap;
  src: url("assets/nunito-cyrillic.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
  font-family: Nunito;
  font-style: normal;
  font-weight: 400 1000;
  font-display: swap;
  src: url("assets/nunito-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 {
  color-scheme: light;
  --paper: #fffcf3;
  --ink: #2c2343;
  --ink-soft: #5c506a;
  --plum: #7046bd;
  --plum-dark: #563399;
  --gold: #ffd165;
  --gold-edge: #e4a538;
  --wash: #f1eafa;
  --correct: #216349;
  --wrong: #8c3652;
  --gutter: clamp(22px, 5vw, 64px);
  font-family: Nunito, "Trebuchet MS", sans-serif;
  background: var(--paper);
  color: var(--ink);
  scroll-behavior: smooth;
}

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

body, h1, h2, p, figure {
  margin: 0;
}

body {
  min-inline-size: 0;
}

img, svg {
  display: block;
}

[hidden] {
  display: none !important;
}

:focus-visible {
  outline: 3px solid var(--plum);
  outline-offset: 4px;
}

::selection {
  background: #e7d8ff;
  color: var(--ink);
}

.frame {
  inline-size: min(1200px, calc(100% - var(--gutter) * 2));
  margin-inline: auto;
}

.site-header {
  border-block-end: 1px solid #ede6d9;
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-block-size: 78px;
  padding-block: 12px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border-radius: 12px;
  color: var(--ink);
  font-size: 24px;
  font-weight: 1000;
  letter-spacing: -.035em;
  line-height: 1;
  text-decoration: none;
}

.brand img {
  flex: none;
}

.demo-label {
  display: flex;
  align-items: baseline;
  gap: .35em;
  flex: none;
  padding: 7px 13px;
  border: 1px solid #e6d8f3;
  border-radius: 999px;
  background: #f8f1fd;
  color: #674a80;
  font-size: 14px;
  font-weight: 750;
  line-height: 1.2;
}

.demo-label strong {
  color: var(--plum-dark);
  font-weight: 950;
}

.hero {
  display: grid;
  grid-template-columns: .96fr 1.04fr;
  align-items: center;
  gap: clamp(30px, 5vw, 70px);
  padding-block: clamp(42px, 4.6vw, 70px);
}

.hero__copy h1 {
  position: relative;
  isolation: isolate;
  font-size: clamp(3rem, 6.6vw, 6rem);
  font-weight: 1000;
  line-height: .99;
  letter-spacing: -.04em;
}

.hero__underline {
  position: relative;
  display: table;
}

.hero__underline::after {
  position: absolute;
  z-index: -1;
  inset: auto 1% .005em 1%;
  block-size: .12em;
  border-radius: 49% 46% 52% 40%;
  background: #ffde83;
  transform: rotate(-2deg);
  content: "";
}

.hero__copy p {
  max-inline-size: 28ch;
  margin-block: 26px 28px;
  color: var(--ink-soft);
  font-size: clamp(1.125rem, 1.8vw, 1.5rem);
  font-weight: 700;
  line-height: 1.43;
}

.button {
  --button-color: var(--gold);
  --button-edge: var(--gold-edge);
  --button-hover: #ffdb81;
  --button-ink: var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-block-size: 58px;
  padding: 11px 22px;
  border: 0;
  border-block-end: 5px solid var(--button-edge);
  border-radius: 17px;
  background: var(--button-color);
  color: var(--button-ink);
  font: inherit;
  font-size: 19px;
  font-weight: 950;
  line-height: 1.15;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 150ms ease, transform 150ms ease;
}

.button--primary {
  min-inline-size: 212px;
  min-block-size: 64px;
}

.button__icon {
  flex: none;
  inline-size: 22px;
  block-size: 22px;
}

.button:active, .answer:active:enabled {
  transform: translateY(2px);
}

.hero__art {
  position: relative;
  display: grid;
  place-items: end center;
  isolation: isolate;
  overflow: hidden;
  aspect-ratio: 1.33;
  border-radius: clamp(26px, 3.4vw, 48px);
  background: #e8dafb;
}

.hero__art::before, .hero__art::after {
  position: absolute;
  z-index: -1;
  border-radius: 50%;
  content: "";
}

.hero__art::before {
  inset: 9% auto auto 15%;
  inline-size: 70%;
  aspect-ratio: 1;
  background: #f3eaff;
}

.hero__art::after {
  inset: 81% auto auto -13%;
  inline-size: 126%;
  block-size: 45%;
  background: #d9c3f4;
}

.hero__art img {
  inline-size: 82%;
  block-size: auto;
  margin-block-end: 5.5%;
}

.hero__ground-shadow {
  position: absolute;
  inset: auto 14% 6%;
  block-size: 5%;
  border-radius: 50%;
  background: #68408f;
  opacity: .18;
  filter: blur(6px);
}

.sparkle {
  position: absolute;
  aspect-ratio: 1;
  clip-path: polygon(50% 0, 65% 34%, 100% 50%, 65% 65%, 50% 100%, 35% 65%, 0 50%, 35% 34%);
}

.sparkle--left {
  inset: 23% auto auto 8%;
  inline-size: 6%;
  background: #956acb;
  transform: rotate(-9deg);
}

.sparkle--right {
  inset: 13% 11% auto auto;
  inline-size: 8%;
  background: #ffd066;
  transform: rotate(12deg);
}

.sparkle--small {
  inset: 29% 6% auto auto;
  inline-size: 3.7%;
  background: #fff8de;
}

.lesson {
  min-block-size: 100vh;
  min-block-size: 100svh;
  padding: clamp(34px, 5vw, 66px) var(--gutter);
  background: var(--wash);
}

.lesson__inner {
  max-inline-size: 960px;
  margin-inline: auto;
}

.lesson__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px 28px;
  margin-block-end: 24px;
}

.lesson__header h2 {
  font-size: clamp(2rem, 4vw, 3.35rem);
  font-weight: 1000;
  line-height: 1.08;
  letter-spacing: -.035em;
}

.lesson__header h2:focus, .exercise__instruction:focus {
  outline: none;
}

.lesson__progress {
  flex: none;
  inline-size: min(190px, 32%);
  color: #624682;
  font-size: 16px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}

.progress-track {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 5px;
  margin-block-start: 8px;
}

.progress-track__segment {
  block-size: 8px;
  border-radius: 999px;
  background: #ded0ed;
}

.progress-track__segment[data-state="current"] {
  background: #ab84e8;
}

.progress-track__segment[data-state="done"] {
  background: var(--plum);
}

.exercise {
  display: grid;
  grid-template-columns: minmax(0, .92fr) minmax(0, 1.08fr);
  gap: clamp(22px, 4vw, 42px);
  align-items: stretch;
  padding: clamp(18px, 3vw, 30px);
  border-radius: 32px;
  background: #fffefb;
  box-shadow: 0 14px 32px #4e267411;
}

.clue {
  --clue-backdrop: #e9e1fc;
  --clue-spotlight: #f5efff;
  position: relative;
  display: grid;
  place-items: center;
  isolation: isolate;
  overflow: hidden;
  min-block-size: 308px;
  border-radius: 23px;
  background: var(--clue-backdrop);
}

.clue[data-picture="fish"] {
  --clue-backdrop: #dff4ee;
  --clue-spotlight: #effaf4;
}

.clue[data-picture="owl"] {
  --clue-backdrop: #ffe9dc;
  --clue-spotlight: #fff3e8;
}

.clue::before {
  position: absolute;
  z-index: -1;
  inline-size: clamp(150px, 65%, 254px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--clue-spotlight);
  content: "";
}

.clue img {
  inline-size: min(63%, 242px);
  block-size: auto;
}

.exercise__content {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-inline-size: 0;
  padding-block: 4px;
}

.exercise__instruction {
  color: var(--ink);
  font-size: clamp(1.25rem, 2.1vw, 1.65rem);
  font-weight: 950;
  line-height: 1.25;
}

.syllable-pair {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-block: 16px 20px;
}

.syllable {
  display: grid;
  place-items: center;
  min-inline-size: 82px;
  min-block-size: 76px;
  padding-inline: 10px;
  border-radius: 18px;
  font-size: 44px;
  font-weight: 1000;
  line-height: 1;
}

.syllable--given {
  background: #e9defb;
  color: #532d91;
}

.syllable--blank {
  border: 2px dashed #c9b4e4;
  background: #fbf8fe;
  color: #775b93;
}

.syllable--filled {
  border: 2px solid #b7ddc8;
  background: #dff3e7;
  color: var(--correct);
  animation: syllable-arrives 240ms cubic-bezier(.18, .8, .37, 1.4);
}

.syllable-pair__plus {
  inline-size: 20px;
  block-size: 20px;
  color: #806b95;
}

.answers {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(8px, 1.2vw, 12px);
}

.answer {
  min-block-size: 64px;
  padding: 6px 4px;
  border: 2px solid #e4d9f0;
  border-block-end-width: 5px;
  border-radius: 16px;
  background: #fffefc;
  color: var(--ink);
  font: inherit;
  font-size: 30px;
  font-weight: 1000;
  line-height: 1;
  cursor: pointer;
  transition: background-color 150ms ease, transform 150ms ease;
}

.answer[data-state="wrong"] {
  border-color: #e6afbd;
  background: #fff0f3;
  color: var(--wrong);
}

.answer[data-state="correct"] {
  border-color: #9bcdb3;
  background: #dff3e7;
  color: var(--correct);
}

.answer:disabled {
  cursor: default;
}

.answer:disabled:not([data-state="correct"]) {
  border-color: #ece4f0;
  background: #faf7fc;
  color: #726580;
}

.exercise__response {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-block-size: 56px;
  margin-block-start: 14px;
}

.feedback {
  color: var(--correct);
  font-size: 15px;
  font-weight: 850;
  line-height: 1.25;
}

.feedback[data-state="wrong"] {
  color: var(--wrong);
  font-size: 17px;
}

.feedback strong:not(:empty) {
  display: block;
  font-size: 30px;
  font-weight: 1000;
  line-height: 1;
}

.button--next {
  --button-color: var(--plum);
  --button-edge: #543292;
  --button-hover: #6338b1;
  --button-ink: #fff;
  gap: 6px;
  min-block-size: 50px;
  padding: 8px 14px;
  border-radius: 14px;
  font-size: 16px;
}

.button--next .button__icon {
  inline-size: 18px;
  block-size: 18px;
}

.lesson__notice {
  margin-block-start: 16px;
  color: var(--ink-soft);
  font-weight: 750;
}

@media (hover: hover) {
  .button:hover {
    background: var(--button-hover);
  }

  .answer:hover:enabled:not([data-state="wrong"]) {
    border-color: #cbb4e8;
    background: #f2eafb;
  }
}

@keyframes syllable-arrives {
  from { transform: scale(.91); }
  to { transform: scale(1); }
}

@media (max-width: 780px) {
  .site-header__inner {
    min-block-size: 66px;
  }

  .hero {
    grid-template-columns: 1fr;
    gap: 32px;
    padding-block: 36px 40px;
  }

  .hero__copy h1 {
    font-size: clamp(3rem, 12vw, 5.1rem);
  }

  .hero__copy p {
    margin-block: 20px 22px;
  }

  .hero__art {
    max-inline-size: 600px;
  }

  .lesson__header {
    margin-block-end: 18px;
  }

  .exercise {
    gap: 20px;
    border-radius: 26px;
  }

  .clue {
    min-block-size: 260px;
  }

  .exercise__response {
    flex-wrap: wrap;
  }
}

@media (max-width: 560px) {
  .brand {
    gap: 7px;
    font-size: clamp(1rem, 5vw, 1.25rem);
  }

  .brand img {
    inline-size: 36px;
    block-size: 36px;
  }

  .demo-label {
    padding-inline: 9px;
    font-size: 11px;
  }

  .button--primary {
    inline-size: 100%;
    min-block-size: 58px;
  }

  .hero__copy h1 {
    font-size: clamp(2.75rem, 13.4vw, 4.25rem);
  }

  .hero__art {
    aspect-ratio: 1.24;
  }

  .lesson__header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .lesson__progress {
    display: flex;
    align-items: center;
    gap: 14px;
    inline-size: 100%;
    font-size: 14px;
  }

  .progress-track {
    flex: 1;
    max-inline-size: 155px;
    margin: 0;
  }

  .exercise {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
    padding: 14px;
  }

  .clue {
    min-block-size: 164px;
    border-radius: 18px;
  }

  .clue::before {
    inline-size: 143px;
  }

  .clue img {
    inline-size: 135px;
  }

  .exercise__content {
    padding: 0 2px;
  }

  .syllable-pair {
    margin-block: 12px 16px;
  }

  .syllable {
    min-inline-size: 68px;
    min-block-size: 62px;
    border-radius: 15px;
    font-size: 36px;
  }

  .answer {
    min-block-size: 58px;
    font-size: 28px;
  }

  .exercise__response {
    flex-direction: column;
    align-items: stretch;
    min-block-size: 30px;
    margin-block-start: 10px;
  }
}

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

  .demo-label {
    padding-inline: 7px;
  }
}

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

  .button, .answer {
    transition: none;
  }

  .syllable--filled {
    animation: none;
  }
}
