:root {
  --bg: #f7f9ff;
  --layer: #ffffff;
  --ink: #1f2937;
  --muted: #65758b;
  --brand: #6c63ff;
  --brand-2: #ff6ec7;
  --green: #18a558;
  --yellow: #ffb703;
  --shadow: 0 10px 30px rgba(0, 0, 0, .08);
  --radius-xl: 22px;
  --radius-lg: 16px;
  --radius-md: 12px;
}

* {
  box-sizing: border-box
}

html,
body {
  height: 100%
}

body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(108, 99, 255, .12), transparent 60%),
    radial-gradient(900px 500px at 90% 0%, rgba(255, 110, 199, .12), transparent 60%),
    var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.skip-link:focus {
  left: 16px;
  top: 16px;
  width: auto;
  height: auto;
  background: #000;
  color: #fff;
  padding: .5rem .75rem;
  border-radius: 8px;
}

/* Header & Nav */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, .85);
  backdrop-filter: saturate(1.2) blur(8px);
  border-bottom: 1px solid rgba(0, 0, 0, .05);
}

.nav {
  max-width: 1100px;
  margin: 0 auto;
  padding: .8rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
  gap: .6rem;
  text-decoration: none;
  color: var(--ink);
  font-weight: 800;
}

.brand-badge {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  font-family: Nunito, Inter, system-ui, sans-serif;
  font-weight: 900;
}

.brand-text {
  font-family: Nunito, Inter, system-ui, sans-serif;
  font-weight: 900;
  letter-spacing: .2px;
}

.nav-menu {
  display: flex;
  gap: .5rem;
  align-items: center;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-menu a {
  display: inline-block;
  padding: .6rem .9rem;
  border-radius: 10px;
  text-decoration: none;
  color: var(--ink);
  font-weight: 600;
}

.nav-menu a.active,
.nav-menu a:hover {
  background: rgba(108, 99, 255, .12);
  color: #2b2bff;
}

.nav-toggle {
  display: none;
  background: transparent;
  border: 0;
  cursor: pointer;
  padding: .4rem;
  border-radius: 10px;
}

.nav-toggle:focus-visible {
  outline: 3px solid #2b2bff
}

.nav-toggle .bar {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--ink);
  margin: 4px 0;
  border-radius: 1px;
}

