@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

:root {
  color-scheme: dark;
  --bg: #08090d;
  --bg-elevated: #101219;
  --panel: #151821;
  --panel-strong: #1d2230;
  --text: #f7f1e8;
  --muted: #a8adbb;
  --line: #303747;
  --primary: #ff3d2e;
  --primary-deep: #bf1f17;
  --amber: #ffd166;
  --cyan: #4cc9f0;
  --green: #76e0a3;
  --shadow: 0 26px 80px rgb(0 0 0 / 0.42);
  --radius: 18px;
  font-family: Manrope, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background:
    linear-gradient(135deg, rgb(255 61 46 / 0.12), transparent 26rem),
    radial-gradient(circle at 82% 10%, rgb(76 201 240 / 0.16), transparent 30rem),
    repeating-linear-gradient(90deg, rgb(255 255 255 / 0.025) 0 1px, transparent 1px 74px),
    var(--bg);
  color: var(--text);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background-image: linear-gradient(rgb(255 255 255 / 0.035) 1px, transparent 1px);
  background-size: 100% 6px;
  mask-image: linear-gradient(to bottom, black, transparent 70%);
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.page-glow {
  position: fixed;
  inset: auto -12vw -24vw auto;
  z-index: -1;
  width: 44vw;
  height: 44vw;
  border-radius: 50%;
  background: rgb(255 209 102 / 0.10);
  filter: blur(52px);
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid rgb(255 255 255 / 0.08);
  background: rgb(8 9 13 / 0.82);
  backdrop-filter: blur(20px);
}

.nav,
main {
  width: min(1240px, calc(100% - 36px));
  margin: 0 auto;
}

.nav {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.brand,
.nav-actions {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.brand {
  color: var(--text);
  text-decoration: none;
}

.brand-mark {
  width: 58px;
  height: 46px;
  display: grid;
  place-items: center;
  overflow: visible;
}

.brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 10px 20px rgb(0 0 0 / 0.38));
}

.brand-text {
  font-family: "Archivo Black", Impact, sans-serif;
  font-size: 1.02rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.nav-link {
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 800;
  text-decoration: none;
}

.hero {
  padding: 40px 0 40px;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(330px, 0.65fr);
  align-items: center;
  gap: 34px;
}

.hero-copy,
.latest-video-card,
.featured-strip,
.toolbar,
.video-card {
  animation: rise-in 520ms ease both;
}

.eyebrow,
.panel-kicker,
.results-label {
  margin: 0;
  color: var(--amber);
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 880px;
  margin-bottom: 0px;
  font-family: "Archivo Black", Impact, sans-serif;
  font-size: clamp(3.2rem, 8.4vw, 8.2rem);
  line-height: 0.86;
  letter-spacing: 0;
  text-transform: uppercase;
}

.curator {
  max-width: 780px;
  margin: 0 0 8px auto;
  color: var(--amber);
  font-size: clamp(0.95rem, 1.8vw, 1.28rem);
  font-weight: 900;
  letter-spacing: 0.04em;
  text-align: right;
}

.intro {
  max-width: 660px;
  color: var(--muted);
  font-size: clamp(1.65rem, 3.2vw, 3rem);
  font-weight: 900;
  line-height: 1.08;
}

.search-box span {
  display: block;
  margin: 0 0 8px 6px;
  color: var(--muted);
  font-size: 0.83rem;
  font-weight: 800;
}

input {
  width: 100%;
  min-height: 54px;
  border: 1px solid rgb(255 255 255 / 0.10);
  border-radius: 16px;
  padding: 0 16px;
  background: rgb(4 5 8 / 0.72);
  color: var(--text);
  outline: none;
}

input::placeholder {
  color: #6f7686;
}

input:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 4px rgb(76 201 240 / 0.16);
}

.primary-button,
.secondary-button,
.ghost-button {
  min-height: 46px;
  border: 0;
  border-radius: 999px;
  padding: 0 22px;
  color: var(--text);
  font-weight: 900;
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    background 180ms ease;
}

.primary-button {
  min-width: 118px;
  background: var(--primary);
  color: #120807;
  box-shadow: 0 18px 44px rgb(255 61 46 / 0.26);
}

.secondary-button,
.ghost-button {
  border: 1px solid rgb(255 255 255 / 0.13);
  background: rgb(255 255 255 / 0.055);
}

.primary-button:hover,
.secondary-button:hover,
.ghost-button:hover {
  transform: translateY(-2px);
}

.play-badge {
  position: absolute;
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
  width: 44px;
  height: 44px;
  border: 1px solid rgb(255 255 255 / 0.12);
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgb(8 9 13 / 0.72);
  backdrop-filter: blur(12px);
  color: var(--text);
  transition: all 200ms ease;
}

.thumbnail-button:hover .play-badge,
.thumbnail-button:focus-visible .play-badge {
  background: var(--amber);
  border-color: var(--amber);
  color: #120807;
  transform: translate(-50%, -50%) scale(1.1);
}

#backToTopButton {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 900;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: rgb(255 255 255 / 0.15);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgb(255 255 255 / 0.25);
  color: #fff;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  place-items: center;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#backToTopButton:hover,
#backToTopButton:focus-visible {
  background: var(--primary);
  border-color: var(--primary);
  transform: scale(1.1);
}

