/* ============================================
   期末報告 — 地震學 2026 學期回顧
   Design System & Complete Styles
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=Noto+Sans+TC:wght@300;400;500;700;900&family=Orbitron:wght@400;700;900&display=swap');

/* ---------- CSS Variables ---------- */
:root {
  --bg-primary: #060a1a;
  --bg-secondary: #0d1230;
  --bg-card: rgba(15, 23, 60, 0.65);
  --bg-glass: rgba(255, 255, 255, 0.04);
  --bg-glass-hover: rgba(255, 255, 255, 0.08);

  --accent-cyan: #00f5d4;
  --accent-orange: #ffa726;
  --accent-purple: #bb86fc;
  --accent-pink: #ff6b9d;
  --accent-blue: #4fc3f7;
  --accent-green: #69f0ae;
  --accent-red: #ff5252;

  --text-primary: #e8eaf6;
  --text-secondary: rgba(232, 234, 246, 0.65);
  --text-muted: rgba(232, 234, 246, 0.38);

  --border-subtle: rgba(255, 255, 255, 0.06);
  --border-glow: rgba(0, 245, 212, 0.25);

  --shadow-card: 0 8px 32px rgba(0, 0, 0, 0.4);
  --shadow-glow-cyan: 0 0 30px rgba(0, 245, 212, 0.15);
  --shadow-glow-purple: 0 0 30px rgba(187, 134, 252, 0.15);

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;

  --font-zh: 'Noto Sans TC', 'Microsoft JhengHei', sans-serif;
  --font-en: 'Inter', sans-serif;
  --font-mono: 'Orbitron', monospace;

  --timeline-width: 3px;
  --timeline-dot: 18px;
  --max-width: 1200px;
  --transition: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

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

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

body {
  font-family: var(--font-zh);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a {
  color: var(--accent-cyan);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover {
  color: var(--accent-blue);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

button {
  cursor: pointer;
  font-family: var(--font-zh);
  border: none;
  outline: none;
}

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar {
  width: 6px;
}
::-webkit-scrollbar-track {
  background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
  background: rgba(0, 245, 212, 0.3);
  border-radius: 3px;
}

/* ============================================
   HERO SECTION
   ============================================ */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden;
  background: radial-gradient(ellipse at 50% 30%, rgba(0, 245, 212, 0.06) 0%, transparent 60%),
              radial-gradient(ellipse at 80% 80%, rgba(187, 134, 252, 0.05) 0%, transparent 50%),
              var(--bg-primary);
}

/* Animated seismic wave background */
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 320'%3E%3Cpath fill='none' stroke='rgba(0,245,212,0.08)' stroke-width='1.5' d='M0,160 C180,100 360,220 540,160 C720,100 900,220 1080,160 C1260,100 1440,220 1440,160'/%3E%3C/svg%3E");
  background-size: 100% auto;
  background-repeat: repeat-y;
  animation: waveScroll 12s linear infinite;
  opacity: 0.5;
}

@keyframes waveScroll {
  0% { background-position-y: 0; }
  100% { background-position-y: 320px; }
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 800px;
  padding: 2rem;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 20px;
  background: var(--bg-glass);
  border: 1px solid var(--border-subtle);
  border-radius: 50px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  backdrop-filter: blur(10px);
  margin-bottom: 1.5rem;
  animation: fadeInDown 0.8s ease-out;
}

.hero-title {
  font-family: var(--font-zh);
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  font-weight: 900;
  line-height: 1.15;
  margin-bottom: 1rem;
  animation: fadeInUp 1s ease-out 0.2s both;
}

.hero-title .gradient-text {
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: clamp(1rem, 2.5vw, 1.3rem);
  color: var(--text-secondary);
  font-weight: 300;
  margin-bottom: 2rem;
  animation: fadeInUp 1s ease-out 0.4s both;
}

.hero-author {
  font-family: var(--font-en);
  font-size: 0.95rem;
  color: var(--text-muted);
  letter-spacing: 2px;
  animation: fadeInUp 1s ease-out 0.6s both;
}

.hero-scroll-hint {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  font-size: 0.8rem;
  animation: bounce 2s infinite;
}

.hero-scroll-hint .arrow {
  width: 24px;
  height: 24px;
  border-right: 2px solid var(--accent-cyan);
  border-bottom: 2px solid var(--accent-cyan);
  transform: rotate(45deg);
}

@keyframes bounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(10px); }
}

