/* ============================================================
   WortQuest — landing page styles
   Brand palette mirrors lib/theme/app_theme.dart
   ============================================================ */

:root {
  /* Brand */
  --primary: #1e88e5;
  --primary-dark: #1565c0;
  --purple: #5e35b1;
  --brand-gradient: linear-gradient(120deg, #1e88e5 0%, #5e35b1 100%);

  /* Backgrounds & surfaces */
  --bg: #faf9f6;          /* warm off-white, matches app background */
  --surface: #ffffff;
  --tint: #f1f4fa;
  --ink: #1f2430;
  --ink-soft: #5b6270;
  --line: #e6e3dc;

  /* Difficulty accents */
  --leicht: #d16c5a;
  --mittel: #215786;
  --schwer: #612e79;

  /* Type */
  --font-display: "Baloo 2", system-ui, sans-serif;
  --font-body: "Nunito", system-ui, sans-serif;

  /* Misc */
  --radius: 20px;
  --radius-sm: 12px;
  --shadow: 0 10px 30px rgba(31, 36, 48, 0.08);
  --shadow-lg: 0 24px 60px rgba(31, 36, 48, 0.14);
  --container: 1140px;
}

/* ---------- Reset & base ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 84px;
}

body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: inherit;
  text-decoration: none;
}

ul {
  list-style: none;
}

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: 24px;
}

.container--narrow {
  max-width: 820px;
}

.gradient-text {
  background: var(--brand-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-body);
  font-weight: 800;
  border-radius: 999px;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
  white-space: nowrap;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn:active {
  transform: translateY(0);
}

.btn--primary {
  background: var(--brand-gradient);
  color: #fff;
  box-shadow: 0 12px 26px rgba(30, 136, 229, 0.35);
}

.btn--primary:hover {
  box-shadow: 0 16px 32px rgba(94, 53, 177, 0.4);
}

.btn--ghost {
  background: transparent;
  color: var(--ink);
  border: 2px solid rgba(31, 36, 48, 0.18);
}

.btn--ghost:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.btn--white {
  background: #fff;
  color: var(--primary-dark);
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.25);
}

.btn--white:hover {
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.32);
}

.btn--lg {
  padding: 15px 30px;
  font-size: 17px;
}

.btn--small {
  padding: 10px 20px;
  font-size: 14px;
}

/* ---------- Nav ---------- */
.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  background: rgba(250, 249, 246, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.25s ease, background 0.25s ease;
}

.nav--scrolled {
  border-color: var(--line);
  background: rgba(250, 249, 246, 0.95);
}

.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.nav__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 800;
}

.nav__logo {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  box-shadow: var(--shadow);
}

.nav__name-accent {
  color: var(--primary);
}

.nav__links {
  display: flex;
  align-items: center;
  gap: 30px;
  font-weight: 700;
}

.nav__links a:not(.btn) {
  color: var(--ink-soft);
  transition: color 0.18s ease;
}

.nav__links a:not(.btn):hover {
  color: var(--primary);
}

.nav__toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: 0;
  cursor: pointer;
  padding: 8px;
}

.nav__toggle span {
  width: 24px;
  height: 3px;
  border-radius: 3px;
  background: var(--ink);
  transition: transform 0.25s ease, opacity 0.25s ease;
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  padding: 160px 0 110px;
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(94, 53, 177, 0.12), transparent 60%),
    radial-gradient(900px 500px at 0% 20%, rgba(30, 136, 229, 0.12), transparent 55%),
    var(--bg);
}

.hero__inner {
  position: relative;
  z-index: 2;
}

.hero__content {
  max-width: 720px;
  margin-inline: auto;
  text-align: center;
}

.hero__logo {
  width: 96px;
  height: 96px;
  margin: 0 auto 22px;
  border-radius: 22px;
  box-shadow: var(--shadow-lg);
}

.hero__eyebrow {
  font-weight: 800;
  font-size: 14px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 16px;
}

.hero__title {
  font-family: var(--font-display);
  font-size: clamp(40px, 6vw, 62px);
  font-weight: 800;
  line-height: 1.06;
  letter-spacing: -0.5px;
}

