/* Easy Little Lessons · aifamilyplay.com
   One stylesheet for every page. Tokens first, then base, layout, components, pages.
   @font-face rules live in fonts.css (generated by tools/build_fonts.py). */

:root {
  color-scheme: light;

  --paper: #fff8ee;
  --paper-2: #fff0dc;
  --card: #ffffff;
  --ink: #1e2a33;
  --ink-2: #4a5863;
  --ink-3: #6b7a86;
  --line: rgba(30, 42, 51, 0.12);
  --line-2: rgba(30, 42, 51, 0.2);
  --grid: rgba(30, 42, 51, 0.055);

  --sun: #ffd43b;
  --sun-edge: #e0a300;

  /* Stage colors: Move it (orange) → Draw it (teal) → Prove it (indigo) */
  --s1: #f76707;
  --s1-soft: #ffe8cc;
  --s1-ink: #9a3412;
  --s2: #13a89e;
  --s2-soft: #cff3ee;
  --s2-ink: #0b5e58;
  --s3: #5c5ce0;
  --s3-soft: #e4e4ff;
  --s3-ink: #3730a3;

  --l1: #ffa94d;
  --l2: #ff8a1f;
  --l3: #f76707;
  --l4: #3cc9b8;
  --l5: #17b0a2;
  --l6: #0e958a;
  --l7: #8a8af0;
  --l8: #6e6ee6;
  --l9: #5050d2;

  --math-soft: #dbeafe;
  --math-ink: #1d4ed8;
  --science-soft: #dcfce7;
  --science-ink: #15803d;
  --thinking-soft: #fce7f3;
  --thinking-ink: #be185d;

  --night: #172129;
  --night-2: #22303a;
  --night-ink: #f6f1e9;
  --night-muted: #b9c4cc;

  --grove: #eef5e6;

  /* "ELL Hangul" is a Hangul-only Pretendard subset (see fonts.css); Latin falls through to the system font. */
  --font-display: "Fredoka", "ELL Hangul", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", sans-serif;
  --font-body: "ELL Hangul", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", sans-serif;

  --r-xl: 32px;
  --r-lg: 26px;
  --r-md: 18px;
  --r-sm: 12px;
  --toy: 0 5px 0 rgba(30, 42, 51, 0.09);
  --lift: 0 24px 48px -28px rgba(30, 42, 51, 0.45);
  --header-h: 72px;
}

/* ---------- Language: both languages live in the HTML; one is hidden ---------- */

html[data-lang="en"] body [lang="ko"],
html[data-lang="ko"] body [lang="en"] {
  display: none !important;
}

/* ---------- Base ---------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

:lang(ko) {
  word-break: keep-all;
  overflow-wrap: break-word;
}

img,
svg {
  display: block;
  max-width: 100%;
}

img {
  height: auto;
}

a {
  color: inherit;
  text-underline-offset: 0.18em;
  text-decoration-thickness: 2px;
}

button,
select,
input {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.015em;
}

:lang(ko) h1,
:lang(ko) h2,
:lang(ko) h3 {
  letter-spacing: -0.035em;
  line-height: 1.22;
}

p {
  margin: 0;
}

ul,
ol {
  margin: 0;
  padding: 0;
}

:focus-visible {
  outline: 3px solid var(--s3);
  outline-offset: 3px;
  border-radius: 6px;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font-weight: 700;
  text-decoration: none;
}

.skip-link:focus {
  top: 12px;
}

.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

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

@media (min-width: 720px) {
  .wrap {
    width: min(1200px, calc(100% - 64px));
  }
}

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 248, 238, 0.88);
  -webkit-backdrop-filter: saturate(1.5) blur(14px);
  backdrop-filter: saturate(1.5) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.site-header.is-scrolled {
  border-bottom-color: var(--line);
}

.nav {
  display: flex;
  align-items: center;
  gap: 12px;
  height: var(--header-h);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.18rem;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.brand-mark {
  width: 38px;
  height: 38px;
  flex: none;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-left: auto;
}

.nav-links a {
  padding: 8px 14px;
  border-radius: 999px;
  color: var(--ink-2);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
}

.nav-links a:hover {
  background: rgba(30, 42, 51, 0.06);
  color: var(--ink);
}

.nav-links a[aria-current="page"] {
  background: var(--ink);
  color: #fff;
}

.nav-tools {
  display: flex;
  align-items: center;
  gap: 10px;
}

.lang-switch {
  display: inline-flex;
  padding: 3px;
  border: 2px solid var(--line-2);
  border-radius: 999px;
  background: #fff;
}

.lang-switch button {
  min-width: 44px;
  height: 32px;
  padding: 0 10px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--ink-2);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.9rem;
}

.lang-switch button[aria-pressed="true"] {
  background: var(--ink);
  color: #fff;
}

.yt-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 16px 0 12px;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  box-shadow: 0 3px 0 #0b1116;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.yt-link:hover {
  transform: translateY(-1px);
}

.yt-link:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 #0b1116;
}

.yt-link svg {
  width: 22px;
  height: 22px;
}

.menu-btn {
  display: none;
  width: 44px;
  height: 44px;
  border: 2px solid var(--line-2);
  border-radius: 14px;
  background: #fff;
  align-items: center;
  justify-content: center;
}

.menu-btn svg {
  width: 22px;
  height: 22px;
}

.mobile-panel {
  display: none;
}

@media (max-width: 920px) {
  .nav-links,
  .nav-tools .yt-link {
    display: none;
  }
  .nav-tools {
    margin-left: auto;
  }
  .menu-btn {
    display: inline-flex;
  }
  .mobile-panel {
    display: block;
    border-top: 1px solid var(--line);
    background: var(--paper);
  }
  .mobile-panel[hidden] {
    display: none;
  }
  .mobile-panel nav {
    display: grid;
    gap: 4px;
    padding: 12px 0 20px;
  }
  .mobile-panel a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-radius: 16px;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 1.1rem;
    text-decoration: none;
  }
  .mobile-panel a:hover,
  .mobile-panel a[aria-current="page"] {
    background: #fff;
  }
}

@media (max-width: 420px) {
  .brand {
    font-size: 1.04rem;
    gap: 8px;
  }
  .brand-mark {
    width: 34px;
    height: 34px;
  }
  .lang-switch button {
    min-width: 38px;
    padding: 0 8px;
  }
}

/* ---------- Buttons & chips ---------- */

