:root {
  --ink: #0d1f2d;
  --ink-soft: #2b475f;
  --paper: #f5f3ed;
  --accent: #ff6f3c;
  --accent-2: #1d9bf0;
  --panel: rgba(255, 255, 255, 0.86);
  --shadow: 0 14px 34px rgba(13, 31, 45, 0.15);
  --font-summary-english: "Lora", "Georgia", serif;
  --font-devanagari: "Noto Serif Devanagari", "Noto Serif", serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Space Grotesk", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 12%, rgba(255, 111, 60, 0.27), transparent 30%),
    radial-gradient(circle at 88% 22%, rgba(29, 155, 240, 0.3), transparent 34%),
    linear-gradient(180deg, #fcfbf8 0%, #f0ebe2 100%);
}

.shell {
  width: min(1200px, 92vw);
  margin: 0 auto;
  padding: 2.2rem 0 4.5rem;
}

.hero {
  margin-bottom: 2rem;
}

.eyebrow {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-soft);
  font-size: 0.72rem;
}

h1 {
  margin: 0.35rem 0 0.6rem;
  font-family: "Sora", sans-serif;
  font-size: clamp(1.8rem, 3.6vw, 3rem);
}

.subhead {
  margin: 0;
  color: var(--ink-soft);
}

.bento-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.95rem;
}

.summary-count {
  margin: 0 0 0.75rem;
  font-size: 0.82rem;
  color: var(--ink-soft);
}

.feed-tabs {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 0.45rem;
  margin-bottom: 0.7rem;
  padding: 0.25rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(13, 31, 45, 0.1);
  width: 100%;
}

.feed-tab {
  border: 0;
  border-radius: 999px;
  padding: 0.35rem 0.7rem;
  font-size: 0.78rem;
  color: var(--ink-soft);
  background: transparent;
  cursor: pointer;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.feed-tab.is-active {
  background: rgba(13, 31, 45, 0.9);
  color: #fff;
}

.feed-tab-count {
  min-width: 1.1rem;
  text-align: center;
  padding: 0.1rem 0.35rem;
  border-radius: 999px;
  font-size: 0.7rem;
  background: rgba(13, 31, 45, 0.12);
}

.feed-tab.is-active .feed-tab-count {
  background: rgba(255, 255, 255, 0.18);
}

.tag-filter-strip {
  display: inline-flex;
  gap: 0.45rem;
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: thin;
  flex: 1 1 auto;
  min-width: 0;
  padding-left: 0.2rem;
}

.tag-filter-tab {
  flex: 0 0 auto;
}

.video-feed {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.video-feed[aria-busy="true"] {
  min-height: 420px;
}

.feed-pagination {
  margin: 0.2rem 0 0.55rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.7rem;
  min-height: 2rem;
}

.feed-page-btn {
  border: 0;
  border-radius: 999px;
  padding: 0.32rem 0.74rem;
  font-size: 0.75rem;
  color: #fff;
  background: rgba(13, 31, 45, 0.9);
  cursor: pointer;
  font-family: inherit;
}

.feed-page-btn:disabled {
  cursor: default;
  opacity: 0.45;
}

.feed-page-meta {
  font-size: 0.78rem;
  color: var(--ink-soft);
}

.tag-group {
  background: rgba(255, 255, 255, 0.4);
  border: 1px solid rgba(13, 31, 45, 0.08);
  border-radius: 16px;
  padding: 0.75rem;
}

.tag-group-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.6rem;
}

.tag-group-title {
  margin: 0;
  font-family: "Sora", sans-serif;
  font-size: 0.9rem;
  text-transform: lowercase;
}

.tag-group-count {
  font-size: 0.72rem;
  color: var(--ink-soft);
  background: rgba(13, 31, 45, 0.08);
  border-radius: 999px;
  padding: 0.15rem 0.45rem;
}

.tag-group-grid {
  gap: 0.8rem;
}

.video-card {
  position: relative;
  border: 0;
  border-radius: 20px;
  overflow: hidden;
  padding: 0;
  background: var(--panel);
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease;
  text-align: left;
}

.loading-grid {
  pointer-events: none;
}

.skeleton-card {
  cursor: default;
  box-shadow: 0 10px 26px rgba(13, 31, 45, 0.11);
}

.skeleton-card:hover {
  transform: none;
  box-shadow: 0 10px 26px rgba(13, 31, 45, 0.11);
}

.skeleton-thumb {
  width: 100%;
  height: 140px;
  background: linear-gradient(90deg, rgba(13, 31, 45, 0.08), rgba(13, 31, 45, 0.15), rgba(13, 31, 45, 0.08));
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.3s linear infinite;
}

.skeleton-line {
  height: 10px;
  border-radius: 999px;
  margin-top: 0.5rem;
  background: linear-gradient(90deg, rgba(13, 31, 45, 0.08), rgba(13, 31, 45, 0.15), rgba(13, 31, 45, 0.08));
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.3s linear infinite;
}

.skeleton-line.w70 {
  width: 70%;
}

.skeleton-line.w50 {
  width: 50%;
}

.skeleton-line.w35 {
  width: 35%;
}

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

  100% {
    background-position: -200% 0;
  }
}

