/* =====================================================================
   HiuHiu IELTS — refined typography & components
   Body: Inter · Headings: Be Vietnam Pro (both bundled in /fonts)
   ===================================================================== */
:root {
  --font: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  --font-head: "Be Vietnam Pro", "Inter", "Segoe UI", system-ui, sans-serif;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(30, 10, 14, .04), 0 1px 1px rgba(30, 10, 14, .03);
  --shadow: 0 10px 30px -12px rgba(60, 10, 20, .18), 0 2px 6px rgba(60, 10, 20, .05);
  --tint: color-mix(in srgb, var(--primary) 5%, var(--surface));
}
body { font-family: var(--font); font-size: 15px; line-height: 1.7; letter-spacing: -0.006em; font-feature-settings: "cv11", "ss01"; text-rendering: optimizeLegibility; }
h1, h2, h3, h4, .brand-text, .hero h1, .fc-word, .stat-num, .res-band b, .bk-num { font-family: var(--font-head); letter-spacing: -0.02em; }
h1 { font-weight: 700; } h2, h3 { font-weight: 600; } h4 { font-weight: 600; }
b, strong { font-weight: 600; }
::selection { background: color-mix(in srgb, var(--primary) 22%, transparent); }

/* ---------- navigation ---------- */
.brand-text { font-weight: 700; font-size: 16.5px; }
.brand-text small { font-family: var(--font); font-weight: 450; letter-spacing: 0; }
.nav-links a { font-weight: 500; font-size: 14px; padding: 7px 13px; border-radius: 9px; color: var(--text-2); }
.nav-links a.active { font-weight: 600; }
.icon-btn { border-radius: 10px; }

/* ---------- page heads & sections ---------- */
.page-head h1 { font-size: 32px; font-weight: 700; line-height: 1.2; margin-bottom: 10px; }
.page-head p { font-size: 15.5px; line-height: 1.7; }
.eyebrow { font-size: 11.5px; font-weight: 600; letter-spacing: .12em; }
.section-title h2, .unit-block h2 { font-size: 19px; font-weight: 600; }
.hero h1 { font-weight: 700; letter-spacing: -0.03em; }
.hero p { font-size: 16.5px; line-height: 1.7; }
.hero-stats b { font-family: var(--font-head); font-weight: 700; }
.hero-stats span { font-weight: 450; }

/* ---------- cards ---------- */
.card { border-radius: var(--radius); border-color: var(--border); box-shadow: var(--shadow-sm); }
.card h3 { font-size: 16.5px; font-weight: 600; line-height: 1.35; }
.card p { font-size: 14px; line-height: 1.65; }
.card.hover:hover { transform: translateY(-3px); }
a.card.lesson-card { display: flex; gap: 16px; align-items: flex-start; padding: 20px 22px; }
.lesson-card .lc-num { width: 38px; height: 38px; border-radius: 11px; font-family: var(--font-head); font-weight: 600; font-size: 15px; background: var(--primary-soft); color: var(--primary); flex: none; }
.lesson-card.done .lc-num { background: var(--success-soft); color: var(--success); }
.lesson-card h3 { font-size: 15.5px; margin-bottom: 6px; }
.lesson-card .small { font-size: 12.5px; }
.lesson-card p { font-size: 13.5px; color: var(--muted); }
.feature-icon { border-radius: 12px; width: 44px; height: 44px; font-size: 20px; }