/* Seismic wave animation in hero */
.seismic-wave-container {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 200px;
  overflow: hidden;
  opacity: 0.3;
}

.seismic-wave {
  position: absolute;
  bottom: 0;
  width: 200%;
  height: 100%;
}

/* Particle effect */
.particles {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.particle {
  position: absolute;
  width: 3px;
  height: 3px;
  background: var(--accent-cyan);
  border-radius: 50%;
  animation: float-particle linear infinite;
  opacity: 0;
}

@keyframes float-particle {
  0% { opacity: 0; transform: translateY(100vh) scale(0); }
  10% { opacity: 0.6; }
  90% { opacity: 0.6; }
  100% { opacity: 0; transform: translateY(-100px) scale(1); }
}

/* ============================================
   STATS SECTION
   ============================================ */
.stats-section {
  padding: 4rem 2rem;
  background: linear-gradient(180deg, var(--bg-primary), var(--bg-secondary));
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1.5rem;
  max-width: var(--max-width);
  margin: 0 auto;
}

.stat-card {
  text-align: center;
  padding: 2rem 1.5rem;
  background: var(--bg-glass);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(10px);
  transition: all var(--transition);
  opacity: 0;
  transform: translateY(30px);
}

.stat-card.visible {
  opacity: 1;
  transform: translateY(0);
}

.stat-card:hover {
  background: var(--bg-glass-hover);
  border-color: var(--border-glow);
  box-shadow: var(--shadow-glow-cyan);
  transform: translateY(-5px);
}

.stat-icon {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.stat-number {
  font-family: var(--font-mono);
  font-size: 2.5rem;
  font-weight: 900;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-blue));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat-label {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-top: 0.25rem;
}

/* ============================================
   SECTION HEADERS
   ============================================ */
.section-header {
  text-align: center;
  padding: 4rem 2rem 2rem;
  max-width: var(--max-width);
  margin: 0 auto;
}

.section-header h2 {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 800;
  margin-bottom: 0.5rem;
}

.section-header p {
  color: var(--text-secondary);
  font-size: 1.05rem;
  max-width: 600px;
  margin: 0 auto;
}

.section-divider {
  width: 60px;
  height: 3px;
  background: linear-gradient(90deg, var(--accent-cyan), var(--accent-purple));
  border-radius: 2px;
  margin: 1rem auto 0;
}

/* ============================================
   TIMELINE
   ============================================ */
.timeline-section {
  padding: 2rem 1rem 4rem;
  background: var(--bg-secondary);
  position: relative;
}

.timeline {
  position: relative;
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem 0;
}

/* Center line */
.timeline::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: var(--timeline-width);
  background: linear-gradient(180deg, transparent, var(--accent-cyan), var(--accent-purple), var(--accent-cyan), transparent);
  transform: translateX(-50%);
}

/* Animated glow on timeline line */
.timeline::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 0;
  width: 6px;
  height: 80px;
  background: linear-gradient(180deg, transparent, var(--accent-cyan), transparent);
  transform: translateX(-50%);
  animation: timelineGlow 4s ease-in-out infinite;
  border-radius: 3px;
  filter: blur(2px);
}

@keyframes timelineGlow {
  0%, 100% { top: 0; }
  50% { top: calc(100% - 80px); }
}

.timeline-item {
  position: relative;
  width: 50%;
  padding: 1rem 2.5rem;
  opacity: 0;
  transform: translateX(-30px);
  transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.timeline-item.visible {
  opacity: 1;
  transform: translateX(0);
}

.timeline-item:nth-child(even) {
  margin-left: 50%;
  transform: translateX(30px);
}

.timeline-item:nth-child(even).visible {
  transform: translateX(0);
}

/* Timeline dot */
.timeline-item::before {
  content: '';
  position: absolute;
  top: 2rem;
  width: var(--timeline-dot);
  height: var(--timeline-dot);
  background: var(--bg-primary);
  border: 3px solid var(--accent-cyan);
  border-radius: 50%;
  z-index: 2;
  transition: all var(--transition);
}

.timeline-item:nth-child(odd)::before {
  right: calc(-1 * var(--timeline-dot) / 2 - 1px);
}

.timeline-item:nth-child(even)::before {
  left: calc(-1 * var(--timeline-dot) / 2 - 1px);
}

.timeline-item:hover::before {
  background: var(--accent-cyan);
  box-shadow: 0 0 20px var(--accent-cyan);
}

/* Timeline card */
.timeline-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  backdrop-filter: blur(12px);
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}

