/* ============================================================
   KORPHOR — Global Styles
   tokens.css ต้อง load ก่อนไฟล์นี้เสมอ
   ============================================================ */

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }
body { font-family: var(--font-th); color: var(--ink); background: var(--white); line-height: 1.65; }
a { text-decoration: none; color: inherit; }
img { display: block; }

.container { max-width: 1160px; margin: 0 auto; padding: 0 28px; }

/* ── Typography helpers ── */
.num { font-family: var(--font-en); }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn-red-sm {
  display: inline-flex; align-items: center;
  background: var(--red); color: #fff;
  border: none; border-radius: var(--r-sm);
  padding: 8px 18px; font-family: var(--font-th);
  font-size: 14px; font-weight: 700; cursor: pointer;
  transition: background .18s, transform .12s;
}
.btn-red-sm:hover { background: var(--red-dark); transform: translateY(-1px); }

.btn-ghost-sm {
  display: inline-flex; align-items: center;
  background: transparent; color: var(--ink-soft);
  border: none; border-radius: var(--r-sm);
  padding: 8px 14px; font-family: var(--font-th);
  font-size: 14px; font-weight: 600; cursor: pointer;
  transition: background .15s, color .15s;
}
.btn-ghost-sm:hover { background: var(--surface); color: var(--ink); }

.btn-white-lg {
  display: inline-flex; align-items: center;
  background: #fff; color: var(--red);
  border: none; border-radius: var(--r);
  padding: 14px 32px; font-family: var(--font-th);
  font-size: 16px; font-weight: 800; cursor: pointer;
  box-shadow: 0 2px 16px rgba(0,0,0,.14);
  transition: transform .15s, box-shadow .15s;
}
.btn-white-lg:hover { transform: translateY(-2px); box-shadow: 0 6px 28px rgba(0,0,0,.18); }

.btn-ghost-lg {
  display: inline-flex; align-items: center;
  background: rgba(255,255,255,.12); color: rgba(255,255,255,.9);
  border: 1.5px solid rgba(255,255,255,.28); border-radius: var(--r);
  padding: 13px 28px; font-family: var(--font-th);
  font-size: 16px; font-weight: 600; cursor: pointer;
  transition: background .15s, border-color .15s;
}
.btn-ghost-lg:hover { background: rgba(255,255,255,.2); border-color: rgba(255,255,255,.5); }

.btn-ghost-lg-dark {
  display: inline-flex; align-items: center;
  background: transparent; color: rgba(255,255,255,.8);
  border: 1.5px solid rgba(255,255,255,.25); border-radius: var(--r);
  padding: 13px 28px; font-family: var(--font-th);
  font-size: 16px; font-weight: 600; cursor: pointer;
  transition: all .15s;
}
.btn-ghost-lg-dark:hover { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.5); color: #fff; }

.btn-red-md {
  display: inline-flex; align-items: center;
  background: var(--red); color: #fff;
  border: none; border-radius: var(--r);
  padding: 13px 28px; font-family: var(--font-th);
  font-size: 15px; font-weight: 700; cursor: pointer;
  transition: background .18s, transform .12s;
  margin-top: 8px;
}
.btn-red-md:hover { background: var(--red-dark); transform: translateY(-1px); }

/* ============================================================
   NAVBAR
   ============================================================ */
.navbar {
  position: sticky; top: 0; z-index: 200;
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  transition: box-shadow .2s;
}
.navbar.scrolled { box-shadow: var(--shadow); }

.nav-inner {
  display: flex; align-items: center;
  height: 64px; gap: 12px;
}