.btn {
  --bg: #fff;
  --fg: var(--ink);
  --edge: rgba(30, 42, 51, 0.16);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 54px;
  padding: 0 26px;
  border: 2px solid transparent;
  border-radius: 999px;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.08rem;
  line-height: 1;
  text-decoration: none;
  box-shadow: 0 5px 0 var(--edge);
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.15s ease;
  white-space: nowrap;
}

.btn svg {
  width: 20px;
  height: 20px;
  flex: none;
}

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

.btn:active {
  transform: translateY(4px);
  box-shadow: 0 1px 0 var(--edge);
}

.btn-sun {
  --bg: var(--sun);
  --edge: var(--sun-edge);
}

.btn-ink {
  --bg: var(--ink);
  --fg: #fff;
  --edge: #0b1116;
}

.btn-ghost {
  --edge: rgba(30, 42, 51, 0.14);
  border-color: var(--line-2);
}

.btn-small {
  min-height: 44px;
  padding: 0 18px;
  font-size: 0.98rem;
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.05rem;
  text-decoration: none;
  border-bottom: 2px solid currentColor;
  padding-bottom: 2px;
}

.text-link svg {
  width: 18px;
  height: 18px;
  transition: transform 0.15s ease;
}

.text-link:hover svg {
  transform: translateX(3px);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chip {
  --chip-bg: rgba(30, 42, 51, 0.07);
  --chip-fg: var(--ink-2);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--chip-bg);
  color: var(--chip-fg);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.8rem;
  line-height: 1;
  white-space: nowrap;
}

.chip-level.s-move { --chip-bg: var(--s1-soft); --chip-fg: var(--s1-ink); }
.chip-level.s-draw { --chip-bg: var(--s2-soft); --chip-fg: var(--s2-ink); }
.chip-level.s-prove { --chip-bg: var(--s3-soft); --chip-fg: var(--s3-ink); }
.chip-math { --chip-bg: var(--math-soft); --chip-fg: var(--math-ink); }
.chip-science { --chip-bg: var(--science-soft); --chip-fg: var(--science-ink); }
.chip-thinking { --chip-bg: var(--thinking-soft); --chip-fg: var(--thinking-ink); }
.chip-published { --chip-bg: #d3f9d8; --chip-fg: #1b6b2f; }
.chip-beta { --chip-bg: #fff3bf; --chip-fg: #7a5600; }
.chip-prototype { --chip-bg: rgba(30, 42, 51, 0.08); --chip-fg: var(--ink-2); }

.chip-dot::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

/* ---------- Sections ---------- */

.section {
  position: relative;
  padding: clamp(72px, 9vw, 120px) 0;
}

.section-tight {
  padding-top: clamp(48px, 6vw, 72px);
}

.section-head {
  max-width: 780px;
  margin-bottom: clamp(32px, 4vw, 48px);
}

.section-head.center {
  margin-inline: auto;
  text-align: center;
}

.kicker {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.98rem;
  letter-spacing: 0.02em;
  color: var(--ink-2);
}

.kicker::before {
  content: "";
  width: 14px;
  height: 14px;
  border-radius: 4px;
  background: var(--kicker, var(--s1));
  box-shadow: 0 3px 0 rgba(30, 42, 51, 0.15);
}

.title {
  margin-top: 12px;
  font-size: clamp(2.1rem, 1.35rem + 2.6vw, 3.4rem);
  line-height: 1.05;
  letter-spacing: -0.025em;
}

:lang(ko) .title {
  line-height: 1.2;
}

.lead {
  margin-top: 16px;
  color: var(--ink-2);
  font-size: clamp(1.06rem, 1rem + 0.35vw, 1.22rem);
  line-height: 1.65;
}

.section-foot {
  margin-top: 40px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 28px;
}

.graph-paper {
  background-color: var(--paper);
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 32px 32px;
  background-position: -1px -1px;
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  padding: clamp(40px, 6vw, 72px) 0 clamp(56px, 7vw, 96px);
  overflow: hidden;
}

.hero::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 120px;
  background: linear-gradient(to bottom, rgba(255, 248, 238, 0), var(--paper));
  pointer-events: none;
}

.hero-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(0, 1fr);
  gap: clamp(28px, 4vw, 56px);
  align-items: center;
}

.eyebrow {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 10px;
  padding: 7px 16px 7px 8px;
  border: 2px solid var(--line);
  border-radius: 999px;
  background: #fff;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--ink-2);
  box-shadow: var(--toy);
}

.eyebrow-badge {
  display: inline-flex;
  align-items: center;
  height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font-size: 0.82rem;
}

