/* Design tokens */
:root {
  --bg: #0a0a0b;
  --panel: #12121a;
  --text: #e6e8ef;
  --muted: #b1acc5;
  --primary: #8b5cf6; /* violet */
  --primary-contrast: #0a0a0b;
  --danger: #ff6b6b;
  --ring: #2b2240;
  --card: #0e0e14;
  --border: #241f35;
  --ease-out: cubic-bezier(.2,.8,.2,1);
  --ease-in-out: cubic-bezier(.4,0,.2,1);
  --duration-fast: 140ms;
  --duration-med: 260ms;
  color-scheme: dark light;
}

[data-theme="light"] {
  --bg: #fafafa;
  --panel: #ffffff;
  --text: #0f172a;
  --muted: #4b5563;
  --primary: #7c3aed; /* violet */
  --primary-contrast: #ffffff;
  --danger: #e11d48;
  --ring: #dcd7fe;
  --card: #ffffff;
  --border: #e5e7eb;
}

html, body {
  height: 100%;
}

html {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
}

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  background: linear-gradient(180deg, var(--bg), #0b0c10 60%);
  color: var(--text);
}
body.no-scroll { overflow: hidden; }

/* Animated purple lights background */
.bg-lights { position: fixed; inset: 0; z-index: -1; overflow: hidden; }
.bg-lights .light { position: absolute; width: 42vmax; height: 42vmax; background: radial-gradient(closest-side, rgba(139,92,246,.18), rgba(139,92,246,0)); filter: blur(40px); animation: drift 24s var(--ease-in-out) infinite alternate; }
.bg-lights .l1 { left: -10vmax; top: -10vmax; }
.bg-lights .l2 { right: -8vmax; top: 10vmax; animation-duration: 28s; }
.bg-lights .l3 { left: 20vmax; bottom: -12vmax; animation-duration: 32s; }

@keyframes drift { from { transform: translate3d(0,0,0); } to { transform: translate3d(4vmax, -3vmax, 0); } }

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px clamp(16px, 4vw, 32px);
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0));
  position: sticky;
  top: 0;
  backdrop-filter: saturate(1.4) blur(12px);
  z-index: 10;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  box-shadow: 0 0 0 1px var(--border) inset;
}

.titles h1 {
  font-size: 28px;
  line-height: 1.2;
  margin: 0;
}
.titles .tagline {
  margin: 2px 0 0 0;
  color: var(--muted);
  font-size: 13px;
}

.center-slogan { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); color: var(--muted); font-weight: 500; }
.actions { display: flex; align-items: center; gap: 10px; }

.btn {
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(255,255,255,.03), rgba(255,255,255,0));
  color: var(--text);
  border-radius: 10px;
  padding: 10px 14px;
  cursor: pointer;
  font: inherit;
}
.btn:hover { border-color: var(--ring); }
.btn-primary { background: var(--primary); color: var(--primary-contrast); border-color: transparent; }
.btn-primary:hover { filter: brightness(1.05); }
.btn[disabled] { opacity: .6; cursor: not-allowed; }
.center-slogan { transition: opacity var(--duration-med) var(--ease-in-out); }
.actions { display: flex; }
.cta {
  text-decoration: none;
  color: var(--text);
  border: 1px solid var(--border);
  padding: 8px 12px;
  border-radius: 10px;
}

.tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 12px clamp(16px, 4vw, 32px) 0;
  margin-top: 12px;
  margin-bottom: 12px;
}

.tab {
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,0));
  backdrop-filter: blur(8px) saturate(1.1);
  color: var(--text);
  cursor: pointer;
  font: inherit;
  transition: background-color var(--duration-med) var(--ease-out),
              border-color var(--duration-med) var(--ease-out),
              color var(--duration-med) var(--ease-out),
              outline-color var(--duration-fast) var(--ease-out);
}
.tab[aria-selected="true"] {
  outline: 2px solid var(--primary);
  outline-offset: 0;
}
.tab:hover { border-color: var(--ring); }

.controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px clamp(16px, 4vw, 32px);
  margin-bottom: 12px;
}
.search {
  flex: 1 1 auto;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  font: inherit;
  transition: border-color var(--duration-fast) var(--ease-out),
              background-color var(--duration-med) var(--ease-out),
              box-shadow var(--duration-fast) var(--ease-out);
}
.search::placeholder { color: var(--muted); font: inherit; }
.search:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(139,92,246,.18); }

/* Ensure form controls inherit Inter */
button, input, select, textarea { font: inherit; }
.counts { color: var(--muted); font-size: 14px; }

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
  padding: 16px clamp(16px, 4vw, 32px) 40px;
}

.card {
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,0));
  backdrop-filter: blur(10px) saturate(1.1);
  border-radius: 16px;
  padding: 14px;
  padding-bottom: 30px; /* leave space for score badge */
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: transform var(--duration-fast) var(--ease-out),
              box-shadow var(--duration-fast) var(--ease-out),
              border-color var(--duration-fast) var(--ease-out);
  will-change: transform;
  position: relative;
  cursor: pointer;
  min-height: 116px;
}
.card:hover { transform: translateY(-2px); border-color: var(--ring); box-shadow: 0 4px 20px rgba(0,0,0,.25); }
/* Remove full-card link for modal behavior */
.card .card-link { display: none; }

