/* Horny Wombat — design system. Palette drawn from the wombat mark (amber on soil). */

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

:root {
  --ink: #150f0a;
  --surface: #201710;
  --surface-2: #2c2013;
  --surface-3: #3a2c1c;
  --parchment: #f3e8d8;
  --muted: #b3a189;
  --faint: #7c6f5c;
  --fur: #e8a33d;
  --fur-strong: #ffc266;
  --ember: #ff6b4a;
  --moss: #9bc27c;
  --rust: #d9695f;
  --line: rgba(243, 232, 216, 0.09);
  --shadow: rgba(0, 0, 0, 0.45);

  --font-display: "Space Grotesk", system-ui, sans-serif;
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --radius-s: 6px;
  --radius-m: 10px;
  --radius-l: 16px;
  --gap: 1.25rem;
  --container: 1360px;
}

@media (prefers-color-scheme: light) {
  :root {
    /* Site is intentionally dark-only; keep the same palette regardless of OS theme. */
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  color-scheme: dark;
}

body {
  margin: 0;
  background: var(--ink);
  color: var(--parchment);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

img,
video {
  max-width: 100%;
  display: block;
}

a {
  color: var(--fur-strong);
  text-decoration: none;
}

a:hover {
  color: var(--ember);
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
summary:focus-visible,
.btn:focus-visible {
  outline: 2px solid var(--fur);
  outline-offset: 2px;
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.15;
  margin: 0 0 0.5em;
  color: var(--parchment);
}

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 1.25rem;
}

.section {
  margin: 2.5rem 0;
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.section-head h1,
.section-head h2 {
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.section-head h1 a,
.section-head h2 a {
  color: inherit;
}

.section-head .fa-fire {
  color: var(--ember);
}

.section-head .fa-rss,
.section-head .fa-history {
  color: var(--fur);
}

.title {
  font-family: var(--font-display);
  font-size: 1.75rem;
}

.eyebrow-link {
  color: var(--muted);
  font-size: 0.95rem;
}

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(21, 15, 10, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

.site-header .container {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  height: 64px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-family: var(--font-display);
  color: var(--parchment);
  flex-shrink: 0;
}

.brand-mark {
  width: 40px;
  height: 40px;
  filter: drop-shadow(0 5px 10px rgba(232, 163, 61, 0.18));
  transition: transform 180ms ease, filter 180ms ease;
}

.brand-wordmark {
  display: flex;
  align-items: baseline;
  font-size: 1.22rem;
  font-weight: 600;
  letter-spacing: -0.045em;
  line-height: 1;
  white-space: nowrap;
}

.brand-wordmark strong {
  color: var(--fur-strong);
  font-weight: 700;
}

.brand-wordmark small {
  margin-left: 0.18rem;
  color: var(--ember);
  font-size: 0.56em;
  font-weight: 700;
  letter-spacing: 0;
}

.brand:hover {
  color: var(--parchment);
}

.brand:hover .brand-mark {
  filter: drop-shadow(0 7px 13px rgba(232, 163, 61, 0.3));
  transform: translateY(-1px) rotate(-2deg);
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex: 1;
  min-width: 0;
}

.main-nav > a,
.nav-dropdown > summary {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-s);
  color: var(--parchment);
  font-size: 0.95rem;
  white-space: nowrap;
}

.main-nav > a:hover,
.nav-dropdown > summary:hover {
  background: var(--surface-2);
  color: var(--fur-strong);
  cursor: pointer;
}

.main-nav .fa-fire {
  color: var(--ember);
}

/* Native <details> dropdown: zero JS for menus, works on touch and desktop alike. */
.nav-dropdown {
  position: relative;
}

.nav-dropdown > summary {
  list-style: none;
}

.nav-dropdown > summary::-webkit-details-marker {
  display: none;
}

.nav-dropdown > summary::after {
  content: "";
  border: 4px solid transparent;
  border-top-color: var(--muted);
  margin-top: 4px;
  margin-left: 2px;
}

.nav-dropdown[open] > summary::after {
  border-top-color: transparent;
  border-bottom-color: var(--muted);
  margin-top: -2px;
}

.nav-dropdown-panel {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 220px;
  max-height: 70vh;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  box-shadow: 0 12px 32px var(--shadow);
  padding: 0.4rem;
  z-index: 50;
}

.nav-dropdown-panel a {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.6rem;
  border-radius: var(--radius-s);
  color: var(--parchment);
  font-size: 0.92rem;
}

.nav-dropdown-panel a:hover {
  background: var(--surface-2);
  color: var(--fur-strong);
}

.nav-dropdown-panel hr {
  border: none;
  border-top: 1px solid var(--line);
  margin: 0.4rem 0;
}

/* Click-outside-to-close + closing one another handled by app.js (a few lines, no framework). */

.search-form {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.search-form .field {
  position: relative;
  margin: 0;
}

.search-form input[type="text"] {
  width: 220px;
  padding: 0.5rem 0.75rem 0.5rem 2.1rem;
}

.search-form .field .fa-search {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--faint);
}

.header-burger {
  display: none;
}

@media (max-width: 900px) {
  .main-nav {
    position: fixed;
    top: 64px;
    left: 0;
    right: 0;
    /* .site-header uses backdrop-filter, which (like transform) makes it the
       containing block for fixed descendants, so `bottom: 0` would resolve
       against the header's own ~64px box instead of the viewport. */
    height: calc(100vh - 64px);
    flex-direction: column;
    align-items: stretch;
    background: var(--ink);
    padding: 1rem;
    overflow-y: auto;
    transform: translateX(-100%);
    transition: transform 0.2s ease;
  }

  .main-nav.is-open {
    transform: translateX(0);
  }

  .main-nav > a,
  .nav-dropdown > summary {
    padding: 0.85rem 0.75rem;
    font-size: 1.05rem;
  }

  .nav-dropdown-panel {
    position: static;
    box-shadow: none;
    margin: 0.25rem 0 0.5rem 0.5rem;
  }

  .search-form {
    order: -1;
    flex: 0 0 auto;
    margin-bottom: 0.5rem;
  }

  .search-form .field,
  .search-form input[type="text"] {
    width: 100%;
  }

  .header-burger {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-s);
    background: transparent;
    border: 1px solid var(--line);
    color: var(--parchment);
    font-size: 1.1rem;
    flex-shrink: 0;
  }
}

/* ---------- Buttons & form controls ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border: none;
  border-radius: var(--radius-s);
  padding: 0.55rem 1.1rem;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  background: var(--surface-2);
  color: var(--parchment);
  transition: background 0.15s ease, transform 0.05s ease;
}

.btn:hover {
  background: var(--surface-3);
  color: var(--parchment);
}

.btn:active {
  transform: translateY(1px);
}

.btn--primary {
  background: var(--fur);
  color: var(--ink);
}

.btn--primary:hover {
  background: var(--fur-strong);
  color: var(--ink);
}

.btn--danger {
  background: var(--rust);
  color: var(--ink);
}

.btn--ghost {
  background: transparent;
  border: 1px solid var(--line);
}

.btn--loading {
  opacity: 0.6;
  pointer-events: none;
}

.btn-icon {
  padding: 0.5rem;
  width: 2.4rem;
  height: 2.4rem;
}

label,
.label {
  display: block;
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 0.35rem;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="search"],
textarea,
select {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
  color: var(--parchment);
  padding: 0.6rem 0.75rem;
  font-family: var(--font-body);
  font-size: 0.95rem;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--fur);
}

.field {
  margin-bottom: 1rem;
}

.form-narrow {
  max-width: 420px;
  margin: 0 auto;
}

/* ---------- Tags / breadcrumbs / pagination ---------- */

.tag {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 0.82rem;
}

.tag a {
  color: inherit;
}

.tag:hover {
  background: var(--surface-3);
}

.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  color: var(--faint);
  font-size: 0.9rem;
  margin: 1.25rem 0;
}

.breadcrumbs a {
  color: var(--muted);
}

.breadcrumbs li {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  list-style: none;
}

.breadcrumbs li + li::before {
  content: "/";
  color: var(--faint);
}

.breadcrumbs,
.breadcrumbs ul {
  padding: 0;
  margin-left: 0;
}

.breadcrumbs ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  list-style: none;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  flex-wrap: wrap;
  margin: 2rem 0;
  padding: 0;
  list-style: none;
}

.pagination a,
.pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.25rem;
  height: 2.25rem;
  padding: 0 0.5rem;
  border-radius: var(--radius-s);
  color: var(--muted);
}