/* Logo */
.logo { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.logo-mark {
  width: 36px; height: 36px;
  background: var(--red); color: #fff;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-en); font-size: 18px; font-weight: 900;
  letter-spacing: -0.5px;
}
.logo-name { font-family: var(--font-en); font-size: 19px; font-weight: 800; color: var(--ink); letter-spacing: -0.3px; }

/* Center nav */
.nav-center { display: flex; align-items: center; gap: 2px; flex: 1; padding: 0 16px; }
.nl {
  display: flex; align-items: center; gap: 4px;
  padding: 7px 12px; border-radius: var(--r-sm);
  font-size: 14px; font-weight: 600; color: var(--muted);
  white-space: nowrap; transition: color .15s, background .15s;
}
.nl:hover { color: var(--ink); background: var(--surface); }

.ico-chev {
  width: 12px; height: 12px;
  stroke: currentColor; stroke-width: 1.8;
  fill: none; stroke-linecap: round; stroke-linejoin: round;
}

/* Right */
.nav-right { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }

/* Hamburger */
.hamburger {
  display: none; flex-direction: column; justify-content: center;
  gap: 5px; background: none; border: none; cursor: pointer; padding: 8px;
}
.hamburger span { display: block; width: 22px; height: 2px; background: var(--ink); border-radius: 2px; transition: all .25s; }

/* Mobile nav */
.mobile-nav {
  display: none; flex-direction: column;
  position: fixed; top: 64px; left: 0; right: 0;
  background: #fff; border-bottom: 1px solid var(--border);
  padding: 12px 20px 20px; gap: 2px; z-index: 199;
  box-shadow: var(--shadow);
}
.mobile-nav a { padding: 10px 10px; font-size: 15px; font-weight: 600; color: var(--ink); border-radius: var(--r-sm); transition: background .15s; }
.mobile-nav a:hover { background: var(--surface); }
.mobile-nav-btns { display: flex; gap: 8px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); }
.mobile-nav.open { display: flex; }

/* ============================================================
   HERO — SPLIT
   ============================================================ */
.hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: calc(100vh - 64px);
}

/* LEFT — RED */
.hero-left {
  background: var(--red);
  display: flex; align-items: center;
  padding: 80px 0;
  position: relative;
  overflow: hidden;
}
/* subtle texture */
.hero-left::before {
  content: '';
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 60% 60% at 110% 10%, rgba(255,255,255,.07) 0%, transparent 60%),
    radial-gradient(ellipse 40% 40% at -10% 90%, rgba(0,0,0,.12) 0%, transparent 60%);
}

.hero-left-inner {
  position: relative; z-index: 1;
  padding: 0 56px 0 60px;
  max-width: 560px;
}

.hero-eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,.15); color: rgba(255,255,255,.95);
  border: 1px solid rgba(255,255,255,.2);
  padding: 5px 14px; border-radius: 100px;
  font-size: 13px; font-weight: 600;
  margin-bottom: 24px;
}
.eyebrow-dot { width: 6px; height: 6px; background: #fff; border-radius: 50%; animation: pulse 2s infinite; }
@keyframes pulse { 0%,100%{opacity:1;transform:scale(1)} 50%{opacity:.5;transform:scale(1.4)} }

.hero-h1 {
  font-family: var(--font-th);
  font-size: clamp(38px, 4.5vw, 58px);
  font-weight: 800;
  line-height: 1.12;
  color: #fff;
  margin-bottom: 20px;
  letter-spacing: -0.5px;
}
.hero-h1 span {
  /* underline decoration */
  position: relative; display: inline-block;
}
.hero-h1 span::after {
  content: '';
  position: absolute; left: 0; bottom: -4px; right: 0;
  height: 3px; background: rgba(255,255,255,.45); border-radius: 2px;
}

.hero-sub {
  font-size: 16.5px; color: rgba(255,255,255,.82);
  line-height: 1.7; margin-bottom: 36px;
}

.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 40px; }

.hero-proof { display: flex; align-items: center; gap: 12px; }
.avatars { display: flex; }
.avatars img {
  width: 34px; height: 34px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,.5);
  margin-left: -8px; background: rgba(255,255,255,.2);
  object-fit: cover;
}
.avatars img:first-child { margin-left: 0; }
.hero-proof span { font-size: 13.5px; color: rgba(255,255,255,.8); }
.hero-proof strong { color: #fff; }

/* RIGHT — WHITE */
.hero-right {
  background: #fff;
  display: flex; align-items: center; justify-content: center;
  padding: 80px 0;
  border-left: 1px solid var(--border);
}
.hero-right-inner { width: 100%; max-width: 420px; padding: 0 52px; display: flex; flex-direction: column; gap: 28px; }

/* Stat block */
.stat-block {
  border: 1.5px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
}
.stat-row {
  display: flex; align-items: center; gap: 20px;
  padding: 20px 24px;
}
.stat-row:hover { background: var(--surface); }
.stat-num {
  font-family: var(--font-en);
  font-size: 40px; font-weight: 900; color: var(--red);
  line-height: 1; flex-shrink: 0; min-width: 80px;
  letter-spacing: -1.5px;
}
.stat-plus { font-size: 28px; }
.stat-desc strong { display: block; font-size: 14.5px; font-weight: 700; color: var(--ink); margin-bottom: 2px; }
.stat-desc span { font-size: 12.5px; color: var(--muted); }
.stat-divider { height: 1px; background: var(--border); margin: 0; }

/* Mini quiz card */
.mini-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--r-lg);
  padding: 20px;
}
.mini-card-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.mini-tag {
  background: var(--red-light); color: var(--red);
  padding: 3px 10px; border-radius: 6px;
  font-size: 11.5px; font-weight: 700;
}
.mini-q { font-size: 11px; color: var(--muted); }

