:root{
  --bg:#0e0f12; --panel:#12141a; --panel-2:#171a21; --ink:#e9eaee; --muted:#98a2b3;
  --accent:red; --accent-2:#FF4BD8; --line:#252a33; --good:#41d391; --warn:#ffb020;
}
*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0; background: radial-gradient(1200px 600px at 20% -10%, #1a2030 0%, #0d0f14 50%, var(--bg) 100%) fixed;
  color:var(--ink); font-family:Inter,system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif; line-height:1.55;
}

.scanline:before{
  content:""; position:fixed; inset:0; pointer-events:none;
  background: repeating-linear-gradient(to bottom, rgba(255,255,255,0.045), rgba(255,255,255,0.045) 1px, transparent 1px, transparent 3px);
  mix-blend-mode: overlay; opacity:.06;
}
.wrap{max-width:1120px; margin:0 auto}

header{
  position:relative; padding:72px 20px 40px; border-bottom:1px solid var(--line);
  background:
    radial-gradient(600px 280px at 70% -80%, rgba(77,224,232,0.25), transparent 60%),
    radial-gradient(500px 240px at 0% -40%, rgba(255,75,216,0.18), transparent 60%);
}
.brand{ display:flex; align-items:center; gap:16px; margin-bottom:26px }
.logo{
  width:68px;height:68px;border-radius:16px;border:1px solid var(--line);
  background:#0e121a; display:grid; place-items:center; overflow:hidden;
  box-shadow: 0 0 0 1px rgba(77,224,232,0.28) inset, 0 12px 30px rgba(0,0,0,.35);
}
.wordmark{ font-family: Orbitron, Inter, sans-serif; letter-spacing:.02em }
.wordmark .name{ font-size:34px; font-weight:800; line-height:1 }
.wordmark .tag{ color:var(--muted); margin-top:6px; font-size:14.5px }

.hero{ display:grid; grid-template-columns: 1.1fr 0.9fr; gap:24px; align-items:start }
@media (max-width: 900px){ .hero{ grid-template-columns:1fr } }

.panel{
  background: linear-gradient(180deg, var(--panel), var(--panel-2));
  border:1px solid var(--line); border-radius:16px; padding:20px;
  box-shadow: 0 10px 30px rgba(0,0,0,.35);
}
.hero h1{ margin:10px 0 8px; font-size:38px; letter-spacing:.01em }
.hero p.lead{ color:var(--muted); margin:0 0 16px; font-size:17px }

