:root {
  --bg-color: #12100f;
  --bg-gradient: radial-gradient(circle at 50% 10%, #2a221f 0%, #12100f 100%);
  --text-primary: #e6dfd6;
  --text-secondary: #a39b92;
  --accent-sepia: #d4a373;
  --accent-crimson: #8b0000;
  --glass-bg: rgba(255, 255, 255, 0.02);
  --glass-border: rgba(212, 163, 115, 0.15);
}

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

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg-color);
  background-image: var(--bg-gradient);
  color: var(--text-primary);
  line-height: 1.7;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Typography */
h1, h2, h3 {
  font-family: 'Playfair Display', serif;
}

h1 {
  font-size: 3.5rem;
  font-weight: 700;
  text-align: center;
  color: var(--accent-sepia);
  margin-bottom: 1rem;
  line-height: 1.2;
}

.subtitle {
  text-align: center;
  font-size: 1.2rem;
  font-style: italic;
  color: var(--text-secondary);
  margin-bottom: 4rem;
}

h2 {
  font-size: 2rem;
  color: white;
  margin-bottom: 1.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--glass-border);
}

h3 {
  font-size: 1.3rem;
  color: var(--accent-sepia);
  margin: 1.5rem 0 1rem 0;
}

p {
  margin-bottom: 1.2rem;
}

.container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 2rem;
}

/* Layout */
.glass-panel {
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 2.5rem;
  margin-bottom: 3rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  transition: transform 0.3s ease;
}

.glass-panel:hover {
  border-color: rgba(212, 163, 115, 0.3);
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}

/* Interactive Timeline */
.timeline-container {
  margin-top: 2rem;
}

.timeline-nav {
  display: flex;
  justify-content: space-between;
  border-bottom: 2px solid var(--glass-border);
  margin-bottom: 2rem;
  padding-bottom: 1rem;
}

.timeline-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-family: 'Playfair Display', serif;
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0.5rem 1rem;
  transition: all 0.3s ease;
  position: relative;
}

.timeline-btn:hover {
  color: var(--accent-sepia);
}

.timeline-btn.active {
  color: var(--accent-sepia);
  font-weight: bold;
}

.timeline-btn.active::after {
  content: '';
  position: absolute;
  bottom: -18px; /* align with border */
  left: 50%;
  transform: translateX(-50%);
  width: 10px;
  height: 10px;
  background: var(--accent-sepia);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--accent-sepia);
}

.timeline-content {
  background: rgba(0,0,0,0.4);
  padding: 2rem;
  border-radius: 8px;
  border-left: 4px solid var(--accent-sepia);
  min-height: 200px;
}

.timeline-content h3 {
  margin-top: 0;
  font-size: 1.8rem;
}

/* Moral Drift Slider */
.drift-simulator {
  margin-top: 2rem;
  padding: 2rem;
  background: rgba(0,0,0,0.3);
  border-radius: 12px;
  text-align: center;
}

.drift-track {
  width: 100%;
  margin: 2rem 0;
}

input[type=range].drift-slider {
  -webkit-appearance: none;
  width: 100%;
  background: transparent;
}

input[type=range].drift-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  height: 24px;
  width: 24px;
  border-radius: 50%;
  background: var(--accent-sepia);
  cursor: pointer;
  margin-top: -10px;
  border: 2px solid #000;
  transition: background 0.3s ease;
}

input[type=range].drift-slider::-webkit-slider-runnable-track {
  width: 100%;
  height: 4px;
  cursor: pointer;
  background: linear-gradient(to right, #4ade80, var(--accent-sepia), var(--accent-crimson));
  border-radius: 2px;
}

.drift-words {
  display: flex;
  justify-content: space-between;
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: bold;
}

.slogan-box {
  margin-top: 1.5rem;
  padding: 1.5rem;
  font-family: 'Playfair Display', serif;
  font-size: 1.5rem;
  font-style: italic;
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  transition: all 0.3s ease;
}

/* Influence Network */
.network-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
  margin-top: 1.5rem;
}

.person-btn {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  color: var(--text-primary);
  padding: 0.8rem 1.5rem;
  border-radius: 30px;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  transition: all 0.3s ease;
}

.person-btn:hover, .person-btn.active {
  background: var(--accent-sepia);
  color: #000;
  border-color: var(--accent-sepia);
  box-shadow: 0 0 15px rgba(212, 163, 115, 0.4);
}

.person-details {
  margin-top: 2rem;
  padding: 1.5rem;
  background: rgba(0,0,0,0.5);
  border-radius: 8px;
  min-height: 120px;
  font-style: italic;
  display: none;
}

.person-details.visible {
  display: block;
  animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Tooltips (Glossary) */
.glossary-term {
  color: var(--accent-sepia);
  text-decoration: none;
  border-bottom: 1px dotted var(--accent-sepia);
  cursor: help;
  position: relative;
}

.tooltip {
  visibility: hidden;
  position: absolute;
  bottom: 150%;
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  background: #000;
  color: #fff;
  text-align: left;
  padding: 1rem;
  border-radius: 8px;
  width: 250px;
  border: 1px solid var(--accent-sepia);
  box-shadow: 0 10px 30px rgba(0,0,0,0.8);
  opacity: 0;
  transition: all 0.3s ease;
  z-index: 100;
  font-size: 0.85rem;
  pointer-events: none;
  font-family: 'Inter', sans-serif;
  font-style: normal;
}

.glossary-term:hover .tooltip {
  visibility: visible;
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.tooltip::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  margin-left: -5px;
  border-width: 5px;
  border-style: solid;
  border-color: var(--accent-sepia) transparent transparent transparent;
}