.latest-video-card {
  width: 100%;
  overflow: hidden;
  border: 1px solid rgb(255 255 255 / 0.12);
  border-radius: 30px;
  padding: 0;
  color: inherit;
  text-align: left;
  background:
    linear-gradient(180deg, rgb(255 255 255 / 0.12), rgb(255 255 255 / 0.035)),
    #11141d;
  box-shadow: var(--shadow);
}

.latest-video-card:hover {
  transform: translateY(-4px);
}

.latest-video-card:disabled {
  cursor: default;
  opacity: 1;
}

.latest-video-card:disabled:hover {
  transform: none;
}

.latest-video-card:focus-visible {
  outline: 3px solid rgb(255 209 102 / 0.70);
  outline-offset: 4px;
}

.latest-video-frame {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background-position: center;
  background-size: cover;
  background:
    linear-gradient(135deg, rgb(255 61 46 / 0.88), rgb(255 209 102 / 0.58)),
    repeating-linear-gradient(45deg, rgb(255 255 255 / 0.16) 0 2px, transparent 2px 16px),
    #151821;
}

.latest-video-frame::after {
  content: "Placeholder video";
  position: absolute;
  left: 18px;
  bottom: 18px;
  color: rgb(8 9 13 / 0.78);
  font-size: 0.82rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.latest-play {
  position: absolute;
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
  width: 70px;
  height: 70px;
  border: 1px solid rgb(8 9 13 / 0.28);
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgb(8 9 13 / 0.84);
  color: var(--amber);
  box-shadow: 0 20px 54px rgb(0 0 0 / 0.36);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.latest-video-card:not(:disabled):hover .latest-play,
.latest-video-card:not(:disabled):focus-visible .latest-play {
  background: var(--amber);
  border-color: var(--amber);
  color: #120807;
  transform: translate(-50%, -50%) scale(1.1);
}

.latest-video-copy {
  padding: 24px;
}

.latest-video-copy h2 {
  margin: 10px 0 10px;
  font-size: 1.55rem;
  line-height: 1.08;
}

.latest-video-copy p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.6;
}

.stat span,
.muted,
.video-date,
.video-description {
  color: var(--muted);
}

.featured-strip {
  margin: 10px 0 30px;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
}

.section-heading h2 {
  margin: 0;
  font-size: clamp(1.8rem, 4vw, 3.2rem);
  line-height: 1;
}

.featured-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.featured-card {
  overflow: hidden;
  border: 1px solid rgb(255 255 255 / 0.10);
  border-radius: 22px;
  padding: 0;
  color: var(--text);
  text-align: left;
  background: linear-gradient(180deg, var(--panel), #0e1017);
  box-shadow: 0 14px 36px rgb(0 0 0 / 0.24);
  transition:
    transform 180ms ease,
    border-color 180ms ease;
}

.featured-card:hover {
  border-color: rgb(255 209 102 / 0.45);
  transform: translateY(-4px);
}

.featured-card:focus-visible {
  outline: 3px solid rgb(255 209 102 / 0.70);
  outline-offset: 4px;
}

.featured-thumb {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #05060a;
}

.featured-thumb img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.featured-copy {
  display: grid;
  gap: 8px;
  padding: 14px;
}

.featured-copy strong {
  display: -webkit-box;
  overflow: hidden;
  min-height: 2.75em;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  font-size: 0.96rem;
  line-height: 1.36;
}

.rating-summary {
  color: var(--amber);
  font-size: 0.86rem;
  font-weight: 900;
}

.video-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
}

.rating-control {
  display: grid;
  gap: 4px;
}

.stars {
  display: inline-flex;
  gap: 2px;
}

.star-button {
  width: 26px;
  height: 26px;
  border: 0;
  border-radius: 50%;
  padding: 0;
  background: transparent;
  color: #5f6572;
  font-size: 1.05rem;
  line-height: 1;
}

.star-button.is-selected,
.star-button:hover {
  color: var(--amber);
}

.share-menu {
  position: relative;
}

.share-menu summary,
.native-share-button {
  min-height: 34px;
  border: 1px solid rgb(255 255 255 / 0.13);
  border-radius: 999px;
  padding: 7px 13px;
  display: inline-flex;
  align-items: center;
  color: var(--text);
  font-size: 0.86rem;
  font-weight: 900;
  list-style: none;
  background: rgb(255 255 255 / 0.055);
  cursor: pointer;
}

.share-menu summary::-webkit-details-marker {
  display: none;
}

.share-options {
  position: absolute;
  right: 0;
  bottom: calc(100% + 8px);
  z-index: 12;
  min-width: 190px;
  border: 1px solid rgb(255 255 255 / 0.12);
  border-radius: 16px;
  padding: 8px;
  display: grid;
  gap: 4px;
  background: #11141d;
  box-shadow: var(--shadow);
}

.share-options a,
.share-options button {
  border: 0;
  border-radius: 10px;
  padding: 9px 10px;
  color: var(--text);
  text-align: left;
  text-decoration: none;
  background: transparent;
}

.share-options a:hover,
.share-options button:hover {
  background: rgb(255 255 255 / 0.08);
}

.toolbar {
  position: sticky;
  top: 76px;
  z-index: 8;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 26px;
  border: 1px solid rgb(255 255 255 / 0.10);
  border-radius: 24px;
  padding: 16px;
  background: rgb(10 12 18 / 0.78);
  backdrop-filter: blur(18px);
}

.search-box {
  width: min(390px, 100%);
}

.toolbar-actions {
  display: flex;
  align-items: end;
  gap: 12px;
}

.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 22px;
  padding-bottom: 38px;
}

