@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,600;9..144,700&family=Manrope:wght@400;500;600;700;800&display=swap');

/* ============================================================
   Physics Mastery Hub – Main Stylesheet
   Modern, responsive, accessible, AdSense-ready
   ============================================================ */

/* ---------- CSS Variables ---------- */
:root {
  --color-primary:    #12233b;
  --color-secondary:  #18345c;
  --color-accent:     #36a6d6;
  --color-accent2:    #ea6d4e;
  --color-gold:       #f2b84b;
  --color-text:       #223247;
  --color-text-light: #5f7186;
  --color-bg:         #f6f6f0;
  --color-bg-card:    #ffffff;
  --color-border:     #dde4e8;
  --color-success:    #10b981;
  --color-error:      #ef4444;
  --color-warning:    #f59e0b;
  --radius:           18px;
  --radius-sm:        8px;
  --shadow-sm:        0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
  --shadow:           0 4px 16px rgba(0,0,0,.10);
  --shadow-lg:        0 10px 40px rgba(0,0,0,.15);
  --transition:       all .25s ease;
  --font-sans:        'Manrope', 'Segoe UI', Arial, sans-serif;
  --font-display:     'Fraunces', Georgia, serif;
  --font-mono:        'Fira Code', 'Courier New', monospace;
  --max-width:        1200px;
}

/* ---------- Reset & Base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: var(--font-sans);
  color: var(--color-text);
  background:
    radial-gradient(circle at top left, rgba(54,166,214,.10), transparent 28%),
    radial-gradient(circle at top right, rgba(234,109,78,.10), transparent 24%),
    var(--color-bg);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: var(--color-accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- Typography ---------- */
h1, h2, h3, h4, h5 {
  font-weight: 700;
  line-height: 1.25;
  color: var(--color-primary);
  font-family: var(--font-display);
  letter-spacing: -.02em;
}
h1 { font-size: clamp(1.8rem, 4vw, 2.8rem); }
h2 { font-size: clamp(1.4rem, 3vw, 2rem); margin-bottom: 1rem; }
h3 { font-size: clamp(1.1rem, 2.5vw, 1.4rem); margin-bottom: .6rem; }
h4 { font-size: 1.05rem; }
p { margin-bottom: 1rem; color: var(--color-text); }
ul, ol { padding-left: 1.5rem; margin-bottom: 1rem; }
li { margin-bottom: .4rem; }

/* ---------- Skip link (accessibility) ---------- */
.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  background: var(--color-accent);
  color: #fff;
  padding: .5rem 1rem;
  border-radius: var(--radius-sm);
  font-weight: 700;
  z-index: 9999;
  transition: top .2s;
}
.skip-link:focus { top: 1rem; }

/* ---------- Top Bar ---------- */
.top-bar {
  background: var(--color-primary);
  color: rgba(255,255,255,.7);
  font-size: .8rem;
  text-align: center;
  padding: .35rem 1rem;
  letter-spacing: .05em;
}
.top-bar a { color: var(--color-accent); }

/* ---------- Header / Nav ---------- */
.site-header {
  background: var(--color-secondary);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 12px rgba(0,0,0,.25);
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .8rem 1.5rem;
  gap: 1rem;
}

.logo {
  display: flex;
  align-items: center;
  gap: .6rem;
  text-decoration: none;
}
.logo-icon {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--color-accent), var(--color-accent2));
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}
.logo-text { color: #fff; font-size: 1.15rem; font-weight: 800; letter-spacing: -.02em; }
.logo-text span { color: var(--color-accent); }

/* hamburger */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: .4rem;
  flex-direction: column;
  gap: 5px;
}
.nav-toggle span {
  display: block; width: 24px; height: 2px;
  background: #fff; border-radius: 2px;
  transition: var(--transition);
}
.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.main-nav { display: flex; align-items: center; gap: .2rem; }
.main-nav a {
  color: rgba(255,255,255,.85);
  font-size: .88rem;
  font-weight: 600;
  padding: .45rem .75rem;
  border-radius: var(--radius-sm);
  transition: var(--transition);
  white-space: nowrap;
}
.main-nav a:hover, .main-nav a.active {
  background: rgba(0,170,255,.15);
  color: var(--color-accent);
  text-decoration: none;
}

