:root {
  --ink: #172523;
  --muted: #66726f;
  --paper: #f4efe5;
  --surface: #fffdf8;
  --surface-2: #ece4d5;
  --line: #d9cdb9;
  --teal: #0d696b;
  --teal-dark: #084f51;
  --teal-soft: #dceced;
  --gold: #a66516;
  --gold-soft: #f4e7c9;
  --red: #a33a2a;
  --green: #257357;
  --shadow: 0 18px 50px rgba(43, 37, 26, .07);
  --serif: Georgia, "Times New Roman", serif;
  --sans: "Segoe UI", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(circle at 8% 4%, rgba(255,255,255,.78), transparent 25rem),
    var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
}
button, input, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
button { color: inherit; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(244, 239, 229, .94);
  backdrop-filter: blur(14px);
  border-top: 4px solid var(--teal);
  border-bottom: 1px solid var(--line);
}
.header-inner, .container, .wide-container, .footer-inner {
  width: min(100% - 40px, 1120px);
  margin-inline: auto;
}
.container { max-width: 820px; }
.header-inner { padding: 17px 0 13px; }
.header-row { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font: 700 20px/1.1 var(--serif); white-space: nowrap; }
.brand-mark { width: 25px; height: 25px; display: grid; place-items: center; border-radius: 7px; background: var(--teal); color: white; font: 700 14px/1 var(--sans); }
.global-progress { color: var(--muted); font-size: 13px; font-weight: 600; white-space: nowrap; }
.nav-scroller { overflow-x: auto; scrollbar-width: none; margin-top: 13px; padding-bottom: 1px; }
.nav-scroller::-webkit-scrollbar { display: none; }
.main-nav { display: flex; gap: 8px; width: max-content; }
.main-nav a { padding: 9px 15px; border: 1px solid var(--line); border-radius: 999px; background: rgba(255,253,248,.76); font-size: 13px; font-weight: 750; white-space: nowrap; transition: .2s ease; }
.main-nav a:hover { border-color: var(--teal); color: var(--teal); transform: translateY(-1px); }
.main-nav a.active { color: white; border-color: var(--teal); background: var(--teal); box-shadow: 0 6px 16px rgba(13,105,107,.18); }

