:root {
  --forest: #245c42;
  --teal: #176b68;
  --orange: #f28c28;
  --orange-dark: #d77a14;
  --gold: #f4c542;
  --cream: #fff4d8;
  --sky: #b9e0d8;
  --leaf: #72a85a;
  --ink: #202b28;
  --text: #202b28;
  --white: #ffffff;
  --paper: #fffaf1;
  --panel: #f5efe1;
  --sage: #dfecc6;
  --peach: #f9d7aa;
  --green-900: #245c42;
  --green-700: #176b68;
  --green-500: #72a85a;
  --muted: rgba(32, 43, 40, 0.8);
  --border: rgba(32, 43, 40, 0.18);
  --shadow: 0 18px 26px rgba(36, 92, 66, 0.12);
  --radius: 24px;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  background: #f7f0e4;
  color: var(--ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  display: block;
}

button, input {
  font: inherit;
}

.container {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 248, 232, 0.94);
  border-bottom: 3px solid var(--ink);
  backdrop-filter: blur(10px);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 84px;
  gap: 20px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 800;
  color: var(--forest);
  letter-spacing: -0.03em;
}

.brand-mark {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: var(--orange);
  color: var(--white);
  font-size: 1.35rem;
  border: 3px solid var(--ink);
  box-shadow: 0 6px 0 rgba(32, 43, 40, 0.18);
}

.nav {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}

.nav a {
  color: var(--forest);
  font-weight: 700;
  padding: 8px 10px;
  border-radius: 12px;
  transition: transform 0.2s ease, background 0.2s ease;
}

.nav a:hover,
.nav a.active {
  background: rgba(242, 140, 40, 0.14);
  color: var(--forest);
}

.nav-toggle {
  display: none;
  border: 0;
  background: var(--green-900);
  color: #fff;
  width: 46px;
  height: 46px;
  border-radius: 12px;
  cursor: pointer;
}

