/* Look borrowed from k0ba.com: dark graphite, terminal green text, glass cards,
   pearlescent borders, opal headline, Inter + JetBrains Mono. */

:root {
  --bg: #1a1a1a;
  --bg-deep: #0a0a0a;
  --graphite: #2a2a2a;
  --ink: #e8ffe8;
  --ink-90: rgba(232, 255, 232, 0.9);
  --ink-70: rgba(232, 255, 232, 0.7);
  --ink-60: rgba(232, 255, 232, 0.6);
  --ink-50: rgba(232, 255, 232, 0.5);
  --ink-40: rgba(232, 255, 232, 0.4);
  --line: rgba(255, 255, 255, 0.06);
  --line-strong: rgba(255, 255, 255, 0.12);
  --glass: rgba(0, 0, 0, 0.15);
  --glass-hover: rgba(0, 0, 0, 0.22);
  --glass-strong: rgba(0, 0, 0, 0.25);
  --warn: #ffd9a8;
  --sans: 'Inter', system-ui, -apple-system, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --opal: linear-gradient(45deg,
    rgba(255, 200, 255, 1), rgba(255, 255, 255, 1), rgba(200, 255, 255, 1),
    rgba(255, 220, 180, 1), rgba(180, 255, 200, 1), rgba(255, 255, 255, 1),
    rgba(220, 180, 255, 1), rgba(255, 255, 255, 1), rgba(200, 220, 255, 1), rgba(255, 255, 255, 1));
  --pearl: linear-gradient(45deg,
    rgba(255, 200, 255, 0.35), rgba(255, 255, 255, 0.45), rgba(200, 255, 255, 0.4),
    rgba(255, 220, 180, 0.45), rgba(180, 255, 200, 0.4), rgba(255, 255, 255, 0.45),
    rgba(220, 180, 255, 0.35), rgba(255, 255, 255, 0.4));
}

* { box-sizing: border-box; }

html { background: var(--bg); color-scheme: dark; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(1200px 600px at 85% -10%, rgba(180, 255, 200, 0.06), transparent 60%),
    radial-gradient(900px 500px at -10% 20%, rgba(220, 180, 255, 0.05), transparent 60%),
    var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 500;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

.mono { font-family: var(--mono); font-weight: 600; }

/* Scrollbars: same translucent pill as k0ba.com's .modal-scroll, used site-wide. */
html, .modal-scroll { scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, 0.22) transparent; }
::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.18);
  border-radius: 9999px;
  border: 3px solid transparent;
  background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.3); border: 3px solid transparent; background-clip: padding-box; }

.wrap { max-width: 1240px; margin: 0 auto; padding: 0 24px; }
@media (max-width: 640px) { .wrap { padding: 0 16px; } }

/* ---------- Top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  backdrop-filter: blur(14px) saturate(1.4);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  background: rgba(26, 26, 26, 0.72);
  border-bottom: 1px solid var(--line);
}
.topbar .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 56px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-family: var(--mono); font-weight: 600; font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-70); }
.brand b { color: var(--ink); }
.who { display: flex; align-items: center; gap: 12px; font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-50); }
.who a { text-decoration: none; color: var(--ink-60); }
.who a:hover { color: var(--ink); }

/* ---------- Hero ---------- */
.hero { padding: 64px 0 28px; }
.eyebrow { font-family: var(--mono); font-weight: 600; font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-50); margin: 0 0 14px; }
.hero h1 {
  margin: 0;
  font-size: clamp(40px, 7vw, 84px);
  line-height: 0.98;
  letter-spacing: -0.04em;
  font-weight: 700;
}
.opal {
  background: var(--opal);
  background-size: 300% 300%;
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: opal-flow 6s ease-in-out infinite;
}
.hero p.lead { max-width: 720px; margin: 20px 0 0; font-size: 17px; line-height: 1.6; color: var(--ink-60); font-weight: 400; }
.stats { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }
.stat {
  font-family: var(--mono); font-weight: 600; font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase;
  padding: 8px 12px; border-radius: 999px; color: var(--ink-70);
  background: var(--glass); border: 1px solid var(--line); backdrop-filter: blur(4px);
}
.stat b { color: var(--ink); }