main { flex: 1; }
.page { padding: clamp(34px, 6vw, 72px) 0 76px; }
.eyebrow { margin: 0 0 10px; color: var(--gold); font-size: 12px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, .display { font-family: var(--serif); font-weight: 500; letter-spacing: -.025em; }
h1 { margin-bottom: 14px; font-size: clamp(38px, 6vw, 60px); line-height: 1.02; }
.task-title { font-size: clamp(34px, 5vw, 48px); }
h2 { margin-bottom: 10px; font-size: clamp(28px, 4vw, 36px); line-height: 1.15; }
h3 { margin-bottom: 7px; line-height: 1.25; }
.lead { max-width: 720px; margin-bottom: 0; color: #465653; font-size: clamp(16px, 2vw, 18px); }
.back-link { display: inline-flex; align-items: center; gap: 8px; margin-bottom: 25px; color: var(--teal); font-size: 13px; font-weight: 750; }
.back-link::before { content: "←"; font-size: 18px; }
.intro-note { margin: 26px 0 30px; padding: 16px 18px; border: 1px solid #dfcfaa; border-radius: 15px; background: var(--gold-soft); font-size: 14px; }

.hero { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(310px, .75fr); gap: 64px; align-items: center; min-height: 490px; }
.hero-copy { padding: 28px 0; }
.hero-title { max-width: 620px; margin-bottom: 12px; font-size: clamp(56px, 8vw, 92px); }
.hero-kz { margin-bottom: 22px; color: var(--teal); font: italic 24px/1.2 var(--serif); }
.correction-chips { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 25px; }
.correction-chip { padding: 7px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); font-size: 13px; }
.wrong { color: var(--red); text-decoration: line-through; }
.right { color: var(--teal); font-weight: 800; }
.actions { display: flex; flex-wrap: wrap; gap: 11px; margin-top: 28px; }
.btn { min-height: 45px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 19px; border: 1px solid transparent; border-radius: 999px; cursor: pointer; font-size: 13px; font-weight: 800; transition: .2s ease; }
.btn:hover { transform: translateY(-1px); }
.btn-primary { color: white; background: var(--teal); box-shadow: 0 8px 20px rgba(13,105,107,.16); }
.btn-primary:hover { background: var(--teal-dark); }
.btn-secondary { border-color: var(--line); background: var(--surface); }
.btn-secondary:hover { border-color: var(--teal); color: var(--teal); }

.workbook { padding: 25px; border: 1px solid var(--line); border-radius: 22px; background: rgba(255,253,248,.88); box-shadow: var(--shadow); }
.workbook-top, .section-heading-row, .progress-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.workbook-kicker { color: var(--gold); font-size: 11px; font-weight: 850; letter-spacing: .12em; text-transform: uppercase; }
.workbook-total { font: 36px/1 var(--serif); }
.workbook p { margin: 8px 0 16px; color: var(--muted); font-size: 12px; }
.workbook-list { display: grid; gap: 9px; }
.workbook-item { display: grid; grid-template-columns: 32px 1fr auto; align-items: center; gap: 10px; padding: 11px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.item-number { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; background: var(--teal-soft); color: var(--teal); font-size: 12px; font-weight: 850; }
.workbook-item strong { display: block; font-size: 13px; line-height: 1.3; }
.workbook-item small { color: var(--muted); font-size: 11px; }
.workbook-status { color: var(--teal); font-size: 11px; font-weight: 800; }

.project-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 12px auto 70px; }
.project-card { min-height: 190px; padding: 24px; border: 1px solid #dfcfaa; border-radius: 18px; background: var(--gold-soft); }
.project-card .number { color: var(--gold); font: 14px/1 var(--serif); }
.project-card h3 { margin-top: 16px; font: 28px/1.1 var(--serif); }
.project-card p { margin: 12px 0 0; font-size: 13px; }
.tasks-section { scroll-margin-top: 145px; }
.tasks-section > p { color: var(--muted); }
.task-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 15px; margin-top: 25px; }
.task-card { min-height: 230px; display: flex; flex-direction: column; padding: 24px; border: 1px solid var(--line); border-radius: 19px; background: var(--surface); transition: .22s ease; }
.task-card:hover { transform: translateY(-3px); border-color: #b9a98c; box-shadow: var(--shadow); }
.task-card-top { display: flex; justify-content: space-between; align-items: center; gap: 15px; }
.task-icon { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; background: var(--teal-soft); color: var(--teal); font-size: 20px; }
.task-score { color: var(--teal); font-size: 12px; font-weight: 850; }
.task-label { margin: 19px 0 7px; color: var(--gold); font-size: 11px; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.task-card h3 { margin: 0 0 7px; font: 26px/1.15 var(--serif); }
.task-card p { margin-bottom: 18px; color: var(--muted); font-size: 13px; }
.task-link { margin-top: auto; color: var(--teal); font-size: 13px; font-weight: 850; }

.panel { border: 1px solid var(--line); border-radius: 18px; background: var(--surface); box-shadow: 0 8px 30px rgba(43,37,26,.035); }
.progress-row { margin: 28px 0 12px; }
.progress-number { font: 34px/1 var(--serif); }
.progress-caption { color: var(--muted); font-size: 12px; }
.segmented { display: flex; gap: 9px; margin-bottom: 20px; }
.segmented button { flex: 1; min-height: 44px; padding: 9px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); cursor: pointer; font-size: 13px; font-weight: 800; }
.segmented button.active { border-color: var(--teal); color: white; background: var(--teal); }
.chat { overflow: hidden; margin-bottom: 20px; }
.chat-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 15px 18px; color: white; background: var(--teal); font-size: 12px; }
.chat-head strong { font-size: 13px; }
.chat-body { padding: 22px; background: var(--surface-2); }
.bubble { max-width: 86%; padding: 17px 18px; border-radius: 10px 22px 22px 22px; background: var(--surface); font: 18px/1.65 var(--serif); }
.bubble-label { margin: 8px 0 0; color: var(--muted); font-size: 11px; }
label { display: block; margin-bottom: 7px; font-size: 13px; font-weight: 800; }
textarea, input[type="text"] { width: 100%; border: 1px solid var(--line); border-radius: 15px; outline: none; background: var(--surface); color: var(--ink); }
textarea { min-height: 145px; padding: 15px 16px; resize: vertical; }
input[type="text"] { height: 48px; padding: 0 15px; }
textarea:focus, input[type="text"]:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(13,105,107,.12); }
.feedback { min-height: 28px; margin-top: 12px; font-size: 13px; font-weight: 700; }
.success { color: var(--green); }
.warning { color: var(--red); }

.word-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 13px; margin: 18px 0 24px; }
.word-card { padding: 18px; }
.word-card-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 12px; }
.word-number { color: var(--gold); font-size: 11px; font-weight: 850; }
.wrong-word { color: var(--red); font: 26px/1.1 var(--serif); }
.input-row { display: grid; grid-template-columns: 1fr 28px; gap: 8px; align-items: center; }
.input-status { text-align: center; font-weight: 900; }