.timeline-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(0, 245, 212, 0.03), transparent);
  opacity: 0;
  transition: opacity var(--transition);
}

.timeline-card:hover {
  border-color: var(--border-glow);
  box-shadow: var(--shadow-glow-cyan);
  transform: translateY(-3px);
}

.timeline-card:hover::before {
  opacity: 1;
}

.timeline-date {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--accent-cyan);
  letter-spacing: 1px;
  margin-bottom: 0.5rem;
}

.timeline-week {
  font-size: 0.75rem;
  color: var(--accent-orange);
  margin-bottom: 0.25rem;
}

.timeline-card h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  line-height: 1.4;
}

.timeline-card p {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.timeline-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 0.75rem;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  font-size: 0.72rem;
  border-radius: 50px;
  background: rgba(0, 245, 212, 0.08);
  color: var(--accent-cyan);
  border: 1px solid rgba(0, 245, 212, 0.15);
}

.tag.tag-photo {
  background: rgba(255, 167, 38, 0.08);
  color: var(--accent-orange);
  border-color: rgba(255, 167, 38, 0.15);
}

.tag.tag-web {
  background: rgba(187, 134, 252, 0.08);
  color: var(--accent-purple);
  border-color: rgba(187, 134, 252, 0.15);
}

.tag.tag-pdf {
  background: rgba(255, 82, 82, 0.08);
  color: var(--accent-red);
  border-color: rgba(255, 82, 82, 0.15);
}

.tag.tag-game {
  background: rgba(105, 240, 174, 0.08);
  color: var(--accent-green);
  border-color: rgba(105, 240, 174, 0.15);
}

.timeline-card .expand-hint {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 0.75rem;
  font-size: 0.78rem;
  color: var(--accent-cyan);
  opacity: 0;
  transition: opacity var(--transition);
}

.timeline-card:hover .expand-hint {
  opacity: 1;
}

/* ============================================
   MODAL (Sub-page)
   ============================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 2rem;
  overflow-y: auto;
  opacity: 0;
  visibility: hidden;
  transition: all 0.4s ease;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  max-width: 900px;
  width: 100%;
  margin: 2rem auto;
  transform: translateY(40px) scale(0.95);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}

.modal-overlay.active .modal-content {
  transform: translateY(0) scale(1);
}

.modal-header {
  position: relative;
  padding: 2.5rem 2.5rem 1.5rem;
  background: linear-gradient(135deg, rgba(0, 245, 212, 0.06), rgba(187, 134, 252, 0.04));
  border-bottom: 1px solid var(--border-subtle);
}

.modal-close {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-glass);
  border: 1px solid var(--border-subtle);
  border-radius: 50%;
  color: var(--text-primary);
  font-size: 1.2rem;
  transition: all var(--transition);
}

.modal-close:hover {
  background: var(--accent-red);
  border-color: var(--accent-red);
}

.modal-header .modal-date {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--accent-cyan);
  margin-bottom: 0.5rem;
}

.modal-header h2 {
  font-size: 1.8rem;
  font-weight: 800;
  line-height: 1.3;
}

.modal-body {
  padding: 2rem 2.5rem 2.5rem;
}

.modal-body h3 {
  font-size: 1.2rem;
  font-weight: 700;
  margin: 2rem 0 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--accent-cyan);
}

.modal-body h3:first-child {
  margin-top: 0;
}

.modal-body p {
  color: var(--text-secondary);
  margin-bottom: 1rem;
  line-height: 1.85;
  font-size: 0.95rem;
}

.modal-body strong {
  color: var(--text-primary);
}

/* Photo gallery in modal */
.photo-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1rem;
  margin: 1rem 0;
}

.photo-item {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: all var(--transition);
}

.photo-item:hover {
  border-color: var(--border-glow);
  box-shadow: var(--shadow-glow-cyan);
  transform: scale(1.02);
}

.photo-item img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  transition: transform var(--transition);
}

