:root {
  --bg: #fff7ed;
  --bg-2: #fffbeb;
  --ink: #221407;
  --muted: #73552c;
  --deep: #7c2d12;
  --line: rgba(146, 64, 14, 0.18);
  --card: rgba(255, 255, 255, 0.91);
  --white: #ffffff;
  --saffron: #f59e0b;
  --saffron-2: #fb923c;
  --saffron-3: #d97706;
  --green: #15803d;
  --red: #dc2626;
  --blue: #2563eb;
  --code-bg: #17120b;
  --code-ink: #fff7ed;
  --shadow: 0 22px 70px rgba(146, 64, 14, 0.17);
  --radius: 24px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 0%, rgba(245, 158, 11, 0.28), transparent 32%),
    radial-gradient(circle at 98% 5%, rgba(251, 146, 60, 0.18), transparent 30%),
    linear-gradient(135deg, var(--bg), var(--bg-2));
  line-height: 1.7;
}

a {
  color: var(--deep);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.wrap {
  width: min(1180px, calc(100% - 28px));
  margin-inline: auto;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  backdrop-filter: blur(18px);
  background: rgba(255, 247, 237, 0.9);
  border-bottom: 1px solid var(--line);
}

.topbar-inner {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding-block: 10px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  color: var(--deep);
}

.brand:hover {
  text-decoration: none;
}

.brand-logo {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  color: white;
  font-weight: 1000;
  background: linear-gradient(135deg, var(--saffron-3), var(--saffron));
  box-shadow: 0 12px 28px rgba(217, 119, 6, 0.25);
}

.brand strong,
.brand small {
  display: block;
}

.brand small {
  color: var(--muted);
  font-weight: 800;
  font-size: 12px;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.nav a,
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 8px 13px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.74);
  color: var(--deep);
  font-weight: 900;
  font-size: 13px;
  cursor: pointer;
  box-shadow: 0 8px 22px rgba(146, 64, 14, 0.08);
}

.nav a:hover,
.btn:hover {
  background: var(--white);
  text-decoration: none;
  transform: translateY(-1px);
}

.btn.primary {
  background: linear-gradient(135deg, var(--saffron-3), var(--saffron));
  color: white;
  border-color: transparent;
}

.btn.ghost {
  background: rgba(255, 255, 255, 0.86);
}

.hero {
  padding: 46px 0 22px;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.14fr 0.86fr;
  gap: 24px;
  align-items: stretch;
}

