:root {
  --bg: #fafaf7;
  --surface: #ffffff;
  --text: #1c1c1a;
  --muted: #5f5f5a;
  --border: #e4e4de;
  --accent: #c2410c;
  --accent-text: #ffffff;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121211;
    --surface: #1c1c1a;
    --text: #ededea;
    --muted: #a3a39d;
    --border: #2c2c29;
    --accent: #fb923c;
    --accent-text: #121211;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

a { color: var(--accent); }

.wrap {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 16px;
}

.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}
.logo {
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--text);
  text-decoration: none;
}
nav a {
  margin-left: 20px;
  color: var(--muted);
  text-decoration: none;
}
nav a:hover { color: var(--text); }

.hero { padding: 48px 16px 32px; }
.hero h1 {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  line-height: 1.15;
  margin: 0 0 10px;
}
.lead {
  font-size: 1.1rem;
  color: var(--muted);
  max-width: 60ch;
  margin: 0;
}

.btn {
  display: inline-block;
  padding: 10px 20px;
  border: 1px solid var(--accent);
  border-radius: 8px;
  background: var(--accent);
  color: var(--accent-text);
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}
.btn:hover { opacity: .9; }
.btn-ghost {
  background: transparent;
  color: var(--accent);
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 24px 20px;
  padding-bottom: 64px;
}
.card {
  color: var(--text);
  text-decoration: none;
}
.card h3 {
  margin: 10px 0 0;
  font-size: 1rem;
  line-height: 1.4;
}
.card:hover h3 { color: var(--accent); }
.thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: 10px;
  overflow: hidden;
  background: var(--border);
}
.thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .2s;
}
.card:hover .thumb img { transform: scale(1.04); }
.dur {
  position: absolute;
  right: 8px;
  bottom: 8px;
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(0, 0, 0, .8);
  color: #fff;
  font-size: .8rem;
}

.watch { padding-top: 24px; }
.player {
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: 12px;
  overflow: hidden;
}
.player iframe,
.player video {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}
.watch h1 {
  font-size: clamp(1.4rem, 3vw, 1.9rem);
  line-height: 1.25;
  margin: 18px 0 8px;
}
.desc {
  color: var(--muted);
  max-width: 75ch;
  margin: 0 0 18px;
}
.share {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.upnext h2 { margin: 48px 0 16px; }

.prose { max-width: 720px; padding-top: 40px; padding-bottom: 72px; }
.prose h2 { margin-top: 36px; }

.notfound { text-align: center; padding-top: 120px; padding-bottom: 120px; }
.notfound h1 { font-size: 5rem; margin: 0; }

.site-footer {
  border-top: 1px solid var(--border);
  padding: 24px 0;
  color: var(--muted);
  font-size: .9rem;
}
.site-footer .wrap {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

/* Phone: dense 4-column wall so ~16 videos fit on one screen */
@media (max-width: 640px) {
  .hero { padding: 20px 16px 16px; }
  .hero h1 { font-size: 1.35rem; margin-bottom: 4px; }
  .lead { font-size: .9rem; }
  .grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px 8px;
    padding-bottom: 40px;
  }
  .thumb { border-radius: 6px; }
  .card h3 {
    margin-top: 4px;
    font-size: .7rem;
    line-height: 1.25;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    overflow: hidden;
  }
  .dur {
    right: 3px;
    bottom: 3px;
    padding: 0 3px;
    font-size: .6rem;
  }
  .watch { padding-top: 0; }
  .watch .player { margin: 0 -16px; border-radius: 0; }
  .upnext h2 { margin: 28px 0 12px; font-size: 1.1rem; }
}
