/* Reset and base */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #0f0f1a;
  --bg-card: #1a1a2e;
  --bg-card-hover: #222240;
  --bg-input: #16162a;
  --border: #2a2a4a;
  --border-focus: #f59e0b;
  --text: #e8e8f0;
  --text-muted: #9090b0;
  --text-dim: #6a6a8a;
  --accent: #f59e0b;
  --accent-light: #fbbf24;
  --accent-dim: #b45309;
  --danger: #ef4444;
  --success: #22c55e;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 4px 24px rgba(0,0,0,0.3);
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --transition: 0.2s ease;
}

html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

a { color: var(--accent-light); text-decoration: none; }
a:hover, a:focus-visible { text-decoration: underline; }

.skip-link {
  position: absolute; top: -100%; left: 16px;
  background: var(--accent); color: #000;
  padding: 8px 16px; border-radius: var(--radius-sm);
  z-index: 100; font-weight: 600;
}
.skip-link:focus { top: 16px; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(15,15,26,0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  max-width: 1200px; margin: 0 auto;
  padding: 12px 24px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px;
}
.logo {
  display: flex; align-items: center; gap: 10px;
  color: var(--text); font-weight: 700; font-size: 1.15rem;
  text-decoration: none;
}
.logo:hover, .logo:focus-visible { text-decoration: none; }
.logo-icon { width: 32px; height: 32px; flex-shrink: 0; }
.logo-accent { color: var(--accent); }

.site-nav {
  display: flex; gap: 8px;
}
.nav-link {
  color: var(--text-muted); padding: 6px 14px;
  border-radius: var(--radius-sm); font-size: 0.9rem;
  transition: background var(--transition), color var(--transition);
}
.nav-link:hover, .nav-link:focus-visible {
  color: var(--text); background: var(--bg-card-hover);
  text-decoration: none;
}

/* Hero */
.hero {
  max-width: 1200px; margin: 0 auto;
  padding: 80px 24px 60px;
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 48px; align-items: center;
}
.hero-content h1 {
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.15; margin-bottom: 16px;
  background: linear-gradient(135deg, var(--text), var(--accent-light));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero-sub {
  font-size: 1.15rem; color: var(--text-muted);
  margin-bottom: 28px; max-width: 480px;
}
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }

.hero-visual {
  position: relative; height: 260px;
  display: flex; align-items: center; justify-content: center;
}
.stack-card {
  position: absolute;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 24px;
  font-weight: 600;
  font-size: 1rem;
  box-shadow: var(--shadow);
  transition: transform 0.3s ease;
}
.stack-card.stack-1 {
  top: 0; left: 50%; transform: translateX(-50%);
  border-color: var(--accent); color: var(--accent-light);
  z-index: 3;
}
.stack-card.stack-2 {
  top: 60px; left: 30%; transform: translateX(-50%) rotate(-3deg);
  z-index: 2; opacity: 0.85;
}
.stack-card.stack-3 {
  top: 120px; left: 60%; transform: translateX(-50%) rotate(2deg);
  z-index: 1; opacity: 0.7;
}

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 10px 22px; border-radius: var(--radius-sm);
  font-size: 0.95rem; font-weight: 600;
  cursor: pointer; border: 2px solid transparent;
  transition: all var(--transition);
  font-family: var(--font);
}
.btn-primary {
  background: var(--accent); color: #000;
  border-color: var(--accent);
}
.btn-primary:hover, .btn-primary:focus-visible {
  background: var(--accent-light); border-color: var(--accent-light);
  text-decoration: none;
}
.btn-ghost {
  background: transparent; color: var(--text-muted);
  border-color: var(--border);
}
.btn-ghost:hover, .btn-ghost:focus-visible {
  color: var(--text); border-color: var(--text-muted);
  text-decoration: none;
}
.btn-sm { padding: 6px 14px; font-size: 0.85rem; }
.btn-danger-sm {
  background: transparent; color: var(--danger);
  border: none; cursor: pointer; font-size: 0.8rem;
  padding: 4px 8px; font-family: var(--font);
}
.btn-danger-sm:hover, .btn-danger-sm:focus-visible {
  text-decoration: underline;
}

/* Sections */
section { padding: 60px 24px; }
.section-header {
  max-width: 720px; margin: 0 auto 36px;
  text-align: center;
}
.section-header h2 {
  font-size: clamp(1.5rem, 3vw, 2rem);
  margin-bottom: 8px;
}
.section-header p { color: var(--text-muted); }

/* Ranker */
.ranker-section {
  max-width: 1200px; margin: 0 auto;
  padding: 60px 24px;
}
.ranker-layout {
  display: grid; grid-template-columns: 320px 1fr;
  gap: 32px; align-items: start;
}
.ranker-controls {
  position: sticky; top: 80px;
  display: flex; flex-direction: column; gap: 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}
