 :root {
  --bg: #eef3ff;
  --bg-2: #f8fbff;
  --text: #18243d;
  --muted: #61708a;
  --line: rgba(111, 133, 177, 0.18);
  --card: rgba(255, 255, 255, 0.72);
  --card-strong: rgba(255, 255, 255, 0.9);
  --primary: #4f46e5;
  --primary-2: #2563eb;
  --accent: #8b5cf6;
  --shadow: 0 20px 60px rgba(44, 72, 126, 0.14);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 12px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  min-height: 100vh;
  font-family: 'Inter', system-ui, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(99, 102, 241, 0.18), transparent 32%),
    radial-gradient(circle at top right, rgba(59, 130, 246, 0.18), transparent 28%),
    linear-gradient(180deg, var(--bg), var(--bg-2));
}
button, input { font: inherit; }
a { text-decoration: none; color: inherit; }
.hidden { display: none !important; }

.app-shell {
  width: min(1200px, calc(100% - 24px));
  margin: 0 auto;
  padding: 16px 0 48px;
}

.glass-card {
  background: var(--card);
  border: 1px solid rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
}

.site-header {
  position: sticky;
  top: 12px;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 18px;
  margin-bottom: 18px;
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: var(--radius-xl);
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
}

.brand-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.brand-badge {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  font-weight: 800;
  color: white;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  box-shadow: 0 18px 30px rgba(92, 83, 220, 0.24);
}
.brand-title { font-size: 1.1rem; font-weight: 800; }
.brand-subtitle {
  font-size: 0.86rem;
  color: var(--muted);
  margin-top: 2px;
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}
.search-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 260px;
  padding: 0 14px;
  height: 48px;
  background: rgba(255,255,255,0.88);
  border: 1px solid var(--line);
  border-radius: 16px;
}
.search-wrap svg { width: 20px; height: 20px; fill: #7a8aa7; }
.search-wrap input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
}
.menu-toggle {
  display: none;
  width: 48px;
  height: 48px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.88);
  cursor: pointer;
}
.menu-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--text);
  margin: 4px auto;
  border-radius: 999px;
}

.hero-section {
  display: grid;
  grid-template-columns: 1.3fr 0.9fr;
  gap: 18px;
  align-items: stretch;
  margin-bottom: 20px;
}
.hero-copy, .hero-card {
  padding: 28px;
  border-radius: var(--radius-xl);
  border: 1px solid rgba(255,255,255,0.6);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
}
.hero-copy {
  background: linear-gradient(135deg, rgba(79,70,229,0.95), rgba(37,99,235,0.92), rgba(139,92,246,0.88));
  color: white;
}
.eyebrow {
  display: inline-flex;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255,255,255,0.16);
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  font-weight: 600;
  margin-bottom: 16px;
}
.hero-copy h2 {
  font-size: clamp(2rem, 3vw, 3.4rem);
  line-height: 1.05;
  margin-bottom: 14px;
}
.hero-copy h2 span { color: #d7f1ff; }
.hero-copy p {
  max-width: 54ch;
  color: rgba(255,255,255,0.88);
  font-size: 1rem;
  line-height: 1.7;
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  margin-top: 22px;
}
.primary-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 18px;
  border-radius: 14px;
  font-weight: 700;
  color: var(--primary);
  background: white;
  box-shadow: 0 12px 24px rgba(0,0,0,0.14);
}
.hero-note {
  font-size: 0.92rem;
  color: rgba(255,255,255,0.86);
}
.hero-card {
  background: rgba(255,255,255,0.72);
}
.floating-card { animation: floaty 4.5s ease-in-out infinite; }
@keyframes floaty { 0%,100% { transform: translateY(0);} 50% { transform: translateY(-6px);} }
.hero-card-top {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  margin-bottom: 16px;
}
.status-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 6px rgba(34,197,94,0.14);
}
.hero-points {
  list-style: none;
  display: grid;
  gap: 12px;
}
.hero-points li {
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(255,255,255,0.68);
  border: 1px solid rgba(255,255,255,0.72);
  color: var(--text);
}

.toolbar {
  padding: 22px;
  border-radius: var(--radius-xl);
}
.toolbar-copy h3 {
  font-size: 1.1rem;
  margin-bottom: 6px;
}
.toolbar-copy p { color: var(--muted); }
.category-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}
.chip {
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.88);
  color: var(--text);
  min-height: 44px;
  padding: 0 14px;
  border-radius: 999px;
  font-weight: 600;
  cursor: pointer;
  transition: transform .25s ease, background .25s ease, color .25s ease, box-shadow .25s ease;
}
.chip:hover, .chip.active {
  transform: translateY(-2px);
  color: white;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  box-shadow: 0 14px 24px rgba(79,70,229,0.2);
}

.results-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 4px 4px;
}
.results-meta p { color: var(--muted); }

