/* Landing page.
 *
 * Public, cached, and the only page a stranger sees. It shares the palette and
 * spacing scale with the app (tokens.css) so the product does not look like a
 * different company once a teacher signs in, but it owns its own layout: the
 * app's components.css is built for dense data, not for reading.
 *
 * Constraints inherited from the app's CSP: no inline styles, no inline
 * scripts, no external fonts or CDNs. Everything here is one stylesheet and
 * one small script, both served from this origin.
 *
 * Bilingual without a build step: every translatable element exists twice,
 * marked data-lang="bg" or data-lang="en", and one of the two is hidden by the
 * language rule below. js/lang-init.js sets the attribute before first paint,
 * so the page never flashes the wrong language.
 */

/* --- language ------------------------------------------------------------- */

html[data-lang="bg"] [data-lang="en"],
html[data-lang="en"] [data-lang="bg"] {
  display: none !important;
}

/* --- base ----------------------------------------------------------------- */

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  /* The sticky header must not cover the heading of a jumped-to section. */
  scroll-padding-top: 88px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--fs-md);
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
}

img { max-width: 100%; height: auto; }

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

h1, h2, h3 {
  font-family: var(--font-display);
  line-height: 1.15;
  color: var(--brand-text);
  margin: 0;
  letter-spacing: -0.01em;
}

h1 { font-size: clamp(30px, 4.6vw, 44px); }
h2 { font-size: clamp(26px, 4vw, 38px); }
h3 { font-size: var(--fs-lg); }

p { margin: 0; }

.wrap {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 var(--sp-5);
}

section {
  padding: clamp(48px, 8vw, 88px) 0;
}

.sec-head {
  display: grid;
  gap: var(--sp-3);
  max-width: 60ch;
  margin: 0 0 var(--sp-7);
}

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

.eyebrow {
  font-family: var(--font-ui);
  font-size: var(--fs-sm);
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ochre);
}

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--surface);
  color: var(--brand-text);
  padding: var(--sp-3) var(--sp-4);
  z-index: 100;
}

.skip:focus { left: var(--sp-4); top: var(--sp-4); }

/* Keyboard users must be able to see where they are. The app's own sheets
 * are not loaded here, so the landing page states this itself. */
:focus-visible {
  outline: 3px solid var(--brand-line);
  outline-offset: 2px;
  border-radius: 4px;
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  min-height: 48px;
  padding: 0 var(--sp-5);
  border: 1px solid transparent;
  border-radius: 999px;
  font-family: var(--font-ui);
  font-size: var(--fs-base);
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 150ms ease, border-color 150ms ease, transform 150ms ease;
}

.btn:active { transform: translateY(1px); }

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

.btn-primary:hover { background: var(--brand-text); }

.btn-ghost {
  background: transparent;
  border-color: var(--line-strong);
  color: var(--brand-text);
}

.btn-ghost:hover { background: var(--surface); }

.btn-sm { min-height: 40px; padding: 0 var(--sp-4); font-size: var(--fs-sm); }

/* --- header --------------------------------------------------------------- */

.top {
  position: sticky;
  top: 0;
  z-index: 40;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

.top-in {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--sp-3) var(--sp-4);
  min-height: 72px;
  padding: var(--sp-2) 0;
}

/* The wordmark PNG is drawn on white, which shows as a box on the paper
 * background, so the header pairs the transparent mark with live text. */
.top-brand {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  margin-right: auto;
  text-decoration: none;
  color: var(--brand-text);
}

.top-brand img { height: 40px; width: 40px; }

.top-word {
  font-family: var(--font-display);
  font-size: var(--fs-xl);
  font-weight: 700;
  letter-spacing: -0.01em;
}

.top-nav {
  display: flex;
  align-items: center;
  gap: var(--sp-5);
  font-family: var(--font-ui);
  font-size: var(--fs-base);
}

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

.top-nav a:hover { color: var(--brand-text); }

/* No overflow:hidden here: it would clip the focus ring off the two buttons,
 * which are the only place on the page where that ring is the sole cue. The
 * pill shape comes from the buttons' own corners instead. */
.lang {
  display: inline-flex;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  font-family: var(--font-ui);
  font-size: var(--fs-xs);
  font-weight: 700;
}

.lang button {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 8px 13px;
  cursor: pointer;
  min-height: 40px;
}

.lang button:first-child { border-radius: 999px 0 0 999px; }
.lang button:last-child { border-radius: 0 999px 999px 0; }

.lang button[aria-pressed="true"] {
  background: var(--brand);
  color: var(--on-brand);
}

@media (max-width: 860px) {
  .top-nav .nav-hide { display: none; }
  .top-brand img { height: 34px; width: 34px; }
  .top-word { font-size: var(--fs-lg); }
}

