/* Đảo ngược cận thị — tranh minh họa, ảnh nền và mô phỏng thị giác */
:root {
  --sc-sky0: #9fcde0; --sc-sky1: #d3eaee; --sc-sky2: #f2efdf; --sc-sky3: #fbdfb8;
  --sc-glow: rgba(255, 222, 150, .9); --sc-sun: #ffd27f; --sc-cloud: #ffffff; --sc-bird: #33463f;
  --sc-m1: #a6c1c0; --sc-snow: #eef5f4; --sc-m2: #84a998; --sc-m3: #5d8c72; --sc-water: #bfe0e4;
  --sc-road: #e2d6bb; --sc-roadline: #fffaf0; --sc-line: #22322c; --sc-sign: #1f6a4f; --sc-signtext: #ffffff; --sc-post: #5f5f57;
  --sc-trunk: #4a3f30; --sc-leaf1: #3c7656; --sc-leaf2: #66a275; --sc-grass: #4c7c5c;
  --sc-house: #f6f0e3; --sc-roof: #b5583b; --sc-win: #46616c;
  --sc-table: #d3ae80; --sc-table2: #b88f5d; --sc-cover: #7a4b32; --sc-page: #fffdf6; --sc-page2: #f6f0e2; --sc-text: #262626; --sc-shadow: rgba(70, 45, 20, .22);
  --glass: rgba(255, 255, 255, .72);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --sc-sky0: #0c1424; --sc-sky1: #222d48; --sc-sky2: #6a4b62; --sc-sky3: #e0895f;
    --sc-glow: rgba(255, 150, 100, .55); --sc-sun: #ffb07a; --sc-cloud: #6c6079; --sc-bird: #0c0e13;
    --sc-m1: #3d4962; --sc-snow: #8792a8; --sc-m2: #2b3a44; --sc-m3: #1c2b28; --sc-water: #6d6880;
    --sc-road: #4a453d; --sc-roadline: #8a8578; --sc-line: #06090a; --sc-sign: #2a7356; --sc-signtext: #e9f2eb; --sc-post: #1c1c1a;
    --sc-trunk: #121210; --sc-leaf1: #1a3225; --sc-leaf2: #233f2e; --sc-grass: #1d3127;
    --sc-house: #8d8373; --sc-roof: #5a2e24; --sc-win: #ffd479;
    --sc-table: #5e4633; --sc-table2: #4a3627; --sc-cover: #4b2c1f; --sc-page: #e9e3d5; --sc-page2: #ddd5c4; --sc-text: #1b1b1b; --sc-shadow: rgba(0, 0, 0, .4);
    --glass: rgba(23, 36, 30, .72);
  }
}
:root[data-theme="dark"] {
  --sc-sky0: #0c1424; --sc-sky1: #222d48; --sc-sky2: #6a4b62; --sc-sky3: #e0895f;
  --sc-glow: rgba(255, 150, 100, .55); --sc-sun: #ffb07a; --sc-cloud: #6c6079; --sc-bird: #0c0e13;
  --sc-m1: #3d4962; --sc-snow: #8792a8; --sc-m2: #2b3a44; --sc-m3: #1c2b28; --sc-water: #6d6880;
  --sc-road: #4a453d; --sc-roadline: #8a8578; --sc-line: #06090a; --sc-sign: #2a7356; --sc-signtext: #e9f2eb; --sc-post: #1c1c1a;
  --sc-trunk: #121210; --sc-leaf1: #1a3225; --sc-leaf2: #233f2e; --sc-grass: #1d3127;
  --sc-house: #8d8373; --sc-roof: #5a2e24; --sc-win: #ffd479;
  --sc-table: #5e4633; --sc-table2: #4a3627; --sc-cover: #4b2c1f; --sc-page: #e9e3d5; --sc-page2: #ddd5c4; --sc-text: #1b1b1b; --sc-shadow: rgba(0, 0, 0, .4);
  --glass: rgba(23, 36, 30, .72);
}

