@font-face {
  font-family: Inter;
  src: url("./assets/inter.woff2") format("woff2");
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
}

@font-face {
  font-family: "Space Grotesk";
  src: url("./assets/space-grotesk.woff2") format("woff2");
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --background: #101711;
  --surface: #172019;
  --surface-deep: #0b130c;
  --line: #2b382c;
  --text: #f5f8ee;
  --muted: #adb8a9;
  --accent: #c0f76b;
  --accent-hover: #d7ffa1;
  --heading: "Space Grotesk", Inter, system-ui, sans-serif;
  font-family: Inter, system-ui, sans-serif;
  line-height: 1.5;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--background); color: var(--text); }
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 5px; }
::selection { background: var(--accent); color: #102106; }

.shell { width: min(1184px, calc(100% - 96px)); margin-inline: auto; }
.visually-hidden, .skip-link:not(:focus) {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.skip-link:focus { position: fixed; z-index: 5; inset: .5rem auto auto .5rem; padding: .65rem 1rem; background: #14220e; }

.site-header {
  position: relative;
  z-index: 1;
  background: #0e160f;
  border-bottom: 1px solid #29372a;
}
.header-inner { display: flex; align-items: center; justify-content: space-between; min-height: 68px; }
.brand {
  display: inline-flex;
  align-items: center;
  gap: .7rem;
  width: fit-content;
  font: 700 1.4rem/1 var(--heading);
  letter-spacing: -.045em;
}
.brand-mark {
  display: inline-block;
  width: 1.75rem;
  height: 1.75rem;
  position: relative;
  flex: none;
  background: #6da940;
  clip-path: polygon(50% 1%, 96% 25%, 96% 75%, 50% 99%, 4% 75%, 4% 25%);
}
.brand-mark::before, .brand-mark::after, .brand-mark i { content: ""; position: absolute; inset: 0; }
.brand-mark::before { background: #c2f77d; clip-path: polygon(50% 0, 100% 25%, 50% 53%, 0 25%); }
.brand-mark::after { background: #497a2e; clip-path: polygon(50% 53%, 100% 25%, 100% 100%, 50% 100%); }
.brand-mark i { z-index: 1; background: #a3d85f; clip-path: polygon(4% 35%, 19% 43%, 19% 56%, 12% 52%, 12% 47%, 4% 43%, 4% 35%, 28% 60%, 41% 67%, 41% 78%, 28% 70%, 28% 60%); }
.site-header nav { display: flex; align-items: center; gap: 1.75rem; }
.nav-ranking, .channel-link { font-weight: 600; font-size: .875rem; white-space: nowrap; }
.nav-ranking { color: var(--accent); }
.nav-ranking:hover, .footer-link:hover { color: var(--accent-hover); text-decoration: underline; text-underline-offset: .22em; }
.channel-link {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  padding: .5rem .85rem;
  border: 1px solid #455545;
  border-radius: .4rem;
  transition: border-color 150ms, background-color 150ms;
}
.channel-suffix { margin-left: -.2rem; }
.channel-link:hover { background: #263527; border-color: #6e846c; }
.youtube-icon { display: inline-block; position: relative; width: 1rem; height: .72rem; border: 1.4px solid currentColor; border-radius: .23rem; flex: none; }
.youtube-icon::after, .play-icon::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 53%;
  transform: translate(-50%, -50%);
  border: .17rem solid transparent;
  border-right: 0;
  border-left: .26rem solid currentColor;
}

.hero {
  position: relative;
  isolation: isolate;
  min-height: clamp(490px, 44vw, 610px);
  display: grid;
  align-items: center;
  background: #0d200e url("./assets/hero.jpg") center center / cover no-repeat;
  border-bottom: 1px solid #2c3d2b;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(90deg, rgba(6, 16, 8, .94) 0%, rgba(6, 16, 8, .78) 24%, rgba(6, 16, 8, .34) 51%, transparent 73%), linear-gradient(0deg, #101711 0%, transparent 36%);
}
.hero-inner { padding-block: 4rem 5.1rem; }
.hero h1 {
  margin: 0;
  font: 700 clamp(4rem, 7.3vw, 7.25rem)/.92 var(--heading);
  letter-spacing: -.09em;
  text-wrap: nowrap;
}
.hero h1 span { color: var(--accent); }
.hero p {
  max-width: 27rem;
  margin: 1.6rem 0 1.75rem;
  color: #d7dfd1;
  font-size: clamp(1rem, 1.45vw, 1.15rem);
  line-height: 1.55;
  text-wrap: pretty;
}
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .65rem;
  width: fit-content;
  padding: .78rem 1.12rem;
  border: 1px solid transparent;
  border-radius: .4rem;
  font-size: .95rem;
  font-weight: 700;
  line-height: 1.45;
  transition: background-color 150ms, border-color 150ms;
}
.button-primary { background: var(--accent); color: #182411; box-shadow: 0 3px 0 #608237; }
.button-primary:hover { background: var(--accent-hover); }

.ranking { padding-block: 3.5rem 4.4rem; }
.section-header { display: flex; align-items: end; justify-content: space-between; gap: 1.3rem; margin-bottom: 1.8rem; }
.section-header h2 { margin: 0; scroll-margin-top: 1.5rem; font: 700 clamp(2.2rem, 4vw, 3.25rem)/1.06 var(--heading); letter-spacing: -.065em; }
.section-description { margin: .42rem 0 0; color: var(--muted); font-size: .9375rem; }
.search { position: relative; margin: 0; width: min(100%, 19.5rem); }
.search input {
  appearance: none;
  width: 100%;
  min-height: 46px;
  padding: .68rem .85rem .68rem 2.65rem;
  color: var(--text);
  background: #171f17;
  border: 1px solid #3b4a3b;
  border-radius: .45rem;
  font: inherit;
  font-size: 1rem;
}
.search input::placeholder { color: #a9b5a8; opacity: 1; }
.search input:focus { border-color: var(--accent); }
.search-icon { position: absolute; left: 1rem; top: 50%; width: .83rem; height: .83rem; translate: 0 -60%; border: 1.7px solid #a9b5a8; border-radius: 50%; pointer-events: none; }
.search-icon::after { position: absolute; content: ""; left: .58rem; top: .66rem; width: .38rem; height: 1.7px; border-radius: 1px; transform: rotate(45deg); background: #a9b5a8; }
.search-status { margin: -.55rem 0 1.1rem; color: var(--muted); font-size: .9rem; }
.empty-state { padding: 1.35rem; background: var(--surface); border: 1px solid var(--line); border-radius: .65rem; }

.videos {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.4rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.video { display: flex; min-width: 0; }
.video-link {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: .72rem;
  overflow: hidden;
  background: var(--surface);
  transition: border-color 150ms, background-color 150ms;
}
.video-link:hover { border-color: #8cad6b; background: #1e2b20; }
.thumbnail {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #2d422c;
}
.thumbnail img { width: 100%; height: 100%; position: absolute; inset: 0; object-fit: cover; transition: scale 220ms ease-out; }
.video-link:hover img { scale: 1.035; }
.rank-badge, .duration { position: absolute; display: grid; place-items: center; font-variant-numeric: tabular-nums; }
.rank-badge {
  top: .72rem;
  left: .72rem;
  min-width: 3rem;
  min-height: 1.82rem;
  padding-inline: .4rem;
  border: 1px solid #9ac46e;
  border-radius: .3rem;
  background: #101b10;
  color: #d4f8b4;
  font: 700 .875rem/1 var(--heading);
}
.duration {
  bottom: .6rem;
  right: .6rem;
  padding: .18rem .38rem;
  background: rgba(11, 16, 11, .94);
  color: #fbfff9;
  border-radius: .25rem;
  font-size: .8125rem;
  font-weight: 600;
}
.video-content { display: flex; flex: 1; flex-direction: column; align-items: start; justify-content: space-between; gap: .65rem; padding: 1rem 1.05rem 1.1rem; }
.video-title { margin: 0; color: var(--text); font: 700 1.13rem/1.3 var(--heading); letter-spacing: -.015em; overflow-wrap: anywhere; }
.video-views { margin: 0; color: var(--muted); font-size: .875rem; font-variant-numeric: tabular-nums; }
.video-views time { white-space: nowrap; }
.metadata-dot { padding-inline: .27rem; }

.video.featured { grid-column: 1 / -1; margin-bottom: .4rem; }
.featured .video-link { display: grid; grid-template-columns: 1.43fr 1fr; background: #18261a; border-color: #3c5238; }
.featured .video-link:hover { background: #233522; border-color: #9dc973; }
.featured .thumbnail { aspect-ratio: 16 / 9; min-height: 100%; background: #090e0a; }
.featured .thumbnail img { object-fit: contain; }
.featured .rank-badge { min-height: 2.15rem; min-width: 3.55rem; left: .95rem; top: .95rem; background: var(--accent); border-color: var(--accent); color: #182411; font-size: 1rem; }
.featured .video-content { justify-content: center; gap: .8rem; padding: clamp(1.7rem, 3.5vw, 3.25rem); }
.featured .video-title { max-width: 19ch; font-size: clamp(1.5rem, 3vw, 2.55rem); line-height: 1.08; letter-spacing: -.062em; text-wrap: pretty; }
.featured .video-views { margin-bottom: .42rem; font-size: .9375rem; }
.watch-label { color: var(--accent); padding: .62rem .85rem; background: #263c24; border-color: #4b6543; }
.featured .video-link:hover .watch-label { background: #334d2c; }
.play-icon { position: relative; display: inline-block; width: .68rem; height: .78rem; }
.play-icon::after { border-width: .28rem 0 .28rem .43rem; }

.site-footer { border-top: 1px solid var(--line); background: var(--surface-deep); }
.footer-inner { display: flex; align-items: start; justify-content: space-between; gap: 1.25rem; min-height: 8rem; padding-block: 1.8rem 2rem; }
.footer-inner p { margin: .65rem 0 0; color: var(--muted); font-size: .875rem; }
.footer-inner p a { text-decoration: underline; text-underline-offset: .2em; }
.footer-link { white-space: nowrap; color: var(--accent); font-size: .875rem; font-weight: 600; padding-block: .18rem; }

@media (max-width: 900px) {
  .shell { width: calc(100% - 64px); }
  .videos { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.15rem; }
  .hero { min-height: 500px; background-position: 61% center; }
  .featured .video-link { grid-template-columns: 1.2fr 1fr; }
  .featured .video-title { font-size: clamp(1.5rem, 3.2vw, 2.55rem); }
}

@media (max-width: 600px) {
  .shell { width: calc(100% - 36px); }
  .header-inner { min-height: 62px; }
  .site-header nav { gap: .85rem; }
  .channel-link { padding: .42rem .6rem; }
  .channel-suffix { display: none; }
  .brand { gap: .45rem; font-size: 1.25rem; }
  .brand-mark { width: 1.5rem; height: 1.5rem; }
  .hero { min-height: 535px; align-items: end; background-size: auto 110%; background-position: 77% top; }
  .hero::before { background: linear-gradient(0deg, #101711 2%, rgba(8, 18, 9, .93) 29%, rgba(8, 18, 9, .52) 63%, transparent 91%); }
  .hero-inner { padding-block: 9rem 3.15rem; }
  .hero h1 { font-size: clamp(3.45rem, 11.8vw, 5.1rem); }
  .hero p { margin-block: 1.15rem 1.35rem; }
  .ranking { padding-block: 2.35rem 3rem; }
  .section-header { align-items: stretch; flex-direction: column; gap: 1rem; margin-bottom: 1.2rem; }
  .search { width: 100%; }
  .videos { grid-template-columns: 1fr; }
  .video.featured { margin-bottom: 0; }
  .featured .video-link { grid-template-columns: minmax(0, 1fr); }
  .featured .video-content { padding: 1.2rem 1.05rem 1.35rem; }
  .featured .video-title { max-width: none; }
  .footer-inner { flex-wrap: wrap; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}