/* ---------- Toolbar ---------- */
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 18px 0 26px; }
.search {
  flex: 1 1 280px; min-width: 0;
  display: flex; align-items: center; gap: 10px;
  padding: 0 14px; height: 42px; border-radius: 12px;
  background: var(--glass-strong); border: 1px solid var(--line);
}
.search:focus-within { border-color: var(--line-strong); }
.search input { flex: 1; min-width: 0; background: none; border: 0; outline: 0; color: var(--ink); font: 500 14px var(--sans); }
.search input::placeholder { color: var(--ink-40); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  font-family: var(--mono); font-weight: 600; font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase;
  padding: 7px 11px; border-radius: 999px; cursor: pointer;
  color: var(--ink-60); background: rgba(0, 0, 0, 0.1); border: 1px solid rgba(255, 255, 255, 0.05);
  transition: color .2s, border-color .2s, background .2s;
}
.chip:hover { color: var(--ink); border-color: var(--line-strong); }
.chip[aria-pressed="true"] { color: var(--ink); background: linear-gradient(var(--bg-deep), var(--bg-deep)) padding-box, var(--pearl) border-box; border-color: transparent; background-size: 100% 100%, 400% 400%; animation: pearl-flow 8s linear infinite; }
.chip .n { color: var(--ink-40); margin-left: 4px; }
select.sort {
  height: 34px; padding: 0 30px 0 12px; border-radius: 999px; cursor: pointer;
  font: 600 10.5px var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-60);
  background: rgba(0, 0, 0, 0.1) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23e8ffe8' stroke-opacity='.6' fill='none' stroke-width='1.5'/%3E%3C/svg%3E") no-repeat right 12px center;
  border: 1px solid rgba(255, 255, 255, 0.05); appearance: none;
}
select.sort option { background: var(--bg); color: var(--ink); }

