:root {
  --bg: #0b1220;
  --surface: #141e33;
  --surface-2: #1b2740;
  --border: #263550;
  --text: #e6edf7;
  --muted: #9fb0c7;
  --accent: #fbbf24;
  --accent-soft: rgba(251, 191, 36, 0.12);
  --green: #34d399;
  --radius: 14px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Noto Sans Thai', 'Segoe UI', system-ui, sans-serif;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

.container { max-width: 860px; margin: 0 auto; padding: 0 20px; }

/* ---------- Nav ---------- */
nav {
  position: sticky; top: 0; z-index: 10;
  background: rgba(11, 18, 32, 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.nav-inner {
  max-width: 860px; margin: 0 auto; padding: 14px 20px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.brand { font-weight: 700; font-size: 1.05rem; text-decoration: none; color: var(--text); }
.brand span { color: var(--accent); }
.nav-links { display: flex; gap: 18px; }
.nav-links a { color: var(--muted); text-decoration: none; font-size: 0.95rem; }
.nav-links a:hover, .nav-links a.active { color: var(--text); }

/* ---------- Hero ---------- */
.hero { text-align: center; padding: 84px 20px 64px; }
.hero .kicker {
  display: inline-block; background: var(--accent-soft); color: var(--accent);
  padding: 6px 16px; border-radius: 999px; font-size: 0.9rem; font-weight: 600;
  margin-bottom: 22px;
}
.hero h1 { font-size: clamp(2rem, 6vw, 3.2rem); line-height: 1.25; margin-bottom: 18px; }
.hero h1 em { font-style: normal; color: var(--accent); }
.hero p.lead { color: var(--muted); font-size: 1.15rem; max-width: 560px; margin: 0 auto 34px; }
.btn {
  display: inline-block; text-decoration: none; font-weight: 700;
  padding: 14px 30px; border-radius: 12px; font-size: 1.05rem;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.btn-primary { background: var(--accent); color: #1a1206; box-shadow: 0 6px 24px rgba(251,191,36,0.25); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(251,191,36,0.35); }
.btn-ghost { color: var(--muted); padding: 14px 18px; }
.btn-ghost:hover { color: var(--text); }

/* ---------- Sections ---------- */
section { padding: 56px 0; }
.section-title { font-size: 1.6rem; margin-bottom: 8px; }
.section-sub { color: var(--muted); margin-bottom: 32px; }

/* ---------- Rule cards ---------- */
.rules { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.rule {
  background: var(--surface); border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--radius); padding: 22px;
}
.rule .num { font-size: 1.5rem; margin-bottom: 8px; }
.rule h3 { font-size: 1.05rem; margin-bottom: 6px; }
.rule p { color: var(--muted); font-size: 0.95rem; }

/* ---------- Phase timeline ---------- */
.phases { display: flex; flex-direction: column; gap: 14px; }
.phase {
  display: flex; gap: 18px; background: var(--surface);
  border: 1px solid rgba(255,255,255,0.06); border-radius: var(--radius); padding: 22px;
}
.phase .badge {
  flex-shrink: 0; width: 46px; height: 46px; border-radius: 12px;
  background: var(--accent-soft); color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 1.1rem;
}
.phase h3 { font-size: 1.1rem; margin-bottom: 4px; }
.phase h3 small { color: var(--muted); font-weight: 400; font-size: 0.85rem; margin-left: 8px; }
.phase p { color: var(--muted); font-size: 0.95rem; }
.phase .goal { color: var(--green); font-size: 0.92rem; margin-top: 6px; }

/* ---------- Lesson article ---------- */
article { padding: 48px 0 72px; }
article .crumb { margin-bottom: 26px; font-size: 0.92rem; }
article .crumb a { color: var(--muted); text-decoration: none; }
article .crumb a:hover { color: var(--text); }
article h1 { font-size: clamp(1.7rem, 5vw, 2.4rem); line-height: 1.3; margin-bottom: 10px; }
article .meta { color: var(--muted); margin-bottom: 36px; }
article h2 {
  font-size: 1.35rem; margin: 44px 0 14px; padding-top: 20px;
  border-top: 1px solid rgba(255,255,255,0.07);
}
article h3 { font-size: 1.1rem; margin: 24px 0 10px; }
article p { margin-bottom: 14px; }
article ul, article ol { margin: 0 0 16px 24px; }
article li { margin-bottom: 6px; }
article .muted { color: var(--muted); }

.callout {
  background: var(--accent-soft); border-left: 4px solid var(--accent);
  border-radius: 0 10px 10px 0; padding: 14px 18px; margin: 18px 0;
}
.callout.success { background: rgba(52,211,153,0.1); border-color: var(--green); }

pre {
  background: #0a0f1c; border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px; padding: 18px; overflow-x: auto; margin: 16px 0;
  font-size: 0.92rem; line-height: 1.6;
}
code { font-family: Consolas, 'Courier New', monospace; }
p code, li code {
  background: var(--surface-2); padding: 2px 7px; border-radius: 6px; font-size: 0.9em;
}

.checklist { list-style: none; margin-left: 0 !important; }
.checklist li { padding-left: 30px; position: relative; margin-bottom: 10px; }
.checklist li::before {
  content: ''; position: absolute; left: 0; top: 6px; width: 18px; height: 18px;
  border: 2px solid var(--accent); border-radius: 5px;
}

details {
  background: var(--surface); border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px; padding: 12px 18px; margin: 10px 0;
}
details summary { cursor: pointer; font-weight: 600; color: var(--accent); }
details p { margin: 10px 0 4px; }

/* ---------- Footer ---------- */
footer {
  border-top: 1px solid rgba(255,255,255,0.06);
  padding: 32px 20px; text-align: center; color: var(--muted); font-size: 0.92rem;
}
footer a { color: var(--muted); }

@media (max-width: 560px) {
  .hero { padding: 56px 16px 44px; }
  .phase { flex-direction: column; gap: 10px; }
  .nav-links { gap: 12px; }
}
