:root {
  --ink: #27304d;
  --muted: #66708f;
  --cream: #fff9eb;
  --paper: #ffffff;
  --sun: #ffd66b;
  --coral: #ff806f;
  --teal: #54c7bc;
  --sky: #dff3ff;
  --mint: #e2f8e7;
  --lavender: #eee7ff;
  --line: #27304d;
  --shadow: 0 12px 0 rgba(39, 48, 77, 0.1);
  --round: 24px;
  --font: Inter, ui-rounded, "Segoe UI", Arial, sans-serif;
  --myanmar-font: "Myanmar Text", "Noto Sans Myanmar", Padauk, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 12px 12px, rgba(39, 48, 77, 0.045) 2px, transparent 2.5px) 0 0 / 24px 24px,
    var(--cream);
  font-family: var(--font);
  line-height: 1.5;
}

html[lang="my"] body,
html[lang="my"] button,
html[lang="my"] select {
  font-family: var(--myanmar-font);
}

button,
select,
a {
  font: inherit;
}

a {
  color: inherit;
}

button,
a,
select {
  -webkit-tap-highlight-color: transparent;
}

.skip-link {
  position: fixed;
  left: 1rem;
  top: -5rem;
  z-index: 1000;
  padding: 0.75rem 1rem;
  border: 2px solid var(--ink);
  border-radius: 12px;
  background: white;
  font-weight: 800;
}

.skip-link:focus {
  top: 1rem;
}

.hero {
  position: relative;
  overflow: hidden;
  min-height: 720px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0.15)),
    var(--sun);
  border-bottom: 3px solid var(--line);
}

.hero::before,
.hero::after {
  content: "";
  position: absolute;
  border: 3px solid var(--line);
  border-radius: 50%;
  opacity: 0.13;
}

.hero::before {
  width: 280px;
  height: 280px;
  left: -120px;
  bottom: 60px;
}

.hero::after {
  width: 160px;
  height: 160px;
  right: 9%;
  top: 110px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  max-width: 1180px;
  margin: 0 auto;
  padding: 1rem 1.25rem;
  background: rgba(255, 214, 107, 0.88);
  backdrop-filter: blur(12px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  font-size: 1rem;
  font-weight: 950;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 2.2rem;
  height: 2.2rem;
  border: 2px solid var(--line);
  border-radius: 12px;
  background: white;
  transform: rotate(-5deg);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding-right: 5.8rem;
}

.nav-actions > a {
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 800;
}

.nav-actions > a:hover {
  text-decoration: underline;
  text-decoration-thickness: 3px;
  text-underline-offset: 5px;
}

.language-toggle {
  position: fixed;
  top: 1rem;
  right: 1.25rem;
  z-index: 100;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  min-width: 74px;
  height: 34px;
  padding: 0 0.7rem;
  border: 2px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  background: white;
  box-shadow: 0 3px 0 var(--line);
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 900;
}

.language-toggle:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 0 var(--line);
}

.language-toggle:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 var(--line);
}

.hero-inner {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  align-items: center;
  gap: clamp(2rem, 6vw, 5rem);
  width: min(1120px, calc(100% - 2.5rem));
  margin: 0 auto;
  padding: 5rem 0 6rem;
}

.eyebrow,
.chapter-chip,
.mini-label {
  font-weight: 900;
  letter-spacing: 0.03em;
}

.eyebrow {
  display: inline-flex;
  gap: 0.45rem;
  margin: 0 0 1rem;
  padding: 0.45rem 0.8rem;
  border: 2px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  font-size: 0.85rem;
  text-transform: uppercase;
}

.hero h1 {
  max-width: 720px;
  margin: 0;
  font-size: clamp(3rem, 7vw, 6.4rem);
  line-height: 0.96;
  letter-spacing: -0.065em;
}

html[lang="my"] .hero h1 {
  font-size: clamp(2.7rem, 5.5vw, 5.4rem);
  line-height: 1.22;
  letter-spacing: 0;
}

.hero-intro {
  max-width: 620px;
  margin: 1.4rem 0 0;
  color: #3b4566;
  font-size: clamp(1.05rem, 2vw, 1.3rem);
  font-weight: 650;
}