/* Modal styles */
.modal[aria-hidden="true"] { display: none; }
.modal {
  position: fixed; inset: 0; z-index: 50;
}
.modal-backdrop {
  position: absolute; inset: 0; background: rgba(0,0,0,.6);
  backdrop-filter: blur(4px);
}
.modal-dialog {
  position: relative;
  width: min(920px, calc(100% - 24px));
  margin: 8vh auto;
  background: linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,0));
  backdrop-filter: blur(12px) saturate(1.1);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 20px 60px rgba(0,0,0,.45);
  max-height: 82vh;
  overflow: auto;
  overscroll-behavior: contain;
}
.modal.open .modal-backdrop { animation: fadeIn var(--duration-med) var(--ease-out) both; }
.modal.open .modal-dialog { animation: rise var(--duration-med) var(--ease-out) both; }
.modal.closing .modal-backdrop { animation: fadeOut var(--duration-med) var(--ease-out) both; }
.modal.closing .modal-dialog { animation: sink var(--duration-med) var(--ease-out) both; }
.modal-close { position: absolute; top: 8px; right: 10px; border: 1px solid var(--border); background: transparent; color: var(--text); border-radius: 8px; padding: 4px 8px; cursor: pointer; }
.modal-header { display: flex; align-items: center; gap: 12px; }
.modal-titles h2 { margin: 0; font-size: 22px; }
.modal-titles a { color: var(--muted); text-decoration: none; font-size: 13px; }
.modal-desc { color: var(--muted); }
.modal-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 12px; }
.modal-scores { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.modal-scores .score { border: 1px solid var(--border); border-radius: 12px; padding: 12px; background: var(--card); }
.modal-scores h3 { margin: 0 0 8px 0; font-size: 14px; color: var(--text); }
.modal-scores ul { margin: 0; padding-left: 18px; color: var(--text); }
/* Request form */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 8px; }
.field.full { grid-column: 1 / -1; }
.input, .textarea, .select {
  padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--panel); color: var(--text); font: inherit;
}
.textarea { resize: vertical; }
.radio-row { display: flex; gap: 12px; align-items: center; }
.form-actions { display: flex; gap: 12px; align-items: center; justify-content: center; margin-top: 8px; }
.form-actions.full { grid-column: 1 / -1; }

/* Modal images */
.modal-images { margin-top: 24px; }
.modal-images h3 { margin: 0 0 10px 0; font-size: 20px; font-weight: 600; color: var(--text); text-align: center; }
.images-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.images-grid img { width: 100%; height: auto; border-radius: 10px; border: 1px solid var(--border); background: #0a0a0b; object-fit: cover; }

/* Score badge on cards */
.score-badge {
  position: absolute; bottom: 10px; right: 10px;
  font-weight: 700; font-size: 14px;
  padding: 6px 8px; border-radius: 10px;
  background: rgba(0,0,0,.35);
  border: 1px solid var(--border);
}
.score-badge[data-score] { color: #a7f3d0; }

.modal-score { margin: 8px 0 6px; font-weight: 700; }
.modal-warning { margin-top: 12px; border: 1px solid rgba(255,107,107,.35); background: rgba(255,107,107,.08); border-radius: 12px; padding: 12px; }
.modal-warning h3 { margin: 0 0 6px 0; color: var(--danger); }

@keyframes fadeIn { from { opacity: 0 } to { opacity: 1 } }
@keyframes rise { from { opacity: 0; transform: translateY(12px) } to { opacity: 1; transform: translateY(0) } }

/* Cascade reveal for cards */
.card.reveal { animation: fadeUp var(--duration-med) var(--ease-out) both; animation-delay: calc(var(--i, 0) * 60ms); }

.card-header { display: flex; align-items: center; gap: 12px; }
.card-title { display: flex; flex-direction: column; gap: 2px; }
.card-title h3 { margin: 0; font-size: 16px; }
.card-title a { color: var(--muted); text-decoration: none; font-size: 13px; }

.card .desc { color: var(--muted); font-size: 14px; }

.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
.tag {
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.03);
}

.pill {
  align-self: start;
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
}
.pill.trusted { background: var(--primary); color: var(--primary-contrast); border-color: transparent; }
.pill.scam { background: rgba(255, 107, 107, .12); color: var(--danger); border-color: rgba(255, 107, 107, .3); }

/* Footer removed */

.noscript {
  margin: 16px clamp(16px, 4vw, 32px);
  padding: 12px 14px;
  border: 1px dashed var(--border);
  border-radius: 10px;
  color: var(--muted);
}

@media (max-width: 640px) {
  .controls { flex-direction: column; align-items: stretch; }
  .counts { text-align: right; }
}

/* Reduced motion accessibility */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

@keyframes fadeUp {
  0% { opacity: 0.001; transform: translateY(6px); }
  100% { opacity: 1; transform: translateY(0); }
}
@keyframes fadeOut { from { opacity: 1 } to { opacity: 0 } }
@keyframes sink { from { opacity: 1; transform: translateY(0) } to { opacity: 0; transform: translateY(12px) } }

/* Initial entrance animations */
.site-header { animation: rise var(--duration-med) var(--ease-out) both; animation-delay: 10ms; }
.tabs { animation: fadeUp var(--duration-med) var(--ease-out) both; animation-delay: 80ms; }
.controls { animation: fadeUp var(--duration-med) var(--ease-out) both; animation-delay: 140ms; }