.pagination a:hover {
  background: var(--surface-2);
  color: var(--parchment);
}

.pagination .is-current {
  background: var(--fur);
  color: var(--ink);
  font-weight: 700;
}

.pagination ul {
  display: contents;
  list-style: none;
}

/* ---------- Video grid & card ---------- */

.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: var(--gap);
}

.video-card {
  color: inherit;
  display: block;
}

.video-card__thumb {
  position: relative;
  border-radius: var(--radius-m);
  overflow: hidden;
  background: var(--surface);
  aspect-ratio: 16 / 9;
}

.video-card__thumb img,
.video-card__thumb video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.video-card__progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background: rgba(0, 0, 0, 0.5);
}

.video-card__progress span {
  display: block;
  height: 100%;
  background: var(--ember);
}

.video-card__spinner {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 42px;
  transform: translate(-50%, -50%);
  z-index: 2;
}

.video-card__title {
  margin-top: 0.6rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--parchment);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.video-card:hover .video-card__title {
  color: var(--fur-strong);
}

.video-card__meta {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: 0.3rem;
  font-size: 0.82rem;
  color: var(--muted);
  font-family: var(--font-display);
  font-weight: 500;
}

.video-card__meta .fa-thumbs-up {
  color: var(--fur);
}

.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--muted);
  font-size: 1.3rem;
}

/* ---------- Category grid ---------- */

.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--gap);
}

.category-card {
  display: block;
  text-align: center;
  color: inherit;
}

.category-card__image {
  border-radius: var(--radius-m);
  overflow: hidden;
  aspect-ratio: 4 / 3;
  background: var(--surface);
}