.photo-item:hover img {
  transform: scale(1.08);
}

.photo-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 1.5rem 0.8rem 0.8rem;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.85));
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.9);
}

/* Full-width images */
.full-image {
  width: 100%;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  margin: 1rem 0;
}

/* Link buttons in modal */
.modal-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 1.5rem 0;
}

.modal-link-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 50px;
  font-size: 0.88rem;
  font-weight: 500;
  transition: all var(--transition);
  text-decoration: none;
}

.modal-link-btn.btn-web {
  background: rgba(187, 134, 252, 0.12);
  color: var(--accent-purple);
  border: 1px solid rgba(187, 134, 252, 0.25);
}

.modal-link-btn.btn-web:hover {
  background: rgba(187, 134, 252, 0.25);
  box-shadow: 0 0 20px rgba(187, 134, 252, 0.2);
}

.modal-link-btn.btn-pdf {
  background: rgba(255, 82, 82, 0.12);
  color: var(--accent-red);
  border: 1px solid rgba(255, 82, 82, 0.25);
}

.modal-link-btn.btn-pdf:hover {
  background: rgba(255, 82, 82, 0.25);
}

.modal-link-btn.btn-hf {
  background: rgba(255, 167, 38, 0.12);
  color: var(--accent-orange);
  border: 1px solid rgba(255, 167, 38, 0.25);
}

.modal-link-btn.btn-hf:hover {
  background: rgba(255, 167, 38, 0.25);
}

/* Image lightbox */
.lightbox-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.95);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  cursor: zoom-out;
}

.lightbox-overlay.active {
  opacity: 1;
  visibility: visible;
}

.lightbox-overlay img {
  max-width: 95%;
  max-height: 90vh;
  object-fit: contain;
  border-radius: var(--radius-md);
}

/* ============================================
   GAMES SECTION
   ============================================ */
.games-section {
  padding: 4rem 2rem;
  background: linear-gradient(180deg, var(--bg-secondary), var(--bg-primary));
}

.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.5rem;
  max-width: var(--max-width);
  margin: 0 auto;
}

.game-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 2rem;
  backdrop-filter: blur(12px);
  transition: all var(--transition);
  opacity: 0;
  transform: translateY(30px);
}

.game-card.visible {
  opacity: 1;
  transform: translateY(0);
}

.game-card:hover {
  border-color: var(--border-glow);
  box-shadow: var(--shadow-glow-cyan);
}

.game-card .game-icon {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.game-card h3 {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.game-card p {
  font-size: 0.88rem;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
}

.game-start-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 24px;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-blue));
  color: var(--bg-primary);
  border-radius: 50px;
  font-weight: 600;
  font-size: 0.9rem;
  transition: all var(--transition);
}

.game-start-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 245, 212, 0.3);
}

/* Game Modal */
.game-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  backdrop-filter: blur(8px);
  z-index: 1500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  opacity: 0;
  visibility: hidden;
  transition: all 0.4s ease;
}

.game-modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.game-modal {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  max-width: 700px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 2.5rem;
  transform: scale(0.9);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.game-modal-overlay.active .game-modal {
  transform: scale(1);
}

.game-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2rem;
}

.game-modal-header h2 {
  font-size: 1.5rem;
}

.game-close-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-glass);
  border: 1px solid var(--border-subtle);
  border-radius: 50%;
  color: var(--text-primary);
  font-size: 1.1rem;
  transition: all var(--transition);
}

.game-close-btn:hover {
  background: var(--accent-red);
}

/* Quiz Game */
.quiz-progress {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.quiz-progress-bar {
  flex: 1;
  height: 6px;
  background: var(--bg-glass);
  border-radius: 3px;
  overflow: hidden;
}

.quiz-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-cyan), var(--accent-purple));
  border-radius: 3px;
  transition: width 0.4s ease;
}

.quiz-question {
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
  line-height: 1.6;
}