/* Màu các phần của tranh */
.sc-sky0 { stop-color: var(--sc-sky0); } .sc-sky1 { stop-color: var(--sc-sky1); } .sc-sky2 { stop-color: var(--sc-sky2); } .sc-sky3 { stop-color: var(--sc-sky3); }
.sc-glow0 { stop-color: var(--sc-glow); } .sc-glow1 { stop-color: var(--sc-glow); stop-opacity: 0; }
.sc-sun { fill: var(--sc-sun); }
.sc-cloud { fill: var(--sc-cloud); opacity: .72; }
.sc-bird { fill: none; stroke: var(--sc-bird); stroke-width: 2.4; stroke-linecap: round; }
.sc-m1 { fill: var(--sc-m1); } .sc-snow { fill: var(--sc-snow); } .sc-m2 { fill: var(--sc-m2); } .sc-m3 { fill: var(--sc-m3); }
.sc-water { fill: var(--sc-water); } .sc-road { fill: var(--sc-road); }
.sc-roadline { fill: none; stroke: var(--sc-roadline); stroke-width: 3; }
.sc-line { stroke: var(--sc-line); }
.sc-sign { fill: var(--sc-sign); } .sc-signtext { fill: var(--sc-signtext); font: 700 19px var(--font); letter-spacing: .04em; } .sc-post { fill: var(--sc-post); }
.sc-trunk { fill: var(--sc-trunk); } .sc-branch { stroke: var(--sc-trunk); }
.sc-leaf1 { fill: var(--sc-leaf1); } .sc-leaf2 { fill: var(--sc-leaf2); }
.sc-grass { stroke: var(--sc-grass); stroke-width: 3; }
.sc-house { fill: var(--sc-house); } .sc-roof { fill: var(--sc-roof); } .sc-win { fill: var(--sc-win); }
.sc-table { fill: var(--sc-table); } .sc-table2 { fill: var(--sc-table2); } .sc-cover { fill: var(--sc-cover); }
.sc-page { fill: var(--sc-page); } .sc-page2 { fill: var(--sc-page2); } .sc-shadow { fill: var(--sc-shadow); }
.sc-text { fill: var(--sc-text); font-family: var(--serif); }
.scene { display: block; width: 100%; height: 100%; }

/* Nền trang: lớp màu mềm */
body { background-image: radial-gradient(1100px 520px at 105% -8%, color-mix(in srgb, var(--chart-2) 13%, transparent), transparent 62%), radial-gradient(900px 560px at -12% 6%, color-mix(in srgb, var(--brand) 11%, transparent), transparent 60%), radial-gradient(800px 600px at 50% 110%, color-mix(in srgb, var(--chart-3) 8%, transparent), transparent 60%); background-attachment: fixed; }
.card { border-radius: 22px; border-color: color-mix(in srgb, var(--line) 80%, transparent); }
.card.soft, .goals { background: color-mix(in srgb, var(--surface-2) 85%, transparent); }
.btn-glass { background: var(--glass); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); border-color: color-mix(in srgb, var(--ink) 18%, transparent); }

/* Ảnh nền trang chủ */
.hero2 { position: relative; isolation: isolate; border-radius: 30px; overflow: hidden; min-height: 470px; display: flex; align-items: center; margin: 4px 0 18px; box-shadow: var(--shadow); border: 1px solid var(--line); }
.hero2 > .scene { position: absolute; inset: 0; z-index: -2; }
.hero2::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg, color-mix(in srgb, var(--bg) 93%, transparent) 0%, color-mix(in srgb, var(--bg) 78%, transparent) 36%, color-mix(in srgb, var(--bg) 0%, transparent) 66%); }
.hero2-in { padding: 44px 44px 40px; max-width: 640px; }
.hero2 h1 { font-size: clamp(30px, 4.4vw, 50px); line-height: 1.12; margin-bottom: 16px; }
.hero2 .lead { font-size: 18px; color: var(--ink-2); max-width: 34em; }
.today-strip { display: grid; grid-template-columns: minmax(0, 2fr) repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.today-strip .stat { display: flex; flex-direction: column; justify-content: center; gap: 4px; background: color-mix(in srgb, var(--surface) 88%, transparent); border-radius: 18px; padding: 16px 18px; box-shadow: var(--shadow); }
.today-strip .stat b { font-size: 30px; line-height: 1.1; }
.today-strip .stat b small { font-size: 15px; color: var(--ink-2); font-weight: 600; }
.today-strip .stat-wide b { font-size: 36px; }
.teaser h2 { font-size: clamp(20px, 2.6vw, 26px); }
.minis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 6px; }
.minis-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.minis-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.mini { position: relative; display: flex; flex-direction: column; border-radius: 18px; overflow: hidden; text-decoration: none; color: var(--ink); border: 1px solid var(--line); background: var(--surface); transition: transform .15s, box-shadow .15s; }
.mini-img { position: relative; display: block; aspect-ratio: 4 / 3; background: var(--surface-2); }
.mini:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.mini .scene { position: absolute; inset: 0; }
.mini-cap { display: block; padding: 9px 12px 11px; font-size: 13px; line-height: 1.4; color: var(--ink-2); }
.mini-cap b { display: block; color: var(--ink); font-size: 13.5px; }
.compare { margin: 20px 0; }
.compare figcaption { font-size: 13.5px; color: var(--ink-3); margin-top: 8px; }
.step-card .ico { width: 52px; height: 52px; }