/* ---------- Hero Section ---------- */
.hero {
  background: linear-gradient(135deg, var(--color-primary) 0%, #1a3a6b 50%, var(--color-accent2) 100%);
  color: #fff;
  padding: 5rem 1.5rem 4rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute; inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.hero-inner { position: relative; max-width: 800px; margin: 0 auto; }
.hero-badge {
  display: inline-block;
  background: rgba(0,170,255,.2);
  border: 1px solid rgba(0,170,255,.4);
  color: var(--color-accent);
  font-size: .78rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  padding: .35rem .9rem; border-radius: 100px; margin-bottom: 1.2rem;
}
.hero h1 { color: #fff; margin-bottom: 1.2rem; }
.hero p { font-size: 1.15rem; color: rgba(255,255,255,.8); margin-bottom: 2rem; max-width: 600px; margin-left: auto; margin-right: auto; }
.hero-cta { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  font-weight: 700; font-size: .92rem;
  padding: .7rem 1.6rem; border-radius: var(--radius-sm);
  cursor: pointer; transition: var(--transition);
  border: 2px solid transparent; text-decoration: none;
}
.btn-primary {
  background: var(--color-accent);
  color: var(--color-primary);
}
.btn-primary:hover { background: #0090dd; transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0,170,255,.35); text-decoration: none; }
.btn-outline {
  background: transparent;
  border-color: rgba(255,255,255,.5);
  color: #fff;
}
.btn-outline:hover { border-color: #fff; background: rgba(255,255,255,.1); transform: translateY(-2px); text-decoration: none; }
.btn-sm { padding: .45rem 1rem; font-size: .82rem; }
.btn-gold {
  background: var(--color-gold);
  color: var(--color-primary);
}
.btn-gold:hover { background: #d97706; transform: translateY(-2px); text-decoration: none; }

/* ---------- Stats Bar ---------- */
.stats-bar {
  background: #fff;
  border-bottom: 1px solid var(--color-border);
  padding: 1.2rem 1.5rem;
}
.stats-inner {
  max-width: var(--max-width); margin: 0 auto;
  display: flex; justify-content: center; gap: 3rem; flex-wrap: wrap;
}
.stat-item { text-align: center; }
.stat-number { font-size: 1.6rem; font-weight: 800; color: var(--color-accent2); }
.stat-label { font-size: .78rem; color: var(--color-text-light); text-transform: uppercase; letter-spacing: .06em; }

/* ---------- Section wrapper ---------- */
.section {
  padding: 4rem 1.5rem;
}
.section-inner {
  max-width: var(--max-width);
  margin: 0 auto;
}
.section-alt { background: #f1f5f9; }
.section-dark {
  background: var(--color-primary);
  color: #fff;
}
.section-dark h2, .section-dark h3, .section-dark p { color: rgba(255,255,255,.9); }

.section-header { text-align: center; margin-bottom: 3rem; }
.section-header p { color: var(--color-text-light); font-size: 1.05rem; max-width: 600px; margin: .5rem auto 0; }

/* ---------- Cards ---------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}
.card-grid-2 { grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); }

.card {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.6rem;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: var(--color-accent); }
.card-icon {
  font-size: 2rem; margin-bottom: .8rem;
  width: 52px; height: 52px;
  background: linear-gradient(135deg, rgba(0,170,255,.12), rgba(124,58,237,.12));
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
}
.card h3 { color: var(--color-primary); margin-bottom: .5rem; }
.card p { color: var(--color-text-light); font-size: .92rem; margin-bottom: 0; }
.card-link {
  margin-top: 1rem;
  display: inline-flex; align-items: center; gap: .3rem;
  font-size: .88rem; font-weight: 700; color: var(--color-accent);
}
.card-link:hover { gap: .6rem; text-decoration: none; }

.formula-cell {
  white-space: nowrap;
  font-family: var(--font-mono);
}

/* Featured card */
.card-featured {
  background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
  border-color: rgba(0,170,255,.3);
  color: #fff;
}
.card-featured h3, .card-featured p { color: rgba(255,255,255,.9); }
.card-featured .card-icon { background: rgba(255,255,255,.1); }

/* Theory card */
.theory-card {
  border-left: 4px solid var(--color-accent);
  display: flex; flex-direction: column; gap: .5rem;
}
.theory-number {
  font-size: .75rem; font-weight: 800; color: var(--color-accent);
  text-transform: uppercase; letter-spacing: .12em;
}
.theory-tags { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .4rem; }
.tag {
  display: inline-block;
  font-size: .7rem; font-weight: 700;
  padding: .2rem .6rem; border-radius: 100px;
  background: rgba(0,170,255,.1); color: var(--color-accent);
  border: 1px solid rgba(0,170,255,.25);
  text-transform: uppercase; letter-spacing: .06em;
}
.tag-purple { background: rgba(124,58,237,.1); color: var(--color-accent2); border-color: rgba(124,58,237,.25); }
.tag-gold { background: rgba(245,158,11,.1); color: #92400e; border-color: rgba(245,158,11,.3); }
.tag-green { background: rgba(16,185,129,.1); color: #065f46; border-color: rgba(16,185,129,.25); }

/* ---------- Formula Table ---------- */
.filter-bar {
  display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; margin-bottom: 2rem;
  background: #fff; padding: 1.2rem 1.5rem; border-radius: var(--radius); border: 1px solid var(--color-border);
}
.filter-bar label { font-weight: 700; font-size: .88rem; color: var(--color-text-light); white-space: nowrap; }
.filter-bar select, .filter-bar input {
  border: 1px solid var(--color-border); border-radius: var(--radius-sm);
  padding: .5rem .9rem; font-size: .9rem; background: var(--color-bg);
  color: var(--color-text); outline: none; transition: var(--transition);
}
.filter-bar select:focus, .filter-bar input:focus { border-color: var(--color-accent); box-shadow: 0 0 0 3px rgba(0,170,255,.15); }
.filter-bar input { flex: 1; min-width: 200px; }

.formula-count {
  margin-left: auto; font-size: .85rem; color: var(--color-text-light); font-weight: 600;
}

.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--color-border); }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
thead { background: var(--color-primary); }
th { color: #fff; font-weight: 700; padding: .9rem 1rem; text-align: left; font-size: .82rem; text-transform: uppercase; letter-spacing: .07em; white-space: nowrap; }
td { padding: .85rem 1rem; border-bottom: 1px solid var(--color-border); vertical-align: top; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:nth-child(even) td { background: #f8fafc; }
tbody tr:hover td { background: rgba(0,170,255,.05); }
.formula-cell { font-family: var(--font-mono); font-size: .95rem; color: var(--color-accent2); font-weight: 600; }
.levels-cell { display: flex; flex-wrap: wrap; gap: .3rem; }

/* ---------- Breadcrumb ---------- */
.breadcrumb {
  background: #fff; border-bottom: 1px solid var(--color-border);
  padding: .7rem 1.5rem;
}
.breadcrumb-inner { max-width: var(--max-width); margin: 0 auto; font-size: .82rem; color: var(--color-text-light); }
.breadcrumb-inner a { color: var(--color-text-light); }
.breadcrumb-inner a:hover { color: var(--color-accent); }
.breadcrumb-inner span { margin: 0 .4rem; }

/* ---------- Page Hero (sub-pages) ---------- */
.page-hero {
  background: linear-gradient(135deg, var(--color-primary) 0%, #1a3a6b 100%);
  color: #fff; padding: 3.5rem 1.5rem;
}
.page-hero-inner { max-width: var(--max-width); margin: 0 auto; }
.page-hero h1 { color: #fff; margin-bottom: .6rem; }
.page-hero p { color: rgba(255,255,255,.75); font-size: 1.05rem; max-width: 600px; margin-bottom: 0; }

/* ---------- Accordion (for theory details) ---------- */
.accordion { display: flex; flex-direction: column; gap: .75rem; }
.accordion-item { background: #fff; border: 1px solid var(--color-border); border-radius: var(--radius); overflow: hidden; }
.accordion-header {
  width: 100%; text-align: left; background: none; border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.1rem 1.4rem; font-size: 1rem; font-weight: 700; color: var(--color-primary);
  transition: var(--transition); gap: 1rem;
}
.accordion-header:hover { background: rgba(0,170,255,.05); color: var(--color-accent); }
.accordion-header.open { color: var(--color-accent); background: rgba(0,170,255,.05); }
.accordion-icon { font-size: 1.2rem; flex-shrink: 0; transition: transform .3s; }
.accordion-header.open .accordion-icon { transform: rotate(45deg); }
.accordion-body { display: none; padding: 0 1.4rem 1.4rem; }
.accordion-body.open { display: block; }
.accordion-body p, .accordion-body ul { font-size: .95rem; }
.accordion-meta { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: .8rem; }

/* ---------- Quiz Module ---------- */
.quiz-container {
  background: #fff; border: 1px solid var(--color-border); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow);
}
.quiz-header {
  background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
  color: #fff; padding: 1.5rem 2rem;
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 1rem;
}
.quiz-header h2 { color: #fff; margin-bottom: 0; }
.quiz-progress-bar-wrap { background: rgba(255,255,255,.2); border-radius: 100px; height: 8px; width: 200px; }
.quiz-progress-bar { background: var(--color-accent); border-radius: 100px; height: 8px; transition: width .4s ease; }
.quiz-body { padding: 2rem; }
.quiz-question { font-size: 1.15rem; font-weight: 700; color: var(--color-primary); margin-bottom: 1.5rem; line-height: 1.5; }
.quiz-options { display: flex; flex-direction: column; gap: .75rem; }
.quiz-option {
  background: var(--color-bg); border: 2px solid var(--color-border);
  border-radius: var(--radius-sm); padding: .9rem 1.2rem;
  cursor: pointer; transition: var(--transition); font-size: .95rem;
  display: flex; align-items: center; gap: .8rem;
}
.quiz-option:hover { border-color: var(--color-accent); background: rgba(0,170,255,.05); }
.quiz-option.selected { border-color: var(--color-accent); background: rgba(0,170,255,.1); }
.quiz-option.correct { border-color: var(--color-success); background: rgba(16,185,129,.1); }
.quiz-option.incorrect { border-color: var(--color-error); background: rgba(239,68,68,.08); }
.quiz-option-letter {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--color-border); color: var(--color-text-light);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: .82rem; flex-shrink: 0;
}
.quiz-option.selected .quiz-option-letter { background: var(--color-accent); color: #fff; }
.quiz-option.correct .quiz-option-letter { background: var(--color-success); color: #fff; }
.quiz-option.incorrect .quiz-option-letter { background: var(--color-error); color: #fff; }
.quiz-feedback {
  margin-top: 1.2rem; padding: 1rem 1.2rem; border-radius: var(--radius-sm);
  font-size: .92rem; display: none;
}
.quiz-feedback.show { display: block; }
.quiz-feedback.correct-fb { background: rgba(16,185,129,.12); border: 1px solid rgba(16,185,129,.3); color: #065f46; }
.quiz-feedback.incorrect-fb { background: rgba(239,68,68,.08); border: 1px solid rgba(239,68,68,.25); color: #991b1b; }
.quiz-footer {
  padding: 1.2rem 2rem; border-top: 1px solid var(--color-border);
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 1rem;
}
.quiz-score-display { font-size: .9rem; font-weight: 700; color: var(--color-text-light); }
.quiz-results {
  text-align: center; padding: 3rem 2rem;
}
.quiz-score-circle {
  width: 120px; height: 120px; border-radius: 50%;
  background: linear-gradient(135deg, var(--color-accent), var(--color-accent2));
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  margin: 0 auto 1.5rem; color: #fff;
}
.quiz-score-number { font-size: 2.2rem; font-weight: 900; line-height: 1; }
.quiz-score-label { font-size: .72rem; opacity: .85; text-transform: uppercase; letter-spacing: .08em; }

/* ---------- Timeline ---------- */
.timeline { position: relative; padding-left: 2.5rem; }
.timeline::before {
  content: ''; position: absolute; left: 8px; top: 0; bottom: 0;
  width: 2px; background: linear-gradient(to bottom, var(--color-accent), var(--color-accent2));
}
.timeline-item { position: relative; margin-bottom: 2.5rem; }
.timeline-dot {
  position: absolute; left: -2.5rem; top: .35rem;
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--color-accent); border: 3px solid #fff; box-shadow: 0 0 0 2px var(--color-accent);
}
.timeline-year {
  font-size: .75rem; font-weight: 800; color: var(--color-accent);
  text-transform: uppercase; letter-spacing: .1em; margin-bottom: .3rem;
}
.timeline-item h3 { color: var(--color-primary); font-size: 1rem; margin-bottom: .3rem; }
.timeline-item p { font-size: .88rem; color: var(--color-text-light); margin-bottom: 0; }

/* ---------- Glossary ---------- */
.glossary-search-bar {
  display: flex; gap: .8rem; margin-bottom: 1.5rem;
}
.glossary-search-bar input {
  flex: 1; border: 1px solid var(--color-border); border-radius: var(--radius-sm);
  padding: .65rem 1rem; font-size: .95rem; outline: none; transition: var(--transition);
}
.glossary-search-bar input:focus { border-color: var(--color-accent); box-shadow: 0 0 0 3px rgba(0,170,255,.15); }
.alpha-filter { display: flex; flex-wrap: wrap; gap: .3rem; margin-bottom: 1.5rem; }
.alpha-btn {
  width: 32px; height: 32px; border: 1px solid var(--color-border); background: #fff;
  border-radius: var(--radius-sm); font-size: .8rem; font-weight: 700; cursor: pointer;
  transition: var(--transition); display: flex; align-items: center; justify-content: center;
}
.alpha-btn:hover, .alpha-btn.active { background: var(--color-accent); color: #fff; border-color: var(--color-accent); }
.glossary-list { display: flex; flex-direction: column; gap: .6rem; }
.glossary-item {
  background: #fff; border: 1px solid var(--color-border); border-radius: var(--radius-sm);
  padding: 1rem 1.2rem;
}
.glossary-term { font-weight: 800; color: var(--color-primary); font-size: 1rem; }
.glossary-def { font-size: .9rem; color: var(--color-text-light); margin-top: .2rem; margin-bottom: 0; }
.no-results { text-align: center; padding: 3rem; color: var(--color-text-light); }

/* ---------- Info Box / Callout ---------- */
.callout {
  border-left: 4px solid var(--color-accent); background: rgba(0,170,255,.07);
  padding: 1rem 1.2rem; border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin: 1.2rem 0;
}
.callout-purple { border-color: var(--color-accent2); background: rgba(124,58,237,.07); }
.callout-gold { border-color: var(--color-gold); background: rgba(245,158,11,.07); }
.callout h4 { color: var(--color-primary); margin-bottom: .3rem; font-size: .9rem; text-transform: uppercase; letter-spacing: .06em; }
.callout p { margin-bottom: 0; font-size: .92rem; }

/* ---------- Did You Know box ---------- */
.did-you-know {
  background: linear-gradient(135deg, var(--color-primary), #1a3a6b);
  color: #fff; border-radius: var(--radius); padding: 1.5rem 1.8rem; margin: 2rem 0;
  position: relative; overflow: hidden;
}
.did-you-know::before { content: '"'; font-size: 8rem; position: absolute; top: -1.5rem; left: .5rem; opacity: .08; font-family: Georgia, serif; line-height: 1; }
.did-you-know .label { font-size: .72rem; text-transform: uppercase; letter-spacing: .12em; color: var(--color-accent); font-weight: 800; margin-bottom: .4rem; }
.did-you-know p { color: rgba(255,255,255,.9); margin-bottom: 0; font-style: italic; }

/* ---------- AdSense Ad Slots ---------- */
.ad-slot {
  background: #f1f5f9; border: 1px dashed var(--color-border); border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  text-align: center; color: var(--color-text-light); font-size: .8rem;
  min-height: 90px; padding: 1rem; overflow: hidden;
}
.ad-slot-banner { min-height: 90px; }
.ad-slot-square { min-height: 250px; }
.ad-slot-responsive { min-height: 120px; }
.ad-wrap { padding: 1rem 0; }
.ad-label { text-align: center; font-size: .7rem; color: var(--color-text-light); margin-bottom: .3rem; text-transform: uppercase; letter-spacing: .06em; }

/* ---------- Editorial Layouts ---------- */
.eyebrow,
.section-kicker {
  display: inline-block;
  font-size: .76rem;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--color-accent2);
  margin-bottom: .85rem;
}

.hero-editorial {
  text-align: left;
  padding-top: 4.75rem;
  padding-bottom: 4.25rem;
}

.hero-split {
  position: relative;
  z-index: 1;
  max-width: var(--max-width);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.15fr .85fr;
  gap: 2rem;
  align-items: center;
}

.hero-copy p {
  max-width: 640px;
  margin-left: 0;
}

.hero-copy h1 {
  font-size: clamp(2.5rem, 6vw, 4.7rem);
  line-height: 1.04;
}

.hero-note {
  max-width: 620px;
  font-size: .95rem;
  color: rgba(255,255,255,.72);
}

.hero-metrics {
  display: flex;
  gap: .85rem;
  flex-wrap: wrap;
  margin-top: 1.4rem;
}

.hero-metric {
  padding: .8rem 1rem;
  border: 1px solid rgba(255,255,255,.18);
  background: rgba(255,255,255,.08);
  border-radius: 14px;
  min-width: 130px;
}

.hero-metric strong {
  display: block;
  font-size: 1.1rem;
  color: #fff;
}

.hero-metric span {
  font-size: .78rem;
  color: rgba(255,255,255,.7);
  text-transform: uppercase;
  letter-spacing: .08em;
}

.orbital-panel,
.quote-panel,
.policy-card,
.contact-card,
.resource-roadmap,
.faq-item,
.publication-card {
  background: rgba(255,255,255,.92);
  border: 1px solid rgba(255,255,255,.5);
  border-radius: 24px;
  box-shadow: var(--shadow-lg);
}

.orbital-panel {
  padding: 1.6rem;
  position: relative;
  overflow: hidden;
}

.orbital-panel::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 30%, rgba(54,166,214,.12), transparent 24%),
    radial-gradient(circle at 80% 20%, rgba(234,109,78,.14), transparent 22%);
  pointer-events: none;
}

.orbital-panel > * {
  position: relative;
  z-index: 1;
}

.orbital-list,
.compact-list,
.checklist {
  list-style: none;
  padding: 0;
  margin: 0;
}

.orbital-list li,
.compact-list li,
.checklist li {
  border-top: 1px solid var(--color-border);
  padding: .8rem 0;
  margin: 0;
}

.orbital-list li:first-child,
.compact-list li:first-child,
.checklist li:first-child {
  border-top: 0;
  padding-top: 0;
}

.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
  margin-top: 1rem;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .45rem .8rem;
  border-radius: 999px;
  background: rgba(18,35,59,.07);
  border: 1px solid rgba(18,35,59,.08);
  font-size: .82rem;
  font-weight: 700;
  color: var(--color-primary);
}

.path-grid,
.publication-grid,
.trust-grid,
.policy-grid,
.contact-grid,
.faq-grid {
  display: grid;
  gap: 1.4rem;
}

.path-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.publication-grid,
.trust-grid,
.policy-grid,
.contact-grid,
.faq-grid {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.path-card,
.trust-card,
.policy-card,
.contact-card,
.faq-item,
.publication-card {
  padding: 1.45rem;
}

.path-card {
  background: linear-gradient(180deg, rgba(255,255,255,.94), rgba(255,255,255,.82));
  border: 1px solid var(--color-border);
  border-radius: 22px;
  box-shadow: var(--shadow);
}

.path-card h3,
.publication-card h3,
.trust-card h3,
.policy-card h3,
.contact-card h3,
.faq-item h3 {
  margin-bottom: .55rem;
}

.mini-meta {
  font-size: .78rem;
  color: var(--color-text-light);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-bottom: .7rem;
}

.quote-panel {
  padding: 1.8rem;
  background: linear-gradient(135deg, rgba(18,35,59,.96), rgba(24,52,92,.96));
  color: rgba(255,255,255,.86);
}

.quote-panel h1,
.quote-panel h2,
.quote-panel h3,
.quote-panel p,
.quote-panel li {
  color: inherit;
}

.quote-panel strong {
  color: #fff;
}

.quote-panel a {
  color: #fff;
}

.blog-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
}

.blog-stat-card {
  background: rgba(255,255,255,.88);
  border: 1px solid var(--color-border);
  border-radius: 20px;
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
}

.blog-stat-card strong {
  display: block;
  font-size: 2rem;
  color: var(--color-primary);
  line-height: 1;
  margin-bottom: .35rem;
}

.blog-stat-card span {
  display: block;
  font-size: .78rem;
  color: var(--color-text-light);
  text-transform: uppercase;
  letter-spacing: .1em;
  margin-bottom: .55rem;
}

.schedule-list {
  display: flex;
  flex-direction: column;
  gap: .9rem;
}

.schedule-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  padding: 1rem 1.1rem;
  background: rgba(255,255,255,.86);
  border: 1px solid var(--color-border);
  border-radius: 18px;
}

.schedule-item h3 {
  font-size: 1.02rem;
  margin-bottom: .3rem;
}

.schedule-item time {
  display: inline-block;
  white-space: nowrap;
  font-size: .82rem;
  font-weight: 800;
  color: var(--color-accent2);
  text-transform: uppercase;
  letter-spacing: .08em;
}

.meta-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
  margin-top: .75rem;
}

.meta-chip {
  display: inline-flex;
  align-items: center;
  padding: .28rem .65rem;
  border-radius: 999px;
  background: rgba(54,166,214,.10);
  border: 1px solid rgba(54,166,214,.18);
  color: var(--color-primary);
  font-size: .75rem;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.post-shell {
  max-width: 860px;
  margin: 0 auto;
}

.post-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
  margin: 1rem 0 1.4rem;
}

.post-body {
  background: rgba(255,255,255,.94);
  border: 1px solid var(--color-border);
  border-radius: 24px;
  padding: 1.8rem;
  box-shadow: var(--shadow);
}

.post-body section + section {
  margin-top: 1.8rem;
  padding-top: 1.8rem;
  border-top: 1px solid var(--color-border);
}

.post-body h2 {
  margin-bottom: .75rem;
}

.post-body ul {
  margin-bottom: 0;
}

.takeaway-grid,
.glossary-grid,
.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.takeaway-card,
.glossary-card,
.related-card {
  background: rgba(247,248,251,.96);
  border: 1px solid var(--color-border);
  border-radius: 18px;
  padding: 1rem 1.05rem;
  box-shadow: var(--shadow-sm);
}

.takeaway-card p:last-child,
.glossary-card p:last-child,
.related-card p:last-child {
  margin-bottom: 0;
}

.glossary-card h3,
.related-card h3 {
  font-size: .98rem;
  margin-bottom: .35rem;
}

.related-card .card-link,
.schedule-link {
  margin-top: .85rem;
}

.scheduled-note {
  background: rgba(234,109,78,.08);
  border: 1px solid rgba(234,109,78,.22);
  border-radius: 18px;
  padding: 1rem 1.1rem;
  color: var(--color-primary);
}

.scheduled-note-strong {
  margin-bottom: 1.4rem;
}

.resource-roadmap {
  padding: 1.6rem;
}

.roadmap-step {
  padding: 1rem 0;
  border-top: 1px solid var(--color-border);
}

.roadmap-step:first-child {
  border-top: 0;
  padding-top: 0;
}

.roadmap-step h3 {
  margin-bottom: .4rem;
}

.publication-card {
  position: relative;
  overflow: hidden;
}

.publication-card::after {
  content: '';
  position: absolute;
  inset: auto 1.4rem 0 1.4rem;
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--color-accent), var(--color-accent2));
}

.publication-card p:last-child,
.path-card p:last-child,
.trust-card p:last-child,
.policy-card p:last-child,
.contact-card p:last-child,
.faq-item p:last-child {
  margin-bottom: 0;
}

.trust-card {
  background: rgba(255,255,255,.76);
  border: 1px solid var(--color-border);
  border-radius: 22px;
}

.section-intro {
  max-width: 760px;
  margin: 0 0 2rem;
}

.author-box,
.callout-panel {
  background: rgba(255,255,255,.82);
  border: 1px solid var(--color-border);
  border-radius: 22px;
  padding: 1.35rem 1.45rem;
  box-shadow: var(--shadow-sm);
}

.author-box h4,
.callout-panel h4 {
  margin-bottom: .35rem;
}

.alpha-btn.active {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
}

/* ---------- Legacy Pages ---------- */
body > header:not(.site-header) {
  background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
  color: #fff;
  padding: 3.5rem 1.5rem 2.25rem;
  text-align: center;
}

body > header:not(.site-header) h1,
body > header:not(.site-header) p {
  color: inherit;
}

body > header:not(.site-header) p {
  max-width: 760px;
  margin: 0 auto;
  color: rgba(255,255,255,.78);
}

body > nav:not(.main-nav) {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1rem 1.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: .55rem;
}

body > nav:not(.main-nav) a {
  display: inline-flex;
  align-items: center;
  padding: .45rem .8rem;
  border-radius: 999px;
  background: rgba(18,35,59,.06);
  border: 1px solid var(--color-border);
  color: var(--color-primary);
  font-size: .86rem;
  font-weight: 700;
  text-decoration: none;
}

body > nav:not(.main-nav) a:hover {
  background: rgba(54,166,214,.12);
}

body > main:not(#main-content) {
  max-width: 920px;
  margin: 0 auto;
  padding: 1.5rem;
}

body > main:not(#main-content) section {
  background: rgba(255,255,255,.82);
  border: 1px solid var(--color-border);
  border-radius: 22px;
  padding: 1.4rem;
  margin-bottom: 1.2rem;
  box-shadow: var(--shadow-sm);
}

body > footer:not(.site-footer) {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1rem 1.5rem 2rem;
  text-align: center;
  color: var(--color-text-light);
}

.update-info {
  font-size: .82rem;
  color: var(--color-text-light);
  margin: 1rem 0 1.5rem;
}

#cookie-banner {
  position: fixed;
  left: 1rem;
  right: 1rem;
  bottom: 1rem;
  z-index: 1100;
  background: rgba(18,35,59,.96);
  color: rgba(255,255,255,.84);
  border-radius: 18px;
  padding: 1rem 1.2rem;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

#cookie-banner button {
  border: 0;
  border-radius: 999px;
  padding: .55rem .95rem;
  background: var(--color-gold);
  color: var(--color-primary);
  font-weight: 800;
  cursor: pointer;
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--color-primary);
  color: rgba(255,255,255,.75);
  padding: 3.5rem 1.5rem 1.5rem;
}
.footer-inner {
  max-width: var(--max-width); margin: 0 auto;
  display: grid; grid-template-columns: 2fr repeat(3, 1fr); gap: 2.5rem;
  margin-bottom: 2.5rem;
}
.footer-brand .logo-text { font-size: 1.1rem; margin-bottom: .8rem; display: block; }
.footer-brand p { font-size: .88rem; color: rgba(255,255,255,.55); margin-bottom: 1rem; }
.footer-col h4 { color: #fff; font-size: .85rem; text-transform: uppercase; letter-spacing: .1em; margin-bottom: .9rem; }
.footer-col ul { list-style: none; padding: 0; margin: 0; }
.footer-col ul li { margin-bottom: .5rem; }
.footer-col ul li a { color: rgba(255,255,255,.55); font-size: .88rem; transition: var(--transition); }
.footer-col ul li a:hover { color: var(--color-accent); text-decoration: none; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.1); padding-top: 1.5rem;
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 1rem;
  font-size: .82rem; color: rgba(255,255,255,.4);
}
.footer-bottom a { color: rgba(255,255,255,.55); }
.footer-bottom a:hover { color: var(--color-accent); }

/* ---------- Back to top ---------- */
#back-to-top {
  position: fixed; bottom: 1.5rem; right: 1.5rem; z-index: 999;
  background: var(--color-accent2); color: #fff;
  width: 44px; height: 44px; border-radius: 50%; border: none; cursor: pointer;
  font-size: 1.2rem; display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-lg); opacity: 0; pointer-events: none;
  transition: opacity .3s, transform .3s;
}
#back-to-top.visible { opacity: 1; pointer-events: all; }
#back-to-top:hover { transform: translateY(-3px); }

/* ---------- Dark mode toggle (in nav) ---------- */
.dark-toggle {
  background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.2);
  color: #fff; border-radius: var(--radius-sm); padding: .3rem .6rem;
  cursor: pointer; font-size: .85rem; transition: var(--transition);
}
.dark-toggle:hover { background: rgba(255,255,255,.2); }

/* ---------- Dark Mode ---------- */
body.dark-mode {
  --color-bg: #0f172a;
  --color-bg-card: #1e293b;
  --color-text: #e2e8f0;
  --color-text-light: #94a3b8;
  --color-border: #334155;
  --color-primary: #1e40af;
  --color-secondary: #1e3a8a;
}
body.dark-mode .breadcrumb,
body.dark-mode .stats-bar,
body.dark-mode .filter-bar,
body.dark-mode .accordion-item,
body.dark-mode .card,
body.dark-mode .glossary-item,
body.dark-mode .quiz-container,
body.dark-mode table td { background: var(--color-bg-card); }
body.dark-mode thead { background: #0f172a; }
body.dark-mode h1,
body.dark-mode h2,
body.dark-mode h3,
body.dark-mode h4 { color: #e2e8f0; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .footer-inner { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 700px) {
  .nav-toggle { display: flex; }
  .main-nav {
    display: none; flex-direction: column; width: 100%;
    background: var(--color-secondary); padding: .5rem 0 1rem;
    position: absolute; top: 100%; left: 0; right: 0;
    box-shadow: 0 8px 24px rgba(0,0,0,.3);
  }
  .main-nav.open { display: flex; }
  .main-nav a { padding: .65rem 1.5rem; border-radius: 0; }
  .site-header { position: relative; }
  .header-inner { flex-wrap: wrap; }
  .footer-inner { grid-template-columns: 1fr; }
  .stats-inner { gap: 1.5rem; }
  .quiz-footer { flex-direction: column; }
  .quiz-progress-bar-wrap { width: 100%; }
  .hero-split { grid-template-columns: 1fr; }
  #cookie-banner {
    flex-direction: column;
    align-items: stretch;
  }
}

@media (max-width: 480px) {
  .hero { padding: 3rem 1rem 2.5rem; }
  .section { padding: 2.5rem 1rem; }
  .card-grid { grid-template-columns: 1fr; }
  .filter-bar { flex-direction: column; align-items: stretch; }
  .formula-count { margin-left: 0; }
}

/* ---------- Animations ---------- */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
.animate-fade-up { animation: fadeUp .5s ease both; }
.delay-1 { animation-delay: .1s; }
.delay-2 { animation-delay: .2s; }
.delay-3 { animation-delay: .3s; }

/* Intersection observer fade-in */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .6s ease, transform .6s ease; }
.reveal.visible { opacity: 1; transform: none; }

/* ---------- Utility ---------- */
.text-center { text-align: center; }
.text-muted { color: var(--color-text-light); }
.mt-1 { margin-top: .5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mb-0 { margin-bottom: 0; }
.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.gap-1 { gap: .5rem; }
.gap-2 { gap: 1rem; }
.w-full { width: 100%; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }

/* ============================================================
   PHASE 1–5 PREMIUM ADDITIONS
   ============================================================ */

/* ---------- Sitewide Cookie Consent Bar ---------- */
#phub-cookie-bar {
  position: fixed;
  left: 1rem; right: 1rem; bottom: 1rem;
  z-index: 1200;
  background: rgba(15,23,42,.97);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: rgba(255,255,255,.85);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 20px;
  padding: 1.1rem 1.4rem;
  box-shadow: 0 16px 48px rgba(0,0,0,.45);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.2rem;
  animation: slideUp .35s cubic-bezier(.34,1.56,.64,1) both;
  max-width: 900px;
  margin: 0 auto;
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}
#phub-cookie-bar p {
  margin: 0;
  font-size: .88rem;
  color: rgba(255,255,255,.8);
  line-height: 1.5;
}
#phub-cookie-bar a { color: var(--color-accent); text-decoration: underline; }
#phub-cookie-ok {
  flex-shrink: 0;
  border: 0;
  border-radius: 999px;
  padding: .6rem 1.3rem;
  background: var(--color-gold);
  color: var(--color-primary);
  font-weight: 800;
  font-size: .88rem;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}
#phub-cookie-ok:hover { background: #d97706; transform: scale(1.04); }

/* ---------- Reading Progress Bar ---------- */
#phub-reading-bar {
  position: fixed;
  top: 0; left: 0;
  height: 3px;
  width: 0%;
  background: linear-gradient(90deg, var(--color-accent), var(--color-accent2));
  z-index: 9999;
  transition: width .1s linear;
  border-radius: 0 2px 2px 0;
}

/* ---------- Blog Article Body ---------- */
.article-shell {
  max-width: 800px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 4rem;
}
.article-body {
  background: rgba(255,255,255,.96);
  border: 1px solid var(--color-border);
  border-radius: 24px;
  padding: 2.2rem 2.5rem;
  box-shadow: var(--shadow);
  line-height: 1.85;
}
.article-body h2 {
  font-size: clamp(1.15rem, 2.5vw, 1.5rem);
  margin-top: 2rem;
  margin-bottom: .75rem;
  color: var(--color-primary);
}
.article-body h2:first-child { margin-top: 0; }
.article-body section + section {
  margin-top: 1.8rem;
  padding-top: 1.8rem;
  border-top: 1px solid var(--color-border);
}
.article-body p { font-size: 1rem; color: var(--color-text); }
.article-body ul, .article-body ol {
  padding-left: 1.4rem;
  margin-bottom: 1rem;
}
.article-body li { margin-bottom: .45rem; }
.article-body code {
  background: rgba(54,166,214,.1);
  border-radius: 4px;
  padding: .1em .35em;
  font-family: var(--font-mono);
  font-size: .88em;
  color: var(--color-accent2);
}

/* Article author box — upgraded */
.author-card {
  display: flex;
  align-items: flex-start;
  gap: 1.1rem;
  background: linear-gradient(135deg, rgba(18,35,59,.04), rgba(54,166,214,.06));
  border: 1px solid rgba(54,166,214,.2);
  border-left: 4px solid var(--color-accent);
  border-radius: 18px;
  padding: 1.3rem 1.5rem;
  margin: 2rem 0 1rem;
}
.author-avatar {
  width: 52px; height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--color-accent), var(--color-accent2));
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
  color: #fff;
  font-weight: 900;
}
.author-info { flex: 1; }
.author-name {
  font-weight: 800;
  color: var(--color-primary);
  font-size: 1rem;
  margin-bottom: .2rem;
}
.author-cred {
  display: inline-block;
  background: rgba(54,166,214,.12);
  border: 1px solid rgba(54,166,214,.25);
  color: var(--color-accent);
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  padding: .15rem .55rem;
  border-radius: 999px;
  margin-bottom: .4rem;
}
.author-bio {
  font-size: .88rem;
  color: var(--color-text-light);
  margin: 0;
}