.hero-buttons,
.lab-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  margin-top: 1.8rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0.75rem 1.1rem;
  border: 2px solid var(--line);
  border-radius: 14px;
  text-decoration: none;
  cursor: pointer;
  font-weight: 900;
  box-shadow: 0 5px 0 var(--line);
  transition: transform 150ms ease, box-shadow 150ms ease;
}

.button:hover {
  transform: translateY(-2px);
  box-shadow: 0 7px 0 var(--line);
}

.button:active {
  transform: translateY(3px);
  box-shadow: 0 2px 0 var(--line);
}

.button-primary {
  color: white;
  background: var(--ink);
}

.button-secondary,
.button-ghost {
  color: var(--ink);
  background: white;
}

.button-sun {
  color: var(--ink);
  background: var(--sun);
}

.lesson-promise {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 2rem;
  font-size: 0.92rem;
}

.lesson-promise span {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.hero-visual {
  position: relative;
  width: min(100%, 500px);
  max-width: 500px;
  margin: 0 auto;
}

.hero-frame {
  overflow: hidden;
  aspect-ratio: 1;
  border: 4px solid var(--line);
  border-radius: 44px;
  background: white;
  box-shadow: 14px 16px 0 var(--ink);
  transform: rotate(2deg);
}

.hero-frame .sprite {
  height: 100%;
}

.hero-bubble {
  position: absolute;
  z-index: 3;
  top: -2.5rem;
  left: -2.2rem;
  max-width: 230px;
  padding: 0.85rem 1rem;
  border: 3px solid var(--line);
  border-radius: 20px 20px 5px 20px;
  background: white;
  font-weight: 850;
  box-shadow: 6px 7px 0 rgba(39, 48, 77, 0.2);
  transform: rotate(-3deg);
}

.sticker {
  position: absolute;
  z-index: 4;
  display: grid;
  place-items: center;
  width: 3.4rem;
  height: 3.4rem;
  border: 2px solid var(--line);
  border-radius: 50%;
  background: white;
  box-shadow: 4px 4px 0 var(--ink);
  font-size: 1.6rem;
}

.sticker-one {
  right: -1rem;
  top: 18%;
  transform: rotate(9deg);
}

.sticker-two {
  left: -1.2rem;
  bottom: 8%;
  transform: rotate(-8deg);
}

.sticker-three {
  right: 8%;
  bottom: -1.4rem;
  transform: rotate(5deg);
}

.section-pad {
  padding: clamp(4rem, 8vw, 7rem) max(1.25rem, calc((100vw - 1120px) / 2));
}

.section-heading {
  display: flex;
  align-items: flex-start;
  gap: 1.2rem;
  margin-bottom: 1.7rem;
}

.section-heading.centered {
  display: block;
  max-width: 720px;
  margin-right: auto;
  margin-left: auto;
  text-align: center;
}

.section-heading h2 {
  margin: 0;
  font-size: clamp(2.2rem, 4.8vw, 4.2rem);
  line-height: 1.05;
  letter-spacing: -0.045em;
}

html[lang="my"] .section-heading h2 {
  line-height: 1.32;
  letter-spacing: 0;
}

.section-heading p:not(.mini-label) {
  max-width: 660px;
  margin: 0.65rem 0 0;
  color: var(--muted);
  font-size: 1.05rem;
  font-weight: 650;
}

.chapter-number {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 4.2rem;
  height: 4.2rem;
  border: 3px solid var(--line);
  border-radius: 18px;
  background: white;
  box-shadow: 5px 6px 0 var(--ink);
  font-size: 1.4rem;
  font-weight: 950;
  transform: rotate(-4deg);
}

.chapter-chip {
  display: inline-block;
  margin-bottom: 0.9rem;
  padding: 0.4rem 0.75rem;
  border: 2px solid var(--line);
  border-radius: 999px;
  background: var(--sun);
  font-size: 0.78rem;
  text-transform: uppercase;
}

.chapter-chip.dark {
  color: white;
  background: var(--ink);
  border-color: white;
}

.mini-label {
  margin: 0 0 0.35rem;
  color: var(--coral);
  font-size: 0.78rem;
  text-transform: uppercase;
}

.quick-start {
  background: white;
}

.steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  max-width: 1080px;
  margin: 2.2rem auto 0;
}

