/* ============ Cortex — red theme ============ */
:root {
  color-scheme: dark;
  --bg: #0a0506;
  --bg-2: #120809;
  --panel: rgba(28, 12, 15, 0.72);
  --panel-solid: #160a0c;
  --line: rgba(255, 70, 90, 0.14);
  --line-strong: rgba(255, 70, 90, 0.32);
  --red: #ff1a2e;
  --red-hi: #ff5468;
  --red-deep: #9e0a1a;
  --glow: rgba(255, 26, 46, 0.45);
  --text: #f6eff0;
  --muted: #b39ea2;
  --dim: #7a6266;
  --radius: 18px;
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --display: 'Unbounded', 'Inter', system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'Cascadia Code', Consolas, monospace;
  --ease: cubic-bezier(.2, .8, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { scrollbar-gutter: stable; scrollbar-color: #4a1219 var(--bg); }
html.modal-open { overflow: hidden; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
::selection { background: rgba(255, 26, 46, .38); color: #fff; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
[hidden] { display: none !important; }
/* Netlify badge — hidden instantly by CSS; no-badge.js removes it from the page. */
body > a[href*="netlify"], body > div[class*="netlify" i], body > div[id*="netlify" i],
body > iframe[src*="netlify"], [class*="netlify-badge" i], [id*="netlify-badge" i] { display: none !important; }
:focus-visible { outline: 2px solid var(--red-hi); outline-offset: 3px; border-radius: 8px; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #3a1016; border-radius: 10px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: #5c1520; }

/* ---------- background layers ---------- */
#neural { position: fixed; inset: 0; width: 100%; height: 100%; z-index: -3; opacity: .9; }
.bg-grid {
  position: fixed; inset: 0; z-index: -2; pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 60, 80, .05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 60, 80, .05) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 30%, transparent 75%);
}
.bg-glow {
  position: fixed; inset: 0; z-index: -4; pointer-events: none;
  background:
    radial-gradient(60% 45% at 50% -8%, rgba(255, 26, 46, .30), transparent 70%),
    radial-gradient(40% 35% at 95% 30%, rgba(160, 10, 30, .18), transparent 70%),
    radial-gradient(40% 40% at 0% 80%, rgba(120, 8, 24, .16), transparent 70%),
    var(--bg);
}
.bg-grain {
  position: fixed; inset: -50%; z-index: 50; pointer-events: none; opacity: .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");
}

.container { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 24px; }

/* ---------- nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 20;
  background: linear-gradient(to bottom, rgba(10, 5, 6, .85), rgba(10, 5, 6, .55));
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  max-width: 1180px; margin: 0 auto; padding: 12px 24px;
  display: flex; align-items: center; gap: 24px;
}
.brand { display: inline-flex; align-items: center; gap: 10px; }
.brand-mark { width: 34px; height: 25px; filter: drop-shadow(0 0 10px var(--glow)); transition: transform .4s var(--ease); }
.brand:hover .brand-mark { transform: rotate(-8deg) scale(1.08); }
.brand-word { font: 800 17px/1 var(--display); letter-spacing: .14em; }
.tabs {
  position: relative; display: flex; gap: 4px; padding: 4px; margin-right: auto;
  background: rgba(255, 255, 255, .03); border: 1px solid var(--line); border-radius: 999px;
}
.tab {
  position: relative; z-index: 1; padding: 7px 18px; border-radius: 999px;
  font-size: 14px; font-weight: 600; color: var(--muted); transition: color .25s;
}
.tab:hover { color: var(--text); }
.tab[aria-current="page"] { color: #fff; }
.tab-indicator {
  position: absolute; top: 4px; bottom: 4px; left: 0; width: 0; border-radius: 999px;
  background: linear-gradient(135deg, var(--red-hi), var(--red) 55%, var(--red-deep));
  box-shadow: 0 0 22px var(--glow), inset 0 1px 0 rgba(255, 255, 255, .25);
  transition: transform .45s var(--ease), width .45s var(--ease);
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 48px; padding: 0 24px; border-radius: 999px; border: 1px solid transparent;
  font-weight: 600; font-size: 15px; cursor: pointer; white-space: nowrap;
  transition: transform .2s var(--ease), box-shadow .3s, background .3s, border-color .3s, color .3s;
}
.btn:active { transform: scale(.97); }
.btn-sm { height: 38px; padding: 0 16px; font-size: 14px; }
.btn-primary {
  color: #fff;
  background: linear-gradient(135deg, var(--red-hi), var(--red) 50%, var(--red-deep));
  box-shadow: 0 8px 30px -8px var(--glow), inset 0 1px 0 rgba(255, 255, 255, .25);
}
.btn-primary:hover { box-shadow: 0 10px 40px -6px rgba(255, 26, 46, .7), inset 0 1px 0 rgba(255, 255, 255, .3); transform: translateY(-1px); }
.btn-primary svg { transition: transform .3s var(--ease); }
.btn-primary:hover svg { transform: translateX(3px); }
.btn-ghost { background: rgba(255, 255, 255, .04); border-color: var(--line-strong); color: var(--text); }
.btn-ghost:hover { background: rgba(255, 26, 46, .1); border-color: rgba(255, 84, 104, .6); }
.icon-btn {
  display: inline-grid; place-items: center; width: 38px; height: 38px; flex: none;
  border-radius: 12px; border: 1px solid var(--line); background: rgba(255, 255, 255, .03);
  color: var(--muted); cursor: pointer; transition: color .2s, background .2s, border-color .2s;
}
.icon-btn:hover { color: #fff; background: rgba(255, 26, 46, .12); border-color: var(--line-strong); }

/* ---------- views ---------- */
main { flex: 1; }
.view { animation: viewIn .55s var(--ease) both; }
@keyframes viewIn { from { opacity: 0; transform: translateY(12px); } }

/* ---------- hero ---------- */
.hero {
  position: relative; text-align: center;
  min-height: calc(100vh - 140px); min-height: calc(100dvh - 140px);
  padding: 48px 24px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.hero-logo { width: clamp(70px, 9vw, 104px); margin-bottom: 26px; position: relative; }
.hero-logo svg { width: 100%; aspect-ratio: 600 / 430; filter: drop-shadow(0 0 28px rgba(255, 26, 46, .65)); animation: float 6s ease-in-out infinite; }
.hero-logo::after {
  content: ''; position: absolute; inset: -60%; z-index: -1; border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 26, 46, .35), transparent 65%);
  animation: breathe 4s ease-in-out infinite;
}
@keyframes float { 50% { transform: translateY(-8px); } }
@keyframes breathe { 50% { opacity: .5; transform: scale(.85); } }

.eyebrow {
  display: inline-flex; align-items: center; gap: 10px; margin: 0 0 22px;
  padding: 7px 16px 7px 12px; border-radius: 999px;
  background: rgba(255, 26, 46, .08); border: 1px solid var(--line-strong);
  font-size: 13px; font-weight: 600; letter-spacing: .02em; color: #ffc9cf;
}
.pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--red); box-shadow: 0 0 0 0 var(--glow); animation: pulse 2s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 10px rgba(255, 26, 46, 0); } 100% { box-shadow: 0 0 0 0 rgba(255, 26, 46, 0); } }

