/* ═══════════════════════════════════════════════════════════════════════════
   STR Case Explorer — Design System & Styles
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Google Fonts ─────────────────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@400;500;600;700;800&display=swap');

/* ── CSS Variables — Dark theme (default) ─────────────────────────────────── */
:root {
  --bg-deep: #060a14;
  --bg-primary: #0a0e1a;
  --bg-elevated: #111827;
  --bg-card: rgba(17, 24, 39, 0.6);
  --bg-card-hover: rgba(17, 24, 39, 0.85);
  --bg-glass: rgba(255, 255, 255, 0.03);
  --bg-glass-hover: rgba(255, 255, 255, 0.06);

  --accent-primary: #00d4aa;
  --accent-primary-dim: rgba(0, 212, 170, 0.15);
  --accent-secondary: #00b4d8;
  --accent-secondary-dim: rgba(0, 180, 216, 0.12);
  --accent-warm: #f59e0b;
  --accent-warm-dim: rgba(245, 158, 11, 0.12);
  --accent-rose: #f43f5e;
  --accent-rose-dim: rgba(244, 63, 94, 0.12);
  --accent-violet: #8b5cf6;
  --accent-violet-dim: rgba(139, 92, 246, 0.12);

  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-tertiary: #64748b;
  --text-muted: #475569;

  --border-subtle: rgba(255, 255, 255, 0.06);
  --border-accent: rgba(0, 212, 170, 0.25);
  --border-hover: rgba(0, 212, 170, 0.4);

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 20px rgba(0, 212, 170, 0.15);
  --shadow-glow-strong: 0 0 40px rgba(0, 212, 170, 0.25);

  /* Color that sits on top of an accent-colored surface */
  --on-accent: #060a14;

  --max-width: 1160px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;

  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-heading: 'Outfit', 'Inter', sans-serif;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ── Light theme overrides ────────────────────────────────────────────────── */
[data-theme="light"] {
  --bg-deep: #eef2f9;
  --bg-primary: #f2f5fb;
  --bg-elevated: #ffffff;
  --bg-card: rgba(255, 255, 255, 0.75);
  --bg-card-hover: rgba(255, 255, 255, 0.96);
  --bg-glass: rgba(15, 23, 42, 0.035);
  --bg-glass-hover: rgba(15, 23, 42, 0.06);

  --accent-primary: #0d9488;
  --accent-primary-dim: rgba(13, 148, 136, 0.12);
  --accent-secondary: #0284c7;
  --accent-secondary-dim: rgba(2, 132, 199, 0.10);
  --accent-warm: #d97706;
  --accent-warm-dim: rgba(217, 119, 6, 0.12);
  --accent-rose: #e11d48;
  --accent-rose-dim: rgba(225, 29, 72, 0.10);
  --accent-violet: #7c3aed;
  --accent-violet-dim: rgba(124, 58, 237, 0.10);

  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-tertiary: #64748b;
  --text-muted: #94a3b8;

  --border-subtle: rgba(15, 23, 42, 0.10);
  --border-accent: rgba(13, 148, 136, 0.35);
  --border-hover: rgba(13, 148, 136, 0.5);

  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.08);
  --shadow-md: 0 4px 12px rgba(15, 23, 42, 0.10);
  --shadow-lg: 0 8px 32px rgba(15, 23, 42, 0.15);
  --shadow-glow: 0 0 20px rgba(13, 148, 136, 0.15);
  --shadow-glow-strong: 0 0 40px rgba(13, 148, 136, 0.22);

  --on-accent: #ffffff;
}

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  background: var(--bg-deep);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  transition: background-color 0.35s ease, color 0.35s ease;
}

/* Animated background gradient mesh */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 50% at 20% 20%, var(--accent-primary-dim) 0%, transparent 60%),
    radial-gradient(ellipse 60% 40% at 80% 80%, var(--accent-secondary-dim) 0%, transparent 60%),
    radial-gradient(ellipse 50% 60% at 50% 50%, var(--accent-violet-dim) 0%, transparent 60%);
  opacity: 0.6;
  pointer-events: none;
  z-index: 0;
  animation: bgPulse 15s ease-in-out infinite alternate;
}