.hero {
  padding: 72px 0 44px;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 38px;
  align-items: center;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  border-radius: 999px;
  background: rgba(77, 156, 148, 0.12);
  color: var(--green-700);
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

h1, h2, h3 {
  margin: 0 0 16px;
  color: var(--forest);
  letter-spacing: -0.04em;
  font-weight: 900;
}

.hero h1 {
  font-size: clamp(2.6rem, 5vw, 4.4rem);
  line-height: 1.03;
  margin-top: 22px;
}

.lead {
  font-size: 1.12rem;
  color: rgba(32, 43, 40, 0.8);
  max-width: 640px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 28px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 3px solid var(--ink);
  border-bottom-width: 7px;
  border-radius: 16px;
  padding: 14px 22px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  box-shadow: 0 8px 0 rgba(32, 43, 40, 0.08);
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: var(--orange);
  color: var(--white);
}

.btn-secondary {
  background: var(--sky);
  color: var(--forest);
}

.btn-ghost {
  background: transparent;
  color: var(--forest);
  border-color: rgba(32, 43, 40, 0.25);
}

.hero-art {
  background: #fffaf0;
  border: 4px solid var(--ink);
  border-radius: 30px;
  padding: 22px;
  box-shadow: 8px 8px 0 rgba(36, 92, 66, 0.12);
}

.storybook-scene {
  position: relative;
  min-height: 420px;
  border-radius: 26px;
  border: 4px solid var(--ink);
  background: #dfeee9;
  overflow: hidden;
}

.scene-sky {
  position: absolute;
  inset: 0 0 140px 0;
  background: #dff5f1;
}

.scene-sun {
  position: absolute;
  top: 42px;
  right: 58px;
  width: 88px;
  height: 88px;
  border-radius: 50%;
  background: var(--gold);
  border: 4px solid var(--ink);
}

.scene-cloud {
  position: absolute;
  width: 120px;
  height: 42px;
  background: rgba(255, 255, 255, 0.9);
  border: 4px solid var(--ink);
  border-radius: 999px;
}

.scene-cloud.one { top: 38px; left: 54px; }
.scene-cloud.two { top: 74px; right: 128px; width: 136px; }
.scene-cloud::before,
.scene-cloud::after {
  content: "";
  position: absolute;
  background: rgba(255, 255, 255, 0.9);
  border: 4px solid var(--ink);
  border-radius: 50%;
}

.scene-cloud::before { width: 44px; height: 44px; left: 16px; top: -18px; }
.scene-cloud::after { width: 52px; height: 52px; right: 20px; top: -22px; }

.scene-hill {
  position: absolute;
  bottom: 120px;
  width: 260px;
  height: 120px;
  border: 4px solid var(--ink);
  border-bottom: none;
  border-radius: 100% 100% 0 0 / 100% 100% 0 0;
  background: var(--leaf);
}

.scene-hill.left { left: -20px; }
.scene-hill.right { right: -16px; background: #6aa765; }

.scene-tree {
  position: absolute;
  bottom: 94px;
  width: 90px;
  height: 150px;
}

.tree-trunk {
  position: absolute;
  left: 38px;
  bottom: 0;
  width: 16px;
  height: 70px;
  background: #7d4d2c;
  border: 4px solid var(--ink);
  border-radius: 8px;
}

.tree-canopy {
  position: absolute;
  left: 5px;
  bottom: 54px;
  width: 80px;
  height: 80px;
  background: var(--leaf);
  border: 4px solid var(--ink);
  border-radius: 50% 48% 52% 46%;
}

.tree-left { left: 48px; }
.tree-right { right: 56px; }

.scene-book {
  position: absolute;
  left: 50%;
  bottom: 36px;
  transform: translateX(-50%);
  width: 200px;
  height: 160px;
  background: #f9d88b;
  border: 4px solid var(--ink);
  border-radius: 18px;
  box-shadow: 8px 10px 0 rgba(32, 43, 40, 0.08);
}

.scene-book::before {
  content: "";
  position: absolute;
  inset: 18px 18px 18px 18px;
  background: #fff7e8;
  border: 4px solid var(--ink);
  border-radius: 12px;
}

.scene-book::after {
  content: "?";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 4rem;
  font-weight: 900;
  color: var(--forest);
}

.scene-character {
  position: absolute;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%);
  width: 130px;
  height: 160px;
}

.character-head {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 54px;
  height: 54px;
  background: #f5c8a8;
  border: 4px solid var(--ink);
  border-radius: 50%;
}

.character-body {
  position: absolute;
  left: 50%;
  top: 48px;
  transform: translateX(-50%);
  width: 76px;
  height: 94px;
  background: var(--teal);
  border: 4px solid var(--ink);
  border-radius: 20px 20px 18px 18px;
}

.character-arm,
.character-leg {
  position: absolute;
  background: var(--orange);
  border: 4px solid var(--ink);
  border-radius: 999px;
}

.character-arm.left { left: 18px; top: 62px; width: 18px; height: 50px; }
.character-arm.right { right: 18px; top: 62px; width: 18px; height: 50px; }
.character-leg.left { left: 38px; bottom: 3px; width: 20px; height: 44px; }
.character-leg.right { right: 38px; bottom: 3px; width: 20px; height: 44px; }

.page-section {
  padding: 54px 0;
}

.page-section + .page-section {
  border-top: 1px solid rgba(29, 77, 78, 0.08);
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 28px;
}

.section-heading h2 {
  font-size: clamp(2rem, 4vw, 3rem);
}

.section-subtitle {
  color: var(--muted);
  max-width: 500px;
}

.steps-grid,
.preview-grid,
.blog-grid,
.feature-grid,
.article-grid,
.footer-grid {
  display: grid;
  gap: 24px;
}

.steps-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.step-card,
.preview-card,
.blog-card,
.feature-card,
.article-card {
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: 0 8px 18px rgba(29, 77, 78, 0.04);
}

.step-card {
  padding: 26px 22px;
}

.step-number {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(29, 77, 78, 0.12), rgba(240, 166, 76, 0.22));
  display: grid;
  place-items: center;
  font-weight: 800;
  color: var(--green-900);
  margin-bottom: 16px;
}

.preview-grid {
  grid-template-columns: 1.2fr 0.8fr;
  align-items: center;
}

.preview-card {
  padding: 28px;
}

.preview-ladder {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.level-chip {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 16px 18px;
  background: rgba(223, 238, 227, 0.8);
  border-radius: 14px;
}

.progress-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  color: var(--green-900);
  font-weight: 700;
}

.progress-bar {
  width: 100%;
  height: 12px;
  background: rgba(29, 77, 78, 0.08);
  border-radius: 999px;
  overflow: hidden;
}

.progress-bar span {
  display: block;
  height: 100%;
  width: 58%;
  border-radius: inherit;
  background: linear-gradient(135deg, var(--green-500), var(--orange));
}