.wordmark {
  margin: 0; font: 800 clamp(56px, 13vw, 168px)/.9 var(--display); letter-spacing: .04em;
  background: linear-gradient(180deg, #fff 0%, #ffd5da 35%, var(--red-hi) 70%, var(--red-deep) 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-text-fill-color: transparent;
  padding-left: .04em;
  position: relative; isolation: isolate;
}
/* Glow lives on a separate layer: filters on gradient-clipped text render grey in some browsers. */
.wordmark-wrap { position: relative; display: inline-block; }
.wordmark-wrap::before {
  content: 'CORTEX'; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  font: 800 clamp(56px, 13vw, 168px)/.9 var(--display); letter-spacing: .04em; padding-left: .04em;
  color: rgba(255, 26, 46, .55); -webkit-text-fill-color: rgba(255, 26, 46, .55);
  filter: blur(28px);
}
.hero-sub { max-width: 560px; margin: 26px auto 0; font-size: clamp(16px, 2vw, 18px); color: var(--muted); }
.hero-cta { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 34px; }

.stats {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 56px 0 0;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel);
  width: min(620px, 100%); overflow: hidden;
}
.stats div { padding: 18px 12px; }
.stats div + div { border-left: 1px solid var(--line); }
.stats dt { font-size: 12px; text-transform: uppercase; letter-spacing: .12em; color: var(--dim); font-weight: 600; }
.stats dd { margin: 4px 0 0; font: 700 clamp(18px, 3vw, 26px)/1.2 var(--display); color: #fff; }

.reveal { animation: reveal .9s var(--ease) both; }
.reveal:nth-child(2) { animation-delay: .08s; }
.reveal:nth-child(3) { animation-delay: .16s; }
.reveal:nth-child(4) { animation-delay: .24s; }
.reveal:nth-child(5) { animation-delay: .32s; }
.reveal:nth-child(6) { animation-delay: .40s; }
@keyframes reveal { from { opacity: 0; transform: translateY(18px); } }

/* ---------- marquee ---------- */
.marquee {
  overflow: hidden; padding: 22px 0; margin: 8px 0 24px;
  border-block: 1px solid var(--line); background: rgba(255, 26, 46, .03);
  mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
}
.marquee-track { display: flex; width: max-content; animation: marquee 40s linear infinite; }
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee-item {
  display: inline-flex; align-items: center; gap: 36px; padding-right: 36px;
  font: 700 clamp(22px, 3.4vw, 38px)/1 var(--display); letter-spacing: .06em; text-transform: uppercase;
  color: transparent; -webkit-text-stroke: 1px rgba(255, 110, 125, .55); white-space: nowrap;
}
.marquee-item:nth-child(3n+2) { color: var(--red); -webkit-text-stroke: 0; text-shadow: 0 0 24px var(--glow); }
.marquee-item i { font-style: normal; color: var(--red); -webkit-text-stroke: 0; font-size: .6em; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- sections ---------- */
.section { padding: 40px 24px 90px; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.kicker { margin: 0 0 6px; font-size: 12px; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; color: var(--red-hi); }
h2 { margin: 0; font: 700 clamp(24px, 3.4vw, 34px)/1.15 var(--display); letter-spacing: .01em; }
.link-arrow { color: var(--muted); font-weight: 600; font-size: 14px; transition: color .2s; white-space: nowrap; }
.link-arrow span { display: inline-block; transition: transform .3s var(--ease); }
.link-arrow:hover { color: #fff; }
.link-arrow:hover span { transform: translateX(4px); }

.recent { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; }
.recent-item {
  display: flex; align-items: center; gap: 14px; padding: 14px 16px;
  border: 1px solid var(--line); border-radius: 14px; background: var(--panel);
  transition: border-color .25s, background .25s, transform .25s var(--ease);
  animation: reveal .7s var(--ease) both;
}
.recent-item:hover { border-color: var(--line-strong); background: rgba(40, 14, 18, .8); transform: translateX(4px); }
.recent-item .sigil { width: 40px; height: 40px; border-radius: 11px; }
.recent-text { min-width: 0; flex: 1; }
.recent-text strong { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.recent-text span { font-size: 13px; color: var(--dim); }
.recent-arrow { color: var(--dim); transition: color .2s, transform .3s var(--ease); }
.recent-item:hover .recent-arrow { color: var(--red-hi); transform: translateX(3px); }

/* ---------- jailbreaks page ---------- */
.page-head { padding-top: clamp(48px, 9vh, 90px); padding-bottom: 28px; }
.page-title {
  font-size: clamp(40px, 7vw, 76px); line-height: 1;
  background: linear-gradient(180deg, #fff 20%, var(--red-hi) 85%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.page-sub { margin: 14px 0 0; color: var(--muted); max-width: 560px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.search {
  flex: 1 1 320px; display: flex; align-items: center; gap: 10px; height: 48px; padding: 0 12px 0 16px;
  border: 1px solid var(--line); border-radius: 14px; background: var(--panel); color: var(--dim);
  transition: border-color .25s, box-shadow .25s;
}
.search:focus-within { border-color: rgba(255, 84, 104, .6); box-shadow: 0 0 0 4px rgba(255, 26, 46, .12); color: var(--red-hi); }
.search input { flex: 1; min-width: 0; height: 100%; background: none; border: 0; outline: 0; color: var(--text); font: inherit; font-size: 15px; }
.search input::placeholder { color: var(--dim); }
.search input::-webkit-search-cancel-button { filter: grayscale(1) brightness(1.6); }
kbd {
  font: 500 12px var(--mono); color: var(--muted); padding: 2px 8px; border-radius: 6px;
  border: 1px solid var(--line-strong); background: rgba(255, 255, 255, .04);
}
.sort { display: flex; padding: 4px; gap: 4px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); }
.sort button {
  border: 0; background: none; padding: 0 14px; border-radius: 10px; cursor: pointer;
  font-size: 14px; font-weight: 600; color: var(--muted); transition: color .2s, background .2s;
}
.sort button:hover { color: var(--text); }
.sort button[aria-pressed="true"] { background: rgba(255, 26, 46, .16); color: #fff; box-shadow: inset 0 0 0 1px var(--line-strong); }
.result-count { margin: 16px 0 0; font-size: 14px; color: var(--dim); min-height: 1.6em; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 18px; padding-bottom: 96px; }

/* ---------- model card ---------- */
.card {
  --mx: 50%; --my: 0%;
  position: relative; display: flex; flex-direction: column; min-height: 220px; padding: 22px;
  border-radius: var(--radius); background: var(--panel); border: 1px solid var(--line);
  overflow: hidden; isolation: isolate; cursor: pointer;
  transition: transform .4s var(--ease), border-color .3s, box-shadow .4s;
  animation: cardIn .7s var(--ease) both;
}
@keyframes cardIn { from { opacity: 0; transform: translateY(22px) scale(.98); } }
.card::before {
  content: ''; position: absolute; inset: 0; z-index: -1; opacity: 0; transition: opacity .35s;
  background: radial-gradient(420px circle at var(--mx) var(--my), rgba(255, 26, 46, .22), transparent 45%);
}
.card::after {
  content: ''; position: absolute; inset: 0; z-index: -1; border-radius: inherit; padding: 1px; opacity: 0; transition: opacity .35s;
  background: radial-gradient(260px circle at var(--mx) var(--my), rgba(255, 110, 125, .9), transparent 60%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
}
.card:hover, .card:focus-visible {
  transform: translateY(-6px); border-color: var(--line-strong);
  box-shadow: 0 24px 60px -24px rgba(255, 26, 46, .55), 0 0 0 1px rgba(255, 26, 46, .08);
}
.card:hover::before, .card:hover::after, .card:focus-visible::before { opacity: 1; }
.card-top { display: flex; align-items: flex-start; justify-content: space-between; }
.card-go {
  display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%;
  border: 1px solid var(--line); color: var(--muted);
  transition: transform .4s var(--ease), background .3s, color .3s, border-color .3s;
}
.card:hover .card-go { transform: rotate(-45deg); background: var(--red); border-color: var(--red); color: #fff; box-shadow: 0 0 20px var(--glow); }
.card-name { margin: 22px 0 0; font: 700 24px/1.15 var(--display); letter-spacing: .01em; word-break: break-word; }
.card-provider { margin: 4px 0 0; font-size: 14px; color: var(--muted); }
.card-watermark {
  position: absolute; right: -6px; bottom: -34px; z-index: -1;
  font: 800 150px/1 var(--display); color: transparent; -webkit-text-stroke: 1px rgba(255, 70, 90, .09);
  transition: -webkit-text-stroke-color .4s, transform .6s var(--ease); pointer-events: none; user-select: none;
}
.card:hover .card-watermark { -webkit-text-stroke-color: rgba(255, 70, 90, .22); transform: translateY(-6px); }
.card-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin-top: auto; padding-top: 18px; font-size: 13px; color: var(--dim);
}
.pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border-radius: 999px;
  background: rgba(255, 26, 46, .12); border: 1px solid var(--line-strong); color: #ffc9cf; font-weight: 600;
}
.pill.empty { background: rgba(255, 255, 255, .04); border-color: var(--line); color: var(--dim); }
/* locked (empty) cards */
.card.locked { cursor: not-allowed; opacity: .55; filter: grayscale(.6); }
.card.locked:hover { transform: none; border-color: var(--line); box-shadow: none; }
.card.locked:hover::before, .card.locked:hover::after { opacity: 0; }
.card.locked:hover .card-go { transform: none; background: none; border-color: var(--line); color: var(--muted); box-shadow: none; }
.card.locked:hover .sigil img { transform: none; }
.card-x { position: absolute; inset: 14px; width: calc(100% - 28px); height: calc(100% - 28px); z-index: 2; pointer-events: none; }
.card-x line { stroke: rgba(255, 40, 60, .55); stroke-width: 2; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.match-note { margin: 10px 0 0; font-size: 13px; color: var(--red-hi); }

/* sigil (generated neural badge) */
.sigil {
  display: inline-grid; place-items: center; width: 52px; height: 52px; flex: none; border-radius: 14px;
  background: radial-gradient(circle at 30% 20%, rgba(255, 84, 104, .25), rgba(60, 8, 14, .6));
  border: 1px solid var(--line-strong);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08), 0 8px 24px -10px var(--glow);
}
.sigil svg { width: 66%; height: 66%; overflow: visible; }
.sigil line { stroke: var(--red-hi); stroke-width: 6; stroke-linecap: round; opacity: .7; }
.sigil circle { fill: #ffd5da; }
.sigil circle.on { fill: var(--red); filter: drop-shadow(0 0 3px var(--red)); }
.card:hover .sigil line { opacity: 1; }
.sigil.has-logo {
  width: 60px; height: 60px; border-radius: 16px;
  background: radial-gradient(circle at 30% 20%, #2a2224, #121012 70%);
  border-color: rgba(255, 255, 255, .1);
}
.card:hover .sigil.has-logo { border-color: var(--line-strong); }
.sigil img {
  width: 64%; height: 64%; object-fit: contain; user-select: none;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, .45));
  transition: transform .45s var(--ease);
}
.card:hover .sigil img { transform: scale(1.1) rotate(-4deg); }
.viewer-model .sigil.has-logo { width: 48px; height: 48px; border-radius: 14px; }

/* empty state */
.empty-state {
  grid-column: 1 / -1; text-align: center; padding: 64px 24px;
  border: 1px dashed var(--line-strong); border-radius: var(--radius); background: rgba(20, 8, 10, .5); color: var(--muted);
}
.empty-state h3 { margin: 0 0 8px; color: var(--text); font: 700 20px var(--display); }
.empty-state p { margin: 0 auto; max-width: 480px; }
.empty-state code { font-family: var(--mono); font-size: .92em; color: #ffc9cf; background: rgba(255, 26, 46, .1); padding: 2px 6px; border-radius: 6px; }

/* ---------- footer ---------- */
.footer { border-top: 1px solid var(--line); background: rgba(10, 5, 6, .6); }
.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 22px; padding-bottom: 22px; }
.footer p { margin: 0; font-size: 13px; color: var(--dim); }
.brand-sm .brand-mark { width: 26px; height: 19px; }
.brand-sm .brand-word { font-size: 14px; }

/* ---------- viewer dialog ---------- */
.viewer {
  padding: 0; border: 0; background: transparent; color: var(--text);
  width: min(1080px, calc(100vw - 48px)); height: min(820px, calc(100vh - 64px));
  max-width: none; max-height: none; overflow: visible;
}
.viewer::backdrop { background: rgba(6, 2, 3, .72); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.viewer[open] { animation: dlgIn .45s var(--ease) both; }
.viewer[open]::backdrop { animation: fadeIn .35s ease both; }
.viewer.closing { animation: dlgOut .22s ease-in both; }
.viewer.closing::backdrop { animation: fadeOut .22s ease-in both; }
@keyframes dlgIn { from { opacity: 0; transform: translateY(16px) scale(.97); } }
@keyframes dlgOut { to { opacity: 0; transform: translateY(10px) scale(.98); } }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes fadeOut { to { opacity: 0; } }

.viewer-panel {
  position: relative; display: flex; flex-direction: column; height: 100%;
  border-radius: 22px; overflow: hidden;
  background: linear-gradient(180deg, #1a0b0e, #0f0607);
  border: 1px solid var(--line-strong);
  box-shadow: 0 40px 120px -20px rgba(0, 0, 0, .9), 0 0 0 1px rgba(255, 26, 46, .06), 0 0 80px -30px var(--glow);
}
.viewer-panel::before {
  content: ''; position: absolute; top: 0; left: 10%; right: 10%; height: 1px;
  background: linear-gradient(90deg, transparent, var(--red-hi), transparent);
}
.viewer-head {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 18px 20px; border-bottom: 1px solid var(--line);
}
.viewer-model { display: flex; align-items: center; gap: 14px; min-width: 0; }
.viewer-model .sigil { width: 46px; height: 46px; }
.viewer-model h3 { margin: 0; font: 700 20px/1.2 var(--display); }
.viewer-model p { margin: 2px 0 0; font-size: 13px; color: var(--muted); }

.viewer { height: fit-content; max-height: calc(100vh - 64px); width: min(760px, calc(100vw - 48px)); }
.viewer-panel { height: auto; max-height: calc(100vh - 64px); }
.viewer-body { flex: 1; min-height: 0; overflow-y: auto; padding: 16px; }

/* prompt "tabs": name + stats + actions, no text shown */
.prompt-list { display: flex; flex-direction: column; gap: 10px; }
.prompt-tab {
  display: flex; align-items: center; gap: 14px; padding: 14px 14px 14px 16px;
  border: 1px solid var(--line); border-radius: 14px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .025), rgba(255, 255, 255, .01));
  transition: border-color .25s, background .25s, box-shadow .3s;
  animation: cardIn .5s var(--ease) both;
}
.prompt-tab:hover { border-color: var(--line-strong); background: rgba(255, 26, 46, .05); }
.prompt-tab.is-target { border-color: rgba(255, 84, 104, .7); box-shadow: 0 0 0 3px rgba(255, 26, 46, .15), 0 0 30px -10px var(--glow); }
.prompt-icon {
  display: grid; place-items: center; width: 42px; height: 42px; flex: none; border-radius: 12px;
  color: var(--red-hi); background: rgba(255, 26, 46, .1); border: 1px solid var(--line-strong);
}
.prompt-info { min-width: 0; flex: 1; }
.prompt-info strong { display: block; font-weight: 600; font-size: 15px; overflow-wrap: anywhere; line-height: 1.35; }
.prompt-info span { display: block; margin-top: 2px; font-size: 12.5px; color: var(--dim); }
.prompt-actions { display: flex; align-items: center; gap: 8px; flex: none; }
.btn-copy .i-check { display: none; }
.btn-copy.copied .i-copy { display: none; }
.btn-copy.copied .i-check { display: block; }
.btn-copy.copied { background: linear-gradient(135deg, #ff7a88, #ff2a3e); }
.prompt-empty {
  padding: 48px 20px; text-align: center; color: var(--muted);
  border: 1px dashed var(--line-strong); border-radius: 14px;
}

@media (max-width: 760px) {
  .viewer { width: 100vw; height: 100dvh; max-height: 100dvh; margin: 0; }
  .viewer-panel { max-height: none; height: 100%; }
  .viewer-body { padding: 12px; }
  .prompt-tab { flex-wrap: wrap; }
  .prompt-actions { width: 100%; }
  .prompt-actions .btn { flex: 1; }
}

/* ---------- toast ---------- */
.toast-host {
  position: absolute; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 5;
  display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none;
}
.page-toast { position: fixed; z-index: 60; }
#toastHost { position: fixed; bottom: 28px; }
.toast {
  display: inline-flex; align-items: center; gap: 10px; padding: 10px 18px; border-radius: 999px;
  background: rgba(30, 10, 13, .95); border: 1px solid var(--line-strong); color: #fff; font-size: 14px; font-weight: 500;
  box-shadow: 0 16px 40px -10px rgba(0, 0, 0, .8), 0 0 30px -10px var(--glow);
  animation: toastIn .35s var(--ease) both;
}
.toast::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--red); box-shadow: 0 0 10px var(--red); }
.toast.out { animation: toastOut .3s ease-in both; }
@keyframes toastIn { from { opacity: 0; transform: translateY(12px) scale(.95); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(8px); } }

/* ---------- responsive ---------- */
@media (max-width: 760px) {
  .nav-inner { padding: 10px 16px; gap: 12px; }
  .brand-word { display: none; }
  .tabs { margin-right: auto; }
  .tab { padding: 7px 14px; }
  .discord-link.btn-sm span { display: none; }
  .discord-link.btn-sm { padding: 0 12px; }
  .container { padding: 0 16px; }
  .section { padding: 32px 16px 72px; }
  .hero { padding-left: 16px; padding-right: 16px; }
  .stats div { padding: 14px 6px; }
  .stats dt { font-size: 10.5px; letter-spacing: .08em; }
  .recent { grid-template-columns: 1fr; }
  .sort { width: 100%; }
  .sort button { flex: 1; height: 38px; padding: 0 6px; font-size: 13px; white-space: nowrap; }
  .search kbd { display: none; }
}

/* ---------- Discord login (nav) ---------- */
.auth { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.tabs + .auth { margin-left: 0; }
.btn-discord {
  color: #fff; background: #5865f2; border-color: transparent;
  box-shadow: 0 8px 24px -10px rgba(88, 101, 242, .8), inset 0 1px 0 rgba(255, 255, 255, .2);
}
.btn-discord:hover { background: #4752c4; transform: translateY(-1px); }
.auth-user {
  display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 12px 0 5px;
  border-radius: 999px; border: 1px solid var(--line); background: rgba(255, 255, 255, .03);
  font-size: 14px; font-weight: 600; max-width: 220px;
}
.auth-user img { width: 28px; height: 28px; border-radius: 50%; flex: none; }
.auth-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.auth-badge {
  flex: none; padding: 2px 8px; border-radius: 999px; font-size: 11px; letter-spacing: .04em;
  color: #fff; background: linear-gradient(135deg, var(--red-hi), var(--red-deep));
}

/* ---------- Cheats / Sources picker: two big squares ---------- */
.hub-pick { display: grid; grid-template-columns: repeat(2, minmax(0, 220px)); gap: 18px; margin-top: 30px; }
.hub-btn {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  aspect-ratio: 1; border-radius: 22px; border: 1px solid var(--line); overflow: hidden; isolation: isolate;
  background: radial-gradient(120% 90% at 50% 0%, rgba(255, 26, 46, .12), transparent 60%), var(--panel);
  transition: transform .4s var(--ease), border-color .3s, box-shadow .4s;
}
.hub-btn::before {
  content: ''; position: absolute; inset: 0; z-index: -1; opacity: 0; transition: opacity .35s;
  background: radial-gradient(80% 70% at 50% 30%, rgba(255, 26, 46, .28), transparent 70%);
}
.hub-btn:hover { transform: translateY(-5px); border-color: var(--line-strong); box-shadow: 0 24px 60px -24px rgba(255, 26, 46, .55); }
.hub-btn:hover::before, .hub-btn[aria-current="true"]::before { opacity: 1; }
.hub-btn[aria-current="true"] {
  border-color: rgba(255, 84, 104, .75);
  box-shadow: 0 0 0 3px rgba(255, 26, 46, .15), 0 24px 60px -24px rgba(255, 26, 46, .6);
}
.hub-icon {
  display: grid; place-items: center; width: 68px; height: 68px; border-radius: 20px; color: var(--red-hi);
  background: rgba(255, 26, 46, .1); border: 1px solid var(--line-strong);
  transition: transform .45s var(--ease), color .3s;
}
.hub-btn:hover .hub-icon, .hub-btn[aria-current="true"] .hub-icon { transform: scale(1.08) rotate(-4deg); color: #fff; }
.hub-btn strong { font: 700 clamp(18px, 2.4vw, 24px)/1.1 var(--display); }
.hub-count { font-size: 13px; color: var(--dim); min-height: 1.2em; }

.hub-content { padding-bottom: 96px; }
.hub-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 14px 0 18px; }
.hub-head h3 { margin: 0; font: 700 22px var(--display); }
.hub-hint { color: var(--dim); margin: 18px 0 0; }

/* ---------- post cards ---------- */
.post-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 18px; }
.post-card {
  display: flex; flex-direction: column; border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--line); background: var(--panel);
  transition: transform .4s var(--ease), border-color .3s, box-shadow .4s;
  animation: cardIn .6s var(--ease) both;
}
.post-card:hover { transform: translateY(-4px); border-color: var(--line-strong); box-shadow: 0 24px 60px -26px rgba(255, 26, 46, .55); }
.post-media { aspect-ratio: 16 / 9; background: rgba(0, 0, 0, .35); border-bottom: 1px solid var(--line); overflow: hidden; }
.post-media img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .6s var(--ease); }
.post-card:hover .post-media img { transform: scale(1.04); }
.post-placeholder {
  display: grid; place-items: center; width: 100%; height: 100%; color: rgba(255, 70, 90, .45);
  background: radial-gradient(60% 80% at 50% 40%, rgba(255, 26, 46, .14), transparent 70%);
}
.post-placeholder svg { width: 52px; height: 52px; }
.post-body { display: flex; flex-direction: column; flex: 1; padding: 16px 18px 16px; }
.post-body h4 { margin: 0; font: 700 18px/1.25 var(--display); overflow-wrap: anywhere; }
.post-desc { margin: 8px 0 0; color: var(--muted); font-size: 14.5px; white-space: pre-line; overflow-wrap: anywhere; }
.post-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: auto; padding-top: 16px; font-size: 13px; color: var(--dim); }
.post-actions { display: flex; align-items: center; gap: 8px; }
.post-actions .icon-btn:hover { color: #fff; background: rgba(255, 26, 46, .2); }

/* ---------- new post form ---------- */
.post-dialog { width: min(560px, calc(100vw - 32px)); }
.post-dialog .viewer-head h3 { margin: 0; font: 700 20px/1.2 var(--display); }
.post-dialog .viewer-head p { margin: 2px 0 0; font-size: 13px; color: var(--muted); }
.form-body { display: flex; flex-direction: column; gap: 16px; padding: 18px 20px; }
.field { display: flex; flex-direction: column; gap: 8px; }
.field > span { font-size: 13px; font-weight: 600; color: var(--muted); }
.field em { font-style: normal; color: var(--dim); font-weight: 500; }
.field input[type="text"], .field input[type="url"], .field textarea {
  width: 100%; padding: 11px 14px; border-radius: 12px; border: 1px solid var(--line);
  background: rgba(0, 0, 0, .25); color: var(--text); font: inherit; font-size: 15px; outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.field textarea { resize: vertical; min-height: 96px; }
.field input:focus, .field textarea:focus { border-color: rgba(255, 84, 104, .6); box-shadow: 0 0 0 4px rgba(255, 26, 46, .12); }
.image-drop {
  position: relative; display: grid; place-items: center; aspect-ratio: 16 / 9; border-radius: 14px; overflow: hidden;
  border: 1px dashed var(--line-strong); background: rgba(0, 0, 0, .25); cursor: pointer; transition: border-color .2s, background .2s;
}
.image-drop:hover, .image-drop.drag { border-color: var(--red-hi); background: rgba(255, 26, 46, .06); }
.image-drop img { width: 100%; height: 100%; object-fit: cover; }
.image-hint { color: var(--dim); font-size: 14px; padding: 0 16px; text-align: center; }
.image-drop input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.form-error { margin: 0; padding: 10px 14px; border-radius: 10px; font-size: 14px; color: #ffd0d5; background: rgba(255, 26, 46, .12); border: 1px solid var(--line-strong); }
.form-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--line); }
.post-dialog .toast-host { position: fixed; bottom: 28px; }

@media (max-width: 760px) {
  .nav-inner { gap: 8px; padding-left: 12px; padding-right: 12px; }
  .tabs { gap: 2px; padding: 3px; }
  .tab { padding: 7px 9px; font-size: 12.5px; }
  .brand-mark { width: 28px; height: 20px; }
  .auth-name, .auth-badge, .btn-discord span { display: none; }
  .auth-user { padding: 0 5px; }
  .btn-discord { padding: 0 12px; }
  .hub-pick { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .post-grid { grid-template-columns: 1fr; }
  .page-title { font-size: clamp(30px, 10vw, 40px); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .marquee-track { animation: none; }
}