.display {
  margin: 22px 0 0;
  font-size: clamp(2.7rem, 1.7rem + 4.2vw, 5rem);
  line-height: 0.98;
  letter-spacing: -0.035em;
}

:lang(ko) .display {
  font-size: clamp(2.4rem, 1.6rem + 3.6vw, 4.3rem);
  line-height: 1.14;
  letter-spacing: -0.045em;
}

.marker {
  background: linear-gradient(transparent 62%, var(--sun) 62%, var(--sun) 92%, transparent 92%);
  padding: 0 0.06em;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

.hero .lead {
  max-width: 33em;
  margin-top: 22px;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 32px;
}

.trust {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 24px;
  margin-top: 30px;
  color: var(--ink-2);
  font-size: 0.95rem;
}

.trust li {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  list-style: none;
}

.trust svg {
  width: 20px;
  height: 20px;
  flex: none;
  color: var(--s2);
}

.hero-visual {
  position: relative;
}

.stair {
  width: 100%;
  max-width: 620px;
  margin-inline: auto;
  aspect-ratio: 600 / 500;
}

.stair svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.stair .col {
  cursor: pointer;
}

.stair .col .blocks {
  transform-box: fill-box;
  transform-origin: 50% 100%;
}

.stair .col:hover .blocks,
.stair .col:focus-visible .blocks {
  transform: translateY(-6px);
}

.stair .col .blocks {
  transition: transform 0.25s cubic-bezier(0.2, 0.9, 0.3, 1.3);
}

.stair .col:focus {
  outline: none;
}

.stair .col:focus-visible .col-label {
  text-decoration: underline;
}

.stair.is-animated .rise {
  animation: rise 0.7s cubic-bezier(0.2, 0.9, 0.25, 1.15) both;
  animation-delay: calc(var(--i) * 70ms + 120ms);
  transform-box: fill-box;
  transform-origin: 50% 100%;
}

.stair.is-animated .pop {
  animation: pop 0.5s cubic-bezier(0.2, 0.9, 0.3, 1.4) both;
  animation-delay: 1.05s;
  transform-box: fill-box;
  transform-origin: 50% 100%;
}

.stair.is-animated .float {
  animation: float-in 0.6s ease both, bob 5s ease-in-out 1.4s infinite;
  animation-delay: calc(var(--i) * 90ms + 500ms), calc(var(--i) * 300ms + 1.4s);
}

.stair .marker-flag {
  transition: transform 0.45s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}

/* On phones the staircase is drawn at about 60%, so the small age notes would be unreadable. */
@media (max-width: 520px) {
  .stair .stair-note {
    display: none;
  }
}

@keyframes rise {
  from {
    transform: scaleY(0);
    opacity: 0;
  }
  to {
    transform: scaleY(1);
    opacity: 1;
  }
}

@keyframes pop {
  from {
    transform: scale(0.4);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes float-in {
  from {
    opacity: 0;
    translate: 0 10px;
  }
  to {
    opacity: 1;
    translate: 0 0;
  }
}

@keyframes bob {
  0%,
  100% {
    translate: 0 0;
  }
  50% {
    translate: 0 -6px;
  }
}

/* ---------- Approach (bento) ---------- */

.bento {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 20px;
}

.tile {
  position: relative;
  overflow: hidden;
  padding: clamp(22px, 2.5vw, 32px);
  border: 2px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--card);
  box-shadow: var(--toy);
}

.tile h3 {
  font-size: clamp(1.35rem, 1.1rem + 0.8vw, 1.7rem);
}

.tile p {
  margin-top: 10px;
  color: var(--ink-2);
}

.tile-a {
  grid-column: span 7;
  grid-row: span 2;
  display: flex;
  flex-direction: column;
}

.tile-a figure {
  margin: 0 0 24px;
  overflow: hidden;
  border-radius: var(--r-md);
  border: 2px solid var(--line);
  aspect-ratio: 16 / 9;
}

.tile-a figure img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.tile-a .tile-tag {
  margin-top: auto;
  padding-top: 18px;
}

.tile-b {
  grid-column: span 5;
  background: var(--s2-soft);
  border-color: rgba(11, 94, 88, 0.16);
}

.tile-c {
  grid-column: span 5;
  background: var(--s1-soft);
  border-color: rgba(154, 52, 18, 0.14);
}

.tile-d {
  grid-column: span 12;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr);
  gap: 24px;
  align-items: center;
  background: var(--s3-soft);
  border-color: rgba(55, 48, 163, 0.14);
}

.stat {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 12px;
  margin-bottom: 6px;
}

.stat-num {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.6rem, 2rem + 2.2vw, 3.6rem);
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--s2-ink);
}

.stat-unit {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--s2-ink);
}

.zero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  background: #fff;
  color: var(--s2-ink);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
}

.zero-badge svg {
  width: 18px;
  height: 18px;
}

.think-timer {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.think-timer span {
  position: relative;
  flex: 1;
  height: 14px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(154, 52, 18, 0.14);
}

.think-timer span::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: var(--s1);
  transform: scaleX(0);
  transform-origin: left;
  animation: think 6s linear infinite;
  animation-delay: calc(var(--i) * 1s);
}

@keyframes think {
  0% {
    transform: scaleX(0);
  }
  16.6%,
  70% {
    transform: scaleX(1);
  }
  80%,
  100% {
    transform: scaleX(1);
    opacity: 0;
  }
}