@keyframes bgPulse {
  0% { opacity: 0.45; }
  100% { opacity: 0.75; }
}

/* ── App shell (rail + calendar panel + content) ──────────────────────────── */
.app-shell {
  display: flex;
  align-items: flex-start;
  position: relative;
  z-index: 1;
  min-height: 100vh;
}

/* Left rail — fixed vertical toolbar */
.rail {
  position: sticky;
  top: 0;
  align-self: flex-start;
  z-index: 40;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: 60px;
  height: 100vh;
  padding-top: 18px;
  flex-shrink: 0;
  border-right: 1px solid var(--border-subtle);
  background: var(--bg-glass);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.rail__btn {
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-glass);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.25s var(--ease-out);
}

.rail__btn:hover {
  color: var(--accent-primary);
  border-color: var(--border-accent);
  transform: translateY(-1px);
}

.rail__btn.active {
  background: var(--accent-primary-dim);
  color: var(--accent-primary);
  border-color: var(--border-accent);
  box-shadow: var(--shadow-glow);
}

.rail__spacer { flex: 1; }

/* Calendar panel — expands inline along the left border (push, not overlay) */
.cal-panel {
  position: sticky;
  top: 0;
  align-self: flex-start;
  height: 100vh;
  flex-shrink: 0;
  width: 0;
  overflow: hidden;
  transition: width 0.4s var(--ease-out);
  z-index: 30;
}

.cal-panel.open {
  width: 336px;
}

.cal-panel__inner {
  width: 336px;
  height: 100vh;
  overflow-y: auto;
  padding: 24px 18px;
  border-right: 1px solid var(--border-subtle);
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.cal-panel__title {
  font-family: var(--font-heading);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-tertiary);
  margin-bottom: 16px;
}

.cal-panel__hint {
  margin-top: 18px;
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ── Content container ────────────────────────────────────────────────────── */
.container {
  flex: 1;
  min-width: 0;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 28px;
}

/* ── Hero Header (compact) ────────────────────────────────────────────────── */
.hero {
  text-align: center;
  padding: 26px 0 12px;
  position: relative;
}

.hero__badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 14px;
  background: var(--accent-primary-dim);
  border: 1px solid var(--border-accent);
  border-radius: 100px;
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--accent-primary);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 12px;
  animation: fadeInDown 0.6s var(--ease-out) both;
}

.hero__badge::before {
  content: '';
  width: 6px;
  height: 6px;
  background: var(--accent-primary);
  border-radius: 50%;
  animation: pulse 2s ease-in-out infinite;
}

.hero__title {
  font-family: var(--font-heading);
  font-size: clamp(1.6rem, 3.6vw, 2.4rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
  background: linear-gradient(135deg, var(--text-primary) 0%, var(--accent-primary) 55%, var(--accent-secondary) 100%);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradientShift 6s ease infinite, fadeInUp 0.8s var(--ease-out) 0.1s both;
}

.hero__subtitle {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin: 8px auto 0;
  max-width: 560px;
  animation: fadeInUp 0.8s var(--ease-out) 0.2s both;
}

/* ── Stats Bar (slim) ─────────────────────────────────────────────────────── */
.stats-bar {
  display: flex;
  justify-content: center;
  gap: 28px;
  padding: 12px 24px;
  margin: 0 auto 18px;
  max-width: 380px;
  background: var(--bg-glass);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  animation: fadeInUp 0.8s var(--ease-out) 0.3s both;
}

.stat { text-align: center; }

.stat__value {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent-primary);
  line-height: 1;
}

.stat__label {
  font-size: 0.65rem;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 4px;
}

/* ── Search Bar ───────────────────────────────────────────────────────────── */
.search-section {
  margin-bottom: 18px;
  animation: fadeInUp 0.8s var(--ease-out) 0.4s both;
}

.search-wrapper {
  position: relative;
  max-width: 600px;
  margin: 0 auto;
}

.search-icon {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-tertiary);
  pointer-events: none;
  transition: color 0.3s;
}