/* Reading time & update info */
.article-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
  margin: .5rem 0 1.5rem;
  font-size: .82rem;
  color: var(--color-text-light);
}
.article-meta-row span {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
}

/* Reviewer bar */
.reviewer-bar {
  background: rgba(54,166,214,.07);
  border-bottom: 1px solid rgba(54,166,214,.15);
  padding: .65rem 1.5rem;
  font-size: .82rem;
  color: var(--color-text-light);
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}
.reviewer-bar-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: space-between;
}
.reviewer-bar strong { color: var(--color-primary); }
.reviewer-bar a { color: var(--color-accent); font-weight: 600; }

/* References list */
.references-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: .6rem;
}
.references-list li {
  font-size: .88rem;
  color: var(--color-text-light);
  padding-left: 1.2rem;
  position: relative;
}
.references-list li::before {
  content: '↗';
  position: absolute;
  left: 0;
  color: var(--color-accent);
  font-size: .75rem;
}
.references-list a { color: var(--color-accent); }

/* Social share */
.share-row {
  display: flex;
  align-items: center;
  gap: .6rem;
  flex-wrap: wrap;
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--color-border);
}
.share-label {
  font-size: .82rem;
  font-weight: 700;
  color: var(--color-text-light);
  text-transform: uppercase;
  letter-spacing: .08em;
}
.share-btn {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .45rem .9rem;
  border-radius: 999px;
  border: 1px solid var(--color-border);
  background: #fff;
  font-size: .82rem;
  font-weight: 700;
  color: var(--color-primary);
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
}
.share-btn:hover { border-color: var(--color-accent); color: var(--color-accent); transform: translateY(-1px); text-decoration: none; }
.share-btn.copied { border-color: var(--color-success); color: var(--color-success); }