.category-card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.category-card h4 {
  margin-top: 0.6rem;
  font-size: 1rem;
}

.category-card:hover h4 {
  color: var(--fur-strong);
}

/* ---------- Watch page ---------- */

.player-wrap {
  position: relative;
  background: #000;
  border-radius: var(--radius-m);
  overflow: hidden;
}

/* video.js's own stylesheet sets `.video-js { height: 100% !important }`,
   so the player needs a real ancestor height to resolve against — without
   this the whole player collapses to zero height. */
#video_container {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  min-height: 200px;
}

#player_a,
#video_container .video-js {
  position: absolute !important;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
}

.video-heading {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-top: 1.25rem;
}

.video-heading h1 {
  font-size: 1.6rem;
  max-width: 60ch;
}

.video-stats {
  display: flex;
  gap: 1.25rem;
  color: var(--muted);
  font-size: 0.9rem;
  margin-top: 0.4rem;
}

.vote-widget {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--surface);
  border-radius: 999px;
  padding: 0.4rem 0.6rem;
  flex-shrink: 0;
}

.vote-widget .btn {
  border-radius: 999px;
  width: 2.6rem;
  height: 2.6rem;
  padding: 0;
  background: var(--surface-2);
}

.vote-widget .btn:hover {
  background: var(--surface-3);
}

.vote-widget #vote-up:hover {
  color: var(--fur);
}

.vote-widget #vote-down:hover {
  color: var(--rust);
}

.vote-widget .btn.is-voted {
  color: var(--fur-strong);
}

#rate-value {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.2rem;
  min-width: 3.5ch;
  text-align: center;
}

.meta-block {
  margin-top: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.meta-block .tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
}

.tags-more {
  display: inline;
}

.tags-more summary {
  display: inline;
  color: var(--muted);
  cursor: pointer;
}

.tags-more summary::-webkit-details-marker {
  display: none;
}

.tags-more summary::before {
  content: "more \2026 ";
}

.tags-more[open] summary::before {
  content: "";
}

#download_div a {
  display: inline-block;
  margin-top: 0.5rem;
}

/* ---------- Alerts ---------- */

.alert {
  border-radius: var(--radius-s);
  padding: 0.75rem 1rem;
  background: var(--surface-2);
  border: 1px solid var(--line);
  font-size: 0.9rem;
}

.alert--success {
  color: var(--moss);
  border-color: var(--moss);
}

.alert--danger {
  color: var(--rust);
  border-color: var(--rust);
}

/* ---------- Table (my videos) ---------- */

.table-wrap {
  overflow-x: auto;
}

table.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

table.data-table th,
table.data-table td {
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

table.data-table img {
  border-radius: var(--radius-s);
}

/* ---------- Playlists ---------- */

.playlist-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.playlist-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: var(--surface);
  border-radius: var(--radius-s);
  padding: 0.6rem 0.9rem;
}

.playlist-actions {
  display: flex;
  gap: 0.4rem;
}

/* ---------- Upload ---------- */

.upload-panel {
  max-width: 520px;
  margin: 2rem auto;
  text-align: center;
}

.upload-input-label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.8rem 1.5rem;
  border-radius: var(--radius-m);
  border: 1px dashed var(--line);
  color: var(--fur-strong);
  cursor: pointer;
  font-weight: 600;
}

.upload-input-label:hover {
  border-color: var(--fur);
  background: var(--surface);
}

#progressbar {
  margin-top: 1rem;
  background: var(--surface-2);
  border-radius: 999px;
  overflow: hidden;
  height: 10px;
  position: relative;
}

#progressbar .progress {
  height: 100%;
  width: 0%;
  background: var(--fur);
  transition: width 0.2s ease;
}

#progress-val {
  display: block;
  margin-bottom: 0.4rem;
  font-family: var(--font-display);
  color: var(--muted);
}

/* ---------- Footer ---------- */

.site-footer {
  margin-top: 4rem;
  border-top: 1px solid var(--line);
  padding: 2.5rem 0;
  color: var(--muted);
  font-size: 0.9rem;
  text-align: center;
}

.site-footer a {
  color: var(--muted);
}

.site-footer a:hover {
  color: var(--fur-strong);
}

.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  margin-top: 1rem;
  padding: 0.55rem 0.75rem 0.55rem 0.55rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  background: rgba(243, 232, 216, 0.025);
}

.footer-brand img {
  width: 34px;
  height: 34px;
}

.footer-brand:hover {
  border-color: rgba(232, 163, 61, 0.35);
  background: rgba(232, 163, 61, 0.06);
}

/* ---------- Utility ---------- */

.text-center {
  text-align: center;
}

.pointer {
  cursor: pointer;
}

.is-hidden {
  display: none !important;
}

@media (max-width: 730px) {
  .site-header .container {
    height: 56px;
  }

  .container {
    padding: 0 0.9rem;
  }

  .brand {
    gap: 0.5rem;
  }

  .brand-mark {
    width: 36px;
    height: 36px;
  }

  .brand-wordmark {
    font-size: 1.05rem;
  }

  .video-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 0.75rem;
  }

  .video-heading h1 {
    font-size: 1.25rem;
  }
}
