@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,700;0,900;1,400&family=Inter:wght@300;400;500;600;700&family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
  --navy: #0a0e27;
  --navy-light: #111640;
  --gold: #d4a853;
  --gold-light: #f0d48a;
  --teal: #2dd4bf;
  --teal-dark: #0d9488;
  --white: #f8fafc;
  --gray: #94a3b8;
  --gray-dark: #64748b;
  --accent-red: #f43f5e;
  --accent-purple: #a78bfa;
  --accent-blue: #60a5fa;
  --glass-bg: rgba(17, 22, 64, 0.6);
  --glass-border: rgba(212, 168, 83, 0.15);
  --shadow: 0 8px 32px rgba(0,0,0,0.3);
  --radius: 16px;
  --transition: 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

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

body {
  font-family: 'Inter', sans-serif;
  background: var(--navy);
  color: var(--white);
  line-height: 1.8;
  overflow-x: hidden;
  text-align: justify;
}

/* Particle Background */
#particles-canvas {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  z-index: 0; pointer-events: none;
}

/* Scrollbar */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--navy); }
::-webkit-scrollbar-thumb { background: var(--gold); border-radius: 4px; }

/* Navigation */
.nav {
  position: fixed; top: 0; left: 0; width: 100%; z-index: 1000;
  padding: 1rem 2rem;
  background: rgba(10, 14, 39, 0.85);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--glass-border);
  transition: var(--transition);
  display: flex; align-items: center; justify-content: space-between;
}
.nav.scrolled { padding: 0.6rem 2rem; box-shadow: var(--shadow); }
.nav-logo {
  font-family: 'Playfair Display', serif;
  font-size: 1.3rem; font-weight: 700;
  background: linear-gradient(135deg, var(--gold), var(--gold-light));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.nav-links { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.nav-links a {
  color: var(--gray); text-decoration: none; font-size: 0.8rem;
  padding: 0.4rem 0.8rem; border-radius: 8px; transition: var(--transition);
  font-weight: 500;
}
.nav-links a:hover, .nav-links a.active {
  color: var(--gold); background: rgba(212,168,83,0.1);
}
.nav-toggle {
  display: none; background: none; border: none; cursor: pointer;
  flex-direction: column; gap: 5px;
}
.nav-toggle span {
  width: 25px; height: 2px; background: var(--gold); transition: var(--transition);
}

/* Progress Bar */
.progress-bar {
  position: fixed; top: 0; left: 0; height: 3px; z-index: 1001;
  background: linear-gradient(90deg, var(--gold), var(--teal), var(--accent-purple));
  transition: width 0.2s ease;
}

/* Hero */
.hero {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  position: relative; overflow: hidden; text-align: center;
  padding: 2rem;
}
.hero-bg {
  position: absolute; inset: 0;
  background: url('images/hero_knowledge_tree.png') center/cover no-repeat;
  filter: brightness(0.3); z-index: 0;
}
.hero-overlay {
  position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(180deg, rgba(10,14,39,0.4) 0%, rgba(10,14,39,0.9) 100%);
}
.hero-content { position: relative; z-index: 2; max-width: 800px; }
.hero-badge {
  display: inline-block; padding: 0.5rem 1.5rem; margin-bottom: 1.5rem;
  border: 1px solid var(--gold); border-radius: 50px;
  font-size: 0.85rem; color: var(--gold); letter-spacing: 2px;
  text-transform: uppercase; font-weight: 500;
  animation: fadeInDown 1s ease;
}
.hero h1 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  font-weight: 900; line-height: 1.1; margin-bottom: 1rem;
  background: linear-gradient(135deg, var(--white), var(--gold-light));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  animation: fadeInUp 1s ease 0.2s both;
}
.hero .subtitle {
  font-family: 'Outfit', sans-serif;
  font-size: 1.2rem; color: var(--gray);
  margin-bottom: 2rem; font-weight: 300;
  animation: fadeInUp 1s ease 0.4s both;
}
.hero .author {
  font-size: 1.1rem; color: var(--gold);
  font-family: 'Playfair Display', serif; font-style: italic;
  animation: fadeInUp 1s ease 0.6s both;
}
.hero-cta {
  display: inline-flex; align-items: center; gap: 0.5rem;
  margin-top: 2rem; padding: 1rem 2.5rem;
  background: linear-gradient(135deg, var(--gold), #c4943f);
  color: var(--navy); font-weight: 700; font-size: 1rem;
  border: none; border-radius: 50px; cursor: pointer;
  transition: var(--transition); text-decoration: none;
  animation: fadeInUp 1s ease 0.8s both;
}
.hero-cta:hover { transform: translateY(-3px); box-shadow: 0 10px 30px rgba(212,168,83,0.3); }
.scroll-indicator {
  position: absolute; bottom: 2rem; left: 50%; transform: translateX(-50%);
  z-index: 2; animation: bounce 2s infinite;
}
.scroll-indicator span {
  display: block; width: 2px; height: 40px;
  background: linear-gradient(to bottom, var(--gold), transparent);
  margin: 0 auto;
}

/* Section Styles */
.section {
  position: relative; z-index: 1;
  padding: 5rem 2rem; max-width: 1100px; margin: 0 auto;
}
.section-header {
  text-align: center; margin-bottom: 4rem;
}
.section-header .chapter-label {
  display: inline-block; padding: 0.4rem 1.2rem;
  background: rgba(212,168,83,0.1); border: 1px solid var(--glass-border);
  border-radius: 50px; font-size: 0.8rem; color: var(--gold);
  letter-spacing: 2px; text-transform: uppercase; margin-bottom: 1rem;
}
.section-header h2 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(2rem, 4vw, 3rem); font-weight: 700;
  margin-bottom: 1rem;
  background: linear-gradient(135deg, var(--white), var(--gold-light));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.section-header p {
  color: var(--gray); font-size: 1.05rem; max-width: 700px; margin: 0 auto;
}

/* Section Divider Image */
.section-image {
  width: 100%; max-height: 600px; object-fit: contain;
  border-radius: var(--radius); margin: 2rem 0;
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow);
  background: rgba(17, 22, 64, 0.4);
}

/* Glass Card */
.glass-card {
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 2rem; margin-bottom: 2rem;
  transition: var(--transition);
}
.glass-card:hover {
  border-color: rgba(212,168,83,0.3);
  transform: translateY(-2px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.2);
}

/* Content Typography */
.content-text {
  font-size: 1.05rem; line-height: 1.9; color: var(--white);
  margin-bottom: 1.5rem; text-align: justify;
}
.content-text.muted { color: var(--gray); }

/* Quote Block */
.quote-block {
  position: relative; padding: 2rem 2rem 2rem 3rem;
  margin: 2rem 0;
  background: linear-gradient(135deg, rgba(212,168,83,0.05), rgba(45,212,191,0.05));
  border-left: 3px solid var(--gold);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-family: 'Playfair Display', serif;
  font-style: italic; font-size: 1.1rem;
  color: var(--gold-light);
}
.quote-block::before {
  content: '\201C'; position: absolute; top: -10px; left: 10px;
  font-size: 4rem; color: var(--gold); opacity: 0.3;
  font-family: 'Playfair Display', serif;
}
.quote-author {
  display: block; margin-top: 1rem;
  font-family: 'Inter', sans-serif; font-style: normal;
  font-size: 0.9rem; color: var(--gray);
}

/* IDC Steps */
.idc-steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.5rem; margin: 2rem 0; }
.idc-step {
  background: var(--glass-bg); backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border); border-radius: var(--radius);
  padding: 2rem; text-align: center; transition: var(--transition);
}
.idc-step:hover { border-color: var(--gold); transform: translateY(-4px); }
.idc-step .step-number {
  width: 50px; height: 50px; margin: 0 auto 1rem;
  background: linear-gradient(135deg, var(--gold), #c4943f);
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-family: 'Playfair Display', serif; font-weight: 700;
  font-size: 1.3rem; color: var(--navy);
}
.idc-step h4 { font-family: 'Playfair Display', serif; font-size: 1.2rem; color: var(--gold-light); margin-bottom: 0.8rem; }

/* Strategy Cards */
.strategy-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1.5rem; margin: 2rem 0; }
.strategy-card {
  background: var(--glass-bg); backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border); border-radius: var(--radius);
  padding: 1.8rem; transition: var(--transition);
}
.strategy-card:hover { border-color: var(--teal); transform: translateY(-3px); }
.strategy-card h4 {
  font-family: 'Playfair Display', serif;
  font-size: 1.1rem; color: var(--teal); margin-bottom: 0.8rem;
}
.strategy-card p { color: var(--gray); font-size: 0.95rem; }