/* ---------- chips, buttons, pills ---------- */
.chip { font-weight: 600; font-size: 11.5px; padding: 3px 9px; border-radius: 7px; letter-spacing: .01em; background: var(--bg-2); color: var(--text-2); }
.chip.lv-A0, .chip.lv-A1 { background: #e9f8ef; color: #127a45; }
.chip.lv-A2 { background: #e8f2fd; color: #1a62a8; }
.chip.lv-B1 { background: #f0ecfe; color: #5b40c4; }
.chip.lv-B2 { background: #fff1e6; color: #b5541b; }
.chip.lv-C1 { background: #fde9ec; color: #b01c33; }
:root[data-theme="dark"] .chip[class*="lv-"] { background: color-mix(in srgb, currentColor 14%, transparent); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .chip.lv-A0, :root:not([data-theme="light"]) .chip.lv-A1 { color: #5fd69a; } :root:not([data-theme="light"]) .chip.lv-A2 { color: #6fb1f2; } :root:not([data-theme="light"]) .chip.lv-B1 { color: #a996ff; } :root:not([data-theme="light"]) .chip.lv-B2 { color: #ffa36b; } :root:not([data-theme="light"]) .chip.lv-C1 { color: #ff7d8f; } :root:not([data-theme="light"]) .chip[class*="lv-"] { background: color-mix(in srgb, currentColor 14%, transparent); } }
:root[data-theme="dark"] .chip.lv-A0, :root[data-theme="dark"] .chip.lv-A1 { color: #5fd69a; }
:root[data-theme="dark"] .chip.lv-A2 { color: #6fb1f2; }
:root[data-theme="dark"] .chip.lv-B1 { color: #a996ff; }
:root[data-theme="dark"] .chip.lv-B2 { color: #ffa36b; }
:root[data-theme="dark"] .chip.lv-C1 { color: #ff7d8f; }
.chip.done { background: var(--success-soft); color: var(--success); }
.btn { font-weight: 600; font-size: 14px; border-radius: 10px; padding: 10px 18px; letter-spacing: -0.005em; }
.btn-sm { font-size: 13px; padding: 7px 13px; border-radius: 9px; }
.btn-soft { background: var(--primary-soft); color: var(--primary); }
.filter-bar .pill { font-weight: 500; font-size: 13.5px; padding: 6px 14px; }
.filter-bar .pill.active { font-weight: 600; }
.filter-bar input, .doc-side .side-search { font-size: 14px; }

/* ---------- sidebar ---------- */
.doc-side { border-radius: var(--radius); padding: 12px; }
.side-group > summary { font-size: 11.5px; font-weight: 600; letter-spacing: .08em; padding: 9px 8px; }
.side-link { font-size: 13.5px; padding: 6px 10px 6px 22px; line-height: 1.45; border-radius: 8px; }
.side-link.active { font-weight: 600; background: var(--primary-soft); color: var(--primary); box-shadow: inset 3px 0 0 var(--primary); }

/* ---------- lesson layout ---------- */
.lesson-head { border-radius: var(--radius); padding: 28px 34px; background: linear-gradient(180deg, var(--tint), var(--surface) 70%); }
.lesson-head h1 { font-size: 30px; font-weight: 700; line-height: 1.2; margin: 12px 0 4px; }
.lesson-head .en-title { font-family: var(--font); font-weight: 500; font-size: 15px; color: var(--muted); }
.lesson-body { border-radius: var(--radius); padding: 34px 40px; font-size: 15.5px; line-height: 1.8; }
.lesson-body > * { max-width: 860px; }
.lesson-body p { color: var(--text-2); margin-bottom: 14px; }
.lesson-body h3 { font-size: 20px; font-weight: 600; margin: 40px 0 14px; padding-bottom: 0; border-bottom: none; display: flex; align-items: center; gap: 10px; }
.lesson-body h3::before { content: ""; width: 4px; height: 20px; border-radius: 4px; background: var(--primary); flex: none; }
.lesson-body h4 { font-size: 16px; font-weight: 600; margin: 24px 0 8px; }
.lesson-body li { margin: 6px 0; }
.lesson-body ul:not(.examples) li::marker { color: var(--primary); }
.lesson-body b, .lesson-body strong { color: var(--text); }
.lesson-body mark { background: linear-gradient(transparent 58%, color-mix(in srgb, var(--primary) 20%, transparent) 58%); padding: 0 1px; border-radius: 0; font-weight: 600; color: inherit; }
@media (max-width: 620px) { .lesson-body { padding: 22px 18px; } .lesson-head { padding: 22px 20px; } }

/* ---------- callout boxes ---------- */
.box { position: relative; border: 1px solid var(--border); border-left: 3px solid var(--bx, var(--primary)); border-radius: 12px; background: color-mix(in srgb, var(--bx, var(--primary)) 5%, var(--surface)); padding: 16px 20px 16px 20px; margin: 20px 0; }
.box p, .box li { color: var(--text-2); }
.box-title { display: flex; align-items: center; gap: 8px; font-family: var(--font); text-transform: none; letter-spacing: 0; font-size: 14px; font-weight: 600; color: var(--bx, var(--primary)); margin-bottom: 8px; }
.box-title::before { content: "" !important; width: 18px; height: 18px; flex: none; background: currentColor; -webkit-mask: var(--ico) center / contain no-repeat; mask: var(--ico) center / contain no-repeat; }
.box.formula { --bx: var(--primary); --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='3' width='18' height='18' rx='3'/%3E%3Cpath d='M7 8h10M7 12h6M7 16h8'/%3E%3C/svg%3E"); background: color-mix(in srgb, var(--primary) 4%, var(--surface)); }
.box.formula p { font-family: var(--font); font-size: 15px; font-weight: 500; color: var(--text); margin: 0 0 6px; padding: 7px 12px; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; line-height: 1.6; font-feature-settings: "tnum"; }
.box.formula p:last-child { margin-bottom: 0; }
.box.tip { --bx: #16a35a; --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 18h6M10 22h4M12 2a7 7 0 0 0-4 12.7V17h8v-2.3A7 7 0 0 0 12 2z'/%3E%3C/svg%3E"); }
.box.warn { --bx: #dc2f45; --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10.3 3.9 1.8 18a2 2 0 0 0 1.7 3h17a2 2 0 0 0 1.7-3L13.7 3.9a2 2 0 0 0-3.4 0zM12 9v4M12 17h.01'/%3E%3C/svg%3E"); }
.box.warn s { color: #dc2f45; text-decoration-thickness: 1.5px; opacity: .85; }
.box.note { --bx: #d98a00; --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 8h.01M11 12h1v5h1'/%3E%3C/svg%3E"); }
.box.ielts { --bx: #2563eb; --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Ccircle cx='12' cy='12' r='5'/%3E%3Ccircle cx='12' cy='12' r='1'/%3E%3C/svg%3E"); }
:root[data-theme="dark"] .box.ielts { --bx: #6b9bff; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .box.ielts { --bx: #6b9bff; } :root:not([data-theme="light"]) .box.tip { --bx: #3ccf86; } :root:not([data-theme="light"]) .box.note { --bx: #ffbe3d; } :root:not([data-theme="light"]) .box.warn { --bx: #ff6b7d; } }
:root[data-theme="dark"] .box.tip { --bx: #3ccf86; }
:root[data-theme="dark"] .box.note { --bx: #ffbe3d; }
:root[data-theme="dark"] .box.warn { --bx: #ff6b7d; }

/* ---------- example sentences ---------- */
ul.examples { margin: 14px 0 20px; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: var(--surface); }
ul.examples li { margin: 0; border: none; border-radius: 0; border-top: 1px solid var(--border); background: transparent; padding: 11px 16px 11px 40px; position: relative; }
ul.examples li:first-child { border-top: none; }
ul.examples li::before { content: ""; position: absolute; left: 18px; top: 19px; width: 7px; height: 7px; border-radius: 50%; background: var(--primary); opacity: .75; }
ul.examples li:hover { background: var(--surface-2); }
ul.examples .en { font-weight: 500; color: var(--text); font-size: 15.5px; }
ul.examples .vi { font-size: 14px; color: var(--muted); font-style: normal; margin-top: 1px; }
.speak { opacity: .55; transition: opacity .2s; }
.speak:hover { opacity: 1; }

/* ---------- tables ---------- */
.tbl-wrap { margin: 16px 0 22px; border: 1px solid var(--border); border-radius: 12px; overflow-x: auto; background: var(--surface); }
.tbl-wrap table.tbl { margin: 0; border: none; border-radius: 0; }
table.tbl { font-size: 14.5px; line-height: 1.6; }
table.tbl th { background: var(--surface-2); font-family: var(--font); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 11px 16px; border-bottom: 1px solid var(--border); white-space: nowrap; }
table.tbl td { padding: 11px 16px; color: var(--text-2); border-top: 1px solid var(--border); }
table.tbl tbody tr:first-child td { border-top: none; }
table.tbl tr:nth-child(even) td { background: transparent; }
table.tbl tbody tr:hover td { background: var(--surface-2); }
table.tbl td:first-child { color: var(--text); font-weight: 500; }

/* ---------- exercises ---------- */
.exercises { border-radius: var(--radius); padding: 30px 36px; }
.exercises h2 { font-size: 20px; font-weight: 600; }
.ex-item { padding: 18px 0; }
.ex-q { font-weight: 500; font-size: 15.5px; color: var(--text); }
.ex-q .num { font-family: var(--font-head); font-weight: 600; border-radius: 7px; }
.ex-opt { border-width: 1px; border-radius: 9px; font-size: 14.5px; padding: 8px 15px; background: var(--surface); transition: border-color .2s, background .2s, transform .15s; }
.ex-opt:hover { border-color: var(--primary); background: var(--primary-soft); transform: translateY(-1px); }
.ex-input { border-width: 1px; border-radius: 9px; font-size: 15px; }
.ex-input:focus, .filter-bar input:focus, .side-search:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 18%, transparent); }
.ex-explain { border-radius: 10px; font-size: 14px; background: var(--surface-2); border: 1px solid var(--border); }
.ex-score { font-family: var(--font-head); font-weight: 600; }

/* ---------- vocab & tests ---------- */
.fc-word { font-weight: 700; }
.fc-vi { font-family: var(--font-head); font-weight: 600; }
.fc-ex { font-size: 15.5px; }
.word-table td:first-child { font-weight: 600; }
.book-card .bk-title { font-weight: 600; font-size: 13px; letter-spacing: .02em; }
.book-card .bk-num { font-weight: 700; }
.test-row .t-name { font-family: var(--font-head); font-weight: 600; }
.skill-btn { border-radius: 11px; }
.skill-btn b { font-weight: 600; }
.stat-card .stat-num { font-weight: 700; }
.stage-head h3 { font-size: 18px; font-weight: 600; }
.stage ul { font-size: 14.5px; }
.modal { border-radius: 18px; }
.modal h2 { font-weight: 600; }
.box.formula, .box.tip, .box.warn, .box.note, .box.ielts { border-color: var(--border); border-left-color: var(--bx); }
.box.formula .box-title, .box.tip .box-title, .box.warn .box-title, .box.note .box-title, .box.ielts .box-title { color: var(--bx); }
.vocab-set > .small { display: block; font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--primary); opacity: .85; margin-bottom: 6px; }
.vocab-set h3 { margin-bottom: 2px; }
.chip.lv-C2 { background: #1b1b1f; color: #ff6b7d; }
:root[data-theme="dark"] .chip.lv-C2 { color: #ff6b7d; }