.search-input {
  width: 100%;
  padding: 14px 18px 14px 50px;
  background: var(--bg-glass);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.95rem;
  outline: none;
  transition: all 0.3s var(--ease-out);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.search-input::placeholder { color: var(--text-muted); }

.search-input:focus {
  border-color: var(--border-accent);
  box-shadow: var(--shadow-glow);
  background: var(--bg-glass-hover);
}

.search-input:focus ~ .search-icon { color: var(--accent-primary); }

.search-shortcut {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  padding: 3px 8px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  font-size: 0.7rem;
  color: var(--text-muted);
  pointer-events: none;
  transition: opacity 0.2s;
}

.search-input:focus ~ .search-shortcut { opacity: 0; }

.search-results-info {
  text-align: center;
  margin-top: 10px;
  font-size: 0.85rem;
  color: var(--text-tertiary);
  min-height: 18px;
}

/* ── Tag Filter — auto-scrolling marquee ──────────────────────────────────── */
.tag-filter {
  position: relative;
  overflow: hidden;
  margin-bottom: 16px;
  padding: 2px 0;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 5%, #000 95%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 5%, #000 95%, transparent);
  animation: fadeInUp 0.8s var(--ease-out) 0.45s both;
}

.tag-track {
  display: inline-flex;
  width: max-content;
  animation: marquee 48s linear infinite;
}

.tag-track:hover,
.tag-track:focus-within {
  animation-play-state: paused;
}

@keyframes marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

.tag-pill {
  display: inline-flex;
  align-items: center;
  margin-right: 8px;
  padding: 6px 14px;
  background: var(--bg-glass);
  border: 1px solid var(--border-subtle);
  border-radius: 100px;
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.25s var(--ease-out), border-color 0.25s var(--ease-out), background 0.25s var(--ease-out);
}

.tag-pill:hover {
  border-color: var(--border-accent);
  color: var(--accent-primary);
}

.tag-pill.active {
  background: var(--accent-primary-dim);
  border-color: var(--border-accent);
  color: var(--accent-primary);
  box-shadow: var(--shadow-glow);
}

/* ── Toolbar (Surprise Me) ────────────────────────────────────────────────── */
.toolbar {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 28px;
  animation: fadeInUp 0.8s var(--ease-out) 0.5s both;
}

.btn-surprise {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 20px;
  background: linear-gradient(135deg, var(--accent-primary-dim), var(--accent-secondary-dim));
  border: 1px solid var(--border-accent);
  border-radius: 100px;
  color: var(--accent-primary);
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s var(--ease-out);
  white-space: nowrap;
}

.btn-surprise:hover {
  background: linear-gradient(135deg, var(--accent-primary-dim), var(--accent-secondary-dim));
  box-shadow: var(--shadow-glow);
  transform: translateY(-1px);
}

/* ── Calendar (inside the left panel) ─────────────────────────────────────── */
.calendar {
  background: transparent;
  border: none;
  padding: 0;
}

.calendar__nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.calendar__month-title {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-primary);
}

.calendar__nav-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: var(--bg-glass);
  border: 1px solid var(--border-subtle);
  border-radius: 50%;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s var(--ease-out);
}

.calendar__nav-btn:hover:not(:disabled) {
  background: var(--bg-glass-hover);
  border-color: var(--border-accent);
  color: var(--accent-primary);
}

.calendar__nav-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.calendar__grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
}

.calendar__day-header {
  text-align: center;
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 6px 0;
}

.calendar__day {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  color: var(--text-tertiary);
  cursor: default;
  transition: all 0.2s var(--ease-out);
}

.calendar__day.other-month {
  color: var(--text-muted);
  opacity: 0.3;
}

.calendar__day.has-webinar {
  color: var(--text-primary);
  cursor: pointer;
  font-weight: 600;
}

.calendar__day.has-webinar:hover {
  background: var(--accent-primary-dim);
}

.calendar__day.selected {
  background: var(--accent-primary);
  color: var(--on-accent);
  box-shadow: var(--shadow-glow-strong);
}

.calendar__day.today { border: 1px solid var(--border-accent); }

.calendar__dot {
  position: absolute;
  bottom: 4px;
  width: 5px;
  height: 5px;
  background: var(--accent-primary);
  border-radius: 50%;
  animation: pulse 2.5s ease-in-out infinite;
}

.calendar__day.selected .calendar__dot { background: var(--on-accent); }

