/* =========================================================
   Glassmorphism 2.0 theme
   Layered frosted surfaces, gradient edge highlights,
   aurora background, grain, depth via soft shadows.
   ========================================================= */
:root {
  --bg: #0c1024;
  --ink: #f3f4fb;
  --ink-2: rgba(236, 238, 250, 0.74);
  --ink-3: rgba(236, 238, 250, 0.52);
  --glass: rgba(255, 255, 255, 0.075);
  --glass-strong: rgba(255, 255, 255, 0.12);
  --glass-hover: rgba(255, 255, 255, 0.11);
  --edge: rgba(255, 255, 255, 0.16);
  --edge-hi: rgba(255, 255, 255, 0.55);
  --mint: #7ef0d0;
  --violet: #a78bfa;
  --peach: #ffb38a;
  --sky: #7cc8ff;
  --rose: #ff8fb8;
  --radius: 22px;
  --radius-sm: 14px;
  --blur: 22px;
  --shadow: 0 1px 0 rgba(255,255,255,.08) inset, 0 20px 50px -20px rgba(3, 6, 25, .65), 0 6px 18px -8px rgba(3, 6, 25, .5);
  --font: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --display: "Fraunces", Georgia, serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: inherit; }
button { font: inherit; color: inherit; cursor: pointer; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 100; padding: 8px 14px; border-radius: 10px; background: #fff; color: #111; }
.skip:focus { left: 8px; }
:focus-visible { outline: 2px solid var(--mint); outline-offset: 3px; border-radius: 10px; }

.wrap { width: min(1200px, 100% - 32px); margin-inline: auto; }

/* ---------- Soft rainbow background ---------- */
.aurora { position: fixed; inset: 0; z-index: -2; overflow: hidden; background:
  linear-gradient(180deg, #0f1124 0%, #0c0e1f 100%); }
/* faint full-spectrum wash underneath */
.aurora::before { content: ""; position: absolute; inset: -20%; opacity: .16; filter: blur(80px);
  background: conic-gradient(from 210deg at 50% 50%, #ff6b6b, #ffb36b, #ffe66b, #7ee08a, #6bc7ff, #8f7bff, #e07bff, #ff6b6b);
  animation: spin 90s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.blob { position: absolute; border-radius: 50%; filter: blur(90px); opacity: .26; will-change: transform; }
.b1 { width: 40vmax; height: 40vmax; left: -12vmax; top: -14vmax; background: radial-gradient(circle, #ff7a8a, transparent 65%); animation: drift1 30s ease-in-out infinite alternate; }
.b2 { width: 34vmax; height: 34vmax; left: 30vmax; top: -18vmax; background: radial-gradient(circle, #ffc078, transparent 65%); opacity: .2; animation: drift2 34s ease-in-out infinite alternate; }
.b3 { width: 36vmax; height: 36vmax; right: -12vmax; top: 4vmax; background: radial-gradient(circle, #ffe27a, transparent 65%); opacity: .14; animation: drift3 36s ease-in-out infinite alternate; }
.b4 { width: 38vmax; height: 38vmax; right: 6vmax; bottom: -16vmax; background: radial-gradient(circle, #7fe3a0, transparent 65%); opacity: .2; animation: drift1 38s ease-in-out infinite alternate-reverse; }
.b5 { width: 40vmax; height: 40vmax; left: 10vmax; bottom: -20vmax; background: radial-gradient(circle, #6fb8ff, transparent 65%); opacity: .24; animation: drift2 32s ease-in-out infinite alternate-reverse; }
.b6 { width: 30vmax; height: 30vmax; left: -10vmax; top: 30vmax; background: radial-gradient(circle, #a98bff, transparent 65%); opacity: .26; animation: drift3 40s ease-in-out infinite alternate; }
@keyframes drift1 { to { transform: translate(8vmax, 6vmax) scale(1.1); } }
@keyframes drift2 { to { transform: translate(-10vmax, 8vmax) scale(.9); } }
@keyframes drift3 { to { transform: translate(6vmax, -8vmax) scale(1.15); } }
.grain { position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: .07; mix-blend-mode: overlay;
  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='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }

/* ---------- Glass surface ---------- */
.glass {
  position: relative;
  background: linear-gradient(145deg, rgba(255,255,255,.12), rgba(255,255,255,.04));
  -webkit-backdrop-filter: blur(var(--blur)) saturate(160%);
  backdrop-filter: blur(var(--blur)) saturate(160%);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  isolation: isolate;
}
/* gradient hairline border with light catching top-left edge */
.glass::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px; pointer-events: none;
  background: linear-gradient(140deg, var(--edge-hi), rgba(255,255,255,.08) 35%, rgba(255,255,255,.04) 65%, rgba(255,255,255,.22));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .glass { background: rgba(28, 32, 62, .92); }
}

/* ---------- Hero ---------- */
.hero { padding: clamp(40px, 8vw, 96px) 0 28px; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; margin: 0 0 18px; padding: 6px 14px; border-radius: 999px;
  font-size: 13px; font-weight: 600; letter-spacing: .02em; color: var(--ink-2);
  background: rgba(255,255,255,.07); border: 1px solid var(--edge); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
.eyebrow .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 12px var(--mint); }
h1 { font-family: var(--display); font-weight: 650; font-size: clamp(38px, 7vw, 76px); line-height: 1.02; letter-spacing: -.02em; margin: 0 0 18px; }
h1 em { font-style: italic; font-weight: 500;
  background: linear-gradient(100deg, #ff9aa8, #ffc98f 22%, #fff0a0 40%, #a8f0c0 58%, #9ad4ff 76%, #c4a8ff); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lede { max-width: 620px; margin: 0; font-size: clamp(16px, 2vw, 18px); color: var(--ink-2); }

.stats { list-style: none; display: flex; flex-wrap: wrap; gap: 10px; padding: 0; margin: 28px 0 0; }
.stats li { padding: 10px 16px; border-radius: 16px; background: rgba(255,255,255,.06); border: 1px solid var(--edge);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); font-size: 14px; color: var(--ink-2); }
.stats strong { display: block; font-family: var(--display); font-size: 24px; font-weight: 650; color: var(--ink); line-height: 1.1; }

.crisis { display: flex; align-items: center; gap: 14px; margin-top: 26px; padding: 14px 18px; border-radius: 18px;
  background: linear-gradient(135deg, rgba(255,143,184,.16), rgba(255,179,138,.08)); }
.crisis p { margin: 0; font-size: 14.5px; }
.crisis-icon { flex: none; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; color: var(--rose); background: rgba(255,143,184,.16); }
.crisis-links { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 4px; }
.crisis-links a { color: var(--ink-2); text-decoration: none; border-bottom: 1px dashed rgba(255,255,255,.35); }
.crisis-links a:hover { color: var(--ink); border-color: var(--ink); }

/* ---------- Layout ---------- */
.layout { display: grid; grid-template-columns: 290px minmax(0, 1fr); gap: 24px; align-items: start; padding-bottom: 40px; }
.toolbar { grid-column: 1 / -1; display: flex; gap: 10px; padding: 10px; position: sticky; top: 12px; z-index: 20; border-radius: 20px; }
.search { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; padding: 0 14px; border-radius: 14px; background: rgba(255,255,255,.06); border: 1px solid transparent; transition: border-color .2s, background .2s; }
.search:focus-within { border-color: rgba(126,240,208,.55); background: rgba(255,255,255,.09); }
.search svg { color: var(--ink-3); flex: none; }
.search input { flex: 1; min-width: 0; height: 46px; border: 0; outline: 0; background: transparent; color: var(--ink); font: inherit; font-size: 16px; }
.search input::placeholder { color: var(--ink-3); }
.search input::-webkit-search-cancel-button { filter: invert(1); opacity: .6; }

.filter-toggle { flex: none; display: none; align-items: center; gap: 8px; padding: 0 16px; height: 46px; border-radius: 14px; border: 1px solid var(--edge); background: rgba(255,255,255,.08); font-weight: 600; }
.badge { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px; font-size: 12px; font-weight: 700; background: var(--mint); color: #0b1a17; }

.filters { position: sticky; top: 92px; padding: 22px; max-height: calc(100vh - 110px); overflow: auto; scrollbar-width: thin; }
.sheet-head { display: none; }
.filters fieldset { border: 0; padding: 0; margin: 0 0 22px; }
.filters legend { padding: 0; margin-bottom: 10px; font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { padding: 8px 14px; border-radius: 999px; font-size: 14px; font-weight: 600; color: var(--ink-2);
  background: rgba(255,255,255,.06); border: 1px solid var(--edge); transition: all .18s ease; }
.chip:hover { background: rgba(255,255,255,.12); color: var(--ink); }
.chip[aria-pressed="true"] { color: #0b1a17; border-color: transparent;
  background: linear-gradient(135deg, var(--mint), #b8f5e4); box-shadow: 0 6px 20px -6px rgba(126,240,208,.6), inset 0 1px 0 rgba(255,255,255,.7); }
.hint { margin: 10px 0 0; font-size: 12.5px; color: var(--ink-3); }
.select { position: relative; }
.select::after { content: ""; position: absolute; right: 16px; top: 50%; width: 8px; height: 8px; border-right: 2px solid var(--ink-2); border-bottom: 2px solid var(--ink-2); transform: translateY(-70%) rotate(45deg); pointer-events: none; }
.select select { width: 100%; height: 44px; padding: 0 40px 0 14px; border-radius: 12px; border: 1px solid var(--edge); background: rgba(255,255,255,.06); color: var(--ink); font: inherit; font-size: 15px; appearance: none; -webkit-appearance: none; }
.select option { background: #1a1f3d; color: var(--ink); }
.sheet-foot { display: flex; gap: 10px; }


.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 18px; border-radius: 12px; font-weight: 700; font-size: 14.5px; text-decoration: none; border: 1px solid var(--edge); transition: transform .15s ease, background .2s, box-shadow .2s; white-space: nowrap; }
.btn:active { transform: scale(.97); }
.btn.ghost { background: rgba(255,255,255,.06); color: var(--ink); }
.btn.ghost:hover { background: rgba(255,255,255,.12); }
.btn.primary { color: #0b1a17; border-color: transparent; background: linear-gradient(135deg, var(--mint), #b6f6e5 60%, #d8fff4); box-shadow: 0 8px 24px -10px rgba(126,240,208,.8), inset 0 1px 0 rgba(255,255,255,.8); }
.btn.primary:hover { box-shadow: 0 12px 30px -10px rgba(126,240,208,.95), inset 0 1px 0 rgba(255,255,255,.8); }
.icon-btn { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--edge); background: rgba(255,255,255,.06); }

/* ---------- Results ---------- */
.result-meta { margin: 0 0 14px; font-size: 14px; color: var(--ink-3); }
.result-meta strong { color: var(--ink); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 18px; }

.card { display: flex; flex-direction: column; padding: 22px; transition: transform .25s ease, background .25s ease; animation: rise .45s ease both; }
.card:hover { transform: translateY(-3px); background: linear-gradient(145deg, rgba(255,255,255,.15), rgba(255,255,255,.05)); }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }
.card-top { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.num { flex: none; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 11px; font-size: 13px; font-weight: 700; color: var(--ink-2); background: rgba(255,255,255,.08); border: 1px solid var(--edge); }
.card h3 { margin: 2px 0 0; font-family: var(--display); font-size: 21px; font-weight: 650; line-height: 1.2; letter-spacing: -.005em; }

.price { margin: 0 0 14px; padding: 14px 16px; border-radius: var(--radius-sm); background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.08); }
.price-label { display: block; font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 2px; }
.price-main { font-size: 17px; font-weight: 700; color: var(--ink); }
.price-note { display: block; margin-top: 4px; font-size: 13.5px; color: var(--mint); }
.from-tag { float: right; margin-left: 10px; padding: 3px 9px; border-radius: 99px; font-size: 12px; font-weight: 700; color: #0b1a17; background: var(--peach); }
.from-tag.free { background: var(--mint); }

.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.tag { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 99px; font-size: 12.5px; font-weight: 600; color: var(--ink-2); background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.1); }
.tag i { width: 7px; height: 7px; border-radius: 50%; }
.tag.on i { background: var(--sky); }
.tag.off i { background: rgba(255,255,255,.35); }
.tag.queer { background: linear-gradient(90deg, rgba(255,143,184,.18), rgba(167,139,250,.18), rgba(124,200,255,.18)); color: var(--ink); }
.tag.trainee i { background: var(--peach); }

.meta { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 8px; font-size: 14px; color: var(--ink-2); }
.meta li { display: flex; gap: 10px; }
.meta svg { flex: none; margin-top: 3px; color: var(--ink-3); }
.notes { margin: 0 0 16px; font-size: 14px; color: var(--ink-2); }
.notes.clamp { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.more { margin: -10px 0 16px; padding: 0; border: 0; background: none; font-size: 13px; font-weight: 700; color: var(--mint); }

.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; }
.actions .btn { flex: 1 1 auto; white-space: normal; text-align: center; min-height: 44px; height: auto; padding-block: 10px; }
.layout > *, .card { min-width: 0; }

.empty { padding: 40px 24px; text-align: center; }
.empty h3 { font-family: var(--display); font-size: 24px; margin: 0 0 6px; }
.empty p { margin: 0 0 18px; color: var(--ink-2); }

.footer { padding: 24px 0 48px; border-top: 1px solid rgba(255,255,255,.08); font-size: 14px; color: var(--ink-2); }
.footer p { margin: 0 0 6px; max-width: 760px; }
.muted { color: var(--ink-3); }
.scrim { display: none; }

/* ---------- Tablet / mobile ---------- */
@media (max-width: 900px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .toolbar { top: 8px; }
  .filter-toggle { display: inline-flex; }
  .filters {
    position: fixed; left: 0; right: 0; bottom: 0; top: auto; z-index: 60;
    max-height: 86vh; border-radius: 26px 26px 0 0; padding: 18px 18px calc(18px + env(safe-area-inset-bottom));
    background: linear-gradient(160deg, rgba(40,44,88,.82), rgba(20,24,52,.9));
    transform: translateY(105%); transition: transform .35s cubic-bezier(.2,.8,.2,1); visibility: hidden;
  }
  .filters.open { transform: none; visibility: visible; }
  .sheet-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
  .sheet-head::before { content: ""; position: absolute; top: 8px; left: 50%; width: 40px; height: 4px; margin-left: -20px; border-radius: 4px; background: rgba(255,255,255,.3); }
  .sheet-head h2 { margin: 0; font-family: var(--display); font-size: 22px; }
  .sheet-foot { position: sticky; bottom: 0; padding-top: 6px; }
  .sheet-foot .btn { flex: 1; }

  .scrim { display: block; position: fixed; inset: 0; z-index: 50; background: rgba(5,7,20,.5); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
  .scrim[hidden] { display: none; }
  body.sheet-open { overflow: hidden; }
}
@media (max-width: 520px) {
  .wrap { width: calc(100% - 24px); }
  .card { padding: 18px; }
  .stats li { flex: 1 1 calc(50% - 10px); }
  .crisis { align-items: flex-start; }
  :root { --blur: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* state fixes */
.badge[hidden], [hidden] { display: none !important; }
.btn.sheet-only { display: none; }
@media (max-width: 900px) { .btn.sheet-only { display: inline-flex; } }