/* ---------- Hero Star-field ---------- */
.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    radial-gradient(1px 1px at 5% 15%, rgba(255,255,255,.7), transparent),
    radial-gradient(1px 1px at 12% 65%, rgba(255,255,255,.5), transparent),
    radial-gradient(1.5px 1.5px at 20% 35%, rgba(255,255,255,.6), transparent),
    radial-gradient(1px 1px at 28% 80%, rgba(255,255,255,.4), transparent),
    radial-gradient(1px 1px at 35% 20%, rgba(255,255,255,.65), transparent),
    radial-gradient(1.5px 1.5px at 45% 55%, rgba(255,255,255,.5), transparent),
    radial-gradient(1px 1px at 52% 10%, rgba(255,255,255,.7), transparent),
    radial-gradient(1px 1px at 60% 40%, rgba(255,255,255,.45), transparent),
    radial-gradient(1.5px 1.5px at 68% 75%, rgba(255,255,255,.6), transparent),
    radial-gradient(1px 1px at 75% 25%, rgba(255,255,255,.5), transparent),
    radial-gradient(1px 1px at 82% 60%, rgba(255,255,255,.65), transparent),
    radial-gradient(1.5px 1.5px at 90% 12%, rgba(255,255,255,.55), transparent),
    radial-gradient(1px 1px at 96% 50%, rgba(255,255,255,.4), transparent),
    radial-gradient(1px 1px at 8% 45%, rgba(255,255,255,.35), transparent),
    radial-gradient(1px 1px at 55% 88%, rgba(255,255,255,.45), transparent),
    radial-gradient(1px 1px at 38% 92%, rgba(255,255,255,.3), transparent),
    radial-gradient(1px 1px at 72% 5%, rgba(255,255,255,.55), transparent),
    radial-gradient(1px 1px at 15% 90%, rgba(255,255,255,.4), transparent),
    radial-gradient(1.5px 1.5px at 85% 40%, rgba(255,255,255,.5), transparent),
    radial-gradient(1px 1px at 48% 30%, rgba(255,255,255,.6), transparent);
  animation: starTwinkle 6s ease-in-out infinite alternate;
  z-index: 0;
}
@keyframes starTwinkle {
  from { opacity: .55; }
  to   { opacity: 1; }
}

