/* A1 Lithuanian. One idea: the test is a sheet of squared exercise paper, and answers are marked in a teacher's red pen.
   Type rule: the serif (Literata) is always Lithuanian you are learning; the sans (Onest) is help in your language. */

@font-face {
  font-family: "Onest";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url(fonts/onest-cyrillic-ext-wght-normal.woff2) format("woff2-variations"), url(fonts/onest-cyrillic-ext-wght-normal.woff2) format("woff2");
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
@font-face {
  font-family: "Onest";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url(fonts/onest-cyrillic-wght-normal.woff2) format("woff2-variations"), url(fonts/onest-cyrillic-wght-normal.woff2) format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Onest";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url(fonts/onest-latin-ext-wght-normal.woff2) format("woff2-variations"), url(fonts/onest-latin-ext-wght-normal.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Onest";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url(fonts/onest-latin-wght-normal.woff2) format("woff2-variations"), url(fonts/onest-latin-wght-normal.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: "Literata";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url(fonts/literata-latin-ext-600-normal.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Literata";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url(fonts/literata-latin-600-normal.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: "Literata";
  font-style: italic;
  font-weight: 600;
  font-display: swap;
  src: url(fonts/literata-latin-ext-600-italic.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Literata";
  font-style: italic;
  font-weight: 600;
  font-display: swap;
  src: url(fonts/literata-latin-600-italic.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;
  --page: #eef2f7;
  --sheet: #ffffff;
  --grid: #e2e9f3;
  --ink: #1f2e86;
  --text: #252833;
  --muted: #5b6275;
  --line: #c8d2e2;
  --red: #cf2a3e;
  --focus: #2958ff;
  --on-ink: #ffffff;
  --sans: "Onest", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --serif: "Literata", Georgia, "Times New Roman", serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --page: #0f1222;
    --sheet: #171b2e;
    --grid: #222944;
    --ink: #b2bfff;
    --text: #e6e9f2;
    --muted: #a6adc2;
    --line: #36405f;
    --red: #ff6d7e;
    --focus: #93a8ff;
    --on-ink: #0f1222;
  }
}

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

[hidden] { display: none !important; }

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

body {
  margin: 0;
  background: var(--page);
  color: var(--text);
  font: 400 1.0625rem/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
}

svg { display: block; }

a { color: var(--ink); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }

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

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

.lt,
b[lang="lt"] { font-family: var(--serif); font-weight: 600; }

/* ---------- page frame ---------- */

.top,
main,
.foot { width: min(100% - 1.5rem, 40rem); margin-inline: auto; }

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 0.75rem;
}

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

.brand-cell {
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border: 1.5px solid var(--ink);
  font-size: 0.8125rem;
  font-weight: 800;
}

.langs { display: flex; }

.langs button {
  min-width: 2.75rem;
  min-height: 2.75rem;
  padding: 0 0.5rem;
  border: 0;
  border-radius: 6px;
  background: none;
  color: var(--muted);
  font: 600 0.875rem/1 var(--sans);
  cursor: pointer;
}

.langs button:hover { color: var(--ink); }
.langs button[aria-pressed="true"] { color: var(--ink); box-shadow: inset 0 -2px 0 var(--ink); border-radius: 0; }

.intro { padding: 0.75rem 0 1.25rem; }

h1 {
  margin: 0 0 0.625rem;
  color: var(--ink);
  font-size: clamp(1.75rem, 6.6vw, 2.5rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.025em;
  text-wrap: balance;
}

.lead { margin: 0; max-width: 34em; color: var(--muted); }

/* ---------- the exercise sheet ---------- */

.sheet {
  position: relative;
  padding: 1rem 1rem 1.5rem 3.25rem;
  border: 1px solid var(--line);
  border-radius: 3px;
  background-color: var(--sheet);
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 1.25rem 1.25rem;
  background-position: -1px -1px;
  /* a second sheet underneath */
  box-shadow: 5px 5px 0 -1px var(--sheet), 5px 5px 0 0 var(--line);
}

/* the red margin line of a school notebook */
.sheet::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 2.5rem;
  width: 1.5px;
  background: var(--red);
  opacity: 0.5;
}

.sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.counter { margin: 0; color: var(--muted); font-size: 0.875rem; font-weight: 600; }
.counter:focus { outline: none; }

.cells { display: flex; gap: 3px; margin: 0; padding: 0; list-style: none; }

.cells li {
  position: relative;
  width: 0.8125rem;
  height: 0.8125rem;
  border: 1px solid var(--line);
  background: var(--sheet);
}

.cells li.is-now { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }

.cells li.is-right::after {
  content: "";
  position: absolute;
  left: 3px;
  top: -1px;
  width: 4px;
  height: 8px;
  border: solid var(--red);
  border-width: 0 2px 2px 0;
  transform: rotate(40deg);
}

.cells li.is-wrong::after {
  content: "";
  position: absolute;
  left: 1px;
  right: 1px;
  top: 5px;
  height: 2px;
  background: var(--red);
  transform: rotate(-35deg);
}

.sheet-body { position: relative; }

.qnum {
  position: absolute;
  left: -3.125rem;
  top: -0.125rem;
  width: 2.5rem;
  color: var(--ink);
  font: 600 1.375rem/1 var(--serif);
  text-align: center;
}

.ctx { margin: 0 0 0.375rem; color: var(--muted); font-size: 0.9375rem; }

.stim { margin: 0 0 0.875rem; color: var(--ink); font-family: var(--serif); font-weight: 600; }

.stim--phrase { font-size: clamp(2.125rem, 10vw, 2.875rem); line-height: 1.1; letter-spacing: -0.01em; }
.stim--phrase.is-long { font-size: clamp(1.5rem, 6.4vw, 2rem); line-height: 1.25; }
.stim--text { font-size: clamp(1.375rem, 5.6vw, 1.75rem); line-height: 1.3; }
.stim--dialogue { font-size: clamp(1.5rem, 6.4vw, 2rem); line-height: 1.3; }
.stim--dialogue span { display: block; }

.stim--sign {
  display: inline-flex;
  flex-direction: column;
  padding: 0.75rem 1.125rem;
  border: 2px solid var(--ink);
  border-radius: 6px;
  background: var(--sheet);
  font-size: 1.125rem;
  line-height: 1.5;
}
.stim--sign strong { margin-bottom: 0.25rem; font-size: 0.9375rem; letter-spacing: 0.08em; }

.stim--form { display: grid; gap: 0.625rem; max-width: 19rem; font-size: 1.125rem; }
.stim--form div { display: flex; align-items: baseline; gap: 0.5rem; }
.stim--form dt::after { content: ":"; }
.stim--form dd { flex: 1; height: 1.1em; margin: 0; border-bottom: 1.5px solid var(--ink); }

.stim--message {
  max-width: 24rem;
  padding: 0.75rem 1rem;
  border: 1px solid var(--line);
  border-radius: 14px 14px 14px 3px;
  background: var(--sheet);
  font-size: 1.125rem;
  line-height: 1.45;
}
.stim--message p { margin: 0 0 0.25rem; }
.stim--message .sig { margin: 0.375rem 0 0; text-align: right; }

.stim--gap { font-size: clamp(1.75rem, 8vw, 2.25rem); line-height: 1.3; }
.gap { display: inline-block; min-width: 3.25em; border-bottom: 2px solid var(--ink); text-align: center; }
.gap.is-filled { border-color: var(--red); color: var(--red); font-style: italic; }

.ask { margin: 0 0 1rem; font-weight: 600; }

/* ---------- answers ---------- */

.opts { display: grid; gap: 0.75rem; }

.opt {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  min-height: 3.375rem;
  padding: 0.625rem 0.875rem 0.625rem 0.625rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--sheet);
  color: var(--text);
  font: 500 1.0625rem/1.3 var(--sans);
  text-align: left;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.opt .lt { font-size: 1.1875rem; color: var(--ink); }
.opt:hover:not(:disabled) { border-color: var(--ink); }
.opt:active:not(:disabled) { transform: translateY(1px); }
.opt:disabled { cursor: default; color: var(--text); }
.opt.is-dim { opacity: 0.5; }

.opt-key {
  position: relative;
  flex: none;
  display: grid;
  place-items: center;
  width: 1.875rem;
  height: 1.875rem;
  border: 1px solid var(--line);
  color: var(--muted);
  font: 600 0.875rem/1 var(--sans);
}

.opt.is-answer .opt-letter,
.opt.is-wrong .opt-letter { opacity: 0.25; }

.pen { overflow: visible; pointer-events: none; }
.pen path { fill: none; stroke: var(--red); stroke-width: 2.25; stroke-linecap: round; stroke-linejoin: round; }
.pen.draw path { stroke-dasharray: 1; stroke-dashoffset: 1; animation: pen-draw 0.45s cubic-bezier(0.3, 0.6, 0.4, 1) forwards; }

@keyframes pen-draw { to { stroke-dashoffset: 0; } }

.pen-loop { position: absolute; left: -10px; top: -10px; }
.pen-strike { position: absolute; left: 0; top: 0; }
.pen-tick { position: absolute; left: -0.375rem; top: -0.5rem; width: 2.5rem; height: 2.5rem; }
.pen-tick path { stroke-width: 2.75; }

/* ---------- feedback and result ---------- */

.fb { margin-top: 1.375rem; }
.fb-head { margin: 0 0 0.25rem; font-weight: 700; }
.fb-head.is-right { color: var(--ink); }
.fb-head.is-wrong { color: var(--red); }
.fb-text { margin: 0 0 1.125rem; max-width: 34em; }

.grade { margin: 0 0 0.75rem; }

.grade-num {
  position: relative;
  display: inline-block;
  padding: 0 0.25em 0.3em 0;
  color: var(--red);
  font: italic 600 clamp(3.75rem, 17vw, 5rem)/1 var(--serif);
}

.pen-under { position: absolute; left: -0.1em; bottom: -0.05em; width: 1.9em; height: 0.24em; }
.pen-under path { stroke-width: 2.75; }

.res-head { margin: 0 0 0.375rem; font-size: 1.25rem; font-weight: 700; }
.res-note { margin: 0; max-width: 34em; color: var(--muted); }

.btn-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.625rem 1rem; margin-top: 1.25rem; }

.flash { margin: 0.75rem 0 0; color: var(--muted); font-size: 0.9375rem; overflow-wrap: anywhere; }
.flash:empty { display: none; }

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3.125rem;
  padding: 0.75rem 1.25rem;
  border: 1px solid transparent;
  border-radius: 10px;
  font: 650 1.0625rem/1.2 var(--sans);
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}

.btn-primary { background: var(--ink); color: var(--on-ink); }
.btn-primary:hover { background: color-mix(in srgb, var(--ink) 86%, var(--text)); }
.btn-primary:disabled { opacity: 0.6; cursor: progress; }
.btn-quiet { border-color: var(--line); background: var(--sheet); color: var(--ink); }
.btn-quiet:hover { border-color: var(--ink); }
.btn-link { min-height: 2.75rem; padding-inline: 0.25rem; background: none; color: var(--ink); text-decoration: underline; text-underline-offset: 0.18em; }

@media (max-width: 30rem) {
  .btn.wide { width: 100%; }
}

/* ---------- why it matters ---------- */

.why { max-width: 36em; margin: 1.75rem 0 2.75rem; color: var(--muted); font-size: 0.9375rem; }

/* ---------- early-bird list ---------- */

.signup { padding-top: 2rem; border-top: 1px solid var(--line); scroll-margin-top: 1rem; }

h2 {
  margin: 0 0 1rem;
  color: var(--ink);
  font-size: clamp(1.375rem, 5.2vw, 1.75rem);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.includes { display: grid; gap: 0.5rem; margin: 0 0 1.5rem; padding: 0; list-style: none; }
.includes li { position: relative; padding-left: 1.375rem; }
.includes li::before {
  content: "";
  position: absolute;
  left: 0.125rem;
  top: 0.55em;
  width: 0.5rem;
  height: 0.5rem;
  background: var(--ink);
}

.price { display: flex; align-items: baseline; gap: 0.875rem; margin: 0 0 0.25rem; }
.price-now { color: var(--ink); font-size: 2.375rem; font-weight: 800; line-height: 1; letter-spacing: -0.02em; }
.price-later { color: var(--muted); font-size: 1.0625rem; font-weight: 600; }
.price-note { margin: 0 0 1.5rem; color: var(--muted); font-size: 0.9375rem; }

.su-form { display: grid; gap: 1.125rem; }

.levels { margin: 0; padding: 0; border: 0; min-width: 0; }
.levels legend { margin-bottom: 0.5rem; padding: 0; font-weight: 600; }
.seg { display: flex; }
.seg label { position: relative; flex: 1; }
.seg input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.seg span {
  display: grid;
  place-items: center;
  min-height: 3rem;
  margin-left: -1px;
  padding: 0.25rem 0.5rem;
  border: 1px solid var(--line);
  background: var(--sheet);
  font-weight: 600;
  text-align: center;
  line-height: 1.2;
}
.seg label:first-child span { margin-left: 0; border-radius: 10px 0 0 10px; }
.seg label:last-child span { border-radius: 0 10px 10px 0; }
.seg input:checked + span { position: relative; z-index: 1; border-color: var(--ink); background: var(--ink); color: var(--on-ink); }
.seg input:focus-visible + span { position: relative; z-index: 2; outline: 3px solid var(--focus); outline-offset: 2px; }

.field { display: grid; gap: 0.375rem; font-weight: 600; }
.field input {
  width: 100%;
  min-height: 3.125rem;
  padding: 0.625rem 0.875rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--sheet);
  color: var(--text);
  font: 400 1.0625rem/1.3 var(--sans);
}
.field input:focus { outline: 3px solid var(--focus); outline-offset: 1px; border-color: var(--ink); }
.field input[aria-invalid="true"] { border-color: var(--red); }

.consent { display: flex; align-items: flex-start; gap: 0.75rem; color: var(--muted); font-size: 0.9375rem; }
.consent input { flex: none; width: 1.375rem; height: 1.375rem; margin: 0.125rem 0 0; accent-color: var(--ink); }
.consent input[aria-invalid="true"] { outline: 2px solid var(--red); outline-offset: 2px; }

.form-msg { margin: 0; color: var(--red); font-weight: 600; }
.fine { margin: -0.375rem 0 0; color: var(--muted); font-size: 0.875rem; }

.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

.su-ok { padding: 1.25rem; border: 1px solid var(--line); border-radius: 10px; background: var(--sheet); }
.su-ok:focus { outline: none; }
.su-ok-title { margin: 0 0 0.5rem; color: var(--ink); font-size: 1.25rem; font-weight: 800; }
.su-ok p { margin: 0 0 0.5rem; }

/* ---------- questions ---------- */

.faq { margin-top: 3.25rem; }
.faq details { border-top: 1px solid var(--line); }
.faq details:last-of-type { border-bottom: 1px solid var(--line); }
.faq summary {
  position: relative;
  padding: 1rem 2.25rem 1rem 0;
  font-weight: 600;
  list-style: none;
  cursor: pointer;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "";
  position: absolute;
  right: 0.375rem;
  top: 50%;
  width: 0.625rem;
  height: 0.625rem;
  border: solid var(--ink);
  border-width: 0 2px 2px 0;
  transform: translateY(-70%) rotate(45deg);
}
.faq details[open] summary::after { transform: translateY(-25%) rotate(-135deg); }
.faq details p { margin: 0 0 1.125rem; max-width: 36em; color: var(--muted); }

/* ---------- footer ---------- */

.foot { padding-block: 2.75rem 2.5rem; color: var(--muted); font-size: 0.875rem; }
.foot p { margin: 0 0 0.625rem; max-width: 36em; }
.foot-links { display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; }

/* ---------- privacy page ---------- */

.doc { padding-block: 0.5rem 1rem; }
.doc h1 { margin-bottom: 0.25rem; }
.doc h2 { margin: 2rem 0 0.5rem; font-size: 1.1875rem; }
.doc p { max-width: 38em; margin: 0 0 0.875rem; }
.doc .stamp { color: var(--muted); font-size: 0.9375rem; }
.doc-langs { display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; margin: 0 0 1rem; padding: 0; list-style: none; font-weight: 600; }
.doc section { padding-top: 1.5rem; border-top: 1px solid var(--line); margin-top: 2rem; }
.doc section:first-of-type { border-top: 0; margin-top: 0.5rem; }

/* ---------- small phones ---------- */

@media (max-width: 23rem) {
  .sheet { padding-left: 2.75rem; padding-right: 0.75rem; }
  .sheet::before { left: 2.125rem; }
  .qnum { left: -2.75rem; width: 2.125rem; font-size: 1.25rem; }
  .cells { gap: 2px; }
  .cells li { width: 0.6875rem; height: 0.6875rem; }
  .cells li.is-right::after { left: 2px; width: 3px; height: 7px; }
}

@media (prefers-reduced-motion: reduce) {
  .pen.draw path { animation: none; stroke-dashoffset: 0; }
  .opt:active:not(:disabled) { transform: none; }
}