.video-card:hover {
  transform: translateY(-4px) scale(1.01);
  box-shadow: 0 18px 36px rgba(13, 31, 45, 0.2);
}

.video-card:focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: 2px;
}

.video-card img {
  width: 100%;
  height: 140px;
  object-fit: cover;
  display: block;
}

.card-body {
  padding: 0.9rem;
}

.card-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.55rem;
}

.card-tag-chip {
  border-radius: 999px;
  padding: 0.26rem 0.5rem;
  font-size: 0.66rem;
  color: #0d1f2d;
  background: rgba(13, 31, 45, 0.12);
  text-transform: lowercase;
}

.mark-unread-btn {
  border: 0;
  border-radius: 999px;
  padding: 0.3rem 0.56rem;
  font-size: 0.7rem;
  color: #0f6abf;
  background: rgba(15, 106, 191, 0.14);
  cursor: pointer;
  font-family: inherit;
}

.mark-unread-btn:hover {
  background: rgba(15, 106, 191, 0.2);
}

.card-title {
  font-size: 0.94rem;
  margin: 0;
  line-height: 1.35;
}

.card-meta {
  margin: 0.5rem 0 0;
  font-size: 0.76rem;
  color: var(--ink-soft);
}

.rank-chip {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  background: rgba(13, 31, 45, 0.8);
  color: #fff;
  padding: 0.3rem 0.46rem;
  border-radius: 999px;
  font-size: 0.7rem;
  text-transform: lowercase;
}

.summary-chip {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  background: rgba(22, 163, 74, 0.92);
  color: #fff;
  padding: 0.3rem 0.46rem;
  border-radius: 999px;
  font-size: 0.7rem;
}

.summary-chip.is-failed {
  background: rgba(220, 38, 38, 0.94);
}

.last-poll {
  position: fixed;
  right: 1rem;
  bottom: 0.8rem;
  font-size: 0.74rem;
  color: var(--ink-soft);
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(13, 31, 45, 0.1);
  border-radius: 999px;
  padding: 0.28rem 0.65rem;
  backdrop-filter: blur(5px);
}

.toast {
  position: fixed;
  right: 1rem;
  bottom: 3.2rem;
  background: var(--ink);
  color: #fff;
  border-radius: 10px;
  padding: 0.62rem 0.88rem;
  font-size: 0.82rem;
  box-shadow: var(--shadow);
}

.hidden {
  display: none !important;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(13, 31, 45, 0.58);
  backdrop-filter: blur(3px);
}

.modal-panel {
  position: relative;
  width: min(1100px, 95vw);
  margin: 4vh auto;
  background: #fefefe;
  border-radius: 18px;
  padding: 1rem;
  box-shadow: 0 30px 60px rgba(13, 31, 45, 0.4);
}

.close-btn {
  float: right;
  border: 0;
  background: #102a43;
  color: #fff;
  border-radius: 999px;
  padding: 0.42rem 0.8rem;
  font-family: inherit;
  cursor: pointer;
}

.split-view {
  clear: both;
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 1rem;
  margin-top: 0.6rem;
}

.left-pane,
.right-pane {
  background: #f8f8f8;
  border-radius: 12px;
  padding: 0.86rem;
}

.left-pane img {
  width: 100%;
  border-radius: 10px;
  margin-bottom: 0.6rem;
}

.left-pane h2 {
  margin: 0;
  font-family: "Sora", sans-serif;
  font-size: 1rem;
}

.meta {
  margin: 0.4rem 0;
  font-size: 0.82rem;
  color: var(--ink-soft);
}

#modal-link {
  display: inline-block;
  margin-top: 0.6rem;
  background: #0f6abf;
  color: #fff;
  text-decoration: none;
  font-size: 0.84rem;
  border-radius: 999px;
  padding: 0.42rem 0.8rem;
}

.summary-content {
  font-family: var(--font-summary-english);
  white-space: pre-wrap;
  line-height: 1.45;
  font-size: 0.92rem;
  max-height: 62vh;
  overflow: auto;
}

.summary-content.devanagari {
  font-family: var(--font-devanagari);
  font-size: 1rem;
  line-height: 1.6;
  letter-spacing: 0;
}

@media (max-width: 900px) {
  .feed-tabs {
    width: 100%;
  }

  .tag-filter-strip {
    flex: 1 1 auto;
    min-width: 0;
  }

  .split-view {
    grid-template-columns: 1fr;
  }

  .modal-panel {
    margin: 2vh auto;
    max-height: 94vh;
    overflow: auto;
  }
}