.preview-aside {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.preview-stat {
  background: linear-gradient(135deg, rgba(127, 179, 173, 0.12), rgba(240, 166, 76, 0.08));
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 20px;
}

.preview-stat strong {
  display: block;
  font-size: 1.9rem;
  color: var(--green-900);
}

.blog-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.blog-card {
  overflow: hidden;
}

.blog-card figure {
  margin: 0;
  height: 190px;
  background: linear-gradient(135deg, rgba(77, 156, 148, 0.18), rgba(240, 166, 76, 0.2));
  position: relative;
}

.blog-card figure::before {
  content: "✦";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 3.2rem;
  color: rgba(29, 77, 78, 0.55);
}

.blog-card-body {
  padding: 22px;
}

.blog-card-body h3 {
  margin-bottom: 12px;
  font-size: 1.45rem;
}

.meta-line {
  font-size: 0.86rem;
  color: var(--green-700);
  font-weight: 700;
  margin-bottom: 10px;
}

.page-surface {
  background: rgba(255, 255, 255, 0.52);
  border: 1px solid var(--border);
  border-radius: 26px;
  padding: clamp(18px, 3vw, 38px);
  box-shadow: 0 18px 32px rgba(29, 77, 78, 0.04);
}

.content-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 28px;
  align-items: start;
}

.content-list {
  list-style: none;
  padding: 0;
  margin: 20px 0 0;
  display: grid;
  gap: 18px;
}

.content-list li {
  background: rgba(223, 238, 227, 0.6);
  border-radius: 16px;
  padding: 16px 18px;
  border: 1px solid var(--border);
}

.feature-box {
  background: linear-gradient(135deg, rgba(223, 238, 227, 0.8), rgba(255, 255, 255, 0.6));
  padding: 28px;
  border-radius: 20px;
  border: 1px solid var(--border);
}

.site-footer {
  background: var(--green-900);
  color: rgba(255, 255, 255, 0.9);
  padding: 48px 0 34px;
  margin-top: 50px;
}

.footer-grid {
  grid-template-columns: 1fr 1fr 1fr;
  gap: 28px;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 800;
  color: #fff;
}

.footer-links {
  display: grid;
  gap: 8px;
}

.footer-links a {
  color: rgba(255, 255, 255, 0.8);
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  margin-top: 22px;
  padding-top: 18px;
  text-align: center;
  color: rgba(255, 255, 255, 0.7);
}

.page-hero {
  padding: 60px 0 22px;
}

.page-hero h1 {
  font-size: clamp(2.2rem, 4vw, 3.4rem);
}

.article-grid {
  grid-template-columns: 1.4fr 0.6fr;
  margin-top: 18px;
}

.article-card {
  padding: 0;
  overflow: hidden;
}

.article-card .blog-card-body {
  padding: 24px;
}

.article-card .blog-card-body h3 {
  font-size: 1.4rem;
}

.sidebar-card {
  background: rgba(255, 255, 255, 0.68);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 22px;
  box-shadow: 0 10px 22px rgba(29, 77, 78, 0.04);
}

.article-content {
  font-size: 1.05rem;
  color: var(--text);
}

.article-content p {
  margin: 0 0 18px;
}

.article-content h2,
.article-content h3 {
  margin-top: 26px;
}

.inline-list {
  margin: 18px 0;
  padding-left: 18px;
  color: var(--text);
}

.inline-list li {
  margin-bottom: 10px;
}

.game-layout {
  padding: 40px 0 60px;
}

.game-shell {
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--border);
  border-radius: 28px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.game-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 24px 28px 18px;
  border-bottom: 1px solid var(--border);
  background: rgba(223, 238, 227, 0.35);
}