.step-card {
  position: relative;
  min-height: 180px;
  padding: 1.2rem;
  border: 3px solid var(--line);
  border-radius: 22px;
  background: var(--cream);
  box-shadow: var(--shadow);
  text-align: center;
}

.step-card:nth-child(2) {
  background: var(--sky);
}

.step-card:nth-child(3) {
  background: var(--mint);
}

.step-card:nth-child(4) {
  background: var(--lavender);
}

.step-icon {
  display: block;
  margin-bottom: 0.65rem;
  font-size: 3rem;
}

.step-number {
  position: absolute;
  top: 0.65rem;
  left: 0.7rem;
  display: grid;
  place-items: center;
  width: 1.8rem;
  height: 1.8rem;
  border: 2px solid var(--line);
  border-radius: 50%;
  background: white;
  font-weight: 950;
}

.step-card h3 {
  margin: 0;
  font-size: 1.05rem;
}

.step-card p {
  margin: 0.45rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 650;
}

.warm {
  background: #fff4d9;
}

.sky {
  background: var(--sky);
}

.mint {
  background: var(--mint);
}

.tap-hint {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0 0 1.4rem 5.4rem;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 800;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.25rem;
}

.visual-card {
  overflow: hidden;
  padding: 0;
  border: 3px solid var(--line);
  border-radius: var(--round);
  color: var(--ink);
  background: white;
  box-shadow: 0 8px 0 rgba(39, 48, 77, 0.15);
  cursor: pointer;
  text-align: left;
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.visual-card:hover,
.visual-card:focus-visible {
  transform: translateY(-5px) rotate(-0.5deg);
  box-shadow: 0 13px 0 rgba(39, 48, 77, 0.14);
  outline: none;
}

.visual-card:nth-child(even):hover,
.visual-card:nth-child(even):focus-visible {
  transform: translateY(-5px) rotate(0.5deg);
}

.visual-card.open {
  box-shadow: 0 8px 0 var(--coral);
}

.visual-card .sprite {
  aspect-ratio: 1;
  border-bottom: 3px solid var(--line);
}

.card-copy {
  padding: 1rem 1.05rem 1.1rem;
}

.card-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.7rem;
}

.card-copy h3 {
  margin: 0;
  font-size: 1.2rem;
  line-height: 1.2;
}

.card-tag {
  flex: 0 0 auto;
  padding: 0.25rem 0.5rem;
  border: 2px solid var(--line);
  border-radius: 999px;
  background: var(--sun);
  font-size: 0.68rem;
  font-weight: 950;
}

.card-desc {
  margin: 0.55rem 0 0;
  color: var(--muted);
  font-size: 0.93rem;
  font-weight: 650;
}

.card-tip {
  display: grid;
  grid-template-rows: 0fr;
  margin-top: 0;
  color: #36415f;
  font-size: 0.88rem;
  font-weight: 800;
  transition: grid-template-rows 220ms ease, margin-top 220ms ease;
}

.card-tip > span {
  overflow: hidden;
}

.visual-card.open .card-tip {
  grid-template-rows: 1fr;
  margin-top: 0.7rem;
}

.sprite {
  width: 100%;
  background-repeat: no-repeat;
  background-size: 300% 200%;
  background-color: #f3f5f9;
}

.sprite-shots {
  background-image: url("assets/shot-sizes.png");
}

.sprite-angles {
  background-image: url("assets/camera-angles.png");
}

.sprite-movements {
  background-image: url("assets/camera-movements.png");
}

.pos-1 { background-position: 0% 0%; }
.pos-2 { background-position: 50% 0%; }
.pos-3 { background-position: 100% 0%; }
.pos-4 { background-position: 0% 100%; }
.pos-5 { background-position: 50% 100%; }
.pos-6 { background-position: 100% 100%; }

.director-lab {
  color: white;
  background: var(--ink);
}

