:root {
  --bg: #08080a;
  --bg-2: #0f0f12;
  --panel: rgba(22, 22, 26, 0.72);
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.16);
  --text: #f5f5f4;
  --muted: #a3a3a8;
  --faint: #6b6b72;
  --accent: #ff9d2e;
  --accent-2: #ff5e3a;
  --accent-ink: #160c02;
  --radius: 20px;
  --gutter: clamp(16px, 3vw, 40px);
  --bar-h: 64px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --serif: 'Instrument Serif', ui-serif, Georgia, serif;
  --sans: 'Inter Tight', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--bar-h) + 12px); }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
body.is-locked { overflow: hidden; }
a { color: inherit; }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
::selection { background: var(--accent); color: var(--accent-ink); }

/* Film grain over everything: keeps big dark areas from banding and looks like footage. */
.grain {
  position: fixed; inset: -50%; z-index: 100; pointer-events: none; opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 1.2s steps(6) infinite;
}
@keyframes grain {
  0% { transform: translate(0, 0); } 20% { transform: translate(-3%, 2%); } 40% { transform: translate(2%, -3%); }
  60% { transform: translate(-2%, -1%); } 80% { transform: translate(3%, 3%); } 100% { transform: translate(0, 0); }
}

/* --- Buttons --------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 18px; border-radius: 999px;
  border: 1px solid var(--line-strong); background: rgba(255, 255, 255, 0.04); color: var(--text);
  font: 600 14px/1 var(--sans); letter-spacing: -0.005em; text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: transform 0.25s var(--ease), background 0.2s, border-color 0.2s, box-shadow 0.3s;
}
.btn:hover { background: rgba(255, 255, 255, 0.09); border-color: rgba(255, 255, 255, 0.28); }
.btn:active { transform: scale(0.97); }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.btn--primary {
  border: 0; color: var(--accent-ink);
  background: linear-gradient(135deg, #ffc15e, var(--accent) 45%, var(--accent-2));
  box-shadow: 0 8px 30px -8px rgba(255, 130, 40, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.4);
}
.btn--primary:hover { background: linear-gradient(135deg, #ffcb73, #ffa840 45%, #ff6d4c); box-shadow: 0 12px 40px -8px rgba(255, 130, 40, 0.8), inset 0 1px 0 rgba(255, 255, 255, 0.5); }
.btn--big { height: 52px; padding: 0 26px; font-size: 16px; flex: 1; }

/* --- Top bar ---------------------------------------------------------- */
.bar {
  position: sticky; top: 0; z-index: 30; height: var(--bar-h);
  display: flex; align-items: center; gap: 16px; padding: 0 var(--gutter);
  transition: background 0.3s, border-color 0.3s, backdrop-filter 0.3s;
  border-bottom: 1px solid transparent;
}
.bar.is-scrolled {
  background: rgba(8, 8, 10, 0.72); border-bottom-color: var(--line);
  backdrop-filter: blur(20px) saturate(1.4); -webkit-backdrop-filter: blur(20px) saturate(1.4);
}
.brand { display: flex; align-items: center; gap: 9px; text-decoration: none; flex: none; }
.brand__word { font-weight: 700; letter-spacing: -0.02em; font-size: 16px; }
.brand__sub { font: italic 19px/1 var(--serif); color: var(--muted); }
.search {
  flex: 1; max-width: 520px; margin: 0 auto; height: 42px;
  display: flex; align-items: center; gap: 10px; padding: 0 8px 0 16px;
  border-radius: 999px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.05);
  color: var(--muted); cursor: text; transition: border-color 0.2s, background 0.2s, box-shadow 0.3s;
}
.search:focus-within { border-color: rgba(255, 157, 46, 0.6); background: rgba(255, 255, 255, 0.07); box-shadow: 0 0 0 4px rgba(255, 157, 46, 0.12); }
.search input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: none; color: var(--text); font: 500 14px var(--sans); }
.search input::placeholder { color: var(--faint); }
.search input::-webkit-search-cancel-button { filter: invert(1) opacity(0.5); }
.search kbd {
  font: 600 11px/1 ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--faint);
  padding: 5px 8px; border-radius: 8px; border: 1px solid var(--line);
}
.search:focus-within kbd { opacity: 0; }