.game-stats {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.stat-pill {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 9px 14px;
  font-weight: 700;
  color: var(--green-900);
}

.game-body {
  padding: 28px;
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 28px;
}

.puzzle-panel {
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 24px;
}

.question-tag {
  display: inline-block;
  border-radius: 999px;
  background: rgba(240, 166, 76, 0.1);
  color: var(--orange-dark);
  padding: 8px 12px;
  font-weight: 700;
  margin-bottom: 14px;
}

.puzzle-question {
  font-size: clamp(1.3rem, 2vw, 2rem);
  line-height: 1.5;
  margin-bottom: 22px;
  color: var(--green-900);
}

.puzzle-decor {
  position: relative;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-bottom: 12px;
  min-height: 28px;
}

.spark {
  display: inline-block;
  color: var(--orange);
  font-size: 1.2rem;
  opacity: 0.8;
  animation: twinkle 2s ease-in-out infinite;
}

.sparkle-two { animation-delay: 0.4s; }
.sparkle-three { animation-delay: 0.8s; }

@keyframes twinkle {
  0%, 100% { transform: scale(0.9); opacity: 0.7; }
  50% { transform: scale(1.2); opacity: 1; }
}

.answer-form {
  display: grid;
  gap: 16px;
}

.answer-input,
.answer-select {
  width: 100%;
  border: 1px solid rgba(29, 77, 78, 0.18);
  border-radius: 14px;
  padding: 16px 18px;
  background: #fffdfb;
  color: var(--text);
  font-size: 1.02rem;
}

.answer-input:focus,
.answer-select:focus {
  outline: 2px solid rgba(77, 156, 148, 0.18);
  border-color: rgba(77, 156, 148, 0.45);
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.small-btn {
  border: none;
  border-radius: 12px;
  padding: 11px 16px;
  font-weight: 700;
  cursor: pointer;
}

.small-btn.primary { background: var(--green-900); color: white; }
.small-btn.alt { background: rgba(77, 156, 148, 0.1); color: var(--green-900); }
.small-btn.warn { background: rgba(240, 166, 76, 0.12); color: var(--orange-dark); }
.small-btn.soft { background: rgba(29, 77, 78, 0.06); color: var(--green-900); }
.small-btn.danger { background: rgba(214, 69, 62, 0.1); color: #b34141; }

.feedback {
  min-height: 28px;
  font-weight: 700;
  margin-top: 8px;
}

.feedback.success { color: #1d7e62; }
.feedback.error { color: #b34141; }
.feedback.info { color: var(--green-900); }

.side-panel {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.side-card {
  background: linear-gradient(180deg, rgba(77, 156, 148, 0.1), rgba(255,255,255,0.7));
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 20px;
}

.side-card h3 {
  margin-bottom: 10px;
  font-size: 1.15rem;
}

.hint-box,
.suggestion-box,
.answer-box {
  border-radius: 14px;
  padding: 14px 16px;
  background: rgba(255,255,255,0.7);
  border: 1px solid rgba(29, 77, 78, 0.12);
  color: var(--text);
  line-height: 1.6;
}

.hidden {
  display: none !important;
}

.chess-board {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  width: min(100%, 320px);
  border: 2px solid var(--green-900);
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 16px;
}

.chess-square {
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  font-size: 1.6rem;
  line-height: 1;
  font-weight: 700;
}

.chess-square.light { background: #f3efe7; }
.chess-square.dark { background: #d9e7da; }

.visual-card {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 10px;
}

.visual-shape {
  border-radius: 16px;
  min-height: 80px;
  display: grid;
  place-items: center;
  font-size: 2rem;
  font-weight: 800;
  border: 1px solid rgba(29, 77, 78, 0.12);
  background: rgba(77, 156, 148, 0.06);
}

.memory-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-top: 10px;
}

.memory-item {
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: rgba(240, 166, 76, 0.12);
  font-size: 1.8rem;
  font-weight: 700;
  border: 1px solid rgba(29, 77, 78, 0.12);
}

.completion-screen {
  padding: 36px 28px;
  text-align: center;
}

.completion-screen h2 {
  font-size: clamp(2rem, 3vw, 3rem);
  margin-bottom: 18px;
}

.completion-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin: 22px 0 28px;
}

.completion-stat {
  background: linear-gradient(135deg, rgba(223, 238, 227, 0.75), rgba(255, 255, 255, 0.7));
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px 12px;
}

.completion-stat strong {
  display: block;
  font-size: 2rem;
  color: var(--green-900);
}

.contact-card {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.contact-box {
  background: rgba(255,255,255,0.6);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 22px;
}

.contact-box a {
  color: var(--green-800);
  font-weight: 700;
}

@media (max-width: 900px) {
  .hero-grid,
  .preview-grid,
  .content-grid,
  .game-body,
  .contact-card,
  .article-grid,
  .footer-grid,
  .steps-grid,
  .blog-grid {
    grid-template-columns: 1fr;
  }

  .nav {
    display: none;
    position: absolute;
    top: 80px;
    left: 16px;
    right: 16px;
    background: rgba(255, 253, 249, 0.98);
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 18px;
    box-shadow: var(--shadow);
    flex-direction: column;
    align-items: flex-start;
  }

  .nav.open { display: flex; }

  .nav-toggle { display: grid; place-items: center; }
}

@media (max-width: 640px) {
  .hero { padding-top: 48px; }
  .hero-actions { flex-direction: column; align-items: stretch; }
  .btn { width: 100%; }
  .game-header { flex-direction: column; align-items: flex-start; }
  .completion-grid { grid-template-columns: 1fr; }
}