.video-card {
  overflow: hidden;
  border: 1px solid rgb(255 255 255 / 0.10);
  border-radius: 24px;
  background: linear-gradient(180deg, var(--panel), #0f1118);
  box-shadow: 0 18px 46px rgb(0 0 0 / 0.28);
  transition:
    transform 180ms ease,
    border-color 180ms ease;
}

.video-card:hover {
  border-color: rgb(255 209 102 / 0.45);
  transform: translateY(-5px);
}

.thumbnail-button {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 0;
  padding: 0;
  display: block;
  overflow: hidden;
  background: #05060a;
}

.thumbnail-button img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  transition: transform 260ms ease;
}

.video-card:hover .thumbnail-button img {
  transform: scale(1.05);
}

.play-badge {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 54px;
  height: 54px;
  background: rgb(255 255 255 / 0.15);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgb(255 255 255 / 0.25);
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
}

.video-body {
  padding: 18px;
}

.video-body h3 {
  min-height: 3.05em;
  margin-bottom: 10px;
  font-size: 1.04rem;
  line-height: 1.38;
}

.video-description {
  display: -webkit-box;
  overflow: hidden;
  margin-bottom: 0;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-height: 1.58;
}

.load-more-wrap {
  display: grid;
  place-items: center;
  padding: 2px 0 64px;
}

.video-dialog {
  width: min(1040px, calc(100% - 28px));
  border: 1px solid rgb(255 255 255 / 0.12);
  border-radius: 26px;
  padding: 0;
  background: #090a0f;
  color: var(--text);
  box-shadow: var(--shadow);
}

.video-dialog::backdrop {
  background: rgb(0 0 0 / 0.78);
  backdrop-filter: blur(6px);
}

.dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px;
}

.dialog-tools {
  padding: 16px 18px 18px;
}

.dialog-head h2 {
  margin: 0;
  font-size: 1rem;
}

.icon-button {
  width: 42px;
  height: 42px;
  border: 1px solid rgb(255 255 255 / 0.12);
  border-radius: 50%;
  background: rgb(255 255 255 / 0.08);
  color: var(--text);
  font-size: 1.45rem;
}

.player-frame {
  aspect-ratio: 16 / 9;
  background: #020308;
}

.player-frame iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

.popup-placeholder {
  min-height: 100%;
  display: grid;
  place-items: center;
  gap: 16px;
  padding: 28px;
  text-align: center;
  background:
    linear-gradient(135deg, rgb(255 61 46 / 0.24), rgb(255 209 102 / 0.12)),
    #05060a;
}

.popup-placeholder .latest-play {
  position: static;
  transform: none;
}

.popup-placeholder p {
  max-width: 420px;
  margin: 0;
  color: var(--muted);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}