.think-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.think-steps span {
  padding: 6px 12px;
  border-radius: 999px;
  background: #fff;
  color: var(--s1-ink);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.92rem;
}

.hello-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.hello-cloud span {
  padding: 8px 16px;
  border-radius: 999px;
  background: #fff;
  color: var(--s3-ink);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.05rem;
  box-shadow: 0 3px 0 rgba(55, 48, 163, 0.12);
}

.hello-cloud span:nth-child(3n + 2) {
  background: var(--s3);
  color: #fff;
}

/* ---------- Levels ---------- */

.levels-section {
  background: var(--paper-2);
}

.finder {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 20px 40px;
  align-items: center;
  margin-bottom: 36px;
  padding: clamp(22px, 3vw, 36px);
  border: 2px solid var(--line);
  border-radius: var(--r-xl);
  background: #fff;
  box-shadow: var(--toy);
}

.finder h3 {
  font-size: clamp(1.4rem, 1.15rem + 0.8vw, 1.8rem);
}

.finder-intro p {
  margin-top: 8px;
  color: var(--ink-2);
}

.finder-form {
  display: grid;
  gap: 14px;
}

.finder-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.field {
  display: grid;
  gap: 6px;
}

.field label {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--ink-2);
}

.select {
  position: relative;
}

.select select {
  width: 100%;
  height: 52px;
  padding: 0 44px 0 16px;
  border: 2px solid var(--line-2);
  border-radius: 16px;
  background: var(--paper);
  font-weight: 600;
  font-size: 1rem;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
}

.select::after {
  content: "";
  position: absolute;
  right: 18px;
  top: 50%;
  width: 9px;
  height: 9px;
  border-right: 2.5px solid var(--ink);
  border-bottom: 2.5px solid var(--ink);
  transform: translateY(-70%) rotate(45deg);
  pointer-events: none;
}

.finder-result {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 84px;
  padding: 14px 18px;
  border-radius: 20px;
  background: var(--paper);
  border: 2px dashed var(--line-2);
}

.finder-result.has-level {
  border-style: solid;
  border-color: transparent;
  background: var(--result-soft, var(--s1-soft));
}

.finder-result .result-n {
  display: grid;
  place-items: center;
  flex: none;
  width: 58px;
  height: 58px;
  border-radius: 16px;
  background: var(--result-color, var(--line-2));
  color: #fff;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.8rem;
  box-shadow: 0 4px 0 rgba(30, 42, 51, 0.18);
}

.finder-result .result-text {
  display: grid;
  gap: 2px;
}

.finder-result strong {
  font-family: var(--font-display);
  font-size: 1.2rem;
}

.finder-result small {
  color: var(--ink-2);
  font-size: 0.92rem;
}

.finder-result a {
  margin-left: auto;
  flex: none;
}

.stages {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.stage {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 2px solid var(--line);
  border-radius: var(--r-xl);
  background: #fff;
  box-shadow: var(--toy);
}

.stage-head {
  position: relative;
  padding: 24px 24px 20px;
  background: var(--stage-soft);
}

.stage-move { --stage: var(--s1); --stage-soft: var(--s1-soft); --stage-ink: var(--s1-ink); }
.stage-draw { --stage: var(--s2); --stage-soft: var(--s2-soft); --stage-ink: var(--s2-ink); }
.stage-prove { --stage: var(--s3); --stage-soft: var(--s3-soft); --stage-ink: var(--s3-ink); }

.stage-illus {
  height: 92px;
  margin-bottom: 14px;
}

.stage-illus svg {
  height: 100%;
  width: auto;
}

.stage-step {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--stage-ink);
}

.stage-head h3 {
  margin-top: 4px;
  font-size: 1.9rem;
  color: var(--ink);
}

.stage-meta {
  margin-top: 6px;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--stage-ink);
}

.stage-head p.stage-tagline {
  margin-top: 8px;
  color: var(--ink-2);
  font-size: 0.98rem;
}

.lvl-list {
  display: grid;
  gap: 0;
  padding: 8px;
  list-style: none;
}

.lvl {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  padding: 14px;
  border-radius: 18px;
  text-decoration: none;
  transition: background 0.15s ease, box-shadow 0.15s ease;
}

.lvl:hover {
  background: var(--paper);
}

.lvl-n {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: var(--lvl-color);
  color: #fff;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.45rem;
  box-shadow: 0 4px 0 rgba(30, 42, 51, 0.16);
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.18);
}

.lvl-body {
  display: grid;
  gap: 3px;
}

.lvl-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 10px;
}

.lvl-title strong {
  font-family: var(--font-display);
  font-size: 1.12rem;
  line-height: 1.25;
}

.lvl-meta {
  color: var(--ink-3);
  font-size: 0.86rem;
  font-weight: 600;
}

.lvl-can {
  color: var(--ink-2);
  font-size: 0.94rem;
  line-height: 1.5;
}

.lvl.is-match {
  background: var(--sun);
  box-shadow: inset 0 0 0 2px var(--sun-edge);
}

.lvl.is-match .lvl-meta {
  color: var(--ink-2);
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.74rem;
  white-space: nowrap;
}

