/* ============================================================
   Krishna Kanth B — Video Hub  ·  modern UI
   ============================================================ */

:root {
  --bg: #0b0c10;
  --bg-2: #101218;
  --card: #14161d;
  --card-2: #181b23;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.16);
  --text: #f4f5f7;
  --muted: #9aa1ad;
  --muted-2: #6c7280;
  --accent: #ff0033;
  --accent-2: #ff4d6d;
  --portfolio: #4c8dff;
  --portfolio-2: #7aa9ff;
  --radius: 16px;
  --radius-sm: 12px;
  --shadow: 0 18px 40px -16px rgba(0, 0, 0, 0.75);
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Ambient animated glow behind everything */
body::before {
  content: "";
  position: fixed;
  inset: -20% -20% auto -20%;
  height: 70vh;
  background:
    radial-gradient(40% 50% at 20% 0%, rgba(255, 0, 51, 0.18), transparent 70%),
    radial-gradient(40% 50% at 85% 10%, rgba(76, 141, 255, 0.16), transparent 70%);
  filter: blur(40px);
  z-index: -1;
  pointer-events: none;
  animation: drift 18s var(--ease) infinite alternate;
}
@keyframes drift {
  to { transform: translate3d(0, 30px, 0) scale(1.05); }
}

::selection { background: var(--accent); color: #fff; }

/* Custom scrollbar */
::-webkit-scrollbar { width: 11px; }
::-webkit-scrollbar-thumb {
  background: #2a2e38;
  border-radius: 999px;
  border: 3px solid var(--bg);
}
::-webkit-scrollbar-thumb:hover { background: #3a3f4c; }

/* ---------- Sticky navbar ---------- */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px clamp(16px, 4vw, 40px);
  transition: background 0.3s var(--ease), backdrop-filter 0.3s var(--ease),
              border-color 0.3s var(--ease), box-shadow 0.3s var(--ease);
  border-bottom: 1px solid transparent;
}
.navbar.scrolled {
  background: rgba(11, 12, 16, 0.72);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom-color: var(--line);
  box-shadow: 0 8px 30px -20px rgba(0, 0, 0, 0.9);
}
.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
  font-family: "Space Grotesk", sans-serif;
  font-weight: 600;
  font-size: 1rem;
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease);
  pointer-events: none;
}
.navbar.scrolled .nav-brand { opacity: 1; transform: none; pointer-events: auto; }
.nav-logo {
  width: 30px; height: 30px;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}
.nav-cta {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 8px 16px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--portfolio), var(--portfolio-2));
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25);
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity 0.3s var(--ease), transform 0.18s var(--ease), box-shadow 0.18s var(--ease);
  pointer-events: none;
}
.navbar.scrolled .nav-cta { opacity: 1; transform: none; pointer-events: auto; }
.nav-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px -10px var(--portfolio), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: clamp(360px, 56vh, 600px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  text-align: center;
  padding: 90px 20px 40px;
  overflow: hidden;
}
.hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  transform: scale(1.04);
  animation: heroZoom 22s var(--ease) infinite alternate;
}
@keyframes heroZoom {
  to { transform: scale(1.12); }
}
.hero-scrim {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to bottom, rgba(11,12,16,0.35) 0%, rgba(11,12,16,0.15) 35%, rgba(11,12,16,0.85) 80%, var(--bg) 100%),
    radial-gradient(120% 80% at 50% 0%, transparent 40%, rgba(11,12,16,0.5) 100%);
}
.hero-content {
  position: relative;
  z-index: 2;
  max-width: 820px;
  width: 100%;
  animation: rise 0.8s var(--ease) both;
}
@keyframes rise {
  from { opacity: 0; transform: translateY(24px); }
}
.site-logo {
  width: clamp(84px, 12vw, 120px);
  height: auto;
  border-radius: 22px;
  margin-bottom: 14px;
  filter: drop-shadow(0 10px 30px rgba(0, 0, 0, 0.6));
  animation: float 6s ease-in-out infinite;
}
@keyframes float {
  50% { transform: translateY(-8px); }
}
.site-title {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(2.2rem, 6vw, 3.6rem);
  letter-spacing: -0.03em;
  line-height: 1.05;
  background: linear-gradient(180deg, #ffffff, #c9cdd6);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 2px 40px rgba(0, 0, 0, 0.4);
}
.site-tagline {
  margin: 12px auto 24px;
  color: #d6dae2;
  /* One line on wider screens; wraps (not truncates) on small screens — see the
     responsive override below — and never shrinks below a readable size. */
  font-size: clamp(0.78rem, 2.7vw, 1.12rem);
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.6);
}

/* ---------- Buttons ---------- */
.links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: #fff;
  text-decoration: none;
  padding: 11px 22px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid transparent;
  overflow: hidden;
  transition: transform 0.2s var(--ease), box-shadow 0.25s var(--ease),
              background 0.25s var(--ease), border-color 0.25s var(--ease);
  isolation: isolate;
}
.btn:hover { transform: translateY(-3px); }
.btn:active { transform: translateY(-1px); }