/* Layout helpers */
.wrap {
  max-width: 1000px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

.wrap-wide {
  max-width: 1120px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

.page-head h1 {
  margin: .25rem 0 0;
  font-family: Nunito, Inter, system-ui, sans-serif;
  font-weight: 900;
  letter-spacing: .2px;
}

.muted {
  color: var(--muted)
}

.hero {
  position: relative;
  padding: clamp(2rem, 3vw + 2rem, 5rem) 1rem 1rem;
}

.hero-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  gap: 2rem;
  align-items: center;
}

.hero-title {
  font-size: clamp(2rem, 1.4rem + 2.4vw, 3.25rem);
  margin: .25rem 0 .35rem;
  font-family: Nunito, Inter, system-ui, sans-serif;
  font-weight: 900;
  letter-spacing: .3px;
}

.hero-sub {
  font-size: 1.125rem;
  color: var(--muted);
  max-width: 40ch;
}

.eyebrow {
  font-weight: 700;
  color: #2b2bff;
  letter-spacing: .5px
}

.hero-actions {
  display: flex;
  gap: .75rem;
  margin: 1.25rem 0 1rem;
  flex-wrap: wrap;
}

.hero-points {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 0;
  margin: 1rem 0 0;
  list-style: none;
  color: var(--muted);
}

.hero-points li {
  background: var(--layer);
  padding: .5rem .75rem;
  border-radius: 999px;
  box-shadow: var(--shadow);
}

.hero-art {
  position: relative;
  min-height: 320px;
}

.bubble {
  position: absolute;
  display: grid;
  place-items: center;
  width: 92px;
  height: 92px;
  border-radius: 24px;
  color: #fff;
  font-family: Nunito, Inter, system-ui, sans-serif;
  font-weight: 900;
  box-shadow: var(--shadow);
}

.bubble-a {
  background: linear-gradient(135deg, #6c63ff, #7f8cff);
  top: 6%;
  left: 10%;
  animation: float 6s ease-in-out infinite;
}

.bubble-b {
  background: linear-gradient(135deg, #ff6ec7, #ff9f9f);
  top: 2%;
  right: 16%;
  animation: float 5.6s ease-in-out infinite .2s;
}

.bubble-c {
  background: linear-gradient(135deg, #00bcd4, #64e9ff);
  bottom: 18%;
  left: 20%;
  animation: float 6.2s ease-in-out infinite .4s;
}

.bubble-d {
  background: linear-gradient(135deg, #00c853, #b2ff59);
  bottom: 3%;
  right: 12%;
  animation: float 5.8s ease-in-out infinite .6s;
}

.hero-wave {
  position: absolute;
  inset: auto 0 -1px 0;
  width: 100%;
  height: 120px;
  color: #6c63ff;
}

@keyframes float {

  0%,
  100% {
    transform: translateY(0)
  }

  50% {
    transform: translateY(-10px)
  }
}

.features {
  padding: 2rem 0 3rem;
}

.section-title {
  font-family: Nunito, Inter, system-ui, sans-serif;
  font-weight: 900;
  letter-spacing: .2px;
  font-size: 1.8rem;
  text-align: center;
  margin: 0 0 1.5rem;
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

.card {
  background: var(--layer);
  border-radius: var(--radius-lg);
  padding: 1.2rem;
  box-shadow: var(--shadow);
  transition: transform .25s ease, box-shadow .25s ease;
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 40px rgba(0, 0, 0, .12);
}

.card-emoji {
  font-size: 2rem;
  margin-bottom: .35rem;
}

.card h3 {
  margin: .25rem 0 .25rem;
  font-size: 1.15rem;
}

.card p {
  margin: 0;
  color: var(--muted)
}

.cta {
  padding: 1.5rem 0 3.5rem;
  text-align: center;
}

.cta .wrap {
  background: linear-gradient(135deg, rgba(108, 99, 255, .12), rgba(255, 110, 199, .12));
  border-radius: var(--radius-xl);
  padding: 2rem;
  box-shadow: var(--shadow);
}

.cta h2 {
  font-family: Nunito, Inter, system-ui, sans-serif;
  font-weight: 900;
  margin: .25rem 0 .5rem
}

.cta p {
  color: var(--muted);
  margin: .25rem 0 1.25rem
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  text-decoration: none;
  font-weight: 700;
  border-radius: 20px;
  padding: .8rem 1.2rem;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform .2s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow .2s ease, background .2s ease;
}

.btn:focus-visible {
  outline: 3px solid #2b2bff;
  outline-offset: 2px;
}

.btn-emoji {
  font-size: 1.2rem
}

.btn-primary {
  background: linear-gradient(135deg, #6c63ff, #7f8cff);
  color: #fff;
  box-shadow: 0 4px 14px rgba(108, 99, 255, 0.4);
}

.btn-primary:hover {
  transform: scale(1.05) translateY(-2px);
  box-shadow: 0 6px 20px rgba(108, 99, 255, 0.5);
}

.btn-ghost {
  background: var(--layer);
  color: #2b2bff;
  border-color: #2b2bff
}

.btn-ghost:hover {
  transform: scale(1.05) translateY(-2px);
  background: #eef2ff
}

.btn-large {
  padding: 1.1rem 1.6rem;
  font-size: 1.1rem;
  border-radius: 24px;
}

.site-footer {
  border-top: 1px solid rgba(0, 0, 0, .06);
  background: rgba(255, 255, 255, .9);
  padding: 2rem 0;
}

.site-footer .wrap {
  display: flex;
  flex-direction: column;
  gap: .8rem;
  text-align: center;
  padding: 0 1rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.meta {
  font-size: .85rem;
  opacity: 0.8;
}

.footer-link {
  color: var(--brand);
  text-decoration: none;
  font-weight: 600;
}

.footer-link:hover {
  text-decoration: underline;
}

/* Learn grid */
.alphabet-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(6, 1fr);
  margin: .75rem 0 2.5rem;
}

.tile {
  position: relative;
  border: 0;
  padding: 1rem;
  height: 116px;
  border-radius: 18px;
  box-shadow: var(--shadow);
  cursor: pointer;
  color: #0b1020;
  text-align: left;
  background: var(--layer);
  overflow: hidden;
  isolation: isolate;
}

.tile:focus-visible {
  outline: 3px solid #2b2bff
}

.tile .big {
  position: absolute;
  top: -14px;
  right: -6px;
  font-family: Nunito, Inter, system-ui, sans-serif;
  font-weight: 900;
  font-size: 84px;
  line-height: 1;
  opacity: .09;
  pointer-events: none;
}

.tile .label {
  position: relative;
  z-index: 1;
  font-weight: 800;
  letter-spacing: .2px;
  display: block
}

.tile .word {
  position: relative;
  z-index: 1;
  color: var(--muted);
  font-weight: 600;
  font-size: .95rem;
  margin-top: .15rem
}

.tile[data-color="1"] {
  background: linear-gradient(135deg, #eef2ff, #fff);
}

.tile[data-color="2"] {
  background: linear-gradient(135deg, #fff0f7, #fff);
}

.tile[data-color="3"] {
  background: linear-gradient(135deg, #ecfeff, #fff);
}

.tile[data-color="4"] {
  background: linear-gradient(135deg, #f1fff2, #fff);
}

.tile[data-color="5"] {
  background: linear-gradient(135deg, #fff8e6, #fff);
}

/* Letter page */
.back-line {
  margin: .25rem 0 1rem
}

.back-link {
  text-decoration: none;
  font-weight: 700;
  color: #2b2bff
}

.letter-card {
  background: var(--layer);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.progress {
  height: 8px;
  background: #edf2ff;
}

.progress-fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #18a558, #89e219);
  box-shadow: 0 0 10px rgba(24, 165, 88, .35);
  transition: width .35s ease;
}

.card-body {
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  gap: 2rem;
  padding: 1.6rem;
}

.card-body h2 {
  font-family: Nunito, Inter, system-ui, sans-serif;
  font-weight: 900;
  margin: .25rem 0 .25rem
}

.card-body .kicker {
  color: #2b2bff;
  font-weight: 800;
  letter-spacing: .2px
}

.blob {
  width: 120px;
  height: 120px;
  border-radius: 32px;
  display: grid;
  place-items: center;
  color: #fff;
  font-family: Nunito, Inter, system-ui, sans-serif;
  font-weight: 900;
  font-size: 3rem;
  background: linear-gradient(135deg, #6c63ff, #7f8cff);
  box-shadow: var(--shadow);
}

.box {
  border-left: 6px solid;
  padding: 14px 16px;
  border-radius: 12px;
  background: #f8fafc
}

.box h3 {
  margin: .1rem 0 .3rem;
  font-size: 1.05rem
}

.box p {
  margin: 0;
  color: var(--ink)
}

.box.def {
  border-color: #18a558;
}

.box.act {
  border-color: #ffb703;
  background: #fff8e6;
}

.box.fact {
  border-color: #2e7d32;
  background: #f1fff2;
}

.illus {
  background: #f8fafc;
  border: 2px dashed #e2e8f0;
  border-radius: 16px;
  min-height: 260px;
  display: grid;
  place-items: center;
  padding: 1rem;
}

.illus p {
  color: var(--muted);
  margin: 0;
  text-align: center;
}

.card-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: 1rem 1.25rem;
  border-top: 1px solid #eef2ff;
  background: #fbfcff
}

.btn.pill {
  border-radius: 999px;
  border: 2px solid #2b2bff;
  color: #2b2bff;
  background: #fff;
  padding: .6rem 1rem;
  font-weight: 800
}

.btn.pill:hover {
  background: #eef2ff
}

.btn-green {
  border-color: #18a558;
  color: #fff;
  background: linear-gradient(135deg, #18a558, #2bd774)
}

.progress-indicator {
  color: var(--muted);
  font-weight: 700
}

.about-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin: .5rem 0 2rem
}

.about-card {
  background: var(--layer);
  border-radius: 16px;
  padding: 1.2rem;
  box-shadow: var(--shadow)
}

.panel {
  background: var(--layer);
  border-radius: 16px;
  padding: 1.2rem;
  box-shadow: var(--shadow);
  margin: 1rem 0
}

.nice-list {
  padding-left: 1.1rem
}

.nice-list li {
  margin: .25rem 0
}

/* Coming soon */
.coming-soon {
  background: var(--layer);
  border-radius: var(--radius-xl);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  text-align: center
}

.coming-emoji {
  font-size: 3rem;
  margin-bottom: .25rem
}

/* Accessibility & motion */
:focus-visible {
  outline: 3px solid #2b2bff;
  outline-offset: 2px
}

@media (prefers-reduced-motion: reduce) {

  .bubble,
  .hero-wave,
  .btn {
    animation: none;
    transition: none
  }
}

/* Touch Optimization */
.btn,
.tile,
.nav-menu a,
.footer-link {
  touch-action: manipulation;
  /* Prevent double-tap zoom delay */
}

/* Ensure minimum touch target size */
.btn,
.nav-menu a {
  min-height: 44px;
}

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

  .hero-inner {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .hero-actions {
    justify-content: center;
  }

  .hero-points {
    justify-content: center;
  }

  .card-body {
    grid-template-columns: 1fr;
  }

  .illus {
    min-height: 200px;
  }

  .alphabet-grid {
    grid-template-columns: repeat(3, 1fr)
  }

  .about-grid {
    grid-template-columns: 1fr
  }

  .nav-toggle {
    display: block
  }

  .nav-menu {
    position: absolute;
    right: 12px;
    top: 64px;
    background: var(--layer);
    padding: .5rem;
    border-radius: 12px;
    box-shadow: var(--shadow);
    display: none;
    flex-direction: column;
    min-width: 200px;
    z-index: 100;
  }

  .nav-menu.show {
    display: flex
  }

  .guide-grid {
    grid-template-columns: 1fr !important;
  }

  .guide-card-mockup {
    order: 2;
  }
}

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

  .alphabet-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .hero-title {
    font-size: 2.5rem;
  }
}

/* Gentle vertical rhythm between the definition/try/remember boxes */
.box+.box {
  margin-top: 12px;
}

@media (min-width: 920px) {
  .box+.box {
    margin-top: 14px;
  }
}