.lab-shell {
  display: grid;
  grid-template-columns: 1.02fr 0.98fr;
  gap: 2rem;
  max-width: 1100px;
  margin: 0 auto;
}

.lab-copy h2 {
  margin: 0;
  font-size: clamp(2.4rem, 5vw, 4.6rem);
  line-height: 1.05;
}

.lab-copy > p {
  max-width: 600px;
  color: #d6dbeb;
  font-size: 1.02rem;
}

.lab-controls {
  display: grid;
  gap: 0.85rem;
  margin-top: 1.5rem;
}

.lab-controls label {
  display: grid;
  gap: 0.35rem;
  font-size: 0.88rem;
  font-weight: 850;
}

.lab-controls select {
  width: 100%;
  min-height: 48px;
  padding: 0.65rem 2.4rem 0.65rem 0.85rem;
  border: 2px solid white;
  border-radius: 12px;
  color: var(--ink);
  background: white;
  font-weight: 750;
}

.prompt-board {
  align-self: start;
  padding: 1.1rem;
  border: 3px solid white;
  border-radius: 28px;
  color: var(--ink);
  background: var(--paper);
  box-shadow: 12px 14px 0 var(--teal);
  transform: rotate(1deg);
}

.prompt-preview {
  aspect-ratio: 1;
  border: 3px solid var(--line);
  border-radius: 18px;
  background-repeat: no-repeat;
  background-size: 300% 200%;
  background-image: url("assets/camera-angles.png");
}

.prompt-label {
  margin: 1rem 0 0.35rem;
  color: var(--coral);
  font-size: 0.75rem;
  font-weight: 950;
  text-transform: uppercase;
}

.prompt-output {
  min-height: 92px;
  margin: 0;
  padding: 0.9rem;
  border: 2px dashed var(--line);
  border-radius: 14px;
  background: var(--cream);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 0.96rem;
  font-weight: 750;
}

html[lang="my"] .prompt-output {
  font-family: var(--myanmar-font);
}

.copy-status {
  min-height: 1.4rem;
  margin: 0.55rem 0 0;
  color: #287d72;
  font-size: 0.82rem;
  font-weight: 900;
}

.quiz-section {
  background: var(--lavender);
}

.quiz-card {
  max-width: 700px;
  margin: 2rem auto 0;
  padding: clamp(1rem, 4vw, 2rem);
  border: 3px solid var(--line);
  border-radius: 30px;
  background: white;
  box-shadow: 10px 12px 0 var(--ink);
  text-align: center;
}

.quiz-progress {
  overflow: hidden;
  height: 12px;
  border: 2px solid var(--line);
  border-radius: 999px;
  background: #eef0f5;
}

.quiz-progress span {
  display: block;
  width: 33%;
  height: 100%;
  background: var(--teal);
  transition: width 250ms ease;
}

.quiz-count {
  margin: 0.65rem 0 1rem;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 900;
}

.quiz-image {
  width: min(330px, 100%);
  aspect-ratio: 1;
  margin: 0 auto 1.1rem;
  border: 3px solid var(--line);
  border-radius: 22px;
  background-repeat: no-repeat;
  background-size: 300% 200%;
}

.quiz-card h3 {
  margin: 0.4rem 0 1rem;
  font-size: clamp(1.25rem, 3vw, 1.7rem);
}

.quiz-options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.7rem;
}

.quiz-option {
  min-height: 50px;
  padding: 0.65rem;
  border: 2px solid var(--line);
  border-radius: 13px;
  color: var(--ink);
  background: var(--cream);
  cursor: pointer;
  font-weight: 900;
}

.quiz-option:hover,
.quiz-option:focus-visible {
  background: var(--sun);
}

.quiz-option.correct {
  color: #14554e;
  background: #b8f0d9;
}

.quiz-option.wrong {
  color: #7a2430;
  background: #ffd3d0;
}

.quiz-feedback {
  min-height: 1.7rem;
  margin: 0.8rem 0;
  font-weight: 900;
}

.hidden {
  display: none !important;
}

.story-formula {
  background: white;
}

