:root {
  --blue-soft: #E4D7FF;
  --cream: #FFE5E0;
  --blue-dark: #2E294E;
  --highlight-blue: rgba(200, 180, 255, 0.3);
  --blue-mid: #9B8CF2;
  --anxious: #F28C8C;
  --neutral: #90CAF9;
}

/* ---- PAGE 1 ---- */
#page1 {
  background: linear-gradient(135deg, var(--light-yellow) 0%, var(--bone) 50%, var(--almond) 100%);
  color: var(--blue-dark);
  min-height: 100vh;
  padding: 80px 100px;
  transition: background 1s ease;
  position: relative;
  overflow: hidden;
}

#page1::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(201, 168, 130, 0.15) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
  animation: float 20s ease-in-out infinite;
}

@keyframes float {

  0%,
  100% {
    transform: translate(0, 0);
  }

  50% {
    transform: translate(-30px, 30px);
  }
}

/* ---- TEXT ---- */
.text-box {
  flex: 1;
  padding-right: 50px;
  font-size: 1.1rem;
  line-height: 1.8;
  border-right: 1.5px solid rgba(0, 0, 0, 0.07);
}

.highlight {
  background: linear-gradient(135deg, rgba(201, 168, 130, 0.2) 0%, rgba(245, 222, 179, 0.15) 100%);
  border-left: 4px solid var(--tuscan);
  padding: 16px 20px;
  border-radius: 12px;
  margin: 24px 0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  backdrop-filter: blur(5px);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.highlight:hover {
  transform: translateX(4px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
}

.stat-caption {
  font-size: 0.9rem;
  opacity: 0.8;
  margin-top: 8px;
}

/* ---- CHARTS ---- */
.chart-box {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 40px;
}

.sub-chart {
  width: 100%;
  max-width: 420px;
}

/* ---- PICTOGRAM ---- */
.pictogram {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  justify-items: center;
  margin: 30px 0;
  padding: 24px;
  background: rgba(255, 255, 255, 0.4);
  border-radius: 16px;
  backdrop-filter: blur(5px);
}

.student {
  width: 24px;
  height: 44px;
  background: linear-gradient(180deg, var(--wheat) 0%, var(--wold) 100%);
  border-radius: 8px;
  position: relative;
  transition: transform 0.3s ease, filter 0.3s ease, box-shadow 0.3s ease;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.student::before {
  content: "";
  position: absolute;
  top: -12px;
  left: 5px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--wold);
}

.student.anxious {
  background: linear-gradient(180deg, var(--timber) 0%, var(--soft-navy) 100%);
  animation: pulse 3s ease-in-out infinite;
  box-shadow: 0 2px 8px rgba(139, 115, 85, 0.4);
}

.student.anxious::before {
  background: var(--timber);
}

.student:hover {
  transform: scale(1.08);
  filter: brightness(1.1);
}

/* Tooltip (optional hover text) */
.student[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(-5px);
  background: rgba(0, 0, 0, 0.75);
  color: white;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 0.7rem;
  opacity: 0;
  pointer-events: none;
  white-space: nowrap;
  transition: opacity 0.3s ease;
}

.student[data-tooltip]:hover::after {
  opacity: 1;
}

/* ---- TRANSITION LINE ---- */
.transition-line {
  margin-top: 60px;
  text-align: center;
  position: relative;
  padding: 30px 0;
}

.transition-line::before,
.transition-line::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 40%;
  height: 2px;
  background: linear-gradient(90deg, transparent 0%, rgba(0, 0, 0, 0.1) 50%, transparent 100%);
}

.transition-line::before {
  left: 0;
}

.transition-line::after {
  right: 0;
}

.transition-line span {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.8) 0%, rgba(240, 240, 240, 0.8) 100%);
  padding: 12px 28px;
  border-radius: 24px;
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--blue-dark);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(10px);
  display: inline-block;
}

/* ---- ANIMATION ---- */
@keyframes pulse {

  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.08);
  }
}

