/* Palette approximates pollen-robotics.com.
   ponytail: tune these hex values + font against the live site's CSS if it drifts. */
:root {
  --bg: #ffffff;
  --surface: #ffffff;
  --text: #1a1d21;
  --muted: #6b7280;
  --border: #e8eaed;
  --teal: #12b3c4;   /* Pollen primary accent */
  --orange: #ff7a2f; /* Pollen secondary accent */
  --shadow: 0 1px 2px rgba(0,0,0,.04), 0 8px 24px rgba(0,0,0,.06);
  --radius: 16px;
  --maxw: 1280px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1113; --surface: #171a1d; --text: #e8eaed;
    --muted: #9aa2ab; --border: #262b2f;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.4);
  }
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* --- header --- */
.site-header { max-width: var(--maxw); margin: 0 auto; padding: 3rem 1.5rem 1.5rem; }
.brand { display: inline-flex; align-items: center; gap: .5rem; font-weight: 600; color: var(--muted); font-size: .9rem; }
.brand-dot { width: 10px; height: 10px; border-radius: 50%; background: linear-gradient(135deg, var(--teal), var(--orange)); }
.site-header h1 { margin: .6rem 0 .3rem; font-size: clamp(2rem, 5vw, 3.2rem); font-weight: 800; letter-spacing: -.02em; }
.site-header h1 span { color: var(--teal); }
.tagline { margin: 0; color: var(--muted); font-size: 1.05rem; }

.controls { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1rem; }
.sort, .filter { display: inline-flex; gap: .25rem; padding: .25rem; border: 1px solid var(--border); border-radius: 999px; }
.sort button, .filter button { border: 0; background: transparent; color: var(--muted); font: inherit; font-size: .9rem; font-weight: 600; padding: .35rem .95rem; border-radius: 999px; cursor: pointer; }
.sort button:hover, .filter button:hover { color: var(--text); }
.sort button.active, .filter button.active { background: var(--teal); color: #fff; }
/* platform icons in the filter bar */
.filter button svg { width: 17px; height: 17px; fill: currentColor; display: block; }
.filter button:has(svg) { padding: .4rem .7rem; }

/* --- masonry wall: JS distributes cards round-robin across columns so ranking
       reads left-to-right by row (CSS columns would fill top-to-bottom instead). --- */
.wall {
  display: flex;
  gap: 1.25rem;
  align-items: flex-start;
  max-width: var(--maxw);
  margin: 1rem auto;
  padding: 0 1.5rem;
}
.wall .col {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

/* --- card --- */
.card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow);
  transition: transform .15s ease, box-shadow .15s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: 0 4px 8px rgba(0,0,0,.08), 0 16px 40px rgba(0,0,0,.12); }

.media { position: relative; display: block; aspect-ratio: 16/9; background: var(--border); }
.media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.media.play::after {
  content: ""; position: absolute; inset: 0; margin: auto;
  width: 54px; height: 54px; border-radius: 50%;
  background: rgba(0,0,0,.55) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill='white'%3E%3Cpath d='M8 5v14l11-7z'/%3E%3C/svg%3E") center/24px no-repeat;
}

.body { padding: .9rem 1rem 1rem; }
.who { display: flex; align-items: center; gap: .55rem; margin-bottom: .5rem; }
.avatar { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; background: var(--border); flex: none; }
.avatar.placeholder { display: flex; align-items: center; justify-content: center; font-weight: 700; color: #fff; }
.name { font-weight: 600; font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.badge { flex: none; margin-left: auto; width: 22px; height: 22px; border-radius: 6px; display: grid; place-items: center; }
.badge svg { width: 14px; height: 14px; fill: #fff; }
.badge.bluesky { background: #1185fe; }
.badge.youtube { background: #ff0000; }
.badge.linkedin { background: #0a66c2; }
.badge.tiktok { background: #010101; }
.badge.x { background: #000000; }
.badge.reddit { background: #ff4500; }
.text.muted { color: var(--muted); -webkit-line-clamp: 1; }

.text { margin: 0; font-size: .94rem; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; }
.date { margin-top: .55rem; font-size: .78rem; color: var(--muted); }
.date .stat { color: var(--text); font-weight: 600; }
.date .cat { color: var(--teal); font-weight: 600; }

.site-footer { max-width: var(--maxw); margin: 2rem auto 3rem; padding: 0 1.5rem; color: var(--muted); font-size: .85rem; }
.empty { text-align: center; color: var(--muted); padding: 3rem 1rem; }

/* --- modal / lightbox --- */
.modal[hidden] { display: none; }
.modal { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; padding: 1.5rem; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.6); backdrop-filter: blur(2px); }
.modal-panel {
  position: relative; z-index: 1;
  width: min(720px, 100%); max-height: 90vh; overflow: auto;
  background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow);
}
.modal-close {
  position: absolute; top: .5rem; right: .5rem; z-index: 2;
  width: 36px; height: 36px; border: 0; border-radius: 50%;
  background: rgba(0,0,0,.55); color: #fff; font-size: 1.5rem; line-height: 1; cursor: pointer;
}
.modal-media { aspect-ratio: 16/9; background: #000; }
.modal-media--tall { aspect-ratio: auto; height: 70vh; background: var(--surface); }
.modal-media--portrait { aspect-ratio: 9/16; max-height: 80vh; margin: 0 auto; background: #000; }
.modal-media iframe, .modal-media img { width: 100%; height: 100%; border: 0; object-fit: contain; display: block; }
/* tweet embed is a fixed-width card — no fixed height, so the panel wraps it and the
   modal centers it vertically; JS resizes the iframe to the tweet's real height. */
.modal-media--tweet { aspect-ratio: auto; background: var(--surface); display: flex; justify-content: center; }
.modal-media--tweet iframe { width: 100%; max-width: 550px; height: 600px; }
.modal-content .body { padding: 1.1rem 1.25rem 1.35rem; }
.modal-content .text { display: block; -webkit-line-clamp: unset; white-space: pre-wrap; font-size: 1rem; }
.view-link {
  display: inline-flex; align-items: center; gap: .35rem; margin-top: .9rem;
  font-weight: 600; font-size: .9rem; color: var(--teal); text-decoration: none;
}
.view-link:hover { text-decoration: underline; }
.card { cursor: pointer; }