.quiz-options {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.quiz-option {
  padding: 14px 18px;
  background: var(--bg-glass);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.95rem;
  text-align: left;
  transition: all var(--transition);
  line-height: 1.5;
}

.quiz-option:hover:not(.disabled) {
  background: var(--bg-glass-hover);
  border-color: var(--accent-cyan);
}

.quiz-option.correct {
  background: rgba(105, 240, 174, 0.15);
  border-color: var(--accent-green);
  color: var(--accent-green);
}

.quiz-option.wrong {
  background: rgba(255, 82, 82, 0.15);
  border-color: var(--accent-red);
  color: var(--accent-red);
}

.quiz-option.disabled {
  pointer-events: none;
  opacity: 0.6;
}

.quiz-feedback {
  margin-top: 1rem;
  padding: 1rem;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  line-height: 1.6;
  display: none;
}

.quiz-feedback.show {
  display: block;
}

.quiz-feedback.correct-feedback {
  background: rgba(105, 240, 174, 0.1);
  border: 1px solid rgba(105, 240, 174, 0.2);
  color: var(--accent-green);
}

.quiz-feedback.wrong-feedback {
  background: rgba(255, 82, 82, 0.1);
  border: 1px solid rgba(255, 82, 82, 0.2);
  color: var(--accent-red);
}

.quiz-next-btn {
  display: none;
  margin-top: 1.5rem;
  padding: 10px 28px;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-blue));
  color: var(--bg-primary);
  border-radius: 50px;
  font-weight: 600;
  font-size: 0.9rem;
}

.quiz-next-btn.show {
  display: inline-flex;
}

.quiz-score {
  text-align: center;
  padding: 2rem;
}

.quiz-score .score-number {
  font-family: var(--font-mono);
  font-size: 4rem;
  font-weight: 900;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.quiz-score p {
  color: var(--text-secondary);
  margin-top: 1rem;
  font-size: 1.05rem;
}

/* Beach Ball Game */
.beachball-game {
  text-align: center;
}

.beachball-question {
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
}

.beachball-options {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin: 1.5rem 0;
}

.beachball-option {
  padding: 1rem;
  background: var(--bg-glass);
  border: 2px solid var(--border-subtle);
  border-radius: var(--radius-md);
  transition: all var(--transition);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.beachball-option:hover:not(.disabled) {
  border-color: var(--accent-cyan);
  background: var(--bg-glass-hover);
}

.beachball-option.correct {
  border-color: var(--accent-green);
  background: rgba(105, 240, 174, 0.1);
}

.beachball-option.wrong {
  border-color: var(--accent-red);
  background: rgba(255, 82, 82, 0.1);
}

.beachball-option canvas {
  border-radius: 50%;
}

.beachball-option span {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* Wave Sort Game */
.wave-sort-game {
  max-width: 400px;
  margin: 0 auto;
}

.wave-sort-instruction {
  font-size: 1rem;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
  text-align: center;
}

.sortable-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.sortable-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 14px 18px;
  background: var(--bg-glass);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  cursor: grab;
  transition: all var(--transition);
  user-select: none;
}

.sortable-item:active {
  cursor: grabbing;
}

.sortable-item.dragging {
  opacity: 0.5;
  border-color: var(--accent-cyan);
}

.sortable-item.drag-over {
  border-color: var(--accent-cyan);
  background: var(--bg-glass-hover);
}

.sortable-item .wave-emoji {
  font-size: 1.5rem;
}

.sortable-item .wave-name {
  font-weight: 600;
  flex: 1;
}

.sortable-item .wave-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.sort-check-btn {
  display: block;
  margin: 1.5rem auto 0;
  padding: 10px 28px;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-blue));
  color: var(--bg-primary);
  border-radius: 50px;
  font-weight: 600;
}

.sort-result {
  text-align: center;
  margin-top: 1rem;
  padding: 1rem;
  border-radius: var(--radius-md);
  display: none;
}

.sort-result.show {
  display: block;
}

.sort-result.correct-sort {
  background: rgba(105, 240, 174, 0.1);
  border: 1px solid rgba(105, 240, 174, 0.2);
  color: var(--accent-green);
}

.sort-result.wrong-sort {
  background: rgba(255, 82, 82, 0.1);
  border: 1px solid rgba(255, 82, 82, 0.2);
  color: var(--accent-red);
}

/* ============================================
   REFLECTION SECTION
   ============================================ */
.reflection-section {
  padding: 4rem 2rem;
  background: var(--bg-primary);
}

.reflection-content {
  max-width: 800px;
  margin: 0 auto;
}

.reflection-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 3rem;
  backdrop-filter: blur(12px);
  position: relative;
  overflow: hidden;
}

