@font-face {
  font-family: Nunito;
  src: url("./assets/fonts/nunito.woff2") format("woff2");
  font-weight: 400 900;
  font-display: swap;
}

@font-face {
  font-family: Fraunces;
  src: url("./assets/fonts/fraunces.woff2") format("woff2");
  font-weight: 500 800;
  font-display: swap;
}

@font-face {
  font-family: "Noto Sans Tamil";
  src: url("./assets/fonts/noto-tamil.woff2") format("woff2");
  font-weight: 400 800;
  font-display: swap;
}

:root {
  color-scheme: light;
  --page: #fbf9f2;
  --paper: #fffdf8;
  --white: #fffefa;
  --ink: #173e34;
  --text: #293f36;
  --subtle: #53665b;
  --green: #23634e;
  --green-dark: #194b3b;
  --mint: #e1eee2;
  --line: #e7e4d7;
  --shadow: 0 5px 16px #263b2510;
  --radius-lg: 28px;
  --radius: 20px;
  --display: Fraunces, Georgia, serif;
  --tamil: "Noto Sans Tamil", "Tamil Sangam MN", "Nirmala UI", sans-serif;
  font-family: Nunito, system-ui, sans-serif;
  font-size: 16px;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-width: 300px; background: var(--page); color: var(--text); line-height: 1.52; }
