:root {
  --primary: #5b4a8a;
  --primary-light: #7b6aaa;
  --primary-dark: #3d2d6b;
  --accent: #e8a44a;
  --accent-light: #f5c97a;
  --bg: #fafafa;
  --bg-card: #ffffff;
  --text: #2d2d2d;
  --text-light: #6b6b6b;
  --text-lighter: #999;
  --border: #e8e8e8;
  --success: #4caf50;
  --radius: 12px;
  --shadow: 0 2px 12px rgba(0,0,0,.06);
  --shadow-hover: 0 4px 24px rgba(0,0,0,.1);
  --max-w: 1140px;
  --trans: .25s ease;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  font-size: 16px;
}

a { color: var(--primary); text-decoration: none; transition: color var(--trans); }
a:hover { color: var(--accent); }

img { max-width: 100%; height: auto; }

.container { max-width: var(--max-w); margin: 0 auto; padding: 0 24px; }

/* HEADER */
.site-header {
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  color: #fff;
  padding: 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,.15);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  max-width: var(--max-w);
  margin: 0 auto;
}

.site-logo {
  font-size: 1.4rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: -.5px;
}

.site-logo span { color: var(--accent); }

nav ul {
  list-style: none;
  display: flex;
  gap: 8px;
}

nav a {
  color: rgba(255,255,255,.85);
  padding: 8px 16px;
  border-radius: 8px;
  font-size: .9rem;
  font-weight: 500;
  transition: all var(--trans);
}

nav a:hover, nav a.active {
  color: #fff;
  background: rgba(255,255,255,.15);
}

.mobile-toggle {
  display: none;
  background: none;
  border: none;
  color: #fff;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 4px 8px;
}

/* HERO */
.hero {
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 50%, var(--primary-light) 100%);
  color: #fff;
  padding: 80px 24px;
  text-align: center;
}

.hero h1 {
  font-size: 2.6rem;
  font-weight: 800;
  margin-bottom: 16px;
  line-height: 1.2;
}

.hero p {
  font-size: 1.15rem;
  opacity: .9;
  max-width: 640px;
  margin: 0 auto 32px;
  line-height: 1.6;
}

.hero-search {
  max-width: 480px;
  margin: 0 auto;
  position: relative;
}

.hero-search input {
  width: 100%;
  padding: 16px 24px;
  border: none;
  border-radius: 50px;
  font-size: 1rem;
  box-shadow: 0 4px 20px rgba(0,0,0,.2);
  outline: none;
}

.hero-search input::placeholder { color: #aaa; }

/* BREADCRUMBS */
.breadcrumbs {
  padding: 16px 0;
  font-size: .85rem;
  color: var(--text-light);
}

.breadcrumbs a { color: var(--primary); }
.breadcrumbs span { margin: 0 6px; color: var(--text-lighter); }

/* SECTION */
.section {
  padding: 64px 0;
}

.section-title {
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--text);
}

.section-subtitle {
  color: var(--text-light);
  font-size: 1.05rem;
  margin-bottom: 40px;
  max-width: 600px;
}

.section--alt { background: #f3f0f8; }

/* CARD GRID */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
}

.card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow);
  transition: all var(--trans);
  border: 1px solid var(--border);
}

.card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
}

.card-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  margin-bottom: 16px;
}

.card h3 {
  font-size: 1.15rem;
  margin-bottom: 8px;
  font-weight: 600;
}

.card h3 a { color: var(--text); }
.card h3 a:hover { color: var(--primary); }

.card p {
  color: var(--text-light);
  font-size: .92rem;
  line-height: 1.6;
}

.card-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 12px;
  font-size: .88rem;
  font-weight: 600;
  color: var(--primary);
}

.card-link:hover { color: var(--accent); gap: 8px; }

/* SILO HUB */
.silo-list {
  list-style: none;
}

.silo-list li {
  border-bottom: 1px solid var(--border);
}

.silo-list li:last-child { border-bottom: none; }

.silo-list a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  color: var(--text);
  border-radius: 8px;
  transition: all var(--trans);
}

.silo-list a:hover {
  background: #f3f0f8;
  color: var(--primary);
  padding-left: 28px;
}

.silo-list .term-label { font-weight: 600; }
.silo-list .term-arrow { color: var(--text-lighter); font-size: 1.2rem; }

/* DEFINITION PAGE */
.def-page {
  padding: 48px 0 80px;
}

.def-page .container {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 48px;
  align-items: start;
}

.def-main h1 {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 8px;
  line-height: 1.25;
}

.def-main .phonetic {
  color: var(--text-light);
  font-style: italic;
  margin-bottom: 24px;
  font-size: .95rem;
}

.def-main h2 {
  font-size: 1.3rem;
  font-weight: 700;
  margin: 32px 0 12px;
  color: var(--primary-dark);
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.def-main h2:first-of-type { border-top: none; padding-top: 0; }

.def-main p {
  margin-bottom: 16px;
  color: var(--text);
  line-height: 1.8;
}

.def-box {
  background: #f3f0f8;
  border-left: 4px solid var(--primary);
  padding: 20px 24px;
  border-radius: 0 var(--radius) var(--radius) 0;
  margin: 24px 0;
}

.def-box strong {
  display: block;
  font-size: 1.05rem;
  margin-bottom: 6px;
  color: var(--primary-dark);
}

.def-box p { margin-bottom: 0; color: var(--text); }

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0;
}