.reflection-card::before {
  content: '"';
  position: absolute;
  top: -20px;
  left: 20px;
  font-size: 10rem;
  color: rgba(0, 245, 212, 0.05);
  font-family: Georgia, serif;
  line-height: 1;
}

.reflection-card p {
  font-size: 1.02rem;
  color: var(--text-secondary);
  line-height: 2;
  margin-bottom: 1.5rem;
  text-indent: 2em;
  position: relative;
  z-index: 1;
}

.reflection-card p:last-child {
  margin-bottom: 0;
}

/* ============================================
   FOOTER
   ============================================ */
.site-footer {
  padding: 3rem 2rem;
  background: var(--bg-primary);
  border-top: 1px solid var(--border-subtle);
  text-align: center;
}

.footer-content {
  max-width: var(--max-width);
  margin: 0 auto;
}

.footer-name {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.footer-info {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-top: 1rem;
}

.footer-links a {
  color: var(--text-secondary);
  font-size: 0.85rem;
  transition: color var(--transition);
}

.footer-links a:hover {
  color: var(--accent-cyan);
}

/* ============================================
   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 shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 10px rgba(0, 245, 212, 0.2); }
  50% { box-shadow: 0 0 25px rgba(0, 245, 212, 0.4); }
}

/* Navigation (floating) */
.floating-nav {
  position: fixed;
  top: 50%;
  right: 1rem;
  transform: translateY(-50%);
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.floating-nav a {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--text-muted);
  transition: all var(--transition);
  position: relative;
}

.floating-nav a:hover,
.floating-nav a.active {
  background: var(--accent-cyan);
  box-shadow: 0 0 10px var(--accent-cyan);
  transform: scale(1.3);
}

.floating-nav a::after {
  content: attr(data-label);
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  white-space: nowrap;
  font-size: 0.75rem;
  color: var(--text-secondary);
  background: var(--bg-card);
  padding: 4px 10px;
  border-radius: 4px;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition);
}

.floating-nav a:hover::after {
  opacity: 1;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
  .timeline::before {
    left: 30px;
  }

  .timeline::after {
    left: 30px;
  }

  .timeline-item {
    width: 100%;
    padding-left: 60px;
    padding-right: 1rem;
  }

  .timeline-item:nth-child(even) {
    margin-left: 0;
  }

  .timeline-item::before {
    left: 21px !important;
    right: auto !important;
  }

  .timeline-item:nth-child(even)::before {
    left: 21px;
  }

  .modal-header,
  .modal-body {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }

  .photo-gallery {
    grid-template-columns: 1fr;
  }

  .beachball-options {
    grid-template-columns: 1fr;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .games-grid {
    grid-template-columns: 1fr;
  }

  .floating-nav {
    display: none;
  }

  .game-modal {
    padding: 1.5rem;
  }

  .reflection-card {
    padding: 2rem;
  }
}

@media (max-width: 480px) {
  .hero-title {
    font-size: 2rem;
  }

  .stats-grid {
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
  }

  .stat-card {
    padding: 1.25rem 1rem;
  }

  .stat-number {
    font-size: 1.8rem;
  }

  .modal-header h2 {
    font-size: 1.3rem;
  }
}

/* ============================================
   Earthquake Dynamic Effects
   ============================================ */
@keyframes quake-shake {
  0% { transform: translate(0, 0) rotate(0deg); }
  20% { transform: translate(-2px, 2px) rotate(-1deg); }
  40% { transform: translate(2px, -2px) rotate(1deg); }
  60% { transform: translate(-2px, -2px) rotate(-1deg); }
  80% { transform: translate(2px, 2px) rotate(1deg); }
  100% { transform: translate(0, 0) rotate(0deg); }
}

.quake-hover:hover {
  animation: quake-shake 0.3s cubic-bezier(0.36, 0.07, 0.19, 0.97) infinite both;
  border-color: var(--accent-red) !important;
  box-shadow: 0 0 20px rgba(255, 82, 82, 0.4) !important;
}

@keyframes glitch-anim-1 {
  0% { clip-path: inset(20% 0 80% 0); transform: translate(-2px, 2px); }
  20% { clip-path: inset(60% 0 10% 0); transform: translate(2px, -2px); }
  40% { clip-path: inset(40% 0 50% 0); transform: translate(-2px, -2px); }
  60% { clip-path: inset(80% 0 5% 0); transform: translate(2px, 2px); }
  80% { clip-path: inset(10% 0 70% 0); transform: translate(-2px, 2px); }
  100% { clip-path: inset(30% 0 50% 0); transform: translate(2px, -2px); }
}

.glitch-text {
  position: relative;
}

.glitch-text::before,
.glitch-text::after {
  content: attr(data-text);
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--bg-primary);
  opacity: 0.8;
}