/* Primary — YouTube red, with a glassy top sheen + hairline so it sits in the theme */
.btn-yt {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-color: rgba(255, 255, 255, 0.14);
  box-shadow: 0 6px 18px -10px var(--accent), inset 0 1px 0 rgba(255, 255, 255, 0.28);
}
.btn-yt:hover {
  box-shadow: 0 14px 32px -10px var(--accent), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

/* Secondary — frosted glass to match the navbar & cards, blue accent */
.btn-portfolio {
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(10px) saturate(140%);
  -webkit-backdrop-filter: blur(10px) saturate(140%);
  border-color: var(--line-strong);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
}
.btn-portfolio .btn-icon { color: var(--portfolio-2); }
.btn-portfolio:hover {
  background: rgba(76, 141, 255, 0.14);
  border-color: rgba(122, 169, 255, 0.55);
  box-shadow: 0 14px 30px -12px var(--portfolio), inset 0 1px 0 rgba(255, 255, 255, 0.16);
}

/* Shine sweep — only on the solid primary buttons */
.btn-yt::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 35%, rgba(255, 255, 255, 0.35) 50%, transparent 65%);
  transform: translateX(-120%);
  transition: transform 0.6s var(--ease);
  z-index: -1;
}
.btn-yt:hover::after { transform: translateX(120%); }
.btn-icon { width: 18px; height: 18px; display: block; flex: none; }

/* ---------- Main / section head ---------- */
main {
  max-width: 1240px;
  margin: 0 auto;
  padding: 8px clamp(16px, 4vw, 32px) 60px;
}
.section-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 28px 4px 22px;
}
.section-head h2 {
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.5rem;
  margin: 0;
  letter-spacing: -0.01em;
}
.count-pill {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
  background: var(--card-2);
  border: 1px solid var(--line);
  padding: 4px 12px;
  border-radius: 999px;
}

.status { text-align: center; color: var(--muted); padding: 20px 0; }

/* ---------- Grid ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
}

.card {
  position: relative;
  background: var(--card);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease), border-color 0.35s var(--ease);
  /* scroll-reveal initial state */
  opacity: 0;
  transform: translateY(22px);
}
.card.in { opacity: 1; transform: none; }
.card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow);
  border-color: var(--line-strong);
}

/* Thumbnail facade */
.thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  cursor: pointer;
  overflow: hidden;
  background: #000;
}
.thumb-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.5s var(--ease), filter 0.35s var(--ease);
}
.card:hover .thumb-img { transform: scale(1.07); filter: brightness(0.78); }
.thumb::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.35), transparent 55%);
  opacity: 0.7;
  transition: opacity 0.35s var(--ease);
}
.card:hover .thumb::after { opacity: 1; }

.play-btn {
  position: absolute;
  top: 50%; left: 50%;
  width: 66px; height: 66px;
  transform: translate(-50%, -50%) scale(0.92);
  background: rgba(255, 0, 51, 0.92);
  border-radius: 50%;
  z-index: 2;
  box-shadow: 0 8px 24px rgba(255, 0, 51, 0.45);
  transition: transform 0.25s var(--ease), background 0.25s var(--ease);
  backdrop-filter: blur(2px);
}
.play-btn::before {
  content: "";
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-38%, -50%);
  border-style: solid;
  border-width: 12px 0 12px 20px;
  border-color: transparent transparent transparent #fff;
}
.card:hover .play-btn { transform: translate(-50%, -50%) scale(1.08); background: var(--accent); }

.card iframe {
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 0;
  display: block;
}

.card-body { padding: 16px 18px 20px; display: flex; flex-direction: column; }

.badge {
  align-self: flex-start;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--accent-2);
  background: rgba(255, 0, 51, 0.1);
  border: 1px solid rgba(255, 0, 51, 0.25);
  border-radius: 999px;
  padding: 3px 10px;
  margin-bottom: 10px;
}
.card-title {
  margin: 0 0 8px;
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.06rem;
  font-weight: 600;
  line-height: 1.35;
}
.card-desc {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  white-space: pre-wrap;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-desc.expanded { -webkit-line-clamp: unset; line-clamp: unset; overflow: visible; }
.more-btn {
  margin-top: 10px;
  align-self: flex-start;
  background: none;
  border: none;
  color: var(--portfolio-2);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  transition: color 0.18s var(--ease);
}
.more-btn:hover { color: #fff; }

/* ---------- Skeleton loaders ---------- */
.skeleton {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.sk-thumb { aspect-ratio: 16 / 9; }
.sk-line { height: 12px; border-radius: 6px; margin: 14px 18px 0; }
.sk-line.short { width: 55%; }
.sk-thumb, .sk-line {
  background: linear-gradient(100deg, #15171e 30%, #20242e 50%, #15171e 70%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
}
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- Footer ---------- */
.site-footer {
  text-align: center;
  color: var(--muted-2);
  font-size: 0.85rem;
  padding: 36px 20px 56px;
  border-top: 1px solid var(--line);
  margin-top: 20px;
}
.site-footer p { margin: 4px 0; }

.empty, .error { text-align: center; color: var(--muted); padding: 50px 0; }
.error { color: #ff8a8a; }

/* ---------- Focus a11y ---------- */
a:focus-visible, button:focus-visible, .thumb:focus-visible {
  outline: 2px solid var(--portfolio-2);
  outline-offset: 3px;
  border-radius: 8px;
}

/* ---------- Responsive ---------- */
@media (max-width: 600px) {
  .grid { grid-template-columns: 1fr; gap: 18px; }
  .hero { min-height: 70vh; }
  .nav-brand span { display: none; }
  /* Wrap the tagline instead of clipping it with an ellipsis on small screens. */
  .site-tagline { white-space: normal; overflow: visible; text-overflow: clip; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .card { opacity: 1; transform: none; }
}