.hero-card,
.progress-card,
.card,
.code-card,
.final-card,
.teacher-box {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.hero-card {
  padding: clamp(24px, 4vw, 38px);
}

.eyebrow {
  display: inline-flex;
  width: fit-content;
  margin: 0 0 12px;
  padding: 7px 12px;
  border-radius: 999px;
  color: var(--deep);
  background: rgba(245, 158, 11, 0.13);
  border: 1px solid rgba(245, 158, 11, 0.26);
  font-weight: 1000;
  font-size: 13px;
}

h1 {
  margin: 0 0 16px;
  max-width: 930px;
  font-size: clamp(34px, 5vw, 64px);
  line-height: 1.02;
  letter-spacing: -0.06em;
}

h2 {
  margin: 0;
  color: var(--deep);
  font-size: clamp(26px, 3vw, 42px);
  line-height: 1.08;
  letter-spacing: -0.04em;
}

h3 {
  margin: 0 0 10px;
  color: var(--deep);
  font-size: 22px;
  line-height: 1.2;
}

.lead {
  max-width: 830px;
  margin: 0;
  font-size: clamp(17px, 2vw, 21px);
  color: var(--muted);
}

.hero-actions,
.quick-points {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.hero-actions {
  margin-top: 24px;
}

.quick-points {
  margin-top: 18px;
}

.quick-points span {
  display: inline-flex;
  width: fit-content;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--white);
  color: var(--deep);
  font-weight: 900;
  padding: 7px 11px;
  font-size: 13px;
}

.progress-card {
  padding: 24px;
}

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

.progress-shell {
  width: 100%;
  height: 18px;
  border-radius: 999px;
  background: rgba(146, 64, 14, 0.12);
  border: 1px solid rgba(146, 64, 14, 0.16);
  overflow: hidden;
  margin: 18px 0;
}

.progress-fill {
  width: 60%;
  height: 100%;
  background: linear-gradient(90deg, var(--saffron-3), var(--saffron), #facc15);
  border-radius: inherit;
}

.percent-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}

.percent-grid span {
  display: grid;
  place-items: center;
  min-height: 42px;
  border-radius: 15px;
  color: var(--deep);
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid var(--line);
  font-size: 13px;
  font-weight: 1000;
}

.mini-note,
.callout,
.warning {
  padding: 16px;
  border-radius: 18px;
}

.mini-note,
.callout {
  margin: 14px 0;
  border-left: 6px solid var(--saffron-3);
  background: rgba(245, 158, 11, 0.1);
  color: var(--deep);
}

.warning {
  border-left: 6px solid var(--red);
  background: rgba(220, 38, 38, 0.08);
}

.ad-section {
  margin-block: 12px 4px;
}

.section {
  padding: 20px 0;
}

.section-head {
  margin-bottom: 14px;
}

.roadmap {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.roadmap article {
  display: grid;
  grid-template-columns: 68px 1fr;
  gap: 12px;
  align-items: center;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--white);
  box-shadow: 0 8px 30px rgba(146, 64, 14, 0.08);
}

.roadmap b {
  display: grid;
  place-items: center;
  height: 44px;
  border-radius: 15px;
  color: var(--deep);
  background: rgba(245, 158, 11, 0.16);
}

.roadmap span {
  font-weight: 900;
}

.two-col,
.three-col {
  display: grid;
  gap: 16px;
}

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

.three-col {
  grid-template-columns: repeat(3, 1fr);
}

.card,
.code-card,
.final-card,
.teacher-box,
.mini-card {
  padding: 24px;
  margin-bottom: 16px;
}

.mini-card {
  border-radius: 22px;
  border: 1px solid var(--line);
  background: var(--white);
  box-shadow: 0 8px 30px rgba(146, 64, 14, 0.08);
}

.success-soft {
  background: rgba(22, 163, 74, 0.08);
}

.danger-soft {
  background: rgba(220, 38, 38, 0.07);
}

code,
pre {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

code {
  background: rgba(245, 158, 11, 0.13);
  color: var(--deep);
  border-radius: 8px;
  padding: 1px 6px;
  font-weight: 800;
}

pre {
  margin: 0;
  padding: 18px;
  color: var(--code-ink);
  background: var(--code-bg);
  border-radius: 18px;
  overflow: auto;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

pre code {
  background: transparent;
  color: inherit;
  padding: 0;
  border-radius: 0;
  font-weight: 500;
}

.code-card {
  overflow: hidden;
}

.code-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}

.copy-btn {
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--saffron-3), var(--saffron));
  color: white;
  padding: 9px 13px;
  font-weight: 1000;
  cursor: pointer;
}

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

.meaning-flow {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr;
  gap: 12px;
  align-items: center;
  margin: 18px 0 0;
}

.meaning-flow div:not(.arrow) {
  min-height: 112px;
  padding: 16px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: var(--white);
}

.meaning-flow span,
.meaning-flow strong {
  display: block;
}

.meaning-flow span {
  color: var(--muted);
  font-weight: 900;
  font-size: 13px;
}

.meaning-flow strong {
  color: var(--deep);
  font-size: 22px;
  line-height: 1.2;
  margin-top: 8px;
}

.arrow {
  color: var(--saffron-3);
  font-weight: 1000;
  font-size: 30px;
}

.editor-frame {
  width: 100%;
  height: 680px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--white);
  box-shadow: var(--shadow);
}

iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

.quiz {
  display: grid;
  gap: 12px;
}

.quiz details {
  padding: 16px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--white);
}

.quiz summary {
  cursor: pointer;
  color: var(--deep);
  font-weight: 1000;
}

.final-card {
  text-align: center;
  padding: clamp(26px, 5vw, 54px);
  background:
    radial-gradient(circle at top left, rgba(245, 158, 11, 0.18), transparent 38%),
    var(--card);
}

.final-card p {
  max-width: 800px;
  margin: 14px auto 24px;
  font-size: 20px;
  color: var(--muted);
}

.footer {
  padding: 36px 0 54px;
  text-align: center;
  color: var(--muted);
}

@media (max-width: 900px) {
  .topbar-inner {
    align-items: flex-start;
    flex-direction: column;
  }

  .nav {
    justify-content: flex-start;
  }

  .hero-grid,
  .two-col,
  .three-col,
  .roadmap,
  .meaning-flow {
    grid-template-columns: 1fr;
  }

  .arrow {
    transform: rotate(90deg);
    text-align: center;
  }

  .editor-frame {
    height: 610px;
  }
}

@media print {
  .topbar,
  .hero-actions,
  .ad-section,
  .editor-frame,
  .copy-btn {
    display: none !important;
  }

  body {
    background: white;
  }

  .hero-card,
  .progress-card,
  .card,
  .code-card,
  .final-card,
  .teacher-box,
  .mini-card {
    box-shadow: none;
    break-inside: avoid;
  }
}