.status::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.status-open { background: #d3f9d8; color: #1b6b2f; }
.status-making { background: #fff3bf; color: #7a5600; }
.status-planned { background: rgba(30, 42, 51, 0.07); color: var(--ink-3); }

/* ---------- Watch (dark) ---------- */

.section-dark {
  background: var(--night);
  color: var(--night-ink);
}

.section-dark .kicker {
  color: var(--night-muted);
}

.section-dark .lead {
  color: var(--night-muted);
}

.video-feature {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}

.vcard {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: var(--r-lg);
  background: var(--night-2);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.vthumb {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  padding: 0;
  border: 0;
  overflow: hidden;
  background: #0d1419;
  text-decoration: none;
  color: inherit;
}

.vthumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.vthumb:hover img {
  transform: scale(1.035);
}

.play-btn {
  position: absolute;
  left: 50%;
  top: 50%;
  display: grid;
  place-items: center;
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: var(--sun);
  color: var(--ink);
  box-shadow: 0 6px 0 var(--sun-edge), 0 18px 40px rgba(0, 0, 0, 0.35);
  transform: translate(-50%, -50%);
  transition: transform 0.18s ease;
}

.play-btn svg {
  width: 30px;
  height: 30px;
  margin-left: 4px;
}

.vthumb:hover .play-btn {
  transform: translate(-50%, -50%) scale(1.08);
}

.vthumb .duration {
  position: absolute;
  right: 12px;
  bottom: 12px;
  padding: 4px 9px;
  border-radius: 8px;
  background: rgba(13, 20, 25, 0.82);
  color: #fff;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.85rem;
}

.vbody {
  display: grid;
  gap: 10px;
  padding: 20px 22px 24px;
}

.vbody h3 {
  font-size: clamp(1.25rem, 1.05rem + 0.6vw, 1.5rem);
}

.vbody p {
  color: var(--night-muted);
  font-size: 0.98rem;
}

.section-dark .chip {
  --chip-bg: rgba(255, 255, 255, 0.1);
  --chip-fg: #e8edf1;
}

.section-dark .chip-level.s-move { --chip-bg: rgba(255, 169, 77, 0.2); --chip-fg: #ffc58a; }
.section-dark .chip-level.s-draw { --chip-bg: rgba(60, 201, 184, 0.18); --chip-fg: #8de6da; }
.section-dark .chip-level.s-prove { --chip-bg: rgba(138, 138, 240, 0.22); --chip-fg: #c4c4ff; }
.section-dark .chip-science { --chip-bg: rgba(134, 239, 172, 0.16); --chip-fg: #a7f3c0; }
.section-dark .chip-math { --chip-bg: rgba(147, 197, 253, 0.16); --chip-fg: #bfdbfe; }
.section-dark .chip-thinking { --chip-bg: rgba(249, 168, 212, 0.16); --chip-fg: #fbcfe8; }

.studio-head {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: 12px 24px;
  margin: 64px 0 22px;
}

.studio-head h3 {
  font-size: clamp(1.5rem, 1.2rem + 1vw, 2rem);
}

.studio-head p {
  margin-top: 6px;
  color: var(--night-muted);
}

.studio-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.scard {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: var(--r-md);
  background: var(--night-2);
  border: 1px solid rgba(255, 255, 255, 0.07);
}

.scard figure {
  position: relative;
  margin: 0;
  aspect-ratio: 16 / 9;
  overflow: hidden;
}

.scard figure img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.scard .studio-tag {
  position: absolute;
  left: 10px;
  top: 10px;
  padding: 4px 9px;
  border-radius: 8px;
  background: rgba(13, 20, 25, 0.78);
  color: #fff;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.76rem;
}

.scard-body {
  display: grid;
  gap: 8px;
  padding: 14px 16px 18px;
}

.scard-body h4 {
  font-size: 1.08rem;
  line-height: 1.25;
}

.section-dark .text-link {
  color: var(--sun);
}

/* ---------- Play (Lumi Grove) ---------- */

.section-grove {
  background: var(--grove);
}

.play-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr);
  gap: clamp(28px, 5vw, 64px);
  align-items: center;
}

.zones {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 28px;
  list-style: none;
}

.zone {
  display: grid;
  gap: 2px;
  padding: 14px 16px;
  border-radius: 18px;
  background: #fff;
  border-left: 6px solid var(--zone);
  box-shadow: var(--toy);
}

.zone strong {
  font-family: var(--font-display);
  font-size: 1.04rem;
}

.zone span {
  color: var(--ink-2);
  font-size: 0.9rem;
}

.play-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 26px;
  margin: 26px 0 0;
  list-style: none;
}

.play-stats li {
  display: grid;
}

.play-stats b {
  font-family: var(--font-display);
  font-size: 2rem;
  line-height: 1.1;
}

.play-stats span {
  color: var(--ink-2);
  font-size: 0.9rem;
}

.play-note {
  margin-top: 14px;
  color: var(--ink-2);
  font-size: 0.92rem;
}

.village {
  position: relative;
  overflow: hidden;
  border-radius: var(--r-xl);
  border: 2px solid rgba(37, 72, 61, 0.12);
  background: #e8efcf;
  box-shadow: var(--lift);
  aspect-ratio: 1000 / 680;
}

.village .village-map {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.village .friend {
  position: absolute;
  width: clamp(54px, 9vw, 92px);
  height: auto;
  aspect-ratio: 1;
  border-radius: 50%;
  box-shadow: 0 6px 0 rgba(37, 72, 61, 0.18), 0 0 0 4px #fff;
  animation: bob 4.5s ease-in-out infinite;
  animation-delay: var(--d, 0s);
}

/* ---------- Parents ---------- */

.steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  list-style: none;
}

.step {
  position: relative;
  padding: 28px;
  border: 2px solid var(--line);
  border-radius: var(--r-lg);
  background: #fff;
  box-shadow: var(--toy);
}

.step-n {
  display: grid;
  place-items: center;
  width: 50px;
  height: 50px;
  margin-bottom: 18px;
  border-radius: 16px;
  background: var(--sun);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.5rem;
  box-shadow: 0 4px 0 var(--sun-edge);
}

.step h3 {
  font-size: 1.35rem;
}

.step p {
  margin-top: 8px;
  color: var(--ink-2);
}

.step q {
  display: block;
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--paper);
  font-family: var(--font-display);
  font-weight: 600;
  quotes: none;
}

.parents-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
  gap: clamp(28px, 4vw, 56px);
  margin-top: clamp(48px, 6vw, 72px);
}

.promises h3,
.faq h3 {
  font-size: 1.6rem;
  margin-bottom: 18px;
}

.promise-list {
  display: grid;
  gap: 14px;
  list-style: none;
}

.promise-list li {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.promise-list .ico {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: var(--s2-soft);
  color: var(--s2-ink);
}

.promise-list .ico svg {
  width: 20px;
  height: 20px;
}

.promise-list strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.05rem;
}

.promise-list span {
  color: var(--ink-2);
  font-size: 0.95rem;
}

.faq details {
  border-bottom: 2px solid var(--line);
}

.faq details:first-of-type {
  border-top: 2px solid var(--line);
}

.faq summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 2px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.12rem;
  cursor: pointer;
  list-style: none;
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary::after {
  content: "";
  flex: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--paper-2) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231e2a33' stroke-width='2.6' stroke-linecap='round'%3E%3Cpath d='M12 6v12M6 12h12'/%3E%3C/svg%3E") center / 16px no-repeat;
  transition: transform 0.2s ease;
}

.faq details[open] summary::after {
  transform: rotate(45deg);
}

.faq details p {
  padding: 0 2px 20px;
  color: var(--ink-2);
}

/* ---------- Footer ---------- */

.site-footer {
  padding: 64px 0 40px;
  background: var(--ink);
  color: #e9e4da;
}

.footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) repeat(2, minmax(0, 1fr));
  gap: 32px;
}

.site-footer .brand {
  color: #fff;
}

.footer-tag {
  margin-top: 14px;
  max-width: 26em;
  color: #b9c4cc;
}

.footer-col h2 {
  font-size: 1rem;
  color: #fff;
  margin-bottom: 12px;
}

.footer-col ul {
  display: grid;
  gap: 8px;
  list-style: none;
}

.footer-col a {
  color: #b9c4cc;
  text-decoration: none;
}

.footer-col a:hover {
  color: #fff;
  text-decoration: underline;
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  color: #8e9aa3;
  font-size: 0.9rem;
}

.site-footer .lang-switch {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.2);
}