body, main { min-height: 60vh; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { color: var(--ink); line-height: 1.12; }
h1, h2 { font-family: var(--display); font-weight: 650; }
h3 { font-weight: 850; }
a { color: inherit; }
button, select, input { font: inherit; }
button { cursor: pointer; }
img { display: block; max-width: 100%; }
[hidden] { display: none !important; }
.tamil, [lang="ta"] { font-family: var(--tamil); }
.hide-hints .lesson-hint { display: none; }
:focus-visible { outline: 3px solid #af5d19; outline-offset: 4px; }
main:focus, h1:focus { outline: none; }
.sr-only, .skip-link:not(:focus) {
  position: absolute;
  width: 1px;
  height: 1px;
  clip-path: inset(50%);
  overflow: hidden;
  white-space: nowrap;
}
.skip-link:focus { position: fixed; top: 8px; left: 8px; z-index: 5; padding: 10px 15px; background: var(--white); }
.icon { display: block; flex: 0 0 auto; width: 1.23em; height: 1.23em; }

.site-header { background: #fffdf8; border-bottom: 1px solid var(--line); }
.header-inner, .footer-inner {
  width: min(100% - 64px, 1184px);
  margin-inline: auto;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
}
.header-inner { min-height: 76px; gap: 22px; }
.brand { display: inline-flex; width: fit-content; align-items: center; gap: 11px; text-decoration: none; color: var(--ink); font-size: 1.19rem; font-weight: 900; white-space: nowrap; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 13px;
  background: var(--green);
  color: #fff7de;
  font-size: 1.38rem;
  line-height: 1;
  font-weight: 700;
  padding-top: 3px;
}
.main-nav { display: flex; align-items: center; gap: 8px; }
.main-nav a, .family-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  gap: 8px;
  padding: 8px 15px;
  border-radius: 12px;
  text-decoration: none;
  font-weight: 800;
  font-size: .96rem;
  color: #486258;
  white-space: nowrap;
}
.main-nav a:hover, .family-link:hover { background: #f1f3e9; color: var(--ink); }
.main-nav [aria-current], .family-link[aria-current] { background: #e6efe3; color: var(--green-dark); }
.nav-letter { width: 1.23rem; text-align: center; font-weight: 750; }
.header-tools { display: flex; align-items: center; justify-self: end; gap: 8px; }
.header-tools select { min-width: 85px; font-size: .94rem; }

.page { width: min(100% - 64px, 1184px); margin: 0 auto; padding: 36px 0 64px; }
.hero {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  display: flex;
  align-items: center;
  min-height: 400px;
  border-radius: var(--radius-lg);
  background: #fbe3d2;
}
.hero-art {
  width: 62%;
  height: 100%;
  position: absolute;
  right: 0;
  top: 0;
  z-index: -1;
  object-fit: cover;
  object-position: center 56%;
  mask-image: linear-gradient(to right, transparent, black 18%);
}
.hero-copy { padding: 38px 0 39px 48px; width: 46%; }
.eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .82rem;
  font-weight: 900;
  line-height: 1.4;
  letter-spacing: .085em;
  text-transform: uppercase;
  color: #76523a;
}
.eyebrow .icon { color: #a95b24; }
.hero h1 {
  font-size: clamp(3.75rem, 6.15vw, 5.55rem);
  max-width: 8ch;
  line-height: .95;
  letter-spacing: -.066em;
  margin: 15px 0 11px;
  font-weight: 675;
}
.hero h1:lang(da) { font-size: clamp(2.7rem, 5.65vw, 4.6rem); max-width: 10ch; }
.hero-tamil { color: #744c38; font-size: clamp(1rem, 1.55vw, 1.22rem); font-weight: 700; margin-bottom: 9px; }
.hero-description { max-width: 19.5rem; font-size: 1.08rem; line-height: 1.44; margin-bottom: 24px; color: #4e5549; font-weight: 650; }

.button {
  min-height: 46px;
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 9px 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
  text-decoration: none;
  line-height: 1.25;
  font-weight: 850;
  background: transparent;
  color: var(--green-dark);
  transition: background-color .16s ease, border-color .16s ease, transform .16s ease;
}
.button .icon { width: 19px; height: 19px; }
.button.primary { background: var(--green); color: white; padding-inline: 20px; }
.button.primary:hover:not(:disabled) { background: var(--green-dark); transform: translateY(-1px); }
.button.primary:disabled { background: #eceee5; color: #6a766c; }
.hero .button { min-height: 52px; padding-inline: 19px 22px; }
.hero .button .icon { width: 21px; height: 21px; }
.button.quiet { border-color: #e2e5d9; background: var(--white); }
.button.quiet:hover:not(:disabled) { background: #f0f4ea; border-color: #cbdccb; }
.button.green-light { background: #e4efe3; border-color: #dceadb; }
.button.green-light:hover:not(:disabled) { background: #d4e8d5; }
.button:disabled { cursor: default; color: #747e73; }

.home-layout { display: grid; grid-template-columns: minmax(0, 1fr) 258px; gap: 26px; align-items: start; margin-top: 37px; }
.course-sections { display: grid; gap: 32px; }
.practice-callout {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px;
  border: 1px solid #d5e5d4;
  border-radius: var(--radius);
  background: #eef4e8;
}
.practice-callout h2 { margin-bottom: 5px; font-size: 1.6rem; }
.practice-callout p { color: var(--subtle); }
.practice-callout .button { flex-shrink: 0; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 12px; margin-bottom: 19px; }
.section-heading h2, .content-panel h2, .alphabet-panel h2, .builder-panel h2 { font-size: 1.9rem; letter-spacing: -.027em; }
.section-heading p, .content-panel > p, .alphabet-panel > p, .builder-panel > p { color: var(--subtle); margin-top: 5px; }
.lessons-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.lesson-card { min-width: 0; border: 1px solid var(--line); border-radius: 19px; background: var(--paper); box-shadow: 0 2px 5px #263b250a; transition: border-color .18s ease, transform .18s ease, box-shadow .18s ease; }
.lesson-card:has(> a:hover) { transform: translateY(-3px); border-color: #99b7a1; box-shadow: var(--shadow); }
.lesson-card.is-next { border-color: #81aa93; }
.lesson-card > a, .locked-card { height: 100%; display: block; padding: 10px; border-radius: inherit; text-decoration: none; }
.lesson-locked { box-shadow: none; background: #f7f5eb; }
.lesson-locked .lesson-visual { filter: saturate(.62); }
.apricot { background: #fae4d1; color: #9a4e2d; }
.blue { background: #e3eef4; color: #345f79; }
.lavender { background: #eee7f4; color: #654873; }
.mint { background: #e1eddf; color: #2e6d51; }
.honey, .gold { background: #faedcd; color: #8d5b15; }
.rose { background: #f7e4e3; color: #964e53; }
.lesson-visual { height: 108px; border-radius: 12px; position: relative; overflow: hidden; display: flex; justify-content: space-between; align-items: center; padding-left: 16px; }
.card-letter { position: relative; z-index: 1; font-size: clamp(1.76rem, 3.4vw, 3.1rem); line-height: 1; font-weight: 720; padding-top: 9px; }
.letter-preview { justify-content: space-evenly; gap: 5px; padding-inline: 6px; }
.letter-preview .card-letter { font-size: clamp(1.3rem, 2.6vw, 2.45rem); }
.lesson-visual img { position: absolute; right: 4%; bottom: 0; width: 54%; height: 94%; object-fit: contain; object-position: center bottom; }
.lesson-card-copy { padding: 11px 5px 5px; }
.lesson-meta { display: flex; justify-content: space-between; gap: 4px; margin-bottom: 5px; color: var(--subtle); font-size: .83rem; font-weight: 850; }
.lesson-meta span:last-child { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.lesson-card h3 { font-size: 1.14rem; padding-bottom: 5px; }
.lesson-card p { color: var(--subtle); font-size: .89rem; line-height: 1.35; }
.home-aside { display: grid; gap: 16px; }
.side-panel {
  padding: 20px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 19px;
}
.side-panel h2 { font: 900 1.24rem/1.2 Nunito, sans-serif; margin: 10px 0 6px; }
.side-panel p { color: var(--subtle); font-size: .94rem; line-height: 1.4; }
.side-icon { width: 39px; height: 39px; display: grid; place-items: center; border-radius: 12px; font-weight: 800; }
.side-icon .icon { width: 22px; height: 22px; }
.side-panel .text-link { margin-top: 12px; display: inline-block; }
.text-link { color: var(--green-dark); font-size: .94rem; font-weight: 900; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.text-link:hover { color: #854522; }
.meter { width: 100%; height: 9px; background: #e9eddf; border-radius: 10px; overflow: hidden; margin: 12px 0 0; }
.meter > span { display: block; width: var(--value); height: 100%; background: #528e67; border-radius: inherit; transition: width .22s ease; }

.site-footer { border-top: 1px solid var(--line); }
.footer-inner { grid-template-columns: 1fr auto; min-height: 74px; gap: 12px; }
.footer-brand { font-size: .96rem; color: #3b5d50; }
.footer-brand .brand-mark { width: 31px; height: 31px; border-radius: 9px; font-size: .97rem; }
.footer-inner > a:last-child { font-weight: 800; font-size: .93rem; text-underline-offset: 3px; }

.lesson-page { max-width: 820px; }
.lesson-top { display: grid; grid-template-columns: 1fr 2fr 1fr; align-items: center; gap: 10px; }
.exit-lesson { justify-self: start; }
.lesson-top-title { text-align: center; color: var(--subtle); line-height: 1.35; font-size: .87rem; font-weight: 750; }
.lesson-top-title strong { display: block; color: var(--ink); font-size: 1.18rem; }
.step-count { justify-self: end; color: var(--green-dark); background: #e6efe3; padding: 6px 12px; border-radius: 30px; font-size: .9rem; font-weight: 850; }
.steps { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 8px; list-style: none; margin: 20px 0; padding: 0; }
.steps li { text-align: center; font-size: .84rem; font-weight: 800; color: #657568; }
.steps li[aria-current], .step-done { color: var(--green-dark); }
.step-bar { display: block; height: 7px; width: 100%; background: #e7ecdf; border-radius: 20px; margin-bottom: 6px; }
.step-done .step-bar { background: #9ec6a2; }
[aria-current="step"] .step-bar { background: #3b805e; }
.activity-card { border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--paper); box-shadow: var(--shadow); padding: 29px clamp(20px, 5vw, 51px) 25px; text-align: center; }
.activity-heading h1, .completion h1 { font-size: clamp(2rem, 5vw, 3.15rem); letter-spacing: -.044em; }
.activity-heading p { margin-top: 7px; color: var(--subtle); }
.round-label { color: var(--subtle); font-size: .92rem; font-weight: 800; margin-bottom: 7px; }
.activity-heading .directions { min-height: 38px; padding: 5px 10px; font-size: .84rem; margin-block: 11px 20px; }
.activity-heading .directions .icon { width: 17px; height: 17px; }
.word-display { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 18px; align-items: center; border-radius: 20px; padding: 17px; margin: 0 auto; max-width: 575px; min-height: 218px; }
.word-display img { width: 100%; height: 184px; object-fit: contain; }
.big-word { display: block; font-size: clamp(1.7rem, 4.6vw, 3.15rem); font-weight: 750; line-height: 1.28; color: var(--ink); overflow-wrap: anywhere; }
.word-display p, .phrase-card p { margin-block: 5px 12px; color: var(--subtle); }
.word-display .button, .phrase-card .button { margin-top: 5px; }
.letter-intro { display: grid; justify-items: center; gap: 6px; margin: 0 auto; max-width: 420px; border-radius: 20px; padding: 16px; }
.introduced-letter { font-size: clamp(4rem, 11vw, 6rem); font-weight: 720; line-height: 1.2; padding-top: .12em; }
.lesson-formula { color: var(--green-dark); margin-top: 15px; display: flex; gap: 10px; align-items: center; justify-content: center; font-size: 1.15rem; font-weight: 800; }
.exercise-audio { margin-bottom: 16px; }
.choice-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 11px; max-width: 570px; margin: 0 auto; }
.choice { position: relative; border: 2px solid #e7e6d8; border-radius: 16px; background: #fff9ec; color: var(--ink); padding: 7px; transition: border-color .16s ease, background-color .16s ease; }
.choice:hover { border-color: #a5bd9e; background: #f4f6e7; }
.choice.correct { border-color: #50875f; background: #e9f3e6; }
.choice.incorrect { border-color: #c35745; background: #fbe9e2; }
.picture-choice { min-height: 126px; display: grid; place-items: center; }
.picture-choice img { width: 100%; max-width: 155px; height: 133px; object-fit: contain; }
.picture-choice:disabled { cursor: default; opacity: .68; }
.picture-choice:disabled:hover { border-color: #e7e6d8; background: #fff9ec; }
.word-review-tile {
  min-width: 0;
  display: grid;
  grid-template-rows: clamp(72px, 16vw, 124px) minmax(2.8rem, 1fr) auto auto;
  justify-items: center;
  align-items: center;
  gap: 3px;
  padding: 9px 5px;
}
.word-review-tile img { width: 100%; height: 100%; object-fit: contain; }
.word-review-tile.is-playing { border-color: #50875f; background: #e9f3e6; }
.review-word { font-size: clamp(.88rem, 2.8vw, 1.15rem); line-height: 1.35; font-weight: 720; overflow-wrap: anywhere; }
.review-meaning { color: var(--subtle); font-size: .88rem; font-weight: 750; }
.review-speaker { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: #e4efe3; color: var(--green-dark); }
.word-clue, .scene-clue { width: fit-content; max-width: 100%; margin: 0 auto 14px; padding: 12px 20px; border-radius: 16px; }
.word-clue img { width: 144px; height: 120px; object-fit: contain; }
.scene-clue { background: #fcf0d5; color: #654a2b; font-size: 1.08rem; font-weight: 850; }
.scene-clue .button { margin-top: 9px; }
.audio-answer { min-width: 0; display: grid; gap: 5px; padding: 7px; border: 1px solid var(--line); border-radius: 14px; background: #fff9ec; }
.audio-answer .button { position: relative; padding-inline: 6px; font-size: .92rem; }
.audio-answer .button.correct { border-color: #50875f; background: #e9f3e6; }
.audio-answer .button.incorrect { border-color: #c35745; background: #fbe9e2; }
.audio-answer .answer-mark:not(:empty) { display: none; }
.picture-choice.correct:disabled { opacity: 1; }
.answer-mark .icon { width: 17px; height: 17px; }
.answer-mark:not(:empty) { display: grid; place-items: center; position: absolute; bottom: 6px; right: 6px; width: 24px; height: 24px; border-radius: 100%; color: white; background: #457b53; }
.incorrect .answer-mark:not(:empty) { background: #9f4538; }
.answer-feedback { margin-top: 9px; min-height: 23px; color: #7c5147; font-weight: 800; }
.answer-feedback.positive, #trace-status { color: var(--green-dark); }
.letter-choices { max-width: 450px; grid-template-columns: repeat(var(--choices), minmax(0, 1fr)); }
.letter-choice { min-width: 48px; min-height: 62px; font-size: clamp(1.6rem, 4.2vw, 2.28rem); font-weight: 720; line-height: 1; padding-top: 13px; }
.letter-choices .letter-choice { min-height: 91px; }
.activity-actions { border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 16px; padding-top: 17px; }
.activity-actions .primary { min-width: 116px; }
.audio-feedback { margin-top: 12px; color: #844637; font-size: .94rem; font-weight: 800; }

.trace-pad { position: relative; margin: 0 auto; width: min(100%, 440px); aspect-ratio: 440 / 230; display: grid; place-items: center; overflow: hidden; border: 2px solid #dbdfcf; border-radius: 18px; background: repeating-linear-gradient(to bottom, transparent 0 22%, #ececdf 22% 22.8%), #fff9ed; }
.trace-guide { position: absolute; font-size: clamp(4.7rem, 17vw, 9.3rem); line-height: 1; padding-top: .15em; color: #aabfac; font-weight: 450; user-select: none; }
.trace-pad canvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; cursor: crosshair; }
.trace-tools { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 11px; }
.trace-tools .button { font-size: .89rem; }
.story-frame { background: #edf0e4; }
.story-line { color: var(--ink); display: block; font-size: clamp(1.13rem, 3.2vw, 1.75rem); font-weight: 750; }
.story-nav { margin: 12px auto 0; display: flex; justify-content: space-between; align-items: center; gap: 7px; max-width: 575px; }
.story-nav span { color: var(--subtle); font-size: .88rem; font-weight: 800; }
.phrase-card { background: #eaf2e5; border-radius: 20px; padding: 24px 12px; margin-inline: auto; max-width: 560px; }
.paired-phrases { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.home-prompt { display: flex; align-items: flex-start; gap: 11px; max-width: 560px; margin: 16px auto 0; padding: 13px 14px; border-radius: 14px; background: #fcf0d5; text-align: left; color: #654a2b; }
.home-prompt .icon { margin-top: 2px; }
.home-prompt p { margin-top: 2px; }
.completion { padding-top: 40px; padding-bottom: 35px; }
.completion .eyebrow { justify-content: center; margin-block: 14px 8px; }
.completion-star { display: grid; place-items: center; margin: 0 auto; width: 83px; height: 83px; border-radius: 26px; background: #faedcd; color: #9b6220; transform: rotate(-6deg); }
.completion-star .icon { width: 51px; height: 51px; fill: #f5c65f; stroke-width: 1.5px; }
.completion-tamil { color: var(--green); font-weight: 780; font-size: 1.3rem; margin: 10px 0 2px; }
.completion-links { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 22px; }

.sub-hero {
  min-height: 208px;
  padding: 33px clamp(23px, 5vw, 54px);
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: flex;
  gap: 24px;
  justify-content: space-between;
  align-items: center;
  border-radius: var(--radius-lg);
  margin-bottom: 23px;
}
.sub-hero h1 { font-size: clamp(2.5rem, 5vw, 4.35rem); margin: 5px 0 7px; letter-spacing: -.052em; }
.sub-hero p:last-child { font-size: 1.05rem; max-width: 570px; color: #445e50; }
.alphabet-hero { background: #dfeee1; }
.alphabet-hero .button { margin-top: 13px; }
.practice-progress { margin-top: 15px; width: min(100%, 420px); color: var(--green-dark); }
.practice-families { display: grid; grid-template-columns: repeat(9, minmax(0, 1fr)); gap: 8px; margin: 15px 0 23px; }
.practice-family {
  min-height: 64px;
  display: grid;
  place-content: center;
  gap: 3px;
  padding: 6px 3px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f9eddb;
  color: var(--green-dark);
  font-weight: 800;
}
.practice-family .tamil { font-size: 1.45rem; line-height: 1.22; }
.practice-family span:last-child { font-size: .8rem; }
.practice-family:hover, .practice-family[aria-pressed="true"] { border-color: #6c9d81; background: #dcebdd; }
.alphabet-art { display: flex; align-items: center; justify-content: center; flex-shrink: 0; gap: 9px; padding-right: 10px; }
.alphabet-art span { display: grid; place-items: center; width: 74px; height: 74px; border-radius: 21px; padding-top: 7px; background: #f9d9bf; color: #7d3d27; font-size: 1.94rem; font-weight: 750; transform: rotate(-10deg) translateY(9px); box-shadow: 0 4px 0 #59735928; }
.alphabet-art span:nth-child(2) { background: #fae8a9; color: #744b19; transform: rotate(5deg) translateY(-9px); }
.alphabet-art span:nth-child(3) { background: #eaddf1; color: #61406e; transform: rotate(13deg) translateY(12px); }
.alphabet-layout, .progress-layout, .family-layout { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); gap: 21px; align-items: start; }
.alphabet-panel, .builder-panel, .content-panel { border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); padding: clamp(16px, 3vw, 25px); min-width: 0; }
.alphabet-panel, .builder-panel { box-shadow: var(--shadow); }
.alphabet-tabs { display: flex; flex-wrap: wrap; gap: 5px; margin: 14px 0 15px; border-bottom: 1px solid var(--line); padding-bottom: 9px; }
.alphabet-tabs button { border: 1px solid transparent; border-radius: 10px; color: var(--subtle); background: transparent; font-size: .89rem; font-weight: 850; min-height: 43px; padding: 7px 8px; }
.alphabet-tabs button:hover { background: #f2f3e8; }
.alphabet-tabs button[aria-selected="true"] { background: #e5efe3; color: var(--green-dark); }
.alphabet-tabs button span { display: inline-block; padding: 1px 5px; border-radius: 10px; background: #fffaf0; font-size: .77rem; }
#letter-panel h3 { font-size: 1.17rem; }
#letter-panel p { color: var(--subtle); font-size: .94rem; margin-block: 3px 12px; }
.letter-picks.with-wheel { display: grid; grid-template-columns: minmax(112px, 1fr) minmax(0, 3fr); gap: 14px; align-items: start; }
.alphabet-letters { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 9px; }
.with-wheel .alphabet-letters { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.listen-tile {
  --tile: #eef1e8;
  --tile-ink: #345d48;
  min-width: 0;
  min-height: 78px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 3px;
  padding: 8px 2px 6px;
  border: 2px solid transparent;
  border-radius: 16px;
  color: var(--tile-ink);
  background: var(--tile);
  box-shadow: 0 3px 0 color-mix(in srgb, var(--tile-ink) 23%, var(--tile));
  touch-action: manipulation;
  transition: transform .14s ease, box-shadow .14s ease, border-color .14s ease;
}
.listen-tile[data-color="orange"] { --tile: #f8e2cd; --tile-ink: #804221; }
.listen-tile[data-color="blue"] { --tile: #e3edfa; --tile-ink: #315a77; }
.listen-tile[data-color="purple"] { --tile: #f4e7fa; --tile-ink: #634475; }
.listen-tile[data-color="green"] { --tile: #e5efdc; --tile-ink: #3d653d; }
.listen-tile[data-color="pink"] { --tile: #f9e2ec; --tile-ink: #89395c; }
.listen-tile[data-color="yellow"] { --tile: #faedc0; --tile-ink: #754e13; }
.listen-tile[data-color="teal"] { --tile: #daf1eb; --tile-ink: #28655f; }
.listen-tile .tamil { font-size: clamp(1.42rem, 2.7vw, 2.07rem); line-height: 1.2; font-weight: 750; padding-top: 3px; }
.listen-tile .icon { width: 15px; height: 15px; opacity: .78; }
.listen-tile:hover, .listen-tile.is-playing { border-color: var(--tile-ink); }
.listen-tile:active, .listen-tile.is-playing { transform: translateY(2px); box-shadow: 0 1px 0 color-mix(in srgb, var(--tile-ink) 23%, var(--tile)); }
.listen-tile.is-playing .icon { opacity: 1; }

.wheel-field { min-width: 0; }
.wheel-label { display: block; font-size: .94rem; font-weight: 900; color: var(--ink); margin-bottom: 4px; }
.letter-wheel {
  --wheel-row: 48px;
  position: relative;
  isolation: isolate;
  border-radius: 16px;
  border: 1px solid #cfdccd;
  background: #fafdf4;
}
.letter-wheel::before {
  content: '';
  position: absolute;
  z-index: -1;
  inset: calc(50% - var(--wheel-row) / 2) 5px auto;
  height: var(--wheel-row);
  border: 1px solid #b7d1b7;
  border-radius: 11px;
  background: #dcecdc;
  pointer-events: none;
}
.wheel-scroll {
  height: calc(3 * var(--wheel-row));
  padding-block: var(--wheel-row);
  overflow-y: auto;
  overscroll-behavior-y: contain;
  scrollbar-width: none;
  scroll-snap-type: y mandatory;
  mask-image: linear-gradient(to bottom, transparent, black 22%, black 78%, transparent);
}
.wheel-scroll:focus-visible { outline: none; }
.letter-wheel:has(.wheel-scroll:focus-visible) { outline: 3px solid #af5d19; outline-offset: 4px; }
.wheel-item {
  display: grid;
  place-items: center;
  height: var(--wheel-row);
  scroll-snap-align: center;
  cursor: pointer;
  padding-top: 6px;
  color: #597563;
  font: 650 1.44rem/1 var(--tamil);
  user-select: none;
}
.wheel-item[aria-selected="true"] { color: var(--green-dark); font-weight: 800; }
.wheel-hint { display: block; margin-top: 4px; color: var(--subtle); font-size: .82rem; font-weight: 750; text-align: center; }
.filter-label { font-size: .93rem; font-weight: 850; color: var(--subtle); display: block; }
.filter-label { margin: 8px 0 12px; }
select { min-height: 44px; border: 1px solid #d4dfcf; border-radius: 10px; appearance: none; padding: 7px 29px 6px 10px; background: linear-gradient(45deg, transparent 50%, #326450 50%) calc(100% - 15px) 52% / 5px 5px no-repeat, linear-gradient(135deg, #326450 50%, transparent 50%) calc(100% - 10px) 52% / 5px 5px no-repeat, #fffcf4; color: var(--ink); font-weight: 750; }
.filter-label select { margin-left: 7px; }
.builder-panel { background: #f0f4e9; }
.builder-panel h2, .family-check h2 { margin-top: 9px; }
.builder-selects { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 16px 0 10px; }
.builder-formula { min-height: 105px; background: var(--paper); border-radius: 15px; display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 5px; color: var(--ink); font-size: clamp(1.05rem, 2.4vw, 1.62rem); font-weight: 800; padding: 7px; }
.builder-formula .built-letter { font-size: clamp(1.7rem, 4vw, 2.7rem); color: var(--green); }
#builder-result .button { margin-top: 10px; width: 100%; }

.progress-hero { background: #f8ecd1; }
.progress-art { flex-shrink: 0; width: 160px; height: 113px; color: #a96924; position: relative; }
.progress-art .icon:first-child { width: 109px; height: 109px; fill: #f5c765; stroke-width: 1.2px; transform: rotate(11deg); }
.progress-art .icon:nth-child(2) { position: absolute; top: 6px; right: 15px; width: 30px; height: 30px; color: #c88138; }
.progress-art .icon:nth-child(3) { position: absolute; bottom: 0; right: 22px; color: #70936e; }
.progress-lessons, .course-list, .prompt-list { list-style: none; padding: 0; margin: 12px 0 0; }
.progress-lessons li + li, .course-list li + li, .prompt-list li + li { border-top: 1px solid var(--line); }
.progress-lessons a, .locked-progress, .course-list li { display: flex; align-items: center; gap: 12px; padding: 10px 0; text-decoration: none; }
.progress-lessons a:hover strong, .course-list a:hover { text-decoration: underline; text-underline-offset: 3px; }
.progress-lessons li > * > .icon { margin-left: auto; color: var(--green); }
.progress-letter { display: grid; place-items: center; flex: 0 0 52px; height: 44px; border-radius: 11px; padding: 4px 4px 0; font-weight: 730; }
.progress-lessons small, .course-list small { display: block; color: var(--subtle); font-size: .86rem; }
.course-list a { font-weight: 850; text-underline-offset: 3px; color: var(--green-dark); }
.course-list .side-icon { flex: 0 0 39px; }
.course-panel .button { margin-top: 12px; }

.family-hero { background: #f8e6db; }
.family-hero div { position: relative; z-index: 1; }
.family-hero img { position: absolute; bottom: 0; right: 110px; width: 145px; height: 140px; object-fit: contain; object-position: bottom; transform: rotate(-4deg); }
.family-hero img:last-child { right: 18px; width: 132px; transform: rotate(6deg); }
.family-side { display: grid; gap: 17px; }
.prompt-list li { display: flex; align-items: center; justify-content: space-between; gap: 9px; padding: 12px 0; }
.prompt-list .tamil { color: var(--ink); font-size: 1.1rem; font-weight: 730; }
.prompt-list p { color: var(--subtle); font-size: .93rem; margin-top: 3px; }
.prompt-list button { flex-shrink: 0; }
.family-sounds { display: grid; gap: 4px; flex-shrink: 0; }
.check-letter-row { display: flex; min-height: 67px; align-items: center; gap: 13px; }
#check-glyph { font-size: 2.48rem; color: var(--green-dark); width: 72px; text-align: center; }
.check-instructions { color: var(--subtle); padding-left: 20px; font-size: .93rem; line-height: 1.5; }
.family-check fieldset { margin: 9px 0 0; border: 1px solid var(--line); border-radius: 13px; padding: 6px 10px; }
.family-check legend { font-weight: 850; color: var(--ink); }
.check-row { display: flex; gap: 8px; align-items: center; min-height: 38px; color: var(--subtle); font-size: .91rem; cursor: pointer; }
.check-row input { accent-color: var(--green); width: 17px; height: 17px; flex-shrink: 0; }
.family-settings > p { font-size: .93rem; }
.family-settings .check-row { margin-top: 6px; }

@media (max-width: 1000px) {
  .family-link { min-width: 44px; padding-inline: 8px; }
  .family-link span { display: none; }
  .home-layout { grid-template-columns: minmax(0, 1fr) 210px; gap: 16px; }
  .lessons-grid { gap: 10px; }
  .lesson-visual { height: 91px; padding-left: 10px; }
  .hero { min-height: 370px; }
  .hero-art { width: 56%; object-fit: contain; object-position: right center; mask-image: linear-gradient(to right, transparent, black 13%); }
  .hero-copy { padding-left: 32px; width: 46%; }
  .family-hero p:last-child { max-width: 58%; }
}

@media (max-width: 780px) {
  .page, .header-inner, .footer-inner { width: min(100% - 36px, 1184px); }
  .header-inner { grid-template-columns: 1fr 1fr; padding: 9px 0 7px; gap: 4px 10px; }
  .main-nav { grid-column: 1 / -1; grid-row: 2; justify-content: center; gap: 3px; }
  .main-nav a { flex: 1; padding-inline: 6px; }
  .header-tools { grid-column: 2; grid-row: 1; gap: 6px; }
  .family-link span { display: inline; }
  .page { padding-top: 23px; }
  .home-layout { grid-template-columns: 1fr; gap: 18px; margin-top: 24px; }
  .home-aside { grid-template-columns: 1fr 1fr; gap: 10px; }
  .side-panel { padding: 15px; }
  .alphabet-layout, .family-layout, .progress-layout { grid-template-columns: 1fr; gap: 14px; }
}

@media (max-width: 570px) {
  .page, .header-inner, .footer-inner { width: calc(100% - 28px); }
  .page { padding-bottom: 38px; }
  .brand { gap: 7px; font-size: 1.05rem; }
  .brand-mark { width: 36px; height: 36px; font-size: 1.17rem; }
  .family-link { padding: 6px; font-size: .86rem; gap: 5px; }
  .family-link span { display: none; }
  .main-nav a { font-size: .91rem; gap: 5px; }
  .hero { display: block; border-radius: 20px; }
  .hero-copy { padding: 24px 21px 0; width: 100%; }
  .hero h1 { font-size: clamp(2.7rem, 11.7vw, 4.5rem); max-width: none; margin-block: 10px 8px; }
  .hero h1:lang(da) { font-size: clamp(2.6rem, 10.4vw, 4rem); max-width: none; }
  .hero-description { margin-bottom: 15px; }
  .hero .button { min-height: 46px; }
  .hero-art { position: static; z-index: auto; width: 100%; height: auto; max-height: 265px; margin-top: -4px; object-fit: cover; object-position: 50% 54%; mask-image: linear-gradient(to bottom, transparent, black 13%); }
  .hero { display: flex; flex-direction: column; }
  .hero-art { order: 2; }
  .hero-copy { order: 1; }
  .lessons-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .lesson-card { border-radius: 15px; }
  .lesson-card > a, .locked-card { padding: 7px; }
  .lesson-card-copy { padding-inline: 3px; }
  .lesson-visual { height: 86px; border-radius: 9px; }
  .lesson-card h3 { font-size: 1.02rem; }
  .lesson-meta { font-size: .77rem; }
  .lesson-card p { font-size: .84rem; }
  .section-heading h2, .content-panel h2, .alphabet-panel h2, .builder-panel h2 { font-size: 1.62rem; }
  .activity-card { border-radius: 19px; padding: 20px 12px 14px; }
  .lesson-top { grid-template-columns: 1fr 1.65fr auto; gap: 5px; }
  .exit-lesson { padding-inline: 8px; gap: 3px; font-size: .88rem; }
  .exit-lesson .icon { width: 16px; }
  .lesson-top-title strong { font-size: 1rem; }
  .steps { gap: 4px; margin-block: 13px; }
  .steps li { font-size: .75rem; }
  .word-display { gap: 6px; padding: 9px; min-height: 160px; }
  .word-display img { height: 130px; }
  .word-display .button { padding-inline: 7px; font-size: .86rem; }
  .word-display .button .icon { width: 16px; }
  .picture-choice { min-height: 104px; }
  .picture-choice img { height: 90px; }
  .choice-grid { gap: 6px; }
  .letter-choices { grid-template-columns: repeat(var(--mobile-choices), minmax(0, 1fr)); }
  .practice-callout { align-items: flex-start; flex-direction: column; gap: 9px; padding: 15px; }
  .practice-families { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 5px; }
  .audio-answer { padding: 4px; }
  .audio-answer .button { padding-inline: 3px; font-size: .81rem; gap: 3px; }
  .audio-answer .button > .icon { width: 14px; }
  .paired-phrases .button, .family-sounds .button { padding-inline: 6px; font-size: .86rem; }
  .story-nav .button { font-size: .85rem; padding-inline: 7px; }
  .sub-hero { min-height: 154px; padding: 20px 16px; border-radius: 19px; margin-bottom: 13px; }
  .sub-hero h1 { font-size: 2.48rem; }
  .sub-hero p:last-child { font-size: .94rem; }
  .alphabet-art, .progress-art { display: none; }
  .alphabet-letters { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .letter-picks.with-wheel { grid-template-columns: 1fr; }
  .letter-picks .wheel-field { max-width: 204px; }
  .family-hero p:last-child { max-width: 72%; }
  .family-hero img { display: none; }
  .family-hero img:last-child { display: block; right: -3px; width: 87px; height: 92px; opacity: .88; z-index: -1; }
  .prompt-list button { min-width: 44px; padding-inline: 8px; font-size: .85rem; }
}

@media (max-width: 355px) {
  .brand { gap: 6px; font-size: .98rem; }
  .brand-mark { width: 32px; height: 32px; }
  .header-tools { gap: 3px; }
  .steps li { font-size: .71rem; }
  .practice-families { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .alphabet-letters, .with-wheel .alphabet-letters { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

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