/* --- hero ----------------------------------------------------------------- */

.hero {
  padding-top: clamp(32px, 5vw, 64px);
  padding-bottom: clamp(40px, 6vw, 72px);
}

.hero-grid {
  display: grid;
  gap: clamp(32px, 5vw, 56px);
  align-items: center;
}

@media (min-width: 900px) {
  .hero-grid { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); }
}

.hero-copy { display: grid; gap: var(--sp-5); }

.hero-sub {
  font-size: clamp(17px, 2.2vw, 21px);
  color: var(--muted);
  max-width: 48ch;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-3);
}

.hero-note {
  font-family: var(--font-ui);
  font-size: var(--fs-sm);
  color: var(--muted);
  display: flex;
  align-items: flex-start;
  gap: var(--sp-2);
  max-width: 52ch;
}

.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ok, #2E7D5B);
  flex: none;
  margin-top: 8px;
}

/* --- product mock ---------------------------------------------------------
 * A drawing, not a screenshot: no real pupil ever appears on a public page,
 * and a hand-built mock cannot go stale when the app is restyled.
 */

.mock {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 18px 40px rgba(20, 68, 112, 0.10);
  padding: var(--sp-4);
  display: grid;
  gap: var(--sp-3);
  font-family: var(--font-ui);
}

.mock-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: var(--fs-sm);
  color: var(--muted);
  padding-bottom: var(--sp-3);
  border-bottom: 1px solid var(--line);
}

.mock-day {
  display: grid;
  grid-template-columns: 54px 1fr;
  gap: var(--sp-3);
  align-items: center;
}

/* --muted, not --faint, for every piece of running text on this page:
 * --faint is 2.9:1 on the paper background, under the 4.5:1 that small text
 * needs, and some of this text is the trader information the law requires. */
.mock-time {
  font-size: var(--fs-sm);
  color: var(--muted);
  text-align: right;
}

.mock-lesson {
  border-left: 3px solid var(--brand-line);
  background: var(--brand-soft);
  border-radius: 8px;
  padding: var(--sp-2) var(--sp-3);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-2);
  font-size: var(--fs-sm);
}

.mock-lesson[data-tone="gold"] {
  border-left-color: var(--gold);
  background: var(--gold-soft);
}

.mock-lesson[data-tone="quiet"] {
  border-left-color: var(--line-strong);
  background: var(--surface-2);
}

.mock-name { font-weight: 600; color: var(--text); }

.mock-pill {
  font-size: var(--fs-xs);
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--muted);
  white-space: nowrap;
}

.mock-foot {
  margin-top: var(--sp-2);
  padding-top: var(--sp-3);
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: var(--fs-sm);
  color: var(--muted);
}

.mock-total {
  font-family: var(--font-display);
  font-size: var(--fs-xl);
  color: var(--brand-text);
}

/* --- the strip of small assurances under the hero ------------------------- */

.strip {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  padding: var(--sp-5) 0;
}

.strip-in {
  display: grid;
  gap: var(--sp-4);
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  font-family: var(--font-ui);
  font-size: var(--fs-sm);
  color: var(--muted);
  text-align: center;
}

.strip b {
  display: block;
  font-family: var(--font-display);
  font-size: var(--fs-lg);
  color: var(--brand-text);
  font-weight: 600;
}

/* --- generic cards -------------------------------------------------------- */

.cards {
  display: grid;
  gap: var(--sp-5);
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: var(--sp-5);
  display: grid;
  gap: var(--sp-3);
  align-content: start;
}

.card p { color: var(--muted); font-size: var(--fs-base); }

.card-ico {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--brand-soft);
  color: var(--brand-text);
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-size: var(--fs-lg);
  font-weight: 700;
}

.alt { background: var(--surface); border-block: 1px solid var(--line); }

/* --- steps ---------------------------------------------------------------- */

.steps {
  display: grid;
  gap: var(--sp-6);
  counter-reset: step;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.step { display: grid; gap: var(--sp-3); align-content: start; }

.step::before {
  counter-increment: step;
  content: counter(step);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--brand);
  color: var(--on-brand);
  font-family: var(--font-display);
  font-size: var(--fs-lg);
  font-weight: 700;
}

.step p { color: var(--muted); font-size: var(--fs-base); }

/* --- security ------------------------------------------------------------- */

.trust-grid {
  display: grid;
  gap: var(--sp-5);
  align-items: start;
}

@media (min-width: 900px) {
  .trust-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}

.trust-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: var(--sp-4);
}

.trust-list li {
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: var(--sp-3);
  align-items: start;
  color: var(--muted);
  font-size: var(--fs-base);
}

.trust-list b { color: var(--text); font-weight: 600; }