/* Resource Category */
.resource-category {
  background: var(--glass-bg); backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border); border-radius: var(--radius);
  padding: 2rem; margin-bottom: 2rem;
  transition: var(--transition);
}
.resource-category:hover { border-color: var(--accent-purple); }
.resource-category h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1.4rem; color: var(--accent-purple); margin-bottom: 1rem;
  display: flex; align-items: center; gap: 0.5rem;
}
.resource-list { list-style: none; }
.resource-list li {
  padding: 0.6rem 0; border-bottom: 1px solid rgba(255,255,255,0.05);
  color: var(--gray); font-size: 0.95rem;
  padding-left: 1.5rem; position: relative;
}
.resource-list li::before {
  content: '◆'; position: absolute; left: 0; color: var(--gold); font-size: 0.6rem; top: 0.8rem;
}

/* Barriers Section */
.barrier-card {
  background: var(--glass-bg); backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border); border-radius: var(--radius);
  padding: 2rem; margin-bottom: 2rem;
}
.barrier-card h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1.5rem; margin-bottom: 1rem;
  display: flex; align-items: center; gap: 0.8rem;
}
.barrier-card h3 .barrier-icon { font-size: 2rem; }

/* Case Study */
.case-study {
  background: linear-gradient(135deg, rgba(212,168,83,0.08), rgba(45,212,191,0.05));
  border: 1px solid var(--glass-border); border-radius: var(--radius);
  padding: 2.5rem; margin: 2rem 0; position: relative; overflow: hidden;
}
.case-study::before {
  content: ''; position: absolute; top: 0; left: 0; width: 4px; height: 100%;
  background: linear-gradient(to bottom, var(--gold), var(--teal));
}
.case-study .case-number {
  font-family: 'Playfair Display', serif; font-size: 0.9rem;
  color: var(--gold); text-transform: uppercase; letter-spacing: 2px;
  margin-bottom: 1rem;
}
.case-study .case-barrier {
  display: inline-block; margin-top: 1rem; padding: 0.4rem 1rem;
  background: rgba(244,63,94,0.15); border: 1px solid rgba(244,63,94,0.3);
  border-radius: 50px; font-size: 0.85rem; color: var(--accent-red);
}