.comic-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  max-width: 1080px;
  margin: 2rem auto 0;
}

.comic-panel {
  position: relative;
  min-height: 210px;
  padding: 1.2rem;
  border: 3px solid var(--line);
  border-radius: 22px;
  background: var(--cream);
  box-shadow: var(--shadow);
  text-align: center;
}

.comic-panel:nth-child(2) { background: var(--sky); }
.comic-panel:nth-child(3) { background: var(--mint); }
.comic-panel:nth-child(4) { background: var(--lavender); }

.comic-panel:not(:last-child)::after {
  content: "➜";
  position: absolute;
  z-index: 2;
  right: -1.3rem;
  top: 42%;
  display: grid;
  place-items: center;
  width: 2.3rem;
  height: 2.3rem;
  border: 2px solid var(--line);
  border-radius: 50%;
  background: var(--sun);
  font-weight: 950;
}

.comic-icon {
  display: block;
  margin: 0.1rem 0 0.7rem;
  font-size: 4rem;
}

.comic-panel h3 {
  margin: 0;
  font-size: 1.1rem;
}

.comic-panel p {
  margin: 0.5rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 650;
}

.golden-rules {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.8rem;
  max-width: 960px;
  margin: 2rem auto 0;
}

.rule {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border: 2px solid var(--line);
  border-radius: 16px;
  background: var(--sun);
  font-size: 0.9rem;
  font-weight: 900;
}

.rule span:first-child {
  font-size: 1.55rem;
}

footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 2rem max(1.25rem, calc((100vw - 1120px) / 2));
  color: white;
  background: var(--ink);
}

footer > div {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.footer-mark {
  font-size: 1.8rem;
}

footer p {
  margin: 0;
  color: #d4daeb;
}

footer a {
  font-weight: 900;
}

.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 500ms ease, transform 500ms ease;
}

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

.noscript {
  margin: 0;
  padding: 1rem;
  color: white;
  background: #8d2732;
  text-align: center;
  font-weight: 800;
}

@media (max-width: 900px) {
  .hero {
    min-height: auto;
  }

  .hero-inner,
  .lab-shell {
    grid-template-columns: 1fr;
  }

  .hero-inner {
    padding-top: 3.4rem;
  }

  .hero-visual {
    width: min(500px, 92%);
    margin-top: 2rem;
  }

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

  .comic-panel:nth-child(2)::after {
    display: none;
  }

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

  .golden-rules {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  .topbar {
    padding: 0.75rem 1rem;
  }

  .nav-actions {
    padding-right: 4.8rem;
  }

  .brand span:last-child,
  .nav-actions > a {
    display: none;
  }

  .hero-inner {
    width: min(100% - 2rem, 600px);
    padding-bottom: 4.5rem;
  }

  .hero h1 {
    font-size: clamp(2.8rem, 15vw, 4.6rem);
  }

  html[lang="my"] .hero h1 {
    font-size: clamp(2.3rem, 10.5vw, 3.8rem);
  }

  .hero-bubble {
    top: -3.4rem;
    left: -0.5rem;
    max-width: 195px;
    font-size: 0.82rem;
  }

  .section-heading {
    gap: 0.85rem;
  }

  .chapter-number {
    width: 3.4rem;
    height: 3.4rem;
    border-radius: 14px;
    font-size: 1rem;
  }

  .tap-hint {
    margin-left: 0;
  }

  .steps,
  .card-grid,
  .comic-strip,
  .quiz-options {
    grid-template-columns: 1fr;
  }

  .step-card {
    min-height: 150px;
  }

  .comic-panel:not(:last-child)::after {
    display: none;
  }

  .visual-card {
    display: grid;
    grid-template-columns: 42% 58%;
    align-items: stretch;
  }

  .visual-card .sprite {
    min-height: 100%;
    border-right: 3px solid var(--line);
    border-bottom: 0;
  }

  .card-copy {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
    padding: 0.8rem;
  }

  .card-copy h3 {
    font-size: 1rem;
  }

  .card-tag {
    font-size: 0.58rem;
  }

  .prompt-board {
    transform: none;
  }

  footer {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}