.hero__subtitle {
  margin: 22px auto 0;
  max-width: 600px;
  font-size: 19px;
  color: var(--ink-soft);
}

.hero__subtitle strong {
  color: var(--ink);
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: center;
  margin-top: 34px;
}

.hero__stats {
  display: flex;
  justify-content: center;
  gap: 48px;
  margin-top: 52px;
}

.hero__stats li {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero__stat-num {
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 800;
  background: var(--brand-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero__stat-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* Decorative floating letters */
.hero__letter {
  position: absolute;
  z-index: 1;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(40px, 6vw, 72px);
  color: rgba(30, 136, 229, 0.10);
  user-select: none;
  pointer-events: none;
  left: var(--x);
  top: var(--y);
  transform: rotate(var(--r));
  animation: float 6s ease-in-out infinite;
  animation-delay: var(--d);
}

.hero__letter--dark {
  color: rgba(94, 53, 177, 0.12);
}

@keyframes float {
  0%, 100% { translate: 0 0; }
  50% { translate: 0 -14px; }
}

/* ---------- Sections ---------- */
.section {
  padding: 96px 0;
}

.section--tint {
  background: var(--tint);
}

.section__head {
  max-width: 680px;
  margin: 0 auto 54px;
  text-align: center;
}

.section__eyebrow {
  font-weight: 800;
  font-size: 13px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 12px;
}

.section__title {
  font-family: var(--font-display);
  font-size: clamp(30px, 4vw, 40px);
  font-weight: 800;
  line-height: 1.12;
}

.section__lead {
  margin-top: 14px;
  font-size: 18px;
  color: var(--ink-soft);
}

/* ---------- Feature cards ---------- */
.features {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 22px;
}

.card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 30px 26px;
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}

.card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
}

.card__icon {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  font-size: 26px;
  border-radius: 14px;
  background: color-mix(in srgb, var(--accent) 12%, #fff);
  margin-bottom: 18px;
}

.card__title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 8px;
}

.card__text {
  font-size: 15.5px;
  color: var(--ink-soft);
}

/* ---------- Steps ---------- */
.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 26px;
  counter-reset: step;
}

.step {
  position: relative;
  background: var(--surface);
  border-radius: var(--radius);
  padding: 34px 28px 30px;
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
}

.step__num {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--brand-gradient);
  color: #fff;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 20px;
  margin-bottom: 20px;
  box-shadow: 0 10px 20px rgba(30, 136, 229, 0.3);
}

.step__title {
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 700;
  margin-bottom: 8px;
}

.step__text {
  font-size: 15.5px;
  color: var(--ink-soft);
}

/* ---------- Levels ---------- */
.levels {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  align-items: stretch;
}

.level {
  --tier: var(--mittel);
  --tier-soft: #e8f1f8;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-radius: var(--radius);
  padding: 32px 28px;
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
  border-top: 5px solid var(--tier);
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}

.level:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
}

.level--featured {
  border-top-width: 6px;
  position: relative;
}

.level__badge {
  align-self: flex-start;
  font-weight: 800;
  font-size: 13px;
  letter-spacing: 0.06em;
  color: var(--tier);
  background: var(--tier-soft);
  padding: 6px 14px;
  border-radius: 999px;
  margin-bottom: 18px;
}

.level__title {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 800;
  color: var(--tier);
  margin-bottom: 8px;
}

.level__desc {
  font-size: 15.5px;
  color: var(--ink-soft);
  margin-bottom: 20px;
}

.level__list {
  display: grid;
  gap: 10px;
  margin-bottom: 26px;
}

.level__list li {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 15px;
  color: var(--ink);
}

.level__list li::before {
  content: "✓";
  font-weight: 800;
  color: var(--tier);
  flex-shrink: 0;
}

.level__tag {
  margin-top: auto;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-soft);
}

.level__tag--hot {
  color: var(--primary);
  font-weight: 800;
}

/* ---------- FAQ ---------- */
.faq {
  display: grid;
  gap: 14px;
}