.reading-card { overflow: hidden; }
.reading-head { padding: 14px 18px; color: white; background: var(--teal); font-size: 12px; font-weight: 800; }
.reading-body { padding: clamp(20px, 4vw, 30px); background: var(--surface-2); }
.reading-text { margin: 0; padding: clamp(18px, 4vw, 26px); border-radius: 18px; background: var(--surface); font: clamp(17px, 2.3vw, 21px)/1.65 var(--serif); }
.audio-card { padding: 22px; }
.audio-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.audio-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 18px; }
.stat { padding: 15px 8px; border: 1px solid var(--line); border-radius: 13px; text-align: center; background: white; }
.stat small { display: block; color: var(--muted); font-size: 11px; }
.stat strong { font: 25px/1.3 var(--serif); }
.diff-text { padding: 18px; border: 1px solid var(--line); border-radius: 14px; background: white; line-height: 2.1; }
.hidden { display: none !important; }

.challenge-progress { padding: 22px; margin: 28px 0 20px; }
.meter { height: 8px; overflow: hidden; margin-top: 15px; border-radius: 999px; background: var(--surface-2); }
.meter-fill { height: 100%; width: 0; background: var(--teal); transition: width .25s ease; }
.name-field { margin-bottom: 18px; }
.day-list { display: grid; gap: 12px; }
.day-card { padding: 0; overflow: hidden; }
.day-summary { display: grid; grid-template-columns: 44px 1fr auto; gap: 12px; align-items: center; padding: 15px 17px; cursor: pointer; }
.day-number { width: 40px; height: 40px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; font-family: var(--serif); }
.day-summary h3 { margin: 0; font-size: 14px; }
.day-summary p { margin: 2px 0 0; color: var(--muted); font-size: 12px; }
.day-check { min-width: 79px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); cursor: pointer; font-size: 12px; font-weight: 800; }
.day-card.done .day-check { color: white; border-color: var(--teal); background: var(--teal); }
.day-card.done .day-number { color: white; border-color: var(--teal); background: var(--teal); }
.day-note { padding: 0 17px 17px 73px; }
.rules { margin-top: 34px; }
.rule-list { display: grid; gap: 9px; padding: 0; list-style: none; }
.rule-list li { padding: 13px 15px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); font-size: 13px; }
.letters { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.letter { padding: 15px; border: 1px solid var(--line); border-radius: 15px; background: var(--surface); }
.letter strong { display: block; color: var(--teal); font: 24px/1 var(--serif); }
.letter small { color: var(--muted); font-size: 10px; }

.site-footer { margin-top: auto; border-top: 1px solid var(--line); }
.footer-inner { display: flex; justify-content: space-between; gap: 20px; padding: 24px 0; color: var(--muted); font-size: 12px; }
.footer-inner strong { color: var(--ink); font-family: var(--serif); font-size: 15px; }

@media (max-width: 820px) {
  .header-inner, .container, .wide-container, .footer-inner { width: min(100% - 28px, 1120px); }
  .header-inner { padding-top: 13px; }
  .global-progress { font-size: 11px; }
  .hero { grid-template-columns: 1fr; gap: 18px; min-height: 0; padding: 14px 0 42px; }
  .hero-copy { padding-bottom: 5px; }
  .hero-title { font-size: clamp(52px, 15vw, 76px); }
  .project-strip { grid-template-columns: 1fr; margin-bottom: 50px; }
  .project-card { min-height: 0; }
  .task-grid { grid-template-columns: 1fr; }
  .task-card { min-height: 210px; }
  .word-grid { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .letters { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 520px) {
  body { font-size: 15px; }
  .site-header { position: relative; }
  .brand { font-size: 18px; }
  .brand-mark { width: 23px; height: 23px; }
  .page { padding: 30px 0 52px; }
  .main-nav a { padding: 8px 13px; font-size: 12px; }
  .hero-title { font-size: 54px; }
  .hero-kz { font-size: 21px; }
  .workbook { padding: 19px; }
  .actions .btn { flex: 1 1 100%; }
  .task-title { overflow-wrap: anywhere; }
  .segmented { overflow-x: auto; scrollbar-width: none; }
  .segmented button { min-width: 105px; }
  .bubble { max-width: 100%; font-size: 17px; }
  .chat-body { padding: 17px; }
  .audio-top { align-items: flex-start; flex-direction: column; }
  .audio-actions .btn { padding-inline: 13px; }
  .day-summary { grid-template-columns: 38px 1fr; }
  .day-check { grid-column: 2; justify-self: start; }
  .day-note { padding-left: 17px; }
  .letters { grid-template-columns: repeat(2, 1fr); }
  .footer-inner { flex-direction: column; gap: 4px; }
}

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