.calendar__case-count {
  position: absolute;
  top: 1px;
  right: 1px;
  min-width: 15px;
  height: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-warm);
  color: var(--on-accent);
  font-size: 0.55rem;
  font-weight: 700;
  border-radius: 100px;
  padding: 0 3px;
}

.calendar__day.selected .calendar__case-count {
  background: var(--on-accent);
  color: var(--accent-primary);
}

/* ── Webinar Section ──────────────────────────────────────────────────────── */
.webinar-section { margin-bottom: 24px; scroll-margin-top: 16px; }

.webinar-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 22px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  margin-bottom: 14px;
  cursor: pointer;
  transition: all 0.3s var(--ease-out);
}

.webinar-header:hover {
  border-color: var(--border-accent);
  background: var(--bg-card-hover);
  box-shadow: var(--shadow-glow);
}

.webinar-header__date {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 54px;
  padding: 8px 12px;
  background: var(--accent-primary-dim);
  border-radius: var(--radius-sm);
}

.webinar-header__date-month {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--accent-primary);
  letter-spacing: 1px;
}

.webinar-header__date-day {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
}

.webinar-header__info { flex: 1; }

.webinar-header__title {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-primary);
}

.webinar-header__meta {
  font-size: 0.8rem;
  color: var(--text-tertiary);
  margin-top: 2px;
}

.webinar-header__chevron {
  color: var(--text-muted);
  transition: transform 0.3s var(--ease-out);
}

.webinar-header.expanded .webinar-header__chevron { transform: rotate(90deg); }

/* ── Case Cards ───────────────────────────────────────────────────────────── */
.cases-list {
  display: grid;
  gap: 12px;
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transition: max-height 0.5s var(--ease-out), opacity 0.3s var(--ease-out);
}

.cases-list.expanded {
  max-height: 100000px;
  opacity: 1;
  margin-bottom: 20px;
}

.case-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 20px 24px;
  transition: all 0.3s var(--ease-out);
  animation: fadeInUp 0.4s var(--ease-out) both;
}

.case-card:hover {
  border-color: var(--border-hover);
  background: var(--bg-card-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.case-card__header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
}

.case-card__number {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  background: var(--accent-primary-dim);
  border-radius: 50%;
  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent-primary);
  flex-shrink: 0;
}

.case-card__title-area { flex: 1; min-width: 0; }

/* Single-tag chip shown on each case card and in the modal details */
.case-card__tag {
  flex-shrink: 0;
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  padding: 3px 11px;
  background: var(--accent-primary-dim);
  border: 1px solid var(--border-accent);
  border-radius: 100px;
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--accent-primary);
  white-space: nowrap;
}

.case-card__title {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.3;
}

.case-card__timestamp {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 6px;
  padding: 3px 10px;
  background: var(--accent-warm-dim);
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--accent-warm);
  cursor: pointer;
  transition: all 0.2s var(--ease-out);
}

.case-card__timestamp:hover {
  background: var(--accent-warm-dim);
  box-shadow: 0 0 12px var(--accent-warm-dim);
}

.case-card__body {
  display: grid;
  gap: 12px;
}

.case-card__section {
  padding: 12px 16px;
  background: var(--bg-glass);
  border-radius: var(--radius-sm);
  border-left: 3px solid;
}

.case-card__section--findings { border-left-color: var(--accent-secondary); }
.case-card__section--takeaways { border-left-color: var(--accent-primary); }

.case-card__section-title {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 6px;
}

.case-card__section--findings .case-card__section-title { color: var(--accent-secondary); }
.case-card__section--takeaways .case-card__section-title { color: var(--accent-primary); }

.case-card__section-text {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.65;
}

/* ── YouTube Modal ────────────────────────────────────────────────────────── */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s var(--ease-out);
}

.modal-backdrop.visible { opacity: 1; visibility: visible; }

.modal {
  position: relative;
  width: 100%;
  max-width: 1080px;
  max-height: 90vh;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  overflow: hidden;
  transform: scale(0.9) translateY(20px);
  transition: transform 0.4s var(--ease-spring);
  box-shadow: var(--shadow-lg);
}

.modal-backdrop.visible .modal { transform: scale(1) translateY(0); }

.modal__body {
  display: flex;
  align-items: stretch;
  max-height: 90vh;
}