.tick {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand-text);
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 700;
  margin-top: 2px;
}

/* --- pricing -------------------------------------------------------------- */

.plans {
  display: grid;
  gap: var(--sp-5);
  /* min() so the track can collapse below its preferred width instead of
   * forcing the page to scroll sideways on a 320px screen. */
  grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr));
  max-width: 760px;
}

.plan {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: var(--sp-6);
  display: grid;
  gap: var(--sp-3);
  align-content: start;
  position: relative;
}

.plan[data-best="1"] {
  border-color: var(--gold);
  box-shadow: 0 10px 30px rgba(217, 150, 58, 0.14);
}

.plan-badge {
  position: absolute;
  top: -13px;
  left: var(--sp-6);
  background: var(--gold);
  color: #3B2606;
  font-family: var(--font-ui);
  font-size: var(--fs-xs);
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 999px;
}

.plan-name {
  font-family: var(--font-ui);
  font-size: var(--fs-sm);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.plan-price {
  font-family: var(--font-display);
  font-size: 44px;
  font-weight: 700;
  color: var(--brand-text);
  line-height: 1;
}

.plan-per { font-size: var(--fs-md); color: var(--muted); font-family: var(--font-body); }

.plan-note { font-size: var(--fs-sm); color: var(--muted); font-family: var(--font-ui); }

.plan .btn { margin-top: var(--sp-2); }

.includes {
  margin: var(--sp-5) 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: var(--sp-2);
  font-size: var(--fs-base);
  color: var(--muted);
  max-width: 760px;
}

.includes li { display: grid; grid-template-columns: 22px 1fr; gap: var(--sp-3); align-items: start; }

.vat {
  margin-top: var(--sp-5);
  font-size: var(--fs-sm);
  color: var(--muted);
  font-family: var(--font-ui);
  max-width: 70ch;
}

/* --- faq ------------------------------------------------------------------ */

.faq { display: grid; gap: var(--sp-3); max-width: 800px; }

.faq details {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0 var(--sp-5);
}

.faq summary {
  cursor: pointer;
  list-style: none;
  padding: var(--sp-4) 0;
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: var(--fs-base);
  color: var(--text);
  display: flex;
  justify-content: space-between;
  gap: var(--sp-4);
  align-items: center;
  min-height: 48px;
}

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

.faq summary::after {
  content: "+";
  font-family: var(--font-ui);
  font-size: var(--fs-lg);
  color: var(--brand-line);
  flex: none;
}

.faq details[open] summary::after { content: "−"; }

.faq details[open] summary { border-bottom: 1px solid var(--line); }

.faq p { padding: var(--sp-4) 0; color: var(--muted); font-size: var(--fs-base); }

/* --- closing cta ---------------------------------------------------------- */

.close-cta {
  background: var(--brand);
  color: var(--on-brand);
  border-radius: 20px;
  padding: clamp(32px, 6vw, 56px);
  text-align: center;
  display: grid;
  gap: var(--sp-4);
  justify-items: center;
}

.close-cta h2 { color: var(--on-brand); }
.close-cta p { color: rgba(255, 255, 255, 0.86); max-width: 52ch; }

.close-cta .btn-primary {
  background: var(--on-brand);
  color: var(--brand-text);
}

.close-cta .btn-primary:hover { background: var(--gold-soft); }

.close-cta .hero-note { color: rgba(255, 255, 255, 0.82); }

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

.foot {
  border-top: 1px solid var(--line);
  background: var(--surface);
  padding: var(--sp-7) 0 var(--sp-6);
  font-family: var(--font-ui);
  font-size: var(--fs-sm);
  color: var(--muted);
}

.foot-grid {
  display: grid;
  gap: var(--sp-6);
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.foot h3 {
  font-family: var(--font-ui);
  font-size: var(--fs-xs);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: var(--sp-3);
}

.foot ul { margin: 0; padding: 0; list-style: none; display: grid; gap: var(--sp-2); }

.foot a { color: var(--muted); text-decoration: none; }
.foot a:hover { color: var(--brand-text); text-decoration: underline; }

.foot-brand img { height: 48px; width: 48px; margin-bottom: var(--sp-3); }

.foot-legal {
  margin-top: var(--sp-6);
  padding-top: var(--sp-5);
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-3) var(--sp-5);
  justify-content: space-between;
  color: var(--muted);
  font-size: var(--fs-xs);
}

/* A link inside a paragraph must not be told apart by colour alone. */
.foot-legal a { text-decoration: underline; }

address { font-style: normal; }

/* --- motion --------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}

/* --- print ---------------------------------------------------------------- */

@media print {
  .top, .close-cta, .hero-cta { display: none; }
  body { background: #fff; }
}