/* Gradient text for hero h1 */
.hero h1,
.hero-copy h1 {
  background: linear-gradient(135deg, #ffffff 30%, var(--color-accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Glassmorphism upgrades */
.orbital-panel,
.hero-metric {
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

/* Nav glow hover */
.main-nav a:hover {
  box-shadow: 0 0 14px rgba(54,166,214,.3);
}

/* ---------- Smooth Accordion ---------- */
.accordion-body {
  display: block !important;
  max-height: 0;
  overflow: hidden;
  padding-top: 0;
  padding-bottom: 0;
  transition: max-height .45s cubic-bezier(.4,0,.2,1), padding .45s ease;
}
.accordion-body.open {
  max-height: 2000px;
  padding-bottom: 1.4rem;
}

/* ---------- Featured Articles (homepage spotlight) ---------- */
.featured-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.4rem;
  margin-top: 2rem;
}
.featured-article-card {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
}
.featured-article-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
  border-color: var(--color-accent);
}
.featured-article-thumb {
  height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3.5rem;
  position: relative;
  overflow: hidden;
}
.featured-article-thumb::after {
  content: '';
  position: absolute;
  inset: 0;
  opacity: .7;
}
.fac-blue  { background: linear-gradient(135deg, #0f2b5b, #1a3a6b); }
.fac-teal  { background: linear-gradient(135deg, #0f3350, #1a5068); }
.fac-gold  { background: linear-gradient(135deg, #3b2700, #6b4a00); }
.featured-article-body { padding: 1.3rem; flex: 1; display: flex; flex-direction: column; }
.featured-article-body .mini-meta { margin-bottom: .5rem; }
.featured-article-body h3 { font-size: 1.05rem; margin-bottom: .5rem; color: var(--color-primary); }
.featured-article-body p { font-size: .88rem; color: var(--color-text-light); flex: 1; }
.featured-article-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 1rem;
  padding-top: .85rem;
  border-top: 1px solid var(--color-border);
  font-size: .8rem;
  color: var(--color-text-light);
}

/* ---------- Ad info micro-link ---------- */
.ad-info-link {
  display: block;
  text-align: right;
  font-size: .7rem;
  color: var(--color-text-light);
  margin-top: .25rem;
  text-decoration: none;
}
.ad-info-link:hover { color: var(--color-accent); }

/* ---------- Enhanced Dark Mode ---------- */
body.dark-mode .article-body,
body.dark-mode .post-body,
body.dark-mode .orbital-panel,
body.dark-mode .path-card {
  background: rgba(30,41,59,.95);
  border-color: rgba(255,255,255,.08);
}
body.dark-mode .author-card {
  background: rgba(30,41,59,.8);
  border-color: rgba(54,166,214,.25);
}
body.dark-mode .featured-article-card {
  background: var(--color-bg-card);
  border-color: rgba(255,255,255,.08);
}
body.dark-mode .reviewer-bar {
  background: rgba(54,166,214,.05);
  border-color: rgba(54,166,214,.1);
}
body.dark-mode .share-btn {
  background: rgba(30,41,59,.9);
  border-color: rgba(255,255,255,.12);
  color: rgba(255,255,255,.8);
}
body.dark-mode code {
  background: rgba(54,166,214,.15);
}

/* ---------- Counter animation ---------- */
.count-up {
  display: inline-block;
  transition: none;
}

/* ---------- 404 page ---------- */
.error-page {
  min-height: 60vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 4rem 1.5rem;
}
.error-code {
  font-size: clamp(5rem, 15vw, 9rem);
  font-weight: 900;
  background: linear-gradient(135deg, var(--color-accent), var(--color-accent2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
  margin-bottom: .5rem;
}
.error-page h1 { font-size: clamp(1.4rem, 3vw, 2rem); margin-bottom: 1rem; }
.error-page p { color: var(--color-text-light); max-width: 500px; margin-bottom: 2rem; }
.error-links {
  display: flex;
  flex-wrap: wrap;
  gap: .8rem;
  justify-content: center;
  margin-top: 2rem;
}

/* ---------- Mobile additions ---------- */
@media (max-width: 700px) {
  #phub-cookie-bar {
    flex-direction: column;
    align-items: stretch;
    bottom: .5rem;
    left: .5rem;
    right: .5rem;
  }
  #phub-cookie-ok { text-align: center; }
  .article-body { padding: 1.4rem 1.2rem; }
  .author-card { flex-direction: column; }
  .featured-grid { grid-template-columns: 1fr; }
  .reviewer-bar-inner { flex-direction: column; align-items: flex-start; gap: .4rem; }
}