.eyebrow {
  display: inline-flex; align-items: center; gap: 8px; margin: 0 0 16px; padding: 5px 11px 5px 9px;
  border-radius: 999px; border: 1px solid var(--line-strong); background: rgba(255, 255, 255, 0.04);
  font: 600 11px/1 var(--sans); letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 0 rgba(255, 157, 46, 0.7); animation: pulse 2s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 8px rgba(255, 157, 46, 0); } 100% { box-shadow: 0 0 0 0 rgba(255, 157, 46, 0); } }
.publish h2 em {
  font: italic 400 1.08em/0.9 var(--serif); letter-spacing: -0.02em;
  background: linear-gradient(100deg, #ffd08a, var(--accent) 40%, var(--accent-2) 80%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  padding-right: 0.06em;
}
/* --- Filters ---------------------------------------------------------- */
.filters {
  position: sticky; top: var(--bar-h); z-index: 20;
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; padding: 20px var(--gutter) 12px;
  background: linear-gradient(var(--bg) 78%, transparent);
}
.cats { display: flex; gap: 2px; flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.cats::-webkit-scrollbar { display: none; }
.cats button {
  flex: none; height: 38px; padding: 0 12px; border: 0; background: none; cursor: pointer;
  color: var(--muted); font: 400 22px/1 var(--serif); letter-spacing: -0.01em;
  box-shadow: inset 0 -2px 0 transparent; transition: color 0.2s, box-shadow 0.25s;
}
.cats button:hover { color: var(--text); }
.cats button[aria-pressed='true'] { color: var(--text); box-shadow: inset 0 -2px 0 var(--accent); }
.cats sup { font: 500 11px var(--sans); color: var(--faint); margin-left: 4px; vertical-align: super; }
.chips__sep { flex: none; width: 1px; height: 20px; align-self: center; background: var(--line); margin: 0 4px; }
.seg { display: flex; padding: 4px; gap: 2px; border-radius: 999px; background: rgba(255, 255, 255, 0.05); border: 1px solid var(--line); flex: none; }
.seg button {
  display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 14px; border: 0; border-radius: 999px;
  background: none; color: var(--muted); font: 600 13px var(--sans); cursor: pointer; transition: background 0.2s, color 0.2s;
}
.seg button:hover { color: var(--text); }
.seg button[aria-pressed='true'] { background: var(--text); color: var(--bg); }
.seg i { display: inline-block; border: 1.6px solid currentColor; border-radius: 3px; }
.chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; flex: 1; min-width: 0; mask-image: linear-gradient(90deg, #000 92%, transparent); -webkit-mask-image: linear-gradient(90deg, #000 92%, transparent); }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; height: 32px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line);
  background: none; color: var(--muted); font: 500 13px var(--sans); cursor: pointer; transition: all 0.2s;
}
.chip:hover { color: var(--text); border-color: var(--line-strong); }
.chip[aria-pressed='true'] { color: var(--accent-ink); background: var(--accent); border-color: var(--accent); }
.count { flex: none; color: var(--faint); font: 500 13px var(--sans); font-variant-numeric: tabular-nums; }

/* --- The board -------------------------------------------------------- */
.board { padding: 8px var(--gutter) 40px; min-height: 50vh; }
.masonry { display: flex; gap: clamp(12px, 1.4vw, 20px); align-items: flex-start; }
.col { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: clamp(18px, 2vw, 28px); }

.card { position: relative; opacity: 0; transform: translateY(40px) scale(0.97); transition: opacity 0.9s var(--ease), transform 0.9s var(--ease); transition-delay: var(--delay, 0s); }
.card.is-in { opacity: 1; transform: none; }
.card__media {
  position: relative; display: block; width: 100%; padding: 0; border: 0; overflow: hidden; cursor: zoom-in;
  border-radius: var(--radius); background: var(--c, #18181b); isolation: isolate;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06) inset, 0 20px 50px -30px var(--c, #000);
  transition: box-shadow 0.5s var(--ease), transform 0.5s var(--ease);
}
.card__media img, .card__media video {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block;
  transition: transform 1.2s var(--ease), opacity 0.6s;
}
.card__media video { opacity: 0; }
.card__media video.is-playing { opacity: 1; }
.card__media::before {
  content: ''; position: absolute; inset: 0; z-index: 2; pointer-events: none; opacity: 0; transition: opacity 0.4s;
  background:
    radial-gradient(400px circle at var(--mx, 50%) var(--my, 50%), rgba(255, 255, 255, 0.14), transparent 45%),
    linear-gradient(to top, rgba(0, 0, 0, 0.72), transparent 45%);
}
.card__media::after {
  content: ''; position: absolute; inset: 0; z-index: 3; border-radius: inherit; pointer-events: none;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}
.card:hover .card__media, .card:focus-within .card__media { transform: translateY(-4px); box-shadow: 0 1px 0 rgba(255, 255, 255, 0.1) inset, 0 40px 80px -30px var(--c, #000), 0 0 0 1px rgba(255, 255, 255, 0.14); }
.card:hover .card__media::before, .card:focus-within .card__media::before { opacity: 1; }
.card:hover .card__media img, .card:hover .card__media video { transform: scale(1.04); }
.card__media:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.badge {
  position: absolute; z-index: 4; display: inline-flex; align-items: center; gap: 5px;
  height: 24px; padding: 0 9px; border-radius: 999px;
  background: rgba(0, 0, 0, 0.5); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  color: #fff; font: 600 11px/1 var(--sans); letter-spacing: 0.02em; font-variant-numeric: tabular-nums;
}
.badge--time { top: 10px; right: 10px; }
.badge--new { top: 10px; left: 10px; background: var(--accent); color: var(--accent-ink); backdrop-filter: none; }
.badge--view { top: 10px; left: 10px; }
.badge--new + .badge--view { left: 62px; }
.badge--design { top: 10px; right: 10px; }
.badge--live { bottom: 12px; left: 12px; opacity: 0; transform: translateY(6px); transition: all 0.4s var(--ease); }
.badge--live::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: #ff4d4d; }
.card__open {
  position: absolute; z-index: 4; right: 12px; bottom: 12px; height: 34px; padding: 0 14px;
  display: inline-flex; align-items: center; gap: 6px; border-radius: 999px;
  background: #fff; color: #0a0a0a; font: 700 13px var(--sans); text-decoration: none;
  opacity: 0; transform: translateY(10px) scale(0.95); transition: all 0.4s var(--ease);
}
.card__open svg { width: 14px; height: 14px; stroke-width: 2.5; }
.card__open:hover { background: var(--accent); }
.card:hover .card__open, .card:focus-within .card__open, .card:hover .badge--live, .card:focus-within .badge--live { opacity: 1; transform: none; }

.card__meta { display: flex; align-items: center; gap: 10px; padding: 12px 4px 0; }
.card__text { min-width: 0; }
.card__name { font-weight: 650; font-size: 15px; letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card__by { color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.avatar {
  flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
  background: conic-gradient(from var(--h1), hsl(var(--h1) 90% 62%), hsl(var(--h2) 90% 55%), hsl(var(--h1) 90% 62%));
  color: #0a0a0a; font: 700 13px var(--sans); text-transform: uppercase;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.3);
}
.avatar--lg { width: 40px; height: 40px; font-size: 16px; }

/* Before the list arrives: shimmering placeholders the shape of cards. */
.skeleton { border-radius: var(--radius); background: linear-gradient(100deg, #141417 30%, #1e1e23 50%, #141417 70%); background-size: 300% 100%; animation: shimmer 1.6s linear infinite; }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -200% 0; } }

.empty { padding: 80px 20px; text-align: center; color: var(--muted); }
.empty__big { margin: 0 0 6px; font: italic 40px/1.1 var(--serif); color: var(--text); }
.empty .btn { margin-top: 16px; }

/* --- Publish call ------------------------------------------------------ */
.publish { padding: 40px var(--gutter) 80px; }
.publish__card {
  position: relative; overflow: hidden; max-width: 1100px; margin: 0 auto; padding: clamp(32px, 6vw, 72px);
  border-radius: 32px; border: 1px solid var(--line);
  background:
    radial-gradient(ellipse 60% 80% at 100% 0%, rgba(255, 110, 40, 0.28), transparent 60%),
    radial-gradient(ellipse 50% 60% at 0% 100%, rgba(255, 190, 90, 0.12), transparent 60%),
    var(--bg-2);
}
.publish h2 { margin: 0 0 14px; font: 600 clamp(34px, 5vw, 64px)/1 var(--sans); letter-spacing: -0.04em; }
.publish p { max-width: 560px; color: var(--muted); font-size: 17px; margin: 0 0 26px; }
.publish p b { color: var(--text); font-weight: 600; }

.foot {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px;
  padding: 28px var(--gutter) calc(28px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line);
  color: var(--faint); font-size: 13px;
}

/* --- Viewer ------------------------------------------------------------ */
.viewer {
  position: fixed; inset: 0; width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0;
  border: 0; background: rgba(6, 6, 8, 0.82); color: var(--text); overflow: hidden;
  backdrop-filter: blur(30px) saturate(1.3); -webkit-backdrop-filter: blur(30px) saturate(1.3);
}
.viewer::backdrop { background: rgba(0, 0, 0, 0.4); }
.viewer[open] { animation: fade 0.35s var(--ease); }
.viewer[open] .viewer__grid { animation: zoom 0.6s var(--ease); }
@keyframes fade { from { opacity: 0; } }
@keyframes zoom { from { opacity: 0; transform: scale(0.96) translateY(20px); } }
/* Ambient light: the playing frame, shrunk to a few pixels and blurred behind the stage. */
.viewer__glow {
  position: absolute; left: 50%; top: 50%; width: 110vw; height: 110vh; transform: translate(-50%, -50%);
  filter: blur(90px) saturate(1.8); opacity: 0.55; pointer-events: none;
}
.viewer__grid {
  position: relative; height: 100%; display: grid; grid-template-columns: minmax(0, 1fr) 400px;
}
.viewer__stage { position: relative; display: flex; align-items: center; justify-content: center; padding: 56px 32px 32px 56px; min-height: 0; }
.viewer__stage video {
  max-width: 100%; max-height: 100%; border-radius: 16px; background: #000; display: block;
  box-shadow: 0 50px 120px -30px rgba(0, 0, 0, 0.9), 0 0 0 1px rgba(255, 255, 255, 0.08);
}
.viewer__side {
  overflow-y: auto; padding: 64px 32px 32px; border-left: 1px solid var(--line);
  background: rgba(10, 10, 12, 0.55);
}
.viewer__x, .viewer__nav {
  position: absolute; z-index: 5; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center;
  border: 1px solid var(--line-strong); background: rgba(0, 0, 0, 0.45); color: var(--text); cursor: pointer;
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); transition: background 0.2s, transform 0.2s;
}
.viewer__x:hover, .viewer__nav:hover { background: rgba(255, 255, 255, 0.14); }
.viewer__x { top: 16px; right: 16px; }
.viewer__nav { top: 50%; transform: translateY(-50%); }
.viewer__nav:active { transform: translateY(-50%) scale(0.92); }
.viewer__nav--prev { left: 16px; }
.viewer__nav--next { right: 16px; }
.who { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.who b { display: block; font-weight: 600; }
.who div > span { color: var(--muted); font-size: 13px; }
.who a { text-decoration: none; }
.who a:hover b { text-decoration: underline; }
.viewer__side h2 { margin: 0 0 10px; font: 600 clamp(28px, 3vw, 38px)/1.05 var(--sans); letter-spacing: -0.035em; }
.viewer__desc { margin: 0 0 16px; color: var(--muted); font-size: 15px; }
.viewer__desc:empty { display: none; }
.viewer__tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 22px; }
.viewer__tags:empty { display: none; }
.viewer__tags button { height: 28px; padding: 0 12px; font-size: 12px; }
.specs { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; margin: 0 0 24px; border-radius: 16px; overflow: hidden; background: var(--line); border: 1px solid var(--line); }
.specs div { padding: 12px 14px; background: rgba(14, 14, 17, 0.9); }
.specs dt { color: var(--faint); font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; }
.specs dd { margin: 3px 0 0; font-weight: 600; font-variant-numeric: tabular-nums; }
.viewer__actions { display: flex; gap: 10px; }
.viewer__actions .btn--ghost { height: 52px; }
.viewer__hint { margin: 10px 0 0; color: var(--faint); font-size: 12px; }
.more { margin-top: 34px; }
.more__title { margin: 0 0 12px; font: italic 22px var(--serif); color: var(--muted); }
.more__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.more__grid button {
  position: relative; padding: 0; border: 0; border-radius: 12px; overflow: hidden; cursor: pointer; background: var(--c, #18181b);
  aspect-ratio: 16 / 10; transition: transform 0.3s var(--ease);
}
.more__grid button:hover { transform: scale(1.03); }
.more__grid img { width: 100%; height: 100%; object-fit: cover; display: block; }
.more__grid span {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 18px 10px 8px; text-align: left;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.8)); color: #fff; font: 600 12px var(--sans);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.toast {
  position: fixed; left: 50%; bottom: 28px; z-index: 200; transform: translateX(-50%);
  padding: 10px 18px; border-radius: 999px; background: var(--text); color: var(--bg); font: 600 14px var(--sans);
  box-shadow: 0 20px 50px -10px rgba(0, 0, 0, 0.6); animation: toast 0.4s var(--ease);
}
@keyframes toast { from { opacity: 0; transform: translate(-50%, 16px); } }

/* --- Smaller screens ----------------------------------------------------- */
@media (max-width: 900px) {
  .viewer { overflow-y: auto; }
  .viewer__grid { height: auto; min-height: 100%; grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .viewer__stage { padding: 64px 12px 12px; }
  .viewer__stage video { max-height: 56vh; }
  .viewer__side { overflow: visible; border-left: 0; border-top: 1px solid var(--line); padding: 24px 20px calc(32px + env(safe-area-inset-bottom)); }
  .viewer__nav { top: calc(50% + 26px); width: 38px; height: 38px; }
  .viewer__nav--prev { left: 18px; }
  .viewer__nav--next { right: 18px; }
}
@media (max-width: 700px) {
  :root { --bar-h: 58px; --radius: 16px; }
  .bar { gap: 10px; }
  .brand__word, .brand__sub, .bar__cta, .search kbd { display: none; }
  .search { height: 40px; }
  .filters { flex-wrap: wrap; }
  .seg { order: 2; }
  .count { display: none; }
  .chips { order: 3; flex-basis: 100%; }
  .card__open { display: none; }
  .card__meta { padding-top: 9px; gap: 8px; }
  .avatar { width: 24px; height: 24px; font-size: 11px; }
  .card__name { font-size: 14px; }
  .card__by { font-size: 12px; }
  .viewer__actions { flex-direction: column; }
  .viewer__actions .btn { width: 100%; flex: none; height: 50px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: 0.01ms !important; }
  .card { opacity: 1; transform: none; }
}