/* Error Cards - Chapter 5 */
.errors-filter {
  display: flex; flex-wrap: wrap; gap: 0.5rem;
  justify-content: center; margin-bottom: 2rem;
}
.filter-btn {
  padding: 0.5rem 1.2rem; border: 1px solid var(--glass-border);
  background: var(--glass-bg); color: var(--gray);
  border-radius: 50px; cursor: pointer; font-size: 0.85rem;
  transition: var(--transition); font-family: 'Inter', sans-serif;
}
.filter-btn:hover, .filter-btn.active {
  background: rgba(212,168,83,0.15); border-color: var(--gold); color: var(--gold);
}
.errors-grid { display: grid; grid-template-columns: 1fr; gap: 1rem; }
.error-card {
  background: var(--glass-bg); backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border); border-radius: var(--radius);
  overflow: hidden; transition: var(--transition);
}
.error-card:hover { border-color: rgba(212,168,83,0.3); }
.error-header {
  padding: 1.2rem 1.5rem; cursor: pointer;
  display: flex; align-items: center; gap: 1rem;
  transition: var(--transition);
}
.error-header:hover { background: rgba(212,168,83,0.05); }
.error-number {
  min-width: 40px; height: 40px;
  background: linear-gradient(135deg, var(--gold), #c4943f);
  border-radius: 10px; display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.9rem; color: var(--navy);
}
.error-title { font-weight: 600; font-size: 0.95rem; flex: 1; }
.error-toggle {
  width: 30px; height: 30px; border-radius: 50%;
  background: rgba(255,255,255,0.05); display: flex;
  align-items: center; justify-content: center;
  transition: var(--transition); font-size: 1.2rem; color: var(--gold);
}
.error-card.open .error-toggle { transform: rotate(180deg); }
.error-body {
  max-height: 0; overflow: hidden; transition: max-height 0.5s ease;
}
.error-card.open .error-body { max-height: 1000px; }
.error-body-inner {
  padding: 0 1.5rem 1.5rem 1.5rem;
  border-top: 1px solid var(--glass-border);
}
.error-desc { color: var(--gray); font-size: 0.95rem; margin: 1rem 0; text-align: justify; }
.error-fix {
  background: rgba(45,212,191,0.08); border: 1px solid rgba(45,212,191,0.2);
  border-radius: 12px; padding: 1rem 1.2rem;
}
.error-fix-label {
  font-size: 0.8rem; text-transform: uppercase; letter-spacing: 1px;
  color: var(--teal); font-weight: 600; margin-bottom: 0.5rem;
}
.error-fix p { color: var(--gray); font-size: 0.9rem; line-height: 1.7; text-align: justify; }

/* Reflection Cards */
.reflection-card {
  background: var(--glass-bg); backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border); border-radius: var(--radius);
  padding: 2rem; margin-bottom: 1.5rem;
  transition: var(--transition); position: relative;
  overflow: hidden;
}
.reflection-card::before {
  content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 3px;
  background: linear-gradient(90deg, var(--gold), var(--teal), var(--accent-purple));
}
.reflection-card:hover { transform: translateY(-3px); border-color: var(--gold); }
.reflection-number {
  font-family: 'Playfair Display', serif; font-size: 3rem;
  font-weight: 900; color: rgba(212,168,83,0.15); line-height: 1;
  margin-bottom: 0.5rem;
}
.reflection-card h4 {
  font-family: 'Playfair Display', serif;
  font-size: 1.2rem; color: var(--gold-light); margin-bottom: 1rem;
}