/* Center the video on a dark stage so any leftover height (when the notes
   panel is taller than the 16:9 video) reads as intentional letterboxing
   rather than empty space. */
.modal__media {
  flex: 1 1 62%;
  min-width: 0;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal__close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 10;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  color: #f1f5f9;
  cursor: pointer;
  transition: all 0.2s;
}

.modal__close:hover { background: rgba(0, 0, 0, 0.85); }

.modal__video-container {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%;
  height: 0;
}

.modal__video-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

.modal__details {
  flex: 1 1 38%;
  max-width: 400px;
  padding: 22px 22px 26px;
  overflow-y: auto;
  border-left: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.modal__case-meta {
  font-size: 0.78rem;
  color: var(--text-tertiary);
}

.modal__case-title {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.3;
}

.modal__case-tag { align-self: flex-start; }

/* ── Empty State ──────────────────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 60px 24px;
  color: var(--text-tertiary);
}

.empty-state__icon { margin-bottom: 16px; opacity: 0.5; display: flex; justify-content: center; }

.empty-state__title {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.empty-state__text { font-size: 0.9rem; }

/* ── Footer ───────────────────────────────────────────────────────────────── */
.footer {
  text-align: center;
  padding: 36px 0 28px;
  border-top: 1px solid var(--border-subtle);
  margin-top: 32px;
}

.footer__text { font-size: 0.8rem; color: var(--text-muted); }

.footer__link {
  color: var(--accent-primary);
  text-decoration: none;
  transition: color 0.2s;
}

.footer__link:hover { color: var(--accent-secondary); }

/* ── Search highlight ─────────────────────────────────────────────────────── */
mark {
  background: var(--accent-warm-dim);
  color: var(--accent-warm);
  padding: 1px 4px;
  border-radius: 3px;
}

/* ── Loading Skeleton ─────────────────────────────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg, var(--bg-glass) 25%, var(--bg-glass-hover) 50%, var(--bg-glass) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}

/* ── Animations ───────────────────────────────────────────────────────────── */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-12px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes gradientShift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.8); }
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

@keyframes highlightFlash {
  0% { box-shadow: 0 0 0 0 rgba(0, 212, 170, 0.4); }
  50% { box-shadow: 0 0 0 8px rgba(0, 212, 170, 0); }
  100% { box-shadow: 0 0 0 0 rgba(0, 212, 170, 0); }
}

.case-card.highlighted {
  animation: highlightFlash 1.5s ease-out;
  border-color: var(--accent-primary);
}

/* ── Reduced motion ───────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .tag-track { animation: none; }
  .tag-filter { overflow-x: auto; }
  body::before { animation: none; }
}

/* ── Responsive ───────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .rail { width: 52px; padding-top: 14px; }

  .container { padding: 0 16px; }

  /* On small screens the calendar overlays instead of pushing content */
  .cal-panel {
    position: fixed;
    left: 52px;
    top: 0;
    height: 100dvh;
    box-shadow: var(--shadow-lg);
  }
  .cal-panel.open { width: min(320px, 82vw); }
  .cal-panel__inner { width: min(320px, 82vw); }

  .hero { padding: 20px 0 10px; }
  .stats-bar { gap: 20px; padding: 10px 18px; }
  .webinar-header { padding: 14px 16px; }
  .case-card { padding: 16px; }

  /* Modal stacks: video on top, details below */
  .modal__body { flex-direction: column; max-height: 90vh; overflow-y: auto; }
  .modal__media { flex: none; width: 100%; }
  .modal__details {
    flex: none;
    max-width: none;
    border-left: none;
    border-top: 1px solid var(--border-subtle);
  }
}

@media (max-width: 480px) {
  .stats-bar { gap: 16px; }
}

/* ── Print ────────────────────────────────────────────────────────────────── */
@media print {
  body { background: white; color: black; }
  body::before,
  .rail,
  .cal-panel,
  .search-section,
  .tag-filter,
  .toolbar,
  .modal-backdrop,
  .footer { display: none !important; }

  .cases-list { max-height: none !important; opacity: 1 !important; }
  .case-card { break-inside: avoid; border: 1px solid #ddd; background: white; }
  .case-card__section { background: #f8f8f8; }
}