.glitch-text::before {
  left: 2px;
  text-shadow: -2px 0 var(--accent-red);
  animation: glitch-anim-1 3s infinite linear alternate-reverse;
}

.glitch-text::after {
  left: -2px;
  text-shadow: 2px 0 var(--accent-cyan);
  animation: glitch-anim-1 2.5s infinite linear alternate-reverse;
}



/* ============================================
   AI COLLABORATION SECTION — Raspberry Pi Debug Loop
   ============================================ */
.ai-collab-section {
  padding: 4rem 2rem;
  background:
    radial-gradient(ellipse at 20% 10%, rgba(0, 245, 212, 0.08), transparent 40%),
    radial-gradient(ellipse at 80% 70%, rgba(255, 167, 38, 0.08), transparent 42%),
    linear-gradient(180deg, var(--bg-primary), var(--bg-secondary));
  position: relative;
  overflow: hidden;
}

.ai-collab-wrap {
  max-width: var(--max-width);
  margin: 0 auto;
}

.ai-intro-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(300px, 0.9fr);
  gap: 1.5rem;
  align-items: stretch;
  margin-bottom: 1.5rem;
}

.ai-panel,
.ai-step-card,
.ai-diagnosis-card,
.ai-learning-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow-card);
}

.ai-panel {
  padding: 2rem;
  position: relative;
  overflow: hidden;
}

.ai-panel::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(0,245,212,.07), transparent 45%, rgba(187,134,252,.06));
  pointer-events: none;
}

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

.ai-kicker {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .35rem .75rem;
  border-radius: 50px;
  color: var(--accent-cyan);
  background: rgba(0,245,212,.08);
  border: 1px solid rgba(0,245,212,.18);
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  margin-bottom: 1rem;
}

.ai-panel h3 {
  font-size: clamp(1.35rem, 3vw, 2rem);
  line-height: 1.35;
  margin-bottom: 1rem;
}

.ai-panel p,
.ai-step-card p,
.ai-diagnosis-card p,
.ai-learning-card p,
.ai-diagnosis-table td {
  color: var(--text-secondary);
  line-height: 1.9;
  font-size: .95rem;
}

.ai-flow {
  display: grid;
  gap: .85rem;
}

.ai-flow-item {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: .9rem;
  align-items: center;
  padding: 1rem;
  background: var(--bg-glass);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
}

.ai-flow-num {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: var(--font-mono);
  font-weight: 900;
  color: var(--bg-primary);
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-green));
  box-shadow: var(--shadow-glow-cyan);
}

.ai-flow-item strong {
  display: block;
  color: var(--text-primary);
  margin-bottom: .1rem;
}

.ai-steps-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin: 1.5rem 0;
}

.ai-step-card {
  padding: 1.25rem;
  transition: all var(--transition);
}

.ai-step-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-glow);
  box-shadow: var(--shadow-glow-cyan);
}

.ai-step-icon {
  font-size: 1.8rem;
  margin-bottom: .75rem;
}

.ai-step-card h4,
.ai-diagnosis-card h4,
.ai-learning-card h4 {
  color: var(--text-primary);
  font-size: 1.02rem;
  margin-bottom: .6rem;
}

.ai-tabs {
  margin: 1.5rem 0;
  background: rgba(255,255,255,.025);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 1rem;
}

.ai-tab-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
  margin-bottom: 1rem;
}

.ai-tab-btn {
  padding: .65rem 1rem;
  border-radius: 50px;
  color: var(--text-secondary);
  background: var(--bg-glass);
  border: 1px solid var(--border-subtle);
  font-weight: 800;
  transition: all var(--transition);
}

.ai-tab-btn.active,
.ai-tab-btn:hover {
  color: var(--bg-primary);
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-blue));
  border-color: transparent;
}