/* Parable Section */
.parable-section {
  background: linear-gradient(135deg, rgba(167,139,250,0.1), rgba(212,168,83,0.1));
  border: 1px solid rgba(167,139,250,0.2); border-radius: var(--radius);
  padding: 3rem; margin: 3rem 0; text-align: center;
}
.parable-section img {
  width: 200px; height: 200px; object-fit: cover;
  border-radius: 50%; margin: 0 auto 2rem;
  border: 3px solid var(--accent-purple);
  box-shadow: 0 0 40px rgba(167,139,250,0.2);
}
.parable-section h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1.8rem; color: var(--accent-purple); margin-bottom: 1.5rem;
}

/* Bibliography */
.bib-entry {
  padding: 1rem 0; border-bottom: 1px solid rgba(255,255,255,0.05);
  color: var(--gray); font-size: 0.9rem; line-height: 1.7;
}

/* TOC */
.toc { margin: 3rem 0; }
.toc-item {
  display: flex; align-items: center; gap: 1rem;
  padding: 1rem 1.5rem; margin-bottom: 0.5rem;
  background: var(--glass-bg); border: 1px solid var(--glass-border);
  border-radius: 12px; cursor: pointer; transition: var(--transition);
  text-decoration: none; color: var(--white);
}
.toc-item:hover { border-color: var(--gold); transform: translateX(8px); background: rgba(212,168,83,0.08); }
.toc-number {
  min-width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--gold), #c4943f);
  border-radius: 8px; display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.85rem; color: var(--navy);
}
.toc-text { font-weight: 500; }
.toc-text small { display: block; color: var(--gray); font-size: 0.8rem; font-weight: 400; }

/* Footer */
.footer {
  text-align: center; padding: 3rem 2rem;
  border-top: 1px solid var(--glass-border);
  color: var(--gray); font-size: 0.9rem;
}
.footer .footer-brand {
  font-family: 'Playfair Display', serif;
  font-size: 1.5rem; color: var(--gold); margin-bottom: 0.5rem;
}

.footer-contact {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--glass-border);
  display: flex;
  justify-content: center;
  gap: 2.5rem;
  flex-wrap: wrap;
}

.footer-contact-item {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--gray);
  font-size: 0.88rem;
  letter-spacing: 0.5px;
  transition: color 0.3s ease, transform 0.3s ease;
}

.footer-contact-item:hover {
  color: var(--gold-light);
  transform: translateY(-2px);
}

.footer-contact-item .fc-icon {
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: rgba(212,168,83,0.1);
  border: 1px solid var(--glass-border);
  border-radius: 50%;
  flex-shrink: 0;
  transition: background 0.3s, border-color 0.3s;
}

.footer-contact-item:hover .fc-icon {
  background: rgba(212,168,83,0.2);
  border-color: var(--gold);
}

.footer-contact-item a {
  color: inherit;
  text-decoration: none;
  transition: color 0.3s;
}

.footer-contact-item a:hover {
  color: var(--gold-light);
}

/* Animations */
@keyframes fadeInUp { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeInDown { from { opacity: 0; transform: translateY(-20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes bounce { 0%,100% { transform: translateX(-50%) translateY(0); } 50% { transform: translateX(-50%) translateY(10px); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.reveal { opacity: 0; transform: translateY(40px); transition: all 0.8s ease; }
.reveal.visible { opacity: 1; transform: translateY(0); }

/* Responsive */
@media (max-width: 768px) {
  .nav-links { display: none; position: absolute; top: 100%; left: 0; width: 100%; flex-direction: column; background: rgba(10,14,39,0.95); backdrop-filter: blur(20px); padding: 1rem; border-top: 1px solid var(--glass-border); }
  .nav-links.open { display: flex; }
  .nav-toggle { display: flex; }
  .section { padding: 3rem 1.2rem; }
  .hero { padding: 1.5rem; }
  .glass-card, .case-study, .barrier-card, .reflection-card { padding: 1.5rem; }
  .idc-steps { grid-template-columns: 1fr; }
  .strategy-grid { grid-template-columns: 1fr; }
  .quote-block { padding: 1.5rem 1.5rem 1.5rem 2rem; }
  .parable-section { padding: 2rem 1.5rem; }
}