/* --- SIDE INFORMATION PANELS --- */
.side-info {
  position: absolute;
  width: 270px;
  padding: 22px 24px;
  background: rgba(255, 255, 255, 0.65);
  border-radius: 18px;
  backdrop-filter: blur(12px);
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.08);
  font-family: 'Inter', sans-serif;
  line-height: 1.65;
  color: #2E294E;
  transition: all 0.6s ease;
  opacity: 0;
  transform: translateY(20px);
  z-index: 5;
}

.side-info.visible {
  opacity: 1;
  transform: translateY(0);
}

.side-info h4 {
  font-weight: 700;
  margin-bottom: 10px;
  font-size: 1rem;
  color: var(--blue-dark);
}

.side-info p {
  font-size: 0.9rem;
  opacity: 0.85;
  line-height: 1.7;
}

.side-info.left {
  left: -320px;
  top: 25%;
  border-left: 3px solid var(--blue-mid);
}

.side-info.right {
  right: -320px;
  top: 45%;
  border-right: 3px solid var(--anxious);
}

/* Optional floating animation for ambience */
@keyframes floatSide {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(6px);
  }
}

.side-info.visible {
  animation: floatSide 10s ease-in-out infinite;
}

/* Hide on smaller screens */
@media (max-width: 1100px) {
  .side-info {
    display: none;
  }
}

/* ---- INTRO HEADER ---- */
.intro-header {
  max-width: 900px;
  margin: 0 auto 60px auto;
  font-size: 1.15rem;
  line-height: 1.85;
  color: var(--blue-dark);
  opacity: 0.92;
}

.intro-header p {
  margin-bottom: 1.2rem;
}

/* ---- VIZ SECTIONS (Text + Chart) ---- */
.viz-section {
  display: flex;
  align-items: center;
  gap: 50px;
  margin: 50px auto;
  max-width: 1300px;
}

.viz-section.reverse {
  flex-direction: row-reverse;
}

/* Text Block */
.viz-text {
  flex: 1;
  font-size: 1.05rem;
  line-height: 1.75;
  color: var(--blue-dark);
  font-family: 'Merriweather', serif;
}

.viz-text h3 {
  font-size: 1.7rem;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--blue-dark);
  letter-spacing: -0.3px;
  font-family: 'Merriweather', serif;
}

.viz-text p {
  margin-bottom: 1rem;
  opacity: 0.9;
  font-family: 'Merriweather', serif;
}

/* Chart Containers with Size Variants */
.viz-chart {
  background: rgba(255, 255, 255, 0.6);
  border-radius: 16px;
  padding: 24px;
  backdrop-filter: blur(8px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.7);
}

/* Large charts - 60% width */
.viz-section.large .viz-chart.large {
  flex: 1.5;
  min-height: 420px;
}

.viz-section.large .viz-text {
  flex: 1;
}

/* Medium charts - 50% width */
.viz-section.medium .viz-chart.medium {
  flex: 1;
  min-height: 380px;
}

.viz-section.medium .viz-text {
  flex: 1;
}

/* Small charts - 40% width */
.viz-section.small .viz-chart.small {
  flex: 0.8;
  min-height: 320px;
}

.viz-section.small .viz-text {
  flex: 1.2;
}

/* Quote Blocks */
.viz-quote {
  margin: 20px 0 0 0;
  padding: 16px 24px;
  background: linear-gradient(135deg, rgba(201, 168, 130, 0.08) 0%, rgba(255, 255, 255, 0.4) 100%);
  border-radius: 10px;
  font-size: 1rem;
  font-style: italic;
  line-height: 1.7;
  color: var(--blue-dark);
  opacity: 0.9;
  backdrop-filter: blur(5px);
}

.viz-quote cite {
  display: block;
  margin-top: 10px;
  font-size: 0.9rem;
  font-style: normal;
  opacity: 0.75;
  font-weight: 500;
}

/* Responsive */
@media (max-width: 1000px) {

  .viz-section,
  .viz-section.reverse {
    flex-direction: column;
    gap: 30px;
  }

  .viz-chart,
  .viz-text {
    flex: 1 !important;
    width: 100%;
  }

  .viz-section.large .viz-chart.large,
  .viz-section.medium .viz-chart.medium,
  .viz-section.small .viz-chart.small {
    min-height: 350px;
  }
}