.control-group { display: flex; flex-direction: column; gap: 6px; }
.control-label {
  font-size: 0.8rem; font-weight: 600;
  color: var(--text-muted); text-transform: uppercase;
  letter-spacing: 0.05em;
}
.control-select, .control-input {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 10px 14px;
  font-size: 0.95rem;
  font-family: var(--font);
  transition: border-color var(--transition);
}
.control-select:focus, .control-input:focus {
  outline: none; border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(245,158,11,0.15);
}
.add-row { display: flex; gap: 8px; }
.add-row .control-input { flex: 1; }
.control-actions {
  display: flex; flex-wrap: wrap; gap: 8px;
  padding-top: 8px; border-top: 1px solid var(--border);
}

/* Rank list */
.ranker-cards { min-height: 200px; }
.cards-heading {
  font-size: 1.1rem; margin-bottom: 16px;
  color: var(--text-muted);
}
.card-count { font-weight: 400; font-size: 0.85rem; }
.empty-state {
  background: var(--bg-card);
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 40px; text-align: center;
  color: var(--text-dim);
}
.rank-list {
  list-style: none;
  display: flex; flex-direction: column; gap: 10px;
}
.rank-item {
  display: flex; align-items: center; gap: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  transition: all var(--transition);
  cursor: grab;
}
.rank-item:hover { background: var(--bg-card-hover); }
.rank-item.dragging {
  opacity: 0.5; border-color: var(--accent);
}
.rank-item.drag-over { border-color: var(--accent-light); border-style: dashed; }
.rank-number {
  font-weight: 700; font-size: 1.1rem;
  color: var(--accent); min-width: 28px;
  text-align: center;
}
.rank-title { flex: 1; font-weight: 500; }
.rank-handle {
  color: var(--text-dim); cursor: grab;
  padding: 4px; font-size: 1.1rem;
  user-select: none;
}
.rank-handle:active { cursor: grabbing; }
.rank-arrows {
  display: flex; flex-direction: column; gap: 2px;
}
.arrow-btn {
  background: none; border: none; color: var(--text-dim);
  cursor: pointer; font-size: 0.75rem; padding: 0 4px;
  font-family: var(--font); line-height: 1;
}
.arrow-btn:hover, .arrow-btn:focus-visible { color: var(--accent); }

/* Results */
.results-section {
  max-width: 1200px; margin: 0 auto;
  padding: 60px 24px;
}
.results-layout {
  display: grid; grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}
.result-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
}
.result-card h3 {
  font-size: 1.05rem; margin-bottom: 16px;
  color: var(--accent-light);
}
.card-desc { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 12px; }
.muted-note { color: var(--text-dim); font-size: 0.9rem; }

/* Score */
.score-display {
  display: flex; align-items: baseline; gap: 4px;
  margin-bottom: 8px;
}
.score-value {
  font-size: 3rem; font-weight: 800;
  color: var(--accent); line-height: 1;
}
.score-max { font-size: 1.2rem; color: var(--text-dim); }
.score-label { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 16px; }
.score-bar {
  height: 8px; background: var(--bg-input);
  border-radius: 4px; overflow: hidden;
}
.score-bar-fill {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--accent-dim), var(--accent-light));
  border-radius: 4px;
  transition: width 0.6s ease;
}

/* Comparison table */
.comparison-table {
  width: 100%; border-collapse: collapse;
  font-size: 0.9rem;
}
.comparison-table th {
  text-align: left; padding: 8px 12px;
  color: var(--text-muted); font-size: 0.8rem;
  text-transform: uppercase; letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border);
}
.comparison-table td {
  padding: 10px 12px; border-bottom: 1px solid var(--border);
}
.comparison-table tr:last-child td { border-bottom: none; }
.match-cell { font-weight: 600; }
.match-high { color: var(--success); }
.match-mid { color: var(--accent); }
.match-low { color: var(--danger); }

/* Blind spots */
.blindspot-list {
  list-style: none; display: flex; flex-direction: column; gap: 8px;
}
.blindspot-list li {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px;
  background: var(--bg-input);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
}
.blindspot-add {
  background: none; border: 1px solid var(--border);
  color: var(--accent); cursor: pointer;
  font-size: 0.8rem; padding: 2px 8px;
  border-radius: 4px; font-family: var(--font);
  flex-shrink: 0;
}
.blindspot-add:hover, .blindspot-add:focus-visible {
  background: var(--accent); color: #000;
}