.cta{ display:flex; gap:12px; flex-wrap:wrap; margin-top:12px }
.btn{
  appearance:none; border:1px solid var(--line); color:var(--ink); background:#151923;
  padding:10px 14px; border-radius:12px; font-weight:600; cursor:pointer;
  transition:transform .05s ease, box-shadow .15s ease, border-color .2s ease, background .2s ease;
  text-decoration:none; display:inline-flex; align-items:center; gap:10px;
}
.btn:hover{ border-color:#334155; box-shadow: 0 0 0 2px rgba(77,224,232,.15) inset }
.btn:active{ transform:translateY(1px) }
.btn.primary{
  background: linear-gradient(180deg, #14222a, #0f1a21);
  border-color: rgba(77,224,232,.45);
  box-shadow: 0 0 0 1px rgba(77,224,232,.35) inset, 0 6px 14px rgba(77,224,232,.12);
}
.btn.primary:hover{ box-shadow: 0 0 0 2px rgba(77,224,232,.22) inset, 0 10px 20px rgba(77,224,232,.18) }
.btn .arrow{ font-size:18px; line-height:1 }

.fact-grid{ display:grid; grid-template-columns: repeat(3,1fr); gap:16px; margin-top:14px }
@media (max-width:900px){ .fact-grid{ grid-template-columns:1fr } }
.fact .title{ font-weight:800; margin-bottom:6px; display:flex; align-items:center; gap:8px }
.muted{ color:var(--muted) }

.emoji{
  opacity:.85; filter: drop-shadow(0 2px 4px rgba(0,0,0,.25));
  font-size:1.05em; transform: translateY(1px);
}

.card + .card{ margin-top:16px }
.card h3{ margin:0 0 6px; font-size:18px; display:flex; align-items:center; gap:8px }
.kpi{ display:flex; align-items:baseline; gap:8px }
.kpi .big{ font-size:24px; font-weight:800 }
.pill{ display:inline-block; font-size:11px; padding:4px 8px; border:1px solid var(--line); border-radius:999px; color:#b2f9ff; background:rgba(77,224,232,.08) }

.wod-word{ font-size:22px; font-weight:800; letter-spacing:.02em }

.inline-code{
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  background:#0b0e13; border:1px solid #1f2430; padding:2px 6px; border-radius:6px;
}
.copy{
  border:1px solid var(--line); background:#12141a; color:var(--ink); border-radius:10px; padding:8px 10px; cursor:pointer;
  font-size:14px; line-height:1.4;
}
.copy:hover{ border-color:#2f3541 }

.dict{ margin-top:26px }
.dict .search{ display:flex; gap:8px; flex-wrap:wrap; align-items:center; margin-bottom:10px }
.dict input{
  background:#0f131a; color:var(--ink); border:1px solid var(--line); border-radius:10px; padding:10px 12px; width:260px;
}
.dict .tips{ font-size:12.5px; color:var(--muted) }
.table{ width:100%; border-collapse: collapse; border:1px solid var(--line); border-radius:12px; overflow:hidden }
.table th, .table td{ padding:10px 12px; border-bottom:1px solid var(--line); text-align:left; font-size:15px }
.table th{ background:#0f141c; color:#a7b0c1; font-weight:800 }
.table tr:hover td{ background:#101724 }

.sep{ height:1px; background:linear-gradient(90deg, transparent, #223, transparent); margin:18px 0 }

footer{
  border-top:1px solid var(--line); margin-top:40px; padding:22px 20px; color:#a3a8b2; font-size:14px;
  background: linear-gradient(180deg, rgba(20,24,32,.4), rgba(10,12,18,0));
}
html, body {
  max-width: 100%;
  overflow-x: hidden;
}
.scanline:before {
  width: 100%;
  height: 100%;
}

/* Loading states */
.loading { opacity: 0.6; }
.error { color: var(--warn); }
















/* Grammar page styles */
.grammar-header {
  padding: 40px 0 20px;
  border-bottom: 1px solid var(--line);
}
.grammar-breadcrumb {
  font-size: 14px;
  margin-bottom: 20px;
  opacity: 0.8;
}
.breadcrumb-link {
  color: var(--accent);
  text-decoration: none;
}
.breadcrumb-link:hover {
  text-decoration: underline;
}
.breadcrumb-sep {
  margin: 0 8px;
  color: var(--muted);
}
.grammar-title-block {
  text-align: center;
  max-width: 800px;
  margin: 0 auto;
}
.grammar-title {
  font-size: 42px;
  margin: 0 0 16px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.grammar-subtitle {
  font-size: 18px;
  color: var(--muted);
  margin: 0 0 30px;
  line-height: 1.5;
}
.grammar-nav-tabs {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 20px;
}
.nav-tab {
  padding: 10px 16px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 14px;
  font-weight: 500;
}
.nav-tab a {
  color: inherit;
  text-decoration: none;
}
.nav-tab:hover {
  background: var(--panel);
  border-color: var(--accent);
}
.nav-tab.active {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}
.grammar-content {
  padding: 40px 20px;
}
.grammar-layout {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 40px;
  align-items: start;
}
@media (max-width: 1000px) {
  .grammar-layout {
    grid-template-columns: 1fr;
  }
  .grammar-outline {
    position: static !important;
    margin-bottom: 30px;
  }
}
.grammar-outline {
  position: sticky;
  top: 20px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 20px;
  max-height: 80vh;
  overflow-y: auto;
}
.outline-header {
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 16px;
  color: var(--ink);
}
.outline-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.outline-list li {
  margin-bottom: 8px;
}
.outline-list a {
  color: var(--muted);
  text-decoration: none;
  font-size: 13px;
  display: block;
  padding: 6px 12px;
  border-radius: 6px;
  transition: all 0.2s ease;
}
.outline-list a:hover {
  background: var(--panel-2);
  color: var(--accent);
}
.grammar-section {
  margin-bottom: 60px;
  scroll-margin-top: 100px;
}
.section-title {
  font-size: 32px;
  margin: 0 0 30px;
  color: var(--ink);
  border-bottom: 2px solid var(--accent);
  padding-bottom: 10px;
}
.rule-block {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 20px;
}
.rule-block h3 {
  margin: 0 0 16px;
  color: var(--accent);
  font-size: 20px;
}
.rule-content p {
  margin: 0 0 16px;
  line-height: 1.6;
}
.rule-content ul {
  margin: 16px 0;
  padding-left: 20px;
}
.rule-content li {
  margin-bottom: 8px;
  line-height: 1.5;
}
.formula {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  text-align: center;
  margin: 16px 0;
  font-family: 'Monaco', 'Menlo', monospace;
  font-size: 16px;
  font-weight: 600;
}
.examples {
  margin: 20px 0;
}
.example {
  background: var(--panel-2);
  border-left: 4px solid var(--accent);
  padding: 16px;
  margin-bottom: 12px;
  border-radius: 0 8px 8px 0;
}
.example .neelan {
  display: block;
  font-weight: 700;
  font-size: 18px;
  color: var(--accent);
  margin-bottom: 4px;
  font-family: 'Georgia', serif;
}
.example .english {
  display: block;
  color: var(--ink);
  margin-bottom: 4px;
}
.example .breakdown {
  display: block;
  font-size: 13px;
  color: var(--muted);
  font-style: italic;
}
.related-topics {
  background: linear-gradient(135deg, var(--panel) 0%, var(--panel-2) 100%);
  padding: 30px;
  text-align: center;
}
.ref-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-top: 20px;
}
.ref-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 20px;
  text-align: center;
}
.ref-card h4 {
  margin: 0 0 12px;
  color: var(--accent);
  font-size: 16px;
}
.ref-card p {
  margin: 0;
  font-size: 14px;
  line-height: 1.4;
  color: var(--muted);
}
@media (max-width: 600px) {
  .grammar-nav-tabs {
    justify-content: flex-start;
    overflow-x: auto;
    padding-bottom: 10px;
  }
  .nav-tab {
    flex-shrink: 0;
  }
  .ref-grid {
    grid-template-columns: 1fr;
  }
}