.tag {
  background: #f3f0f8;
  color: var(--primary);
  padding: 4px 14px;
  border-radius: 50px;
  font-size: .82rem;
  font-weight: 500;
}

/* SIDEBAR */
.sidebar .widget {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  margin-bottom: 24px;
}

.sidebar .widget h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--border);
}

.sidebar .widget ul {
  list-style: none;
}

.sidebar .widget li {
  margin-bottom: 8px;
}

.sidebar .widget li a {
  color: var(--text);
  font-size: .9rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.sidebar .widget li a:hover { color: var(--primary); }
.sidebar .widget li a::before { content: '\2192'; color: var(--primary-light); }

/* CTA BOX */
.cta-box {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: #fff;
  border-radius: var(--radius);
  padding: 32px;
  text-align: center;
  margin: 40px 0;
}

.cta-box h3 {
  font-size: 1.3rem;
  margin-bottom: 12px;
}

.cta-box p {
  opacity: .9;
  margin-bottom: 20px;
  font-size: .95rem;
  color: #fff;
}

.cta-btn {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  padding: 14px 36px;
  border-radius: 50px;
  font-weight: 700;
  font-size: 1rem;
  transition: all var(--trans);
  box-shadow: 0 4px 15px rgba(232,164,74,.3);
}

.cta-btn:hover {
  background: var(--accent-light);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(232,164,74,.4);
}

.cta-box--sidebar {
  padding: 24px;
  margin: 0;
}

.cta-box--sidebar h3 { font-size: 1.1rem; }

/* FAQ */
.faq-item {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 12px;
  overflow: hidden;
}

.faq-q {
  padding: 18px 24px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-card);
  transition: background var(--trans);
}

.faq-q:hover { background: #f9f7fc; }

.faq-a {
  padding: 0 24px 18px;
  color: var(--text-light);
  line-height: 1.7;
  display: none;
}

.faq-item.open .faq-a { display: block; }
.faq-item.open .faq-q { border-bottom: 1px solid var(--border); }

/* FOOTER */
.site-footer {
  background: var(--primary-dark);
  color: rgba(255,255,255,.7);
  padding: 48px 0 24px;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 32px;
  margin-bottom: 40px;
}

.footer-col h4 {
  color: #fff;
  font-size: .95rem;
  margin-bottom: 16px;
  font-weight: 600;
}

.footer-col ul { list-style: none; }

.footer-col li { margin-bottom: 8px; }

.footer-col a {
  color: rgba(255,255,255,.65);
  font-size: .88rem;
  transition: color var(--trans);
}

.footer-col a:hover { color: var(--accent); }

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.1);
  padding-top: 24px;
  text-align: center;
  font-size: .82rem;
}

/* RESPONSIVE */
@media (max-width: 900px) {
  .def-page .container {
    grid-template-columns: 1fr;
  }

  .hero h1 { font-size: 2rem; }
  .hero { padding: 56px 24px; }
}

@media (max-width: 680px) {
  .mobile-toggle { display: block; }

  nav ul {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--primary-dark);
    flex-direction: column;
    padding: 16px;
    gap: 4px;
    box-shadow: 0 8px 24px rgba(0,0,0,.2);
  }

  nav ul.open { display: flex; }
  nav a { padding: 12px 16px; }

  .card-grid {
    grid-template-columns: 1fr;
  }

  .hero h1 { font-size: 1.6rem; }
  .section-title { font-size: 1.4rem; }
  .def-main h1 { font-size: 1.5rem; }
}

/* SCHEMA / STRUCTURED DATA visual */
.schema-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #e8f5e9;
  color: #2e7d32;
  padding: 4px 12px;
  border-radius: 50px;
  font-size: .78rem;
  font-weight: 600;
  margin-bottom: 20px;
}

/* ALPHABET NAV */
.alpha-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 32px;
}

.alpha-nav a {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  font-weight: 600;
  font-size: .9rem;
  color: var(--text);
  transition: all var(--trans);
}

.alpha-nav a:hover, .alpha-nav a.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* STATS */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 20px;
  margin: 40px 0;
}

.stat-box {
  text-align: center;
  padding: 24px;
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

.stat-num {
  font-size: 2rem;
  font-weight: 800;
  color: var(--primary);
  display: block;
}

.stat-label {
  font-size: .85rem;
  color: var(--text-light);
  margin-top: 4px;
}

/* INTERNAL LINKS */
.related-terms {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 20px 0;
}

.related-terms a {
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 8px 18px;
  border-radius: 50px;
  font-size: .88rem;
  font-weight: 500;
  transition: all var(--trans);
}

.related-terms a:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* AUTHOR WIDGET */
.author-widget {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  margin-bottom: 24px;
  text-align: center;
}

.author-widget img {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--primary-light);
  margin-bottom: 12px;
}

.author-widget h4 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 4px;
  color: var(--text);
}

.author-widget .author-role {
  font-size: .8rem;
  color: var(--primary);
  font-weight: 600;
  margin-bottom: 10px;
  display: block;
}

.author-widget p {
  font-size: .84rem;
  color: var(--text-light);
  line-height: 1.55;
  text-align: left;
}