.site-footer .lang-switch button {
  color: #b9c4cc;
}

.site-footer .lang-switch button[aria-pressed="true"] {
  background: #fff;
  color: var(--ink);
}

/* ---------- Page hero (inner pages) ---------- */

.page-hero {
  padding: clamp(40px, 6vw, 72px) 0 clamp(40px, 5vw, 64px);
}

.page-hero .display {
  font-size: clamp(2.4rem, 1.6rem + 3.2vw, 4rem);
}

:lang(ko) .page-hero .display {
  font-size: clamp(2.2rem, 1.5rem + 2.8vw, 3.6rem);
}

.page-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.9fr);
  gap: clamp(24px, 4vw, 48px);
  align-items: center;
}

/* ---------- Levels page ---------- */

.how-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  list-style: none;
}

.how-card {
  padding: 26px;
  border-radius: var(--r-lg);
  background: var(--stage-soft);
  border: 2px solid rgba(30, 42, 51, 0.06);
}

.how-card .stage-illus {
  height: 84px;
}

.how-card h3 {
  font-size: 1.6rem;
}

.how-card .stage-step {
  margin-bottom: 2px;
}

.how-card p {
  margin-top: 8px;
  color: var(--ink-2);
}

.table-wrap {
  overflow-x: auto;
  border: 2px solid var(--line);
  border-radius: var(--r-lg);
  background: #fff;
  box-shadow: var(--toy);
  -webkit-overflow-scrolling: touch;
}

.grade-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.grade-table th,
.grade-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}

.grade-table thead th {
  position: sticky;
  top: 0;
  background: var(--paper);
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--ink-2);
}

.grade-table tbody tr:last-child td,
.grade-table tbody tr:last-child th {
  border-bottom: 0;
}

.grade-table tbody th {
  position: sticky;
  left: 0;
  background: #fff;
  z-index: 1;
}

.grade-table .lvl-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-weight: 700;
}

.grade-table .lvl-pill i {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: var(--lvl-color);
  color: #fff;
  font-style: normal;
}

.grade-table tr.is-match th,
.grade-table tr.is-match td {
  background: #fff6cc;
}

.table-note {
  margin-top: 12px;
  color: var(--ink-3);
  font-size: 0.9rem;
}

.level-details {
  display: grid;
  gap: 24px;
}

.ldetail {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  overflow: hidden;
  border: 2px solid var(--line);
  border-radius: var(--r-xl);
  background: #fff;
  box-shadow: var(--toy);
  scroll-margin-top: calc(var(--header-h) + 20px);
}

.ldetail.is-match {
  border-color: var(--sun-edge);
  box-shadow: 0 0 0 4px var(--sun), var(--toy);
}

.ldetail-side {
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 28px 24px;
  background: var(--stage-soft);
}

