/* ---------- Fonts ---------- */
@font-face {
  font-family: 'Press Start 2P';
  src: url('fonts/PressStart2P-Regular.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

/* ---------- Tokens (shared with dev.parl.tv) ---------- */
:root {
  --bg: #ffffff;
  --ink: #1b1b2f;
  --muted: #6b6b80;
  --line: #e7e7ef;
  --card: #ffffff;
  --accent: #6c4cff;
  --shadow: 0 1px 2px rgba(27, 27, 47, .06), 0 8px 24px rgba(27, 27, 47, .08);
  --radius: 18px;
  --font-pixel: 'Press Start 2P', ui-monospace, monospace;
  --font-body: 'Nunito', 'Segoe UI', system-ui, -apple-system, sans-serif;
}

/* script.js puts data-theme on <body>. The first selector restyles the body,
   the second sets the same colors on <html> so overscroll never flashes white. */
[data-theme="dark"],
:root:has(body[data-theme="dark"]) {
  --bg: #0e0f1d;
  --ink: #f1f1fa;
  --muted: #9b9bb3;
  --line: #26283f;
  --card: #171930;
  --accent: #9a85ff;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .35);
  color-scheme: dark;
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }

html {
  background: var(--bg);
  scroll-padding-top: 80px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  line-height: 1.5;
  overflow-x: hidden;
  transition: background .25s, color .25s;
}

a { color: inherit; }

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
  border-radius: 8px;
}

/* ---------- Header ---------- */
/* Fixed, hidden by default; script.js adds .visible near the top of the page
   or when the cursor reaches the top edge. */
#site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  transform: translateY(-100%);
  transition: transform .25s ease, background .25s;
}
#site-header.visible { transform: translateY(0); }

.header-inner {
  display: flex;
  align-items: center;
  gap: 20px;
  max-width: 1100px;
  margin: 0 auto;
  padding: 22px 24px;
}

.logo {
  font-family: var(--font-pixel);
  font-size: 1.15rem;
  text-decoration: none;
  letter-spacing: .5px;
}

.header-nav {
  display: flex;
  gap: 22px;
  margin-left: auto;
}
.header-nav a {
  font-weight: 700;
  text-decoration: none;
  color: var(--muted);
}
.header-nav a:hover { color: var(--accent); }

.theme-toggle {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 2px solid var(--line);
  border-radius: 50%;
  background: var(--card);
  color: var(--ink);
  cursor: pointer;
  transition: transform .15s, border-color .15s;
}
.theme-toggle:hover {
  transform: rotate(-12deg) scale(1.05);
  border-color: var(--accent);
}

/* ---------- Hero ---------- */
main { padding-top: 88px; } /* room for the fixed header */

.hero {
  max-width: 760px;
  margin: 0 auto;
  padding: 56px 24px 24px;
  text-align: center;
}
.hero h1 {
  margin: 0 0 14px;
  font-size: clamp(2rem, 5vw, 3.2rem);
  line-height: 1.12;
  font-weight: 800;
}
.hero p {
  margin: 0 auto;
  max-width: 46ch;
  font-size: 1.1rem;
  color: var(--muted);
}

/* ---------- Section headings ---------- */
.section-title {
  max-width: 1100px;
  margin: 48px auto 10px;
  padding: 0 24px;
  font-size: 1.3rem;
  font-weight: 800;
}

/* ---------- Scrolling rows ---------- */
/* Extra padding top/bottom so the hover lift and shadow aren't clipped. */
.marquee-wrap {
  overflow: hidden;
  padding: 12px 0 30px;
  -webkit-mask-image: linear-gradient(90deg, transparent, black 5%, black 95%, transparent);
  mask-image: linear-gradient(90deg, transparent, black 5%, black 95%, transparent);
}
.marquee-track {
  display: flex;
  gap: 16px;
  width: max-content;
  will-change: transform;
}

/* ---------- Video cards ---------- */
/* The card itself never moves, so the hover area never shifts away from the
   cursor. The visible box (::before) and the content lift together instead. */
.card {
  position: relative;
  display: flex;
  flex-direction: column;
  flex: 0 0 auto;
  padding: 2px; /* stands in for the border, which now lives on ::before */
  text-decoration: none;
  color: var(--ink);
}

/* The visible card: background, border, rounded corners, shadow */
.card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--card);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  transition: transform .18s, box-shadow .18s, border-color .18s;
}

/* Thumbnail and title sit on top of the box */
.card > * {
  position: relative;
  transition: transform .18s;
}

.card:hover::before {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
  border-color: var(--accent);
}
.card:hover > * {
  transform: translateY(-4px);
}

.card.short { width: 160px; }
.card.short .thumb-wrap { aspect-ratio: 9 / 16; }

.card.video { width: 260px; }
.card.video .thumb-wrap { aspect-ratio: 16 / 9; }

.thumb-wrap {
  background: #000;
  overflow: hidden;
  border-radius: calc(var(--radius) - 2px) calc(var(--radius) - 2px) 0 0;
}
.thumb-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.card-title {
  margin: 12px 14px 14px;
  font-size: .85rem;
  font-weight: 700;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ---------- Footer ---------- */
.site-footer {
  padding: 28px 24px 48px;
  text-align: center;
  color: var(--muted);
}
.site-footer p { margin: 0 0 6px; }
.site-footer a { text-underline-offset: 3px; }
.site-footer a:hover { color: var(--accent); }

/* ---------- Small screens ---------- */
@media (max-width: 480px) {
  .hero { padding-top: 36px; }
  .header-inner { padding: 16px 18px; gap: 14px; }
  .header-nav { gap: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