.mini-progress { height: 4px; background: var(--border); border-radius: 2px; margin-bottom: 14px; overflow: hidden; }
.mini-prog-fill { height: 100%; background: linear-gradient(90deg, var(--red), #FF6B35); border-radius: 2px; }

.mini-question { font-size: 13px; font-weight: 600; color: var(--ink); line-height: 1.55; margin-bottom: 14px; }

.mini-opts { display: flex; flex-direction: column; gap: 7px; }
.mo {
  padding: 9px 13px; border-radius: var(--r-sm);
  background: #fff; border: 1.5px solid var(--border);
  font-size: 12.5px; color: var(--muted); cursor: pointer;
  transition: border-color .12s, color .12s;
}
.mo:hover:not(.mo-correct) { border-color: #d0d0dc; color: var(--ink); }
.mo.mo-correct {
  background: #F0FDF4; border-color: #22C55E; color: #15803D;
  font-weight: 700; display: flex; align-items: center; gap: 8px;
}
.mo.mo-correct svg { width: 14px; height: 14px; stroke: #22C55E; fill: none; flex-shrink: 0; stroke-linecap: round; stroke-linejoin: round; }

/* ============================================================
   SECTION HELPERS
   ============================================================ */
.section { padding: 96px 0; }
.sec-head { text-align: center; margin-bottom: 56px; }
.sec-label {
  display: inline-block;
  font-size: 12px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase;
  color: var(--red); margin-bottom: 12px;
}
.sec-head h2 {
  font-size: clamp(26px, 3vw, 38px); font-weight: 800;
  color: var(--ink); margin-bottom: 10px; letter-spacing: -0.5px;
}
.sec-head p { font-size: 16px; color: var(--muted); }

/* ============================================================
   SUBJECTS
   ============================================================ */
.subjects-section { background: var(--surface); }

.subject-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.subject-card {
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: var(--r-lg);
  padding: 28px 24px 22px;
  display: flex; flex-direction: column; gap: 0;
  transition: border-color .18s, box-shadow .18s, transform .18s;
  position: relative; overflow: hidden;
}
.subject-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0;
  height: 3px; background: var(--c, var(--red));
  transform: scaleX(0); transform-origin: left;
  transition: transform .25s ease;
}
.subject-card:hover { border-color: var(--c, var(--red)); box-shadow: 0 6px 28px rgba(0,0,0,.08); transform: translateY(-3px); }
.subject-card:hover::before { transform: scaleX(1); }

.sc-icon { font-size: 30px; margin-bottom: 14px; }
.sc-body { flex: 1; }
.sc-body h3 { font-size: 16px; font-weight: 700; color: var(--ink); margin-bottom: 6px; }
.sc-body p { font-size: 13.5px; color: var(--muted); line-height: 1.6; }
.sc-foot {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border);
}
.sc-count { font-size: 13px; color: var(--muted); font-weight: 600; }
.sc-arr { font-size: 16px; color: var(--c, var(--red)); font-weight: 700; transition: transform .15s; }
.subject-card:hover .sc-arr { transform: translateX(4px); }

/* ============================================================
   FEATURES
   ============================================================ */
.features-section { background: #fff; }

.features-inner {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 80px;
  align-items: center;
}

.features-text .sec-label { display: block; text-align: left; }
.features-text h2 { font-size: clamp(26px, 3vw, 36px); font-weight: 800; color: var(--ink); margin-bottom: 14px; letter-spacing: -0.5px; line-height: 1.2; }
.features-text p { font-size: 15.5px; color: var(--muted); line-height: 1.7; margin-bottom: 24px; }

.features-list { display: flex; flex-direction: column; gap: 6px; }
.feat-item {
  display: flex; align-items: flex-start; gap: 16px;
  padding: 18px 20px; border-radius: var(--r);
  transition: background .15s;
}
.feat-item:hover { background: var(--surface); }
.feat-icon {
  width: 44px; height: 44px; flex-shrink: 0;
  background: var(--fi, #FEE2E2);
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
}
.feat-item h4 { font-size: 15px; font-weight: 700; color: var(--ink); margin-bottom: 4px; }
.feat-item p { font-size: 13.5px; color: var(--muted); line-height: 1.6; }

/* ============================================================
   TESTIMONIALS
   ============================================================ */
.testi-section { background: var(--surface); }

.testi-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  align-items: start;
}

.testi-card {
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: var(--r-lg);
  padding: 28px 24px;
  transition: box-shadow .18s, transform .18s;
}
.testi-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.testi-featured { border-color: var(--red); box-shadow: 0 0 0 3px rgba(232,36,60,.08); }

.testi-stars { color: #FBBF24; font-size: 16px; letter-spacing: 2px; margin-bottom: 14px; }
.testi-card > p { font-size: 14.5px; color: var(--ink-soft); line-height: 1.7; margin-bottom: 20px; font-style: italic; }
.testi-author { display: flex; align-items: center; gap: 12px; }
.testi-author img { width: 42px; height: 42px; border-radius: 50%; background: var(--border); }
.testi-author strong { display: block; font-size: 14px; font-weight: 700; color: var(--ink); }
.testi-author span { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; }

/* ============================================================
   CTA BANNER
   ============================================================ */
.cta-section {
  background: linear-gradient(135deg, var(--red) 0%, var(--red-dark) 55%, #8B1020 100%);
  padding: 88px 0;
  position: relative; overflow: hidden;
}
.cta-section::before {
  content: '';
  position: absolute; top: -50%; right: -10%;
  width: 600px; height: 600px;
  background: rgba(255,255,255,.04);
  border-radius: 50%;
}
.cta-inner {
  position: relative; z-index: 1;
  display: flex; align-items: center; justify-content: space-between; gap: 40px; flex-wrap: wrap;
}
.cta-text h2 { font-size: clamp(26px, 3vw, 38px); font-weight: 800; color: #fff; margin-bottom: 8px; letter-spacing: -0.5px; }
.cta-text p { font-size: 16px; color: rgba(255,255,255,.78); }
.cta-btns { display: flex; gap: 12px; flex-wrap: wrap; }

/* ============================================================
   FOOTER
   ============================================================ */
.footer { background: var(--ink); }

.footer-inner {
  display: grid; grid-template-columns: 1fr 2fr;
  gap: 60px; padding: 64px 0 56px;
}
.logo-light .lm-light { background: var(--red); }
.logo-light .ln-light { color: #fff; }
.footer-brand p { font-size: 14px; color: rgba(255,255,255,.45); line-height: 1.7; margin-top: 14px; }

.footer-cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; }
.fc h5 { font-size: 13px; font-weight: 700; color: rgba(255,255,255,.9); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 18px; }
.fc a { display: block; font-size: 14px; color: rgba(255,255,255,.45); margin-bottom: 11px; transition: color .15s; }
.fc a:hover { color: rgba(255,255,255,.9); }

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.08);
  padding: 20px 0;
}
.footer-bottom .container { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; }
.footer-bottom span { font-size: 13px; color: rgba(255,255,255,.3); }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
  .hero { grid-template-columns: 1fr; min-height: auto; }
  .hero-left { padding: 72px 0; }
  .hero-left-inner { padding: 0 28px; max-width: 100%; }
  .hero-right { border-left: none; border-top: 1px solid var(--border); padding: 60px 0; }
  .hero-right-inner { padding: 0 28px; max-width: 100%; flex-direction: row; gap: 20px; }
  .stat-block { flex: 1; min-width: 0; }
  .mini-card { flex: 1; min-width: 0; }

  .features-inner { grid-template-columns: 1fr; gap: 48px; }
  .features-text { text-align: center; }
  .features-text .sec-label { text-align: center; }
  .features-text .btn-red-md { margin: 8px auto 0; }
}

@media (max-width: 900px) {
  .nav-center { display: none; }
  .hamburger { display: flex; }
  .btn-ghost-sm { display: none; }

  .subject-grid { grid-template-columns: repeat(2, 1fr); }
  .testi-grid { grid-template-columns: 1fr; max-width: 480px; margin: 0 auto; }
  .footer-inner { grid-template-columns: 1fr; gap: 40px; }
}

@media (max-width: 640px) {
  .hero-right-inner { flex-direction: column; }
  .subject-grid { grid-template-columns: 1fr; }
  .cta-inner { flex-direction: column; text-align: center; }
  .cta-btns { justify-content: center; }
  .footer-cols { grid-template-columns: repeat(2, 1fr); }
  .footer-bottom .container { justify-content: center; text-align: center; }
  .section { padding: 64px 0; }
}
