:root {
  --navy: #0e2f5e;
  --navy-ink: #0a1f44;
  --mint: #7ee8c8;
  --mint-soft: #c9f3e8;
  --ink: #0b1a3a;
  --muted: #3a4663;
  --bg: #fdfdfd;
  --radius: 26px;
  --shadow: 0 10px 30px rgba(14, 47, 94, .12);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 90px; }
body {
  margin: 0;
  font-family: "Be Vietnam Pro", system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
.container { width: min(1640px, 100% - 40px); margin-inline: auto; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(253, 253, 253, .92);
  backdrop-filter: blur(10px);
}
.nav { display: flex; align-items: center; justify-content: space-between; height: 80px; padding-inline: 40px; }
.brand { display: flex; align-items: center; gap: 12px; font-weight: 700; font-size: clamp(22px, 2.4vw, 38px); color: var(--navy-ink); letter-spacing: -.5px; }
.brand img { width: 62px; height: auto; }
.menu { display: flex; align-items: center; gap: clamp(8px, 2.5vw, 44px); }
.menu a {
  font-weight: 600; font-size: 22px; color: var(--navy-ink);
  padding: 10px 26px; border-radius: 12px; transition: background .2s;
}
.menu a:hover { background: #eef6f4; }
.menu a.active { background: var(--mint-soft); color: #0b3b4a; }
.btn-login {
  margin-left: clamp(0px, 8vw, 150px);
  display: inline-flex; align-items: center; gap: 10px;
  background: var(--navy-ink); color: #fff; border: 0; cursor: pointer;
  font-family: inherit; font-weight: 600; font-size: 22px; line-height: 1;
  padding: 14px 26px; border-radius: 12px; transition: transform .15s, background .2s;
}
.btn-login:hover { background: #13305f; transform: translateY(-1px); }
.nav-toggle { display: none; }

/* ---------- Hero ---------- */
.hero {
  position: relative; overflow: hidden;
  display: grid; grid-template-columns: 49% 51%; align-items: center;
  min-height: 382px; border-radius: var(--radius);
  background: linear-gradient(100deg, #0f3360 0%, #0c2d56 45%, #0f2d60 60%);
  color: #fff;
}
.hero-text { position: relative; z-index: 2; padding: 40px 0 44px 78px; }
.hero h1 { margin: 0 0 14px; font-size: clamp(36px, 4.6vw, 76px); line-height: 1.08; font-weight: 800; letter-spacing: -1px; }
.hero p { margin: 0 0 34px; font-size: clamp(16px, 1.5vw, 26px); opacity: .95; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 24px; }
.hero-img {
  height: 100%; width: 100%; object-fit: cover; object-position: right center;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 9%);
  mask-image: linear-gradient(90deg, transparent 0, #000 9%);
}

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  font-family: inherit; font-weight: 700; font-size: clamp(16px, 1.65vw, 28px);
  padding: 16px 46px; border-radius: 14px; cursor: pointer; border: 3px solid transparent;
  transition: transform .15s, box-shadow .2s, background .2s;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: var(--mint); color: var(--navy-ink); box-shadow: 0 6px 18px rgba(126, 232, 200, .35); }
.btn-primary:hover { background: #8ff0d3; }
.btn-outline { border-color: #fff; color: #fff; background: transparent; padding-inline: 38px; }
.btn-outline:hover { background: rgba(255,255,255,.1); }
.btn-sm { font-size: 16px; padding: 10px 20px; border-radius: 10px; }
.btn-block { width: 100%; }

/* ---------- Sections ---------- */
.section { padding-top: 34px; }
.section h2 { font-size: clamp(30px, 3.6vw, 56px); font-weight: 800; margin: 0 0 30px 18px; letter-spacing: -1px; color: var(--navy-ink); }

/* ---------- Subject cards ---------- */
.subjects { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.subject {
  position: relative; overflow: hidden;
  min-height: 336px; border-radius: var(--radius);
  padding: 44px 22px 22px 30px;
  display: flex; flex-direction: column;
  box-shadow: var(--shadow);
  transition: transform .2s, box-shadow .2s;
}
.subject:hover { transform: translateY(-4px); box-shadow: 0 16px 36px rgba(14, 47, 94, .18); }
.subject--toan { background: linear-gradient(160deg, #e9ddfc, #e1d3fe); }
.subject--van  { background: linear-gradient(160deg, #fee5d9, #fcd2be); }
.subject--anh  { background: linear-gradient(160deg, #dcf9eb, #aeebd2); }
.subject-text { position: relative; z-index: 2; max-width: 60%; }
.subject h3 { margin: 0 0 8px; font-size: clamp(32px, 3.4vw, 56px); font-weight: 800; letter-spacing: -1px; color: var(--navy-ink); }
.subject p { margin: 0; font-size: clamp(15px, 1.6vw, 26px); color: #1d2747; }
.subject img {
  position: absolute; right: 0; bottom: 64px;
  width: 50%; height: auto;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 14%), linear-gradient(0deg, transparent 0, #000 8%);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(90deg, transparent 0, #000 14%), linear-gradient(0deg, transparent 0, #000 8%);
  mask-composite: intersect;
}
.subject--van img { width: 58%; }
.subject--anh img { width: 54%; }
.subject-btn {
  position: relative; z-index: 2; margin-top: auto;
  background: #fff; border-radius: 14px; padding: 12px;
  text-align: center; font-weight: 600; font-size: clamp(18px, 1.7vw, 28px); color: var(--navy-ink);
  box-shadow: 0 2px 8px rgba(0,0,0,.05);
  transition: background .2s;
}
.subject-btn span { display: inline-block; transition: transform .2s; }
.subject-btn:hover span { transform: translateX(5px); }

/* ---------- Ôn luyện ---------- */
.tabs { display: flex; gap: 10px; margin: 0 0 22px 18px; flex-wrap: wrap; }
.tabs button {
  font-family: inherit; font-weight: 600; font-size: 18px; cursor: pointer;
  border: 2px solid #dfe6ef; background: #fff; color: var(--navy-ink);
  padding: 10px 22px; border-radius: 999px;
}
.tabs button[aria-selected="true"] { background: var(--navy-ink); border-color: var(--navy-ink); color: #fff; }
.topics { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.topic {
  background: #fff; border: 1px solid #e7ecf3; border-radius: 18px; padding: 20px 22px;
  box-shadow: 0 4px 14px rgba(14,47,94,.06);
}
.topic-link { background: var(--mint-soft); border-color: #a8e6d3; }
.topic-link:hover { background: #b8efdf; }
.topic h4 { margin: 0 0 6px; font-size: 19px; color: var(--navy-ink); }
.topic p { margin: 0; color: var(--muted); font-size: 15px; line-height: 1.5; }

/* ---------- Thi thử ---------- */
.exam {
  display: grid; grid-template-columns: 1fr 1fr; gap: 30px; align-items: center;
  background: linear-gradient(100deg, #0f3360, #0c3967); color: #fff;
  border-radius: var(--radius); padding: 44px 60px;
}
.exam h2 { color: #fff; margin-left: 0; margin-bottom: 12px; }
.exam p { margin: 0; font-size: 19px; opacity: .9; line-height: 1.55; }
.exam-list { display: grid; gap: 12px; }
.exam-item {
  display: grid; grid-template-columns: 1fr auto auto; gap: 18px; align-items: center;
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.15);
  border-radius: 14px; padding: 14px 18px; font-size: 18px;
}
.exam-item span { opacity: .8; }

/* ---------- Footer ---------- */
.site-footer { margin-top: 50px; padding: 26px 0; border-top: 1px solid #eef1f5; color: var(--muted); font-size: 15px; }
.footer-inner { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; padding-inline: 18px; }

/* ---------- Modal ---------- */
.modal { border: 0; border-radius: 20px; padding: 0; width: min(420px, 100% - 32px); box-shadow: 0 30px 80px rgba(0,0,0,.25); }
.modal::backdrop { background: rgba(10, 31, 68, .55); }
.modal-body { position: relative; padding: 34px 30px 26px; display: grid; gap: 14px; }
.modal h2 { margin: 0 0 6px; color: var(--navy-ink); }
.modal label { display: grid; gap: 6px; font-weight: 600; font-size: 15px; }
.modal input { font: inherit; padding: 12px 14px; border: 1.5px solid #d6deea; border-radius: 10px; }
.modal input:focus { outline: 2px solid var(--mint); border-color: transparent; }
.modal .btn { font-size: 18px; padding: 13px; }
.modal-close { position: absolute; top: 10px; right: 14px; border: 0; background: none; font-size: 30px; cursor: pointer; color: var(--muted); }
.modal-note { margin: 0; font-size: 14px; color: var(--muted); text-align: center; }

/* ---------- Responsive ---------- */
@media (max-width: 1200px) {
  .menu a { font-size: 18px; padding: 8px 14px; }
  .btn-login { font-size: 18px; margin-left: 10px; padding: 12px 18px; }
  .hero-text { padding-left: 48px; }
}
@media (max-width: 960px) {
  .subject-text { max-width: 55%; }
  .nav { padding-inline: 4px; height: 68px; }
  .nav-toggle {
    display: grid; gap: 5px; background: none; border: 0; padding: 10px; cursor: pointer;
  }
  .nav-toggle span { width: 26px; height: 3px; border-radius: 2px; background: var(--navy-ink); }
  .menu {
    position: absolute; top: 68px; left: 16px; right: 16px;
    flex-direction: column; align-items: stretch; gap: 4px;
    background: #fff; border-radius: 16px; padding: 12px; box-shadow: var(--shadow);
    display: none;
  }
  .menu.open { display: flex; }
  .btn-login { margin: 6px 0 0; justify-content: center; }
  .hero { grid-template-columns: 1fr; }
  .hero-text { padding: 36px 28px 10px; }
  .hero-img { -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 14%); mask-image: linear-gradient(180deg, transparent 0, #000 14%); max-height: 300px; object-position: center; }
  .subjects { grid-template-columns: 1fr; }
  .subject { min-height: 300px; }
  .subject img { width: 52%; max-width: 330px; }
  .subject--van img, .subject--anh img { width: 56%; }
  .exam { grid-template-columns: 1fr; padding: 32px 24px; }
  .section h2 { margin-left: 4px; }
  .tabs { margin-left: 4px; }
}
@media (max-width: 480px) {
  .container { width: calc(100% - 32px); }
  .brand img { width: 46px; }
  .hero h1 { font-size: 34px; }
  .hero h1 br { display: none; }
  .hero-actions { gap: 12px; }
  .hero-actions .btn { flex: 1 1 auto; padding-inline: 20px; }
  .subject { padding: 30px 16px 16px 22px; min-height: 270px; }
  .subject img { width: 60%; }
  .exam-item { grid-template-columns: 1fr auto; }
  .exam-item .btn { grid-column: 1 / -1; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