@media (max-width: 820px) {
  .nav,
  main {
    width: min(100% - 24px, 1240px);
  }

  .nav {
    min-height: 68px;
  }

  .nav-link {
    display: none;
  }

  .hero {
    min-height: auto;
    grid-template-columns: 1fr;
    padding: 42px 0 34px;
  }

  h1 {
    font-size: 3.25rem;
  }

  .curator {
    margin-left: 0;
    text-align: left;
  }

  .toolbar,
  .toolbar-actions,
  .featured-grid {
    display: grid;
    grid-template-columns: 1fr;
  }

  .toolbar {
    position: static;
  }

}

@media (max-width: 430px) {
  .brand-text {
    font-size: 0.86rem;
  }

  h1 {
    font-size: 2.7rem;
  }

  .latest-video-card,
  .toolbar {
    border-radius: 20px;
  }
}

/* Light Theme Overrides */
:root.light-theme {
  color-scheme: light;
  --bg: #f8fafc;
  --bg-elevated: #ffffff;
  --panel: #ffffff;
  --panel-strong: #f1f5f9;
  --text: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --primary: #ef4444;
  --primary-deep: #b91c1c;
  --amber: #d97706;
  --cyan: #0284c7;
  --green: #059669;
  --shadow: 0 16px 40px rgb(0 0 0 / 0.08);
}

:root.light-theme body {
  background:
    linear-gradient(135deg, rgb(239 68 68 / 0.08), transparent 26rem),
    radial-gradient(circle at 82% 10%, rgb(2 132 199 / 0.1), transparent 30rem),
    repeating-linear-gradient(90deg, rgb(0 0 0 / 0.03) 0 1px, transparent 1px 74px),
    var(--bg);
}

:root.light-theme body::before {
  background-image: linear-gradient(rgb(0 0 0 / 0.04) 1px, transparent 1px);
}

:root.light-theme .app-header {
  border-bottom: 1px solid rgb(0 0 0 / 0.08);
  background: rgb(248 250 252 / 0.82);
}

:root.light-theme input {
  border: 1px solid rgb(0 0 0 / 0.1);
  background: rgb(255 255 255 / 0.8);
  color: var(--text);
}

:root.light-theme .secondary-button,
:root.light-theme .ghost-button,
:root.light-theme .icon-button {
  border: 1px solid rgb(0 0 0 / 0.15);
  background: rgb(0 0 0 / 0.03);
  color: var(--text);
}

:root.light-theme .latest-video-card {
  border: 1px solid rgb(0 0 0 / 0.1);
  background: linear-gradient(180deg, rgb(255 255 255 / 0.8), rgb(255 255 255 / 0.4)), #ffffff;
}

:root.light-theme .latest-play {
  border: 1px solid rgb(255 255 255 / 0.6);
  background: rgb(255 255 255 / 0.9);
}

:root.light-theme .featured-card,
:root.light-theme .video-card {
  border: 1px solid rgb(0 0 0 / 0.08);
  background: linear-gradient(180deg, var(--panel), #f8fafc);
}

:root.light-theme .featured-thumb,
:root.light-theme .thumbnail-button {
  background: #f1f5f9;
}

:root.light-theme .share-menu summary,
:root.light-theme .native-share-button {
  border: 1px solid rgb(0 0 0 / 0.12);
  background: rgb(0 0 0 / 0.04);
}

:root.light-theme .share-options {
  border: 1px solid rgb(0 0 0 / 0.08);
  background: #ffffff;
}

:root.light-theme .share-options a:hover,
:root.light-theme .share-options button:hover {
  background: rgb(0 0 0 / 0.05);
}

:root.light-theme .toolbar {
  border: 1px solid rgb(0 0 0 / 0.08);
  background: rgb(255 255 255 / 0.78);
}

:root.light-theme .video-dialog {
  border: 1px solid rgb(0 0 0 / 0.1);
  background: #ffffff;
}

:root.light-theme .video-dialog::backdrop {
  background: rgb(255 255 255 / 0.6);
}

:root.light-theme .player-frame {
  background: #f1f5f9;
}

:root.light-theme #backToTopButton {
  background: rgb(0 0 0 / 0.12);
  border-color: rgb(0 0 0 / 0.2);
  color: #120807;
}

:root.light-theme #backToTopButton:hover,
:root.light-theme #backToTopButton:focus-visible {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

:root.light-theme .popup-placeholder {
  background:
    linear-gradient(135deg, rgb(239 68 68 / 0.1), rgb(217 119 6 / 0.08)),
    #f8fafc;
}

:root.light-theme .latest-video-frame::after {
  color: rgb(255 255 255 / 0.9);
}