.faq__item {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 20px 24px;
  box-shadow: var(--shadow);
}

.faq__item summary {
  cursor: pointer;
  font-weight: 800;
  font-size: 17px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  list-style: none;
}

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

.faq__item summary::after {
  content: "+";
  font-size: 24px;
  font-weight: 800;
  color: var(--primary);
  transition: transform 0.22s ease;
}

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

.faq__item p {
  margin-top: 14px;
  color: var(--ink-soft);
  font-size: 15.5px;
}

/* ---------- CTA ---------- */
.cta {
  padding: 96px 0;
}

.cta__card {
  background: var(--brand-gradient);
  border-radius: 28px;
  padding: 54px 48px;
  box-shadow: var(--shadow-lg);
  color: #fff;
  overflow: hidden;
  position: relative;
}

.cta__card::before,
.cta__card::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
}

.cta__card::before {
  width: 260px;
  height: 260px;
  top: -120px;
  right: -60px;
}

.cta__card::after {
  width: 180px;
  height: 180px;
  bottom: -80px;
  left: -50px;
}

.cta__grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 40px;
  align-items: center;
}

.cta__logo {
  width: 132px;
  height: 132px;
  border-radius: 28px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.28);
}

.cta__title {
  font-family: var(--font-display);
  font-size: clamp(28px, 4vw, 38px);
  font-weight: 800;
  line-height: 1.12;
}

.cta__text {
  margin-top: 12px;
  font-size: 17px;
  opacity: 0.92;
  max-width: 520px;
}

.cta__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 26px;
}

.cta__note {
  margin-top: 18px;
  font-size: 13.5px;
  opacity: 0.8;
}

/* ---------- Footer ---------- */
.footer {
  background: #171b26;
  color: #b8becb;
  padding: 44px 0;
}

.footer__inner {
  display: grid;
  gap: 18px;
  text-align: center;
  justify-items: center;
}

.footer__brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 800;
  color: #fff;
}

.footer__logo {
  width: 34px;
  height: 34px;
  border-radius: 9px;
}

.footer__links {
  display: flex;
  gap: 26px;
  flex-wrap: wrap;
  justify-content: center;
}

.footer__links a:hover {
  color: #fff;
}

.footer__copy {
  font-size: 13px;
}

/* ---------- Reveal-on-scroll ---------- */
.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

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

  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .hero__letter {
    animation: none;
  }
}

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .features {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 900px) {
  .levels {
    grid-template-columns: 1fr;
    max-width: 460px;
    margin-inline: auto;
  }

  .steps {
    grid-template-columns: 1fr;
    max-width: 460px;
    margin-inline: auto;
  }

  .cta__grid {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }

  .cta__text {
    margin-inline: auto;
  }

  .cta__actions {
    justify-content: center;
  }

  .nav__links {
    position: fixed;
    top: 72px;
    right: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 22px;
    background: var(--bg);
    padding: 30px 28px;
    width: min(320px, 80vw);
    height: calc(100vh - 72px);
    box-shadow: -20px 0 50px rgba(31, 36, 48, 0.12);
    border-left: 1px solid var(--line);
    transform: translateX(100%);
    transition: transform 0.28s ease;
  }

  .nav__links.is-open {
    transform: translateX(0);
  }

  .nav__toggle {
    display: flex;
  }

  .nav__toggle.is-open span:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
  }

  .nav__toggle.is-open span:nth-child(2) {
    opacity: 0;
  }

  .nav__toggle.is-open span:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
  }
}

@media (max-width: 620px) {
  .features {
    grid-template-columns: 1fr;
  }

  .hero {
    padding: 140px 0 80px;
  }

  .hero__stats {
    gap: 26px;
  }

  .hero__actions {
    flex-direction: column;
    align-items: stretch;
  }

  .hero__actions .btn {
    width: 100%;
  }

  .section {
    padding: 72px 0;
  }

  .cta {
    padding: 64px 0;
  }

  .cta__card {
    padding: 40px 26px;
  }
}