.ldetail-num {
  display: grid;
  place-items: center;
  width: 84px;
  height: 84px;
  border-radius: 24px;
  background: var(--lvl-color);
  color: #fff;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 2.6rem;
  box-shadow: 0 6px 0 rgba(30, 42, 51, 0.18);
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.18);
}

.ldetail-side .stage-step {
  margin-top: 6px;
}

.ldetail-side dl {
  display: grid;
  gap: 6px;
  margin: 6px 0 0;
}

.ldetail-side dl div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.92rem;
}

.ldetail-side dt {
  color: var(--ink-3);
}

.ldetail-side dd {
  margin: 0;
  font-weight: 700;
  text-align: right;
}

.ldetail-main {
  padding: 28px clamp(22px, 3vw, 36px) 32px;
}

.ldetail-main h3 {
  font-size: clamp(1.6rem, 1.3rem + 1vw, 2.1rem);
}

.can-do {
  display: flex;
  gap: 12px;
  margin-top: 14px;
  padding: 14px 16px;
  border-radius: 16px;
  background: var(--paper);
  font-weight: 600;
}

.can-do svg {
  flex: none;
  width: 22px;
  height: 22px;
  margin-top: 2px;
  color: var(--s2);
}

.topics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-top: 22px;
}

.topics h4 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 1rem;
}

.topics h4 .chip {
  height: 24px;
}

.topics ul {
  display: grid;
  gap: 6px;
  list-style: none;
}

.topics li {
  position: relative;
  padding-left: 16px;
  color: var(--ink-2);
  font-size: 0.95rem;
  line-height: 1.45;
}

.topics li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 7px;
  height: 7px;
  border-radius: 2px;
  background: var(--lvl-color);
}

.ldetail-content {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 2px dashed var(--line);
}

.ldetail-content h4 {
  font-size: 1rem;
  margin-bottom: 12px;
}

.mini-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
  list-style: none;
}

.mini {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 8px;
  border-radius: 14px;
  background: var(--paper);
  text-decoration: none;
  border: 0;
  width: 100%;
  text-align: left;
}

button.mini:hover,
a.mini:hover {
  background: var(--paper-2);
}

.mini img {
  width: 76px;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 9px;
  background: #e8efcf;
}

.mini b {
  display: block;
  font-family: var(--font-display);
  font-size: 0.95rem;
  line-height: 1.25;
}

.mini small {
  color: var(--ink-3);
  font-size: 0.8rem;
  font-weight: 600;
}

.empty-note {
  color: var(--ink-3);
  font-size: 0.95rem;
}

.notes {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  list-style: none;
}

.notes li {
  padding: 24px;
  border-radius: var(--r-lg);
  background: #fff;
  border: 2px solid var(--line);
}

.notes h3 {
  font-size: 1.2rem;
}

.notes p {
  margin-top: 8px;
  color: var(--ink-2);
  font-size: 0.96rem;
}

/* ---------- Library ---------- */

.filters {
  display: grid;
  gap: 14px;
  margin-bottom: 28px;
  padding: 20px;
  border: 2px solid var(--line);
  border-radius: var(--r-lg);
  background: #fff;
  box-shadow: var(--toy);
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.filter-row > span {
  min-width: 76px;
  margin-right: 6px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--ink-3);
}

.fbtn {
  height: 38px;
  min-width: 42px;
  padding: 0 14px;
  border: 2px solid var(--line-2);
  border-radius: 999px;
  background: #fff;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--ink-2);
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.fbtn:hover {
  border-color: var(--ink-2);
}

.fbtn[aria-pressed="true"] {
  border-color: var(--ink);
  background: var(--ink);
  color: #fff;
}

.fbtn.lvl-btn[aria-pressed="true"] {
  border-color: transparent;
  background: var(--lvl-color);
}

.lib-count {
  margin: 0 0 16px;
  color: var(--ink-3);
  font-family: var(--font-display);
  font-weight: 600;
}

.lib-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
}

.lcard {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 2px solid var(--line);
  border-radius: var(--r-lg);
  background: #fff;
  box-shadow: var(--toy);
}

.lcard .vthumb {
  background: #e8efcf;
}

.lcard .vthumb .play-btn {
  width: 62px;
  height: 62px;
}

.lcard .vthumb .play-btn svg {
  width: 24px;
  height: 24px;
}

.lcard .lthumb-static {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #e8efcf;
}

.lcard .lthumb-static img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.lcard .lthumb-static .studio-tag {
  position: absolute;
  left: 12px;
  top: 12px;
  padding: 4px 9px;
  border-radius: 8px;
  background: rgba(13, 20, 25, 0.78);
  color: #fff;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.78rem;
}

.lcard-body {
  display: grid;
  gap: 10px;
  padding: 18px 20px 22px;
  flex: 1;
  align-content: start;
}

.lcard-body h3 {
  font-size: 1.25rem;
}

.lcard-body p {
  color: var(--ink-2);
  font-size: 0.96rem;
}

.lcard-foot {
  margin-top: auto;
  padding: 0 20px 20px;
}

.lib-empty {
  padding: 48px 24px;
  border: 2px dashed var(--line-2);
  border-radius: var(--r-lg);
  text-align: center;
  color: var(--ink-2);
}

.lib-empty h3 {
  font-size: 1.4rem;
  margin-bottom: 8px;
  color: var(--ink);
}

/* ---------- Player dialog ---------- */