/* ---------- Grid + cards ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 20px; padding-bottom: 80px; }
@media (max-width: 400px) { .grid { grid-template-columns: 1fr; } }

.card {
  position: relative; display: flex; flex-direction: column; gap: 14px;
  padding: 18px; border-radius: 18px; text-align: left; cursor: pointer;
  color: inherit; font: inherit;
  background: var(--glass); border: 1px solid var(--line);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  transition: background .3s, border-color .3s, transform .3s;
  opacity: 0; transform: translateY(14px); filter: blur(6px);
  animation: card-in .6s cubic-bezier(.2,.7,.2,1) forwards;
}
.card:hover { background: var(--glass-hover); border-color: var(--line-strong); }
.card:focus-visible { outline: 1px solid rgba(74, 222, 128, 0.45); outline-offset: 3px; }

.shot {
  position: relative; aspect-ratio: 16 / 10; border-radius: 12px; overflow: hidden;
  background: rgba(0, 0, 0, 0.4); border: 1px solid var(--line);
}
.shot img { width: 100%; height: 100%; object-fit: cover; object-position: top; display: block; opacity: .78; transition: opacity .5s, transform .8s cubic-bezier(.2,.7,.2,1); }
.card:hover .shot img { opacity: .97; transform: scale(1.025); }
.shot::after { content: ''; position: absolute; inset: 0; background: linear-gradient(to top, rgba(0,0,0,.45), transparent 45%); pointer-events: none; }
.shot .placeholder {
  position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 20px;
  font-family: var(--mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-40);
  background:
    radial-gradient(300px 160px at 30% 20%, rgba(200,255,255,.08), transparent 70%),
    radial-gradient(260px 160px at 80% 90%, rgba(255,200,255,.07), transparent 70%),
    repeating-linear-gradient(135deg, rgba(255,255,255,.025) 0 1px, transparent 1px 12px);
}
.shot .placeholder strong { display: block; font-family: var(--sans); font-size: 22px; letter-spacing: -0.02em; text-transform: none; color: var(--ink-60); margin-bottom: 6px; }
.shot .badge { position: absolute; left: 10px; bottom: 10px; z-index: 1; }

.row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag {
  font-family: var(--mono); font-weight: 600; font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase;
  padding: 3px 8px; border-radius: 999px; color: var(--ink-60);
  background: rgba(0, 0, 0, 0.25); border: 1px solid rgba(255, 255, 255, 0.07);
}
.tag.warn { color: var(--warn); border-color: rgba(255, 217, 168, 0.25); }
.time { flex: none; white-space: nowrap; font-family: var(--mono); font-weight: 600; font-size: 10.5px; color: var(--ink-40); letter-spacing: .06em; }

.card h3 { margin: 0; font-size: 19px; line-height: 1.25; letter-spacing: -0.02em; font-weight: 650; }
.card h3.untitled { color: var(--ink-50); font-style: italic; font-weight: 500; }
.author { display: flex; align-items: center; gap: 10px; }
.avatar {
  flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
  font: 700 12px var(--sans); color: var(--bg-deep);
}
.author .name { font-size: 14px; font-weight: 600; color: var(--ink-90); line-height: 1.2; }
.author .handle { font-family: var(--mono); font-size: 11px; font-weight: 600; color: var(--ink-40); }
.prompt-snip {
  margin: 0; font-size: 13.5px; line-height: 1.55; color: var(--ink-60); font-weight: 400;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.prompt-snip.none { color: var(--ink-40); font-style: italic; }
.prompt-snip::before { content: '› '; font-family: var(--mono); color: var(--ink-40); }

.empty { grid-column: 1 / -1; text-align: center; padding: 60px 0; color: var(--ink-50); font-family: var(--mono); font-size: 12px; text-transform: uppercase; letter-spacing: .08em; }

/* ---------- Modal ---------- */
.modal { position: fixed; inset: 0; z-index: 50; display: none; }
.modal.open { display: block; }
.modal .scrim { position: absolute; inset: 0; background: rgba(5, 5, 5, 0.72); backdrop-filter: blur(6px); animation: fade .25s ease; }
.modal .panel {
  position: relative; margin: 4vh auto; width: min(1080px, calc(100% - 32px)); max-height: 92vh; overflow: auto;
  border-radius: 22px; padding: 22px;
  background: linear-gradient(rgb(14, 14, 14), rgb(14, 14, 14)) padding-box, var(--pearl) border-box;
  border: 1px solid transparent; background-size: 100% 100%, 400% 400%;
  animation: pearl-flow 8s linear infinite, pop .35s cubic-bezier(.2,.7,.2,1);
  box-shadow: 0 30px 80px rgba(0,0,0,.6);
}
.panel .close {
  position: sticky; top: 0; float: right; z-index: 2; width: 36px; height: 36px; border-radius: 50%;
  border: 1px solid var(--line-strong); background: rgba(0,0,0,.5); color: var(--ink); cursor: pointer; font-size: 18px; line-height: 1;
}
.panel .big { aspect-ratio: 16 / 10; margin: 14px 0 20px; }
.panel h2 { margin: 6px 0 10px; font-size: clamp(24px, 3.4vw, 36px); letter-spacing: -0.03em; line-height: 1.1; }
.panel .summary { color: var(--ink-60); font-weight: 400; line-height: 1.6; margin: 0 0 18px; }
.panel .cols { display: grid; grid-template-columns: 1fr 280px; gap: 24px; }
@media (max-width: 760px) { .panel .cols { grid-template-columns: 1fr; } }
.panel h4 { margin: 0 0 10px; font-family: var(--mono); font-weight: 600; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-50); }
.prompt-full {
  margin: 0; white-space: pre-wrap; font-family: var(--mono); font-weight: 500; font-size: 13px; line-height: 1.65; color: var(--ink-90);
  padding: 16px; border-radius: 14px; background: rgba(0,0,0,.35); border: 1px solid var(--line);
}
.note { margin: 12px 0 0; font-size: 13px; color: var(--warn); line-height: 1.5; }
.actions { display: flex; flex-direction: column; gap: 8px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 42px; padding: 0 16px; border-radius: 12px;
  font: 600 11px var(--mono); letter-spacing: .08em; text-transform: uppercase; text-decoration: none; cursor: pointer;
  color: var(--ink); background: var(--glass-strong); border: 1px solid var(--line-strong);
  transition: background .2s, border-color .2s;
}
.btn:hover { background: rgba(255,255,255,.06); }
.btn.primary { background: linear-gradient(rgb(10,10,10), rgb(10,10,10)) padding-box, var(--pearl) border-box; border-color: transparent; background-size: 100% 100%, 400% 400%; animation: pearl-flow 8s linear infinite; }
.btn[aria-disabled="true"] { opacity: .4; pointer-events: none; }
.versions { margin-top: 20px; }
.meta-list { margin: 16px 0 0; padding: 0; list-style: none; font-family: var(--mono); font-size: 11px; color: var(--ink-50); line-height: 1.9; }
.meta-list b { color: var(--ink-70); font-weight: 600; }

footer { border-top: 1px solid var(--line); padding: 28px 0 40px; color: var(--ink-40); font-family: var(--mono); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; }
footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; }

@keyframes opal-flow { 0%, 100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }
@keyframes pearl-flow { 0%, 100% { background-position: 0 0, 0% 50%; } 25% { background-position: 0 0, 100% 0%; } 50% { background-position: 0 0, 100% 100%; } 75% { background-position: 0 0, 0% 100%; } }
@keyframes card-in { to { opacity: 1; transform: none; filter: none; } }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(12px) scale(.985); } }

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