/* Dải ảnh nền đầu trang */
.banner { position: relative; isolation: isolate; border-radius: 26px; overflow: hidden; min-height: 168px; display: flex; align-items: flex-end; margin: 0 0 18px; border: 1px solid var(--line); box-shadow: var(--shadow); }
.banner > .scene { position: absolute; inset: 0; z-index: -2; }
.banner::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg, color-mix(in srgb, var(--bg) 92%, transparent) 0%, color-mix(in srgb, var(--bg) 72%, transparent) 42%, transparent 78%); }
.banner-in { padding: 26px 30px; max-width: 640px; }
.banner h1 { margin: 0; font-size: clamp(28px, 3.6vw, 40px); }
.banner p { margin: 6px 0 0; color: var(--ink-2); }

/* Biểu tượng */
.ico { width: 40px; height: 40px; display: block; }
.i-fill { fill: var(--brand-soft); stroke: var(--brand); stroke-width: 2.5; }
.i-line { fill: none; stroke: var(--brand); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.i-accent { fill: none; stroke: var(--chart-2); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.i-dot { fill: var(--brand); }
.i-t { fill: var(--chart-2); font: 800 10px var(--font); }
.lesson-card .n { position: relative; width: 56px; height: 56px; border-radius: 16px; background: var(--surface-2); padding: 7px; }
.lesson-card .n .ico { width: 42px; height: 42px; }
.lesson-card.done .n { background: var(--brand-soft); }
.lesson-card .ok { position: absolute; right: -6px; bottom: -6px; width: 22px; height: 22px; border-radius: 50%; background: var(--brand); color: var(--brand-ink); font: 800 12px/22px var(--font); text-align: center; font-style: normal; border: 2px solid var(--surface); }
.lesson-card .eyebrow { margin: 0 0 2px; font-size: 11.5px; }
.lesson-card { border-radius: 20px; box-shadow: var(--shadow); }
.lesson-card:hover { transform: translateY(-2px); }
.lesson-title { display: flex; gap: 16px; align-items: center; margin-top: 12px; }
.lesson-title h1 { margin: 0; }
.lesson-title .eyebrow { margin: 0; }
.lesson-ico { flex: none; width: 68px; height: 68px; border-radius: 20px; background: var(--brand-soft); padding: 8px; }
.lesson-ico .ico { width: 52px; height: 52px; }
.feature { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 0; text-decoration: none; color: inherit; border-radius: 26px; overflow: hidden; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); margin-bottom: 20px; transition: transform .15s; }
.feature:hover { transform: translateY(-2px); }
.feature-art { position: relative; min-height: 240px; }
.feature-art .scene { position: absolute; inset: 0; }
.feature-text { padding: 26px 28px; display: flex; flex-direction: column; justify-content: center; gap: 4px; }
.feature-text h2 { margin: 0 0 4px; }
.feature-text p { color: var(--ink-2); }
.feature-text .btn { align-self: flex-start; }

/* Trang mô phỏng */
.sim { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(290px, 1fr); gap: 18px; align-items: start; }
.sim-view { position: relative; border-radius: 24px; overflow: hidden; aspect-ratio: 15 / 8; border: 1px solid var(--line); box-shadow: var(--shadow); background: var(--surface-2); }
.sim-view .scene { position: absolute; inset: 0; }
.sim-tag { position: absolute; padding: 4px 10px; border-radius: 999px; background: var(--glass); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); font-size: 12.5px; font-weight: 700; color: var(--ink); }
.sim-read { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 14px 0; }
.sim-read .stat b { font-size: 24px; }
.sim-ctl { position: sticky; top: 76px; }
.presets { display: flex; flex-wrap: wrap; gap: 8px; }
.preset { border: 1px solid var(--line-2); background: var(--surface); border-radius: 999px; padding: 7px 13px; font-size: 14px; font-weight: 600; color: var(--ink-2); cursor: pointer; min-height: 38px; }
.preset:hover { border-color: var(--brand); color: var(--ink); }
.preset[aria-pressed="true"] { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.rng > span { display: flex; justify-content: space-between; }
.rng output { color: var(--ink); font-weight: 700; font-variant-numeric: tabular-nums; }
.types { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.type-card { display: flex; flex-direction: column; gap: 6px; margin: 0; }
.type-card h3 { margin: 4px 0 0; }
.type-card p { flex: 1; margin: 0 0 8px; }
.type-card .btn { align-self: flex-start; }
.type-fig { margin: 0; background: var(--surface-2); border-radius: 16px; padding: 8px; }
.type-fig svg { width: 100%; height: auto; display: block; }
.f-ray2 { fill: none; stroke: var(--chart-2); stroke-width: 2; }
.f-warn2 { fill: var(--chart-2); }
.f-dashray { stroke-dasharray: 5 4; opacity: .75; }

@media (max-width: 900px) {
  .today-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .today-strip .stat-wide { grid-column: 1 / -1; }
  .minis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sim { grid-template-columns: 1fr; }
  .sim-ctl { position: static; }
  .types { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .feature { grid-template-columns: 1fr; }
  .feature-art { min-height: 200px; }
}
@media (max-width: 640px) {
  .hero2 { min-height: 0; flex-direction: column; align-items: stretch; border-radius: 24px; background: var(--surface); }
  .hero2::before { display: none; }
  .hero2 > .scene { position: relative; inset: auto; order: 2; height: 230px; z-index: 0; }
  .hero2-in { order: 1; padding: 24px 20px 20px; }
  .hero2 .lead { font-size: 16.5px; }
  .banner { min-height: 132px; border-radius: 20px; }
  .banner::before { background: linear-gradient(90deg, color-mix(in srgb, var(--bg) 92%, transparent) 0%, color-mix(in srgb, var(--bg) 70%, transparent) 60%, transparent 100%); }
  .banner-in { padding: 18px 18px; }
  .banner p { font-size: 15px; }
  .today-strip { gap: 10px; }
  .today-strip .stat { padding: 12px 14px; }
  .today-strip .stat b { font-size: 22px; }
  .minis, .minis-3 { grid-template-columns: 1fr 1fr; gap: 10px; }
  .mini-cap { font-size: 12px; padding: 7px 10px 9px; }
  .mini-cap b { font-size: 12.5px; }
  .sim-view { aspect-ratio: 4 / 3; border-radius: 18px; }
  .sim-read { gap: 8px; }
  .sim-read .stat { padding: 10px 10px; }
  .sim-read .stat b { font-size: 18px; }
  .sim-read .stat span { font-size: 12px; }
  .types { grid-template-columns: 1fr; }
  .lesson-title { align-items: flex-start; }
  .lesson-ico { width: 54px; height: 54px; padding: 6px; border-radius: 16px; }
  .lesson-ico .ico { width: 42px; height: 42px; }
}
@media (max-width: 900px) { .sim { display: flex; flex-direction: column; align-items: stretch; gap: 0; } .sim > .col { display: contents; } .sim .sim-view { margin-bottom: 14px; position: sticky; top: calc(62px + env(safe-area-inset-top)); z-index: 5; } .sim .sim-read { margin-top: 0; order: 2; } .sim .sim-ctl { order: 3; } .sim #sim-desc { order: 4; } }

/* Lưu ý quan trọng */
.disclaimer { display: flex; gap: 12px; align-items: flex-start; padding: 14px 18px; margin: 0 0 18px; border-radius: 18px; background: var(--app-bg); color: var(--ink); border: 1px solid color-mix(in srgb, var(--app) 35%, transparent); }
.disclaimer svg { flex: none; color: var(--app); margin-top: 2px; }
.disclaimer p { margin: 0; font-size: 15px; line-height: 1.55; }
.intro-wrap { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 16px; background: rgba(10, 20, 16, .55); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.intro { width: min(560px, 100%); max-height: calc(100vh - 32px); overflow: auto; border-radius: 26px; background: var(--surface); color: var(--ink); box-shadow: 0 24px 60px rgba(0, 0, 0, .35); }
.intro-art { position: relative; height: 130px; }
.intro-art .scene { position: absolute; inset: 0; }
.intro-body { padding: 20px 24px 22px; }
.intro-body h2 { margin: 0 0 8px; }
.intro-body p, .intro-body li { font-size: 15.5px; }
.intro-body ul { margin-bottom: 16px; }
@media (max-width: 640px) { .intro-art { height: 96px; } .intro-body { padding: 16px 18px 18px; } .intro-body p, .intro-body li { font-size: 15px; } .intro .btn-lg { width: 100%; } }