/* Taste card */
.taste-card-preview {
  background: linear-gradient(135deg, #1a1a2e, #2a1a3e);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 20px;
  margin-bottom: 16px;
}
.taste-card-inner { text-align: center; }
.taste-card-title {
  font-weight: 700; font-size: 1.1rem;
  color: var(--accent-light); margin-bottom: 4px;
}
.taste-card-sub { color: var(--text-dim); font-size: 0.85rem; }
.taste-card-list {
  list-style: none; margin-top: 12px;
  text-align: left;
}
.taste-card-list li {
  padding: 4px 0; font-size: 0.85rem;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.taste-card-list li:last-child { border-bottom: none; }
.taste-card-score {
  margin-top: 12px; font-size: 0.9rem;
  color: var(--text-muted);
}
.profile-actions { display: flex; gap: 8px; }

/* Guide */
.guide-section {
  max-width: 1200px; margin: 0 auto;
  padding: 60px 24px;
}
.guide-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 24px; margin-bottom: 48px;
}
.guide-block {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}
.guide-block h3 {
  font-size: 1rem; margin-bottom: 10px;
  color: var(--accent-light);
}
.guide-block p { color: var(--text-muted); font-size: 0.9rem; }

.guide-faq { margin-bottom: 48px; }
.guide-faq h3 {
  font-size: 1.2rem; margin-bottom: 16px;
}
.guide-faq details {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  overflow: hidden;
}
.guide-faq summary {
  padding: 14px 20px; cursor: pointer;
  font-weight: 600; font-size: 0.95rem;
  color: var(--text);
  list-style: none;
  display: flex; align-items: center; justify-content: space-between;
}
.guide-faq summary::-webkit-details-marker { display: none; }
.guide-faq summary::after {
  content: '+'; font-size: 1.2rem;
  color: var(--accent); transition: transform 0.2s;
}
.guide-faq details[open] summary::after { content: '−'; }
.guide-faq details p {
  padding: 0 20px 16px;
  color: var(--text-muted); font-size: 0.9rem;
}

.guide-notes {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}
.guide-notes h3 {
  font-size: 1rem; margin-bottom: 12px;
  color: var(--accent-light);
}
.guide-notes ul {
  list-style: disc; padding-left: 20px;
  color: var(--text-muted); font-size: 0.9rem;
  margin-bottom: 16px;
}
.guide-notes li { margin-bottom: 6px; }
.last-updated {
  font-size: 0.8rem; color: var(--text-dim);
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 32px 24px;
  margin-top: 40px;
}
.footer-inner {
  max-width: 1200px; margin: 0 auto;
  text-align: center;
}
.footer-brand {
  font-weight: 700; font-size: 1.1rem;
  margin-bottom: 12px;
}
.footer-nav {
  display: flex; justify-content: center;
  gap: 20px; flex-wrap: wrap;
  margin-bottom: 12px;
}
.footer-nav a {
  color: var(--text-muted); font-size: 0.9rem;
}
.footer-nav a:hover, .footer-nav a:focus-visible {
  color: var(--text);
}
.footer-note {
  font-size: 0.8rem; color: var(--text-dim);
}
.footer-note a { color: var(--text-muted); }

/* Toast */
.toast {
  position: fixed; bottom: 24px; right: 24px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 20px;
  font-size: 0.9rem;
  box-shadow: var(--shadow);
  z-index: 100;
  animation: toastIn 0.3s ease;
}
.toast-success { border-color: var(--success); }
.toast-error { border-color: var(--danger); }
@keyframes toastIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Responsive */
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; padding: 48px 24px 40px; }
  .hero-visual { display: none; }
  .ranker-layout { grid-template-columns: 1fr; }
  .ranker-controls { position: static; }
  .results-layout { grid-template-columns: 1fr; }
  .guide-grid { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .header-inner { flex-direction: column; padding: 12px 16px; }
  .site-nav { flex-wrap: wrap; justify-content: center; }
  section { padding: 40px 16px; }
  .ranker-section { padding: 40px 16px; }
  .results-section { padding: 40px 16px; }
  .guide-section { padding: 40px 16px; }
  .hero-content h1 { font-size: 1.8rem; }
  .hero-sub { font-size: 1rem; }
}

/* Print */
@media print {
  .site-header, .site-footer, .ranker-controls, .hero-actions, .profile-actions, .control-actions { display: none; }
  body { background: #fff; color: #000; }
  .result-card { border: 1px solid #ccc; break-inside: avoid; }
  .taste-card-preview { border: 2px solid #000; }
}

/* Focus visible */
*:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}



/* Factory-injected deployment helpers. The AI owns the site design above this block. */
.ad-unit {
  width: min(100%, 720px);
  min-height: 120px;
  margin: 24px auto;
  display: block;
}

.legal-page {
  width: min(900px, calc(100% - 32px));
  margin: 40px auto;
}

.factory-fallback-nav {
  width: min(900px, calc(100% - 32px));
  margin: 24px auto 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  align-items: center;
  font-size: 0.95rem;
}

.factory-fallback-nav a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid currentColor;
}