.player {
  width: min(1100px, calc(100% - 24px));
  max-width: none;
  padding: 0;
  border: 0;
  border-radius: 22px;
  background: #0d1419;
  color: #fff;
  box-shadow: 0 40px 80px rgba(0, 0, 0, 0.5);
}

.player::backdrop {
  background: rgba(13, 20, 25, 0.78);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}

.player-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 12px 12px 20px;
}

.player-head h2 {
  font-size: 1.1rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.player-close {
  display: grid;
  place-items: center;
  flex: none;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.player-close svg {
  width: 20px;
  height: 20px;
}

.player-frame {
  aspect-ratio: 16 / 9;
  background: #000;
}

.player-frame iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

.player-foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 16px;
  padding: 12px 20px 16px;
  color: var(--night-muted);
  font-size: 0.88rem;
}

.player-foot a {
  color: #fff;
}

/* ---------- Play wrapper ---------- */

.play-page {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background: #f8f8f1;
}

.play-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 56px;
  padding: 0 12px 0 16px;
  background: var(--ink);
  color: #fff;
  flex: none;
}

.play-bar .brand {
  color: #fff;
  font-size: 1rem;
}

.play-bar .brand-mark {
  width: 30px;
  height: 30px;
}

.play-bar-title {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  margin-left: 6px;
  padding-left: 14px;
  border-left: 1px solid rgba(255, 255, 255, 0.2);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.95rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.play-bar .chip {
  --chip-bg: var(--sun);
  --chip-fg: var(--ink);
}

.play-bar a.back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.92rem;
  text-decoration: none;
  white-space: nowrap;
}

.play-bar a.back svg {
  width: 16px;
  height: 16px;
}

.play-frame {
  flex: 1;
  width: 100%;
  border: 0;
  background: #f8f8f1;
}

@media (max-width: 640px) {
  .play-bar .brand span,
  .play-bar-title .chip {
    display: none;
  }
}

/* ---------- 404 ---------- */

.lost {
  display: grid;
  place-items: center;
  min-height: 70vh;
  padding: 64px 0;
  text-align: center;
}

.lost-blocks {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 12px;
  margin-bottom: 28px;
}

.lost-blocks span {
  display: grid;
  place-items: center;
  width: 84px;
  border-radius: 20px;
  color: #fff;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 3rem;
  box-shadow: 0 6px 0 rgba(30, 42, 51, 0.18);
}

.lost-blocks span:nth-child(1) { height: 120px; background: var(--l3); }
.lost-blocks span:nth-child(2) { height: 84px; background: var(--l5); transform: rotate(-8deg); }
.lost-blocks span:nth-child(3) { height: 120px; background: var(--l8); }

.lost p {
  max-width: 30em;
  margin: 14px auto 28px;
  color: var(--ink-2);
}

/* ---------- Responsive ---------- */

@media (max-width: 1080px) {
  .studio-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .lib-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .ldetail {
    grid-template-columns: 200px minmax(0, 1fr);
  }
}

@media (max-width: 960px) {
  .hero-grid,
  .page-hero-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .hero-visual {
    max-width: 560px;
    width: 100%;
    margin-inline: auto;
  }
  .stages {
    grid-template-columns: minmax(0, 1fr);
  }
  .stage {
    display: grid;
    grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  }
  .finder {
    grid-template-columns: minmax(0, 1fr);
  }
  .play-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .village {
    order: -1;
  }
  .steps,
  .how-grid,
  .notes {
    grid-template-columns: minmax(0, 1fr);
  }
  .parents-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .tile-a,
  .tile-b,
  .tile-c {
    grid-column: span 12;
  }
  .tile-a {
    grid-row: auto;
  }
  .tile-d {
    grid-template-columns: minmax(0, 1fr);
  }
  .topics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .footer-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
  .footer-grid > :first-child {
    grid-column: 1 / -1;
  }
}

@media (max-width: 720px) {
  body {
    font-size: 16px;
  }
  .video-feature {
    grid-template-columns: minmax(0, 1fr);
  }
  .stage {
    display: flex;
  }
  .studio-grid {
    grid-auto-flow: column;
    grid-template-columns: none;
    grid-auto-columns: 76%;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding-bottom: 10px;
    margin-inline: -16px;
    padding-inline: 16px;
    scroll-padding-inline: 16px;
  }
  .studio-grid > * {
    scroll-snap-align: start;
  }
  .section-dark .studio-grid {
    scrollbar-color: rgba(255, 255, 255, 0.25) transparent;
    scrollbar-width: thin;
  }
  .lib-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .finder-fields {
    grid-template-columns: minmax(0, 1fr);
  }
  .finder-result {
    flex-wrap: wrap;
  }
  .finder-result a {
    margin-left: 74px;
  }
  .ldetail {
    grid-template-columns: minmax(0, 1fr);
  }
  .ldetail-side {
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    column-gap: 18px;
  }
  .ldetail-num {
    width: 68px;
    height: 68px;
    font-size: 2.1rem;
    grid-row: span 2;
  }
  .ldetail-side dl {
    grid-column: 1 / -1;
  }
  .topics {
    grid-template-columns: minmax(0, 1fr);
  }
  .zones {
    grid-template-columns: minmax(0, 1fr);
  }
  .cta-row .btn {
    flex: 1 1 auto;
  }
  .filter-row > span {
    width: 100%;
    min-width: 0;
  }
  .footer-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .player {
    width: 100%;
    border-radius: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    animation-delay: 0s !important;
    transition-duration: 0.001ms !important;
  }
}
