/* Extracted from the inline <style> in index.php.
   Used by: index.php */

/* Light palette — kept identical to learn/_header.php, which every lesson
   page includes, so the index and the lessons cannot drift apart. */
:root {
  --bg: #faf8fd; --bg2: #ffffff; --bg3: #f2eefa; --bg4: #e8e0f6;
  --text: #1a1723; --text2: #4a4458; --text3: #615a70;
  --gold: #8a6212; --gold-dim: rgba(138,98,18,0.10);
  --blue: #2b58c9; --green: #0f6b32; --red: #b42318;
  --orange: #9a4a06; --purple: #6d28d9; --cyan: #0e6f80;
  --border: rgba(88,28,135,0.13); --border2: rgba(88,28,135,0.22);
  --l1: #0f6b32; --l2: #2b58c9; --l3: #6d28d9; --l4: #9a4a06; --l5: #8a6212;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { font-family: 'Inter', sans-serif; background: var(--bg); color: var(--text); line-height: 1.7; font-size: 0.9375rem; }

/* HEADER */
.site-header { background: rgba(250,248,253,0.90); backdrop-filter: blur(14px); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 100; padding: 0 24px; }
.site-header-inner { max-width: 1100px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; height: 56px; }
.site-logo { font-family: 'JetBrains Mono', monospace; font-size: 1rem; font-weight: 700; color: var(--gold); text-decoration: none; }
.site-logo span { color: var(--text3); }
.nav-links { display: flex; gap: 24px; list-style: none; }
.nav-links a { color: var(--text3); text-decoration: none; font-size: 0.9375rem; font-weight: 500; transition: color 0.2s; }
.nav-links a:hover { color: var(--text); }
.nav-links a.active { color: var(--gold); }

/* HERO */
.hero { text-align: center; padding: 72px 24px 56px; background: linear-gradient(180deg, var(--bg3), var(--bg)); border-bottom: 1px solid var(--border); position: relative; overflow: hidden; }
.hero::before { content: ''; position: absolute; top: -200px; left: 50%; transform: translateX(-50%); width: 800px; height: 800px; background: radial-gradient(circle, rgba(138,98,18,0.05) 0%, transparent 70%); pointer-events: none; }
.hero-badge { display: inline-flex; gap: 8px; background: var(--gold-dim); border: 1px solid rgba(138,98,18,0.28); padding: 5px 14px; border-radius: 20px; font-family: 'JetBrains Mono', monospace; font-size: 0.8125rem; font-weight: 700; color: #7a5610; letter-spacing: 1.5px; text-transform: uppercase; margin-bottom: 20px; }
.hero h1 { font-family: 'Playfair Display', serif; font-size: clamp(2rem, 5vw, 3.2rem); font-weight: 800; line-height: 1.15; max-width: 800px; margin: 0 auto 16px; }
.hero h1 span { color: var(--gold); }
.hero-sub { font-size: 1.0625rem; color: var(--text2); max-width: 600px; margin: 0 auto 36px; }
.hero-stats { display: flex; justify-content: center; gap: 48px; flex-wrap: wrap; margin-bottom: 36px; }
.hero-stat .val { font-family: 'JetBrains Mono', monospace; font-size: 2rem; font-weight: 800; color: var(--gold); }
.hero-stat .lbl { font-size: 0.9375rem; color: var(--text3); margin-top: 2px; }
.hero-search { max-width: 480px; margin: 0 auto; position: relative; }
.hero-search input { width: 100%; padding: 14px 20px 14px 48px; background: var(--bg2); border: 1px solid var(--border2); border-radius: 10px; color: var(--text); font-size: 1rem; font-family: 'Inter', sans-serif; outline: none; transition: border-color 0.2s; }
.hero-search input:focus { border-color: var(--gold); }
.hero-search input::placeholder { color: var(--text3); }
.search-icon { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--text3); font-size: 1.125rem; pointer-events: none; }

/* LEVEL NAV */
.level-nav { background: rgba(250,248,253,0.94); border-bottom: 1px solid var(--border); overflow-x: auto; }
.level-nav-inner { display: flex; max-width: 1100px; margin: 0 auto; }
.level-nav a { flex: 1; text-align: center; padding: 14px 12px; font-size: 0.9375rem; font-weight: 600; color: var(--text3); text-decoration: none; border-bottom: 3px solid transparent; white-space: nowrap; min-width: 100px; transition: all 0.2s; }
.level-nav a:hover { color: var(--text); }
.level-nav a.l1 { border-bottom-color: var(--l1); color: var(--l1); }
.level-nav a.l2 { border-bottom-color: var(--l2); color: var(--l2); }
.level-nav a.l3 { border-bottom-color: var(--l3); color: var(--l3); }
.level-nav a.l4 { border-bottom-color: var(--l4); color: var(--l4); }
.level-nav a.l5 { border-bottom-color: var(--l5); color: var(--l5); }

/* MAIN */
.main { max-width: 1100px; margin: 0 auto; padding: 48px 24px 100px; }

/* LEVEL SECTION */
.level-section { margin-bottom: 80px; }
.level-header { display: flex; align-items: center; gap: 16px; margin-bottom: 8px; padding-bottom: 20px; border-bottom: 2px solid var(--border); }
.level-icon { width: 56px; height: 56px; border-radius: 14px; display: flex; align-items: center; justify-content: center; font-family: 'JetBrains Mono', monospace; font-size: 1.125rem; font-weight: 800; color: #fff; flex-shrink: 0; }
.level-icon.l1 { background: linear-gradient(135deg, var(--l1), #0b5327); }
.level-icon.l2 { background: linear-gradient(135deg, var(--l2), #1f429c); }
.level-icon.l3 { background: linear-gradient(135deg, var(--l3), #55209f); }
.level-icon.l4 { background: linear-gradient(135deg, var(--l4), #7a3a05); }
.level-icon.l5 { background: linear-gradient(135deg, var(--gold), #6f4d0e); }
.level-header-text h2 { font-family: 'Playfair Display', serif; font-size: 1.625rem; font-weight: 700; }
.level-header-text p { font-size: 0.9375rem; color: var(--text3); margin-top: 4px; }
.level-meta-bar { display: flex; gap: 20px; flex-wrap: wrap; background: var(--bg2); border: 1px solid var(--border); border-radius: 10px; padding: 12px 20px; margin-bottom: 24px; font-size: 0.9375rem; font-family: 'JetBrains Mono', monospace; color: var(--text3); }
.level-meta-bar span { display: flex; align-items: center; gap: 6px; }

/* CHAPTER */
.chapter-group { margin-bottom: 32px; }
.chapter-label { font-family: 'JetBrains Mono', monospace; font-size: 0.8125rem; font-weight: 700; text-transform: uppercase; letter-spacing: 1.5px; color: var(--text3); margin-bottom: 12px; padding-left: 4px; border-left: 2px solid var(--border2); padding-left: 10px; }

/* ARTICLE GRID */
.article-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.article-card { background: var(--bg2); border: 1px solid var(--border); border-radius: 14px; padding: 20px; text-decoration: none; transition: border-color 0.2s, transform 0.15s, box-shadow 0.2s; display: flex; flex-direction: column; gap: 10px; }
.article-card:hover { border-color: var(--border2); transform: translateY(-2px); box-shadow: 0 8px 32px rgba(0,0,0,0.3); }
.card-level { font-family: 'JetBrains Mono', monospace; font-size: 0.8125rem; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; }
.card-level.l1 { color: var(--l1); }
.card-level.l2 { color: var(--l2); }
.card-level.l3 { color: var(--l3); }
.card-level.l4 { color: var(--l4); }
.card-level.l5 { color: var(--l5); }
.card-title { font-weight: 600; font-size: 0.9375rem; color: var(--text); line-height: 1.4; }
.card-desc { font-size: 0.9375rem; color: var(--text3); line-height: 1.55; flex: 1; }
.card-tags { display: flex; gap: 5px; flex-wrap: wrap; }
.ctag { font-size: 0.9375rem; padding: 2px 7px; border-radius: 3px; font-weight: 600; font-family: 'JetBrains Mono', monospace; }
.ctag.guide { background: rgba(74,222,128,0.1); color: var(--green); border: 1px solid rgba(74,222,128,0.2); }
.ctag.exam  { background: rgba(91,138,245,0.1); color: var(--blue); border: 1px solid rgba(91,138,245,0.2); }
.ctag.blog  { background: rgba(167,139,250,0.1); color: var(--purple); border: 1px solid rgba(167,139,250,0.2); }
.ctag.lab   { background: rgba(251,146,60,0.1); color: var(--orange); border: 1px solid rgba(251,146,60,0.2); }
.ctag.ref   { background: rgba(138,98,18,0.10); color: var(--gold); border: 1px solid rgba(138,98,18,0.22); }
.ctag.new   { background: rgba(34,211,238,0.1); color: var(--cyan); border: 1px solid rgba(34,211,238,0.2); }
.card-url { font-family: 'JetBrains Mono', monospace; font-size: 0.9375rem; color: var(--text3); background: var(--bg3); padding: 4px 8px; border-radius: 5px; border: 1px solid var(--border); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* CERT STRIPS */
.cert-strip { display: flex; align-items: center; justify-content: space-between; background: var(--bg3); border: 1px solid var(--border); border-radius: 12px; padding: 16px 20px; margin-top: 24px; gap: 16px; flex-wrap: wrap; }
.cert-strip-left { display: flex; align-items: center; gap: 12px; }
.cert-strip-icon { width: 40px; height: 40px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-family: 'JetBrains Mono', monospace; font-size: 0.9375rem; font-weight: 800; color: #fff; flex-shrink: 0; }
.cert-strip-icon.l1 { background: linear-gradient(135deg, var(--l1), #0b5327); }
.cert-strip-icon.l2 { background: linear-gradient(135deg, var(--l2), #1f429c); }
.cert-strip-icon.l3 { background: linear-gradient(135deg, var(--l3), #55209f); }
.cert-strip-icon.l4 { background: linear-gradient(135deg, var(--l4), #7a3a05); }
.cert-strip-icon.l5 { background: linear-gradient(135deg, var(--gold), #6f4d0e); }
.cert-strip-text strong { font-size: 0.9375rem; color: var(--text); display: block; }
.cert-strip-text span { font-size: 0.9375rem; color: var(--text3); }
.cert-btn { background: var(--gold); color: #ffffff; font-weight: 700; font-size: 0.9375rem; padding: 9px 20px; border-radius: 7px; text-decoration: none; white-space: nowrap; transition: opacity 0.2s; }
.cert-btn:hover { opacity: 0.85; }

/* FOOTER */
.site-footer { border-top: 1px solid var(--border); padding: 40px 24px; text-align: center; color: var(--text3); font-size: 0.9375rem; }
.site-footer a { color: var(--text3); text-decoration: none; }
.site-footer a:hover { color: var(--gold); }

/* RESPONSIVE */
@media (max-width: 640px) {
  .hero-stats { gap: 24px; }
  .article-grid { grid-template-columns: 1fr; }
  .level-meta-bar { flex-direction: column; gap: 6px; }
  .nav-links { display: none; }
}