.cards-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  margin-top: 10px;
}
.learning-card {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: rgba(255,255,255,0.8);
  border: 1px solid rgba(255,255,255,0.66);
  box-shadow: var(--shadow);
  transition: transform .28s ease, box-shadow .28s ease;
}
.learning-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 24px 50px rgba(44,72,126,0.18);
}
.thumb-wrap {
  position: relative;
  overflow: hidden;
  aspect-ratio: 4 / 3;
}
.thumb-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  background: linear-gradient(90deg, rgba(222,228,240,1) 25%, rgba(241,244,250,1) 50%, rgba(222,228,240,1) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.6s linear infinite;
}
.thumb-image.loaded {
  animation: none;
  background: transparent;
}
@keyframes shimmer {
  from { background-position: 200% 0; }
  to { background-position: -200% 0; }
}
.thumb-ar-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 8px 10px;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 800;
  color: white;
  background: linear-gradient(135deg, rgba(79,70,229,.95), rgba(37,99,235,.95));
  box-shadow: 0 12px 24px rgba(79,70,229,0.22);
}
.card-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
  padding: 18px;
}
.card-category {
  align-self: flex-start;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(79,70,229,0.08);
  color: var(--primary);
  font-size: 0.78rem;
  font-weight: 700;
}
.card-title { font-size: 1.12rem; }
.card-description {
  color: var(--muted);
  line-height: 1.65;
  font-size: 0.94rem;
}
.card-footer {
  display: flex;
  margin-top: auto;
}
.card-btn {
  width: 100%;
  border: 0;
  min-height: 46px;
  border-radius: 14px;
  cursor: pointer;
  font-weight: 700;
  color: white;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  box-shadow: 0 14px 24px rgba(79,70,229,0.2);
  transition: transform .25s ease, filter .25s ease;
}
.card-btn:hover { transform: translateY(-1px); filter: brightness(1.03); }

.empty-state {
  margin-top: 18px;
  padding: 28px;
  text-align: center;
  border-radius: var(--radius-xl);
}
.empty-state h3 { margin-bottom: 8px; }
.empty-state p { color: var(--muted); }

.modal-overlay {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(13, 22, 40, 0.6);
  backdrop-filter: blur(8px);
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease, visibility .25s ease;
  z-index: 100;
}
.modal-overlay.open {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
}
.modal-panel {
  width: min(1020px, 100%);
  display: grid;
  grid-template-columns: 1.3fr 0.8fr;
  gap: 18px;
  padding: 18px;
  border-radius: 28px;
  background: rgba(255,255,255,0.92);
  box-shadow: 0 32px 80px rgba(0,0,0,0.22);
  transform: scale(0.96) translateY(8px);
  transition: transform .25s ease;
}
.modal-overlay.open .modal-panel { transform: scale(1) translateY(0); }
.close-btn {
  position: absolute;
  right: 26px;
  top: 24px;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.06);
  color: var(--text);
  font-size: 1.8rem;
  cursor: pointer;
  z-index: 2;
}
.modal-panel { position: relative; }
.modal-viewer-wrap {
  min-height: 420px;
  border-radius: 22px;
  overflow: hidden;
  background: rgba(245,248,255,0.95);
  border: 1px solid rgba(111,133,177,0.16);
}
.modal-info {
  display: flex;
  flex-direction: column;
  padding: 12px 6px 12px 2px;
}
.modal-category {
  display: inline-flex;
  align-self: flex-start;
  margin-top: 12px;
  margin-bottom: 12px;
  padding: 7px 11px;
  border-radius: 999px;
  background: rgba(79,70,229,0.1);
  color: var(--primary);
  font-size: 0.8rem;
  font-weight: 700;
}
#modal-title {
  font-size: clamp(1.6rem, 2vw, 2rem);
  margin-bottom: 10px;
}
#modal-description {
  color: var(--muted);
  line-height: 1.75;
}
.modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 22px;
}
.nav-btn, .ar-launch-btn {
  border: 0;
  min-height: 46px;
  padding: 0 16px;
  border-radius: 14px;
  cursor: pointer;
  font-weight: 700;
}
.nav-btn {
  color: white;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
}
.ar-launch-btn {
  position: absolute;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  color: white;
  background: linear-gradient(135deg, #16a34a, #22c55e);
  box-shadow: 0 16px 30px rgba(34,197,94,0.25);
}
.swipe-hint {
  margin-top: auto;
  padding-top: 18px;
  color: var(--muted);
  font-size: 0.92rem;
}

@media (max-width: 1080px) {
  .cards-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 860px) {
  .site-header {
    flex-wrap: wrap;
    align-items: stretch;
  }
  .header-controls {
    width: 100%;
    justify-content: space-between;
  }
  .search-wrap { flex: 1; min-width: 0; }
  .hero-section { grid-template-columns: 1fr; }
  .cards-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .modal-panel {
    grid-template-columns: 1fr;
    width: min(760px, 100%);
    max-height: calc(100vh - 32px);
    overflow: auto;
  }
  .modal-viewer-wrap { min-height: 360px; }
}

@media (max-width: 640px) {
  .app-shell { width: min(100% - 16px, 100%); }
  .site-header { top: 8px; padding: 14px; border-radius: 22px; }
  .brand-subtitle { display: none; }
  .menu-toggle { display: inline-block; }
  .toolbar { padding: 18px; }
  .category-nav {
    display: none;
    margin-top: 14px;
  }
  .category-nav.open { display: flex; }
  .cards-grid { grid-template-columns: 1fr; gap: 16px; }
  .hero-copy, .hero-card { padding: 22px; }
  .modal-overlay { padding: 8px; }
  .modal-panel { padding: 12px; border-radius: 22px; }
  .modal-viewer-wrap { min-height: 300px; }
  .modal-actions { flex-direction: column; }
  .swipe-hint { font-size: 0.86rem; }
 }