.ai-tab-panel {
  display: none;
  padding: 1.2rem;
  border-radius: var(--radius-lg);
  background: rgba(0,0,0,.18);
  border: 1px solid var(--border-subtle);
}

.ai-tab-panel.active {
  display: block;
  animation: fadeInUp .35s ease-out;
}

.ai-tab-panel ul {
  padding-left: 1.2rem;
  color: var(--text-secondary);
  line-height: 1.9;
}

.ai-code-note {
  margin-top: 1rem;
  padding: 1rem;
  border-radius: var(--radius-md);
  background: rgba(0,0,0,.28);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: .82rem;
  line-height: 1.8;
  overflow-x: auto;
}

.ai-diagnosis-card,
.ai-learning-card {
  padding: 1.5rem;
  margin: 1.5rem 0;
}

.ai-diagnosis-table {
  width: 100%;
  border-collapse: collapse;
  overflow: hidden;
  border-radius: var(--radius-md);
  margin-top: 1rem;
}

.ai-diagnosis-table th,
.ai-diagnosis-table td {
  padding: .95rem;
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: top;
  text-align: left;
}

.ai-diagnosis-table th {
  color: var(--accent-cyan);
  background: rgba(0,245,212,.055);
  font-size: .88rem;
}

.ai-diagnosis-table tr:last-child td { border-bottom: none; }

.ai-gallery-title {
  margin: 2rem 0 1rem;
  font-size: 1.3rem;
  color: var(--accent-cyan);
}

.ai-evidence-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 1rem;
  margin: 1rem 0 1.5rem;
}

.ai-evidence-item {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  background: var(--bg-glass);
  cursor: pointer;
  transition: all var(--transition);
}

.ai-evidence-item:hover {
  transform: translateY(-4px) scale(1.015);
  border-color: var(--border-glow);
  box-shadow: var(--shadow-glow-cyan);
}

.ai-evidence-item img {
  width: 100%;
  height: 180px;
  object-fit: cover;
}

.ai-evidence-caption {
  padding: .9rem;
  color: var(--text-secondary);
  font-size: .82rem;
  line-height: 1.6;
}

.ai-learning-card ul {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: .6rem 1.2rem;
  padding-left: 1.2rem;
  color: var(--text-secondary);
  line-height: 1.9;
}

@media (max-width: 980px) {
  .ai-intro-grid,
  .ai-steps-grid,
  .ai-learning-card ul {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .ai-collab-section { padding: 3rem 1rem; }
  .ai-panel, .ai-diagnosis-card, .ai-learning-card { padding: 1.25rem; }
  .ai-diagnosis-table { display: block; overflow-x: auto; }
}

/* ============================================
   Overleaf PDF Cards (Week 15)
   ============================================ */
.overleaf-pdf-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
  margin: 1.25rem 0 1.5rem;
}

.overleaf-pdf-card {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 1rem;
  align-items: flex-start;
  padding: 1.15rem;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 82, 82, 0.22);
  background: linear-gradient(135deg, rgba(255, 82, 82, 0.10), rgba(187, 134, 252, 0.06));
  color: var(--text-primary);
  text-decoration: none;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}

.overleaf-pdf-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 15% 10%, rgba(255, 255, 255, 0.10), transparent 35%);
  opacity: 0;
  transition: opacity var(--transition);
}

.overleaf-pdf-card:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 82, 82, 0.55);
  box-shadow: 0 0 28px rgba(255, 82, 82, 0.18);
  color: var(--text-primary);
}

.overleaf-pdf-card:hover::before {
  opacity: 1;
}

.overleaf-pdf-icon {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.10);
  font-size: 1.65rem;
  position: relative;
  z-index: 1;
}

.overleaf-pdf-card h4 {
  margin: 0 0 0.45rem;
  font-size: 1rem;
  line-height: 1.45;
  color: var(--text-primary);
  position: relative;
  z-index: 1;
}

.overleaf-pdf-card p {
  margin: 0 0 0.7rem;
  font-size: 0.86rem;
  line-height: 1.7;
  color: var(--text-secondary);
  position: relative;
  z-index: 1;
}

.overleaf-pdf-card span {
  color: var(--accent-red);
  font-size: 0.82rem;
  font-weight: 700;
  position: relative;
  z-index: 1;
}
