/* === Reset & Base === */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg: #09090b;
  --bg-card: #131316;
  --bg-card-hover: #1a1a1f;
  --border: #27272a;
  --border-hover: #3f3f46;
  --text: #e4e4e7;
  --text-dim: #a1a1aa;
  --text-muted: #71717a;
  --accent: #22c55e;
  --accent-dim: #16a34a;
  --accent-glow: rgba(34, 197, 94, 0.15);
  --gold: #f5c542;
  --gold-dim: #c49b30;
  --link: #60a5fa;
  --link-hover: #93bbfd;
  --mono: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--link); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--link-hover); }

code {
  font-family: var(--mono);
  font-size: 0.875em;
  background: rgba(255, 255, 255, 0.06);
  padding: 0.15em 0.4em;
  border-radius: 4px;
}

.container { max-width: 860px; margin: 0 auto; padding: 0 1.5rem; width: 100%; }

/* === Header === */
.site-header {
  border-bottom: 1px solid var(--border);
  padding: 1rem 0;
  position: sticky;
  top: 0;
  background: rgba(9, 9, 11, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 100;
}

.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.header-brand { display: flex; align-items: center; gap: 0.75rem; }

.header-logo {
  font-family: var(--mono);
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
}

.header-logo .prompt { color: var(--accent); }
.header-nav { display: flex; gap: 1.5rem; list-style: none; }
.header-nav a { font-size: 0.8125rem; color: var(--text-dim); font-weight: 500; transition: color 0.2s; }
.header-nav a:hover { color: var(--text); }

/* === Hero === */
.hero { padding: 4rem 0 3rem; border-bottom: 1px solid var(--border); }

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-dim);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  padding: 0.35rem 0.75rem;
  border-radius: 100px;
  margin-bottom: 1.25rem;
  letter-spacing: 0.02em;
}

.hero h1 {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-bottom: 1rem;
}

.hero h1 .highlight { color: #DEA584; }
.hero-desc { font-size: 1.0625rem; color: var(--text-dim); max-width: 600px; line-height: 1.7; }
.hero-desc a { font-weight: 500; }
.hero-links { display: flex; gap: 0.75rem; margin-top: 1.5rem; flex-wrap: wrap; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--mono);
  font-size: 0.8125rem;
  font-weight: 600;
  padding: 0.6rem 1.25rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
  transition: all 0.2s;
  cursor: pointer;
}

.btn:hover { background: var(--bg-card-hover); border-color: var(--border-hover); color: var(--text); }
.btn-primary { background: rgba(222, 165, 132, 0.15); border-color: #DEA584; color: #DEA584; }
.btn-primary:hover { background: rgba(222, 165, 132, 0.25); }

/* === Sections === */
section { padding: 3rem 0; }
section + section { border-top: 1px solid var(--border); }

.section-label {
  font-family: var(--mono);
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.section-title { font-size: 1.375rem; font-weight: 700; letter-spacing: -0.02em; margin-bottom: 1rem; }
.section-text { color: var(--text-dim); line-height: 1.7; margin-bottom: 1rem; }

/* === Origin Card === */
.origin-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem;
  margin-top: 1rem;
  margin-bottom: 1rem;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.origin-icon { font-size: 1.25rem; flex-shrink: 0; margin-top: 0.1rem; }
.origin-text { font-size: 0.875rem; color: var(--text-dim); line-height: 1.6; }
.origin-text a { font-weight: 600; }
.origin-text strong { color: var(--accent); }

/* === Result Card === */
.result-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  margin-top: 1.5rem;
}

.result-header { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 1.25rem; }
.result-icon { font-size: 1.5rem; }
.result-title { font-size: 1rem; font-weight: 600; }
.result-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 1rem; }

.result-stat {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
}

.result-stat-label {
  font-family: var(--mono);
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

.result-stat-value { font-family: var(--mono); font-size: 1.25rem; font-weight: 700; }
.result-stat-value.perfect { color: var(--accent); }
.result-stat-value.gold { color: var(--gold); }

/* === Tech Stack === */
.stack-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.75rem;
  margin-top: 1.25rem;
}

.stack-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  transition: border-color 0.2s, background 0.2s;
}

.stack-item:hover { border-color: var(--border-hover); background: var(--bg-card-hover); }
.stack-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.stack-name { font-size: 0.875rem; font-weight: 500; }
.stack-desc { font-size: 0.75rem; color: var(--text-muted); }

/* === Architecture === */
.arch-block {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  margin-top: 1.25rem;
  font-family: var(--mono);
  font-size: 0.8125rem;
  line-height: 1.8;
  color: var(--text-dim);
  overflow-x: auto;
}

.arch-block .comment { color: var(--text-muted); }
.arch-block .keyword { color: #DEA584; }
.arch-block .string { color: var(--gold); }

/* === Reports === */
.reports-list { list-style: none; margin-top: 1.25rem; display: flex; flex-direction: column; gap: 0.5rem; }

.report-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  transition: border-color 0.2s, background 0.2s;
}

.report-item:hover { border-color: var(--border-hover); background: var(--bg-card-hover); }
.report-info { display: flex; align-items: center; gap: 0.75rem; min-width: 0; }
.report-icon { color: var(--text-muted); flex-shrink: 0; font-size: 1rem; }

.report-name {
  font-family: var(--mono);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.report-date { font-family: var(--mono); font-size: 0.75rem; color: var(--text-muted); white-space: nowrap; }
.report-link { font-family: var(--mono); font-size: 0.75rem; font-weight: 600; color: var(--link); white-space: nowrap; }
.report-link:hover { color: var(--link-hover); }

.reports-empty,
.reports-loading {
  font-family: var(--mono);
  font-size: 0.8125rem;
  color: var(--text-muted);
  padding: 1.5rem;
  text-align: center;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-top: 1.25rem;
}

.reports-loading .spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid var(--border);
  border-top-color: #DEA584;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin-right: 0.5rem;
  vertical-align: middle;
}

@keyframes spin { to { transform: rotate(360deg); } }

.older-reports-toggle { margin-top: 1rem; width: 100%; text-align: center; font-family: var(--mono); font-size: 0.8125rem; cursor: pointer; }

/* === Footer === */
.site-footer { margin-top: auto; border-top: 1px solid var(--border); padding: 2rem 0; }
.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.footer-text { font-size: 0.8125rem; color: var(--text-muted); }
.footer-links { display: flex; gap: 1rem; }
.footer-links a { font-size: 0.8125rem; color: var(--text-muted); transition: color 0.2s; }
.footer-links a:hover { color: var(--text); }

/* === Responsive === */
@media (max-width: 640px) {
  .hero { padding: 2.5rem 0 2rem; }
  section { padding: 2rem 0; }
  .header-nav { gap: 1rem; }
  .result-grid { grid-template-columns: repeat(2, 1fr); }
  .stack-grid { grid-template-columns: 1fr; }
  .footer-inner { flex-direction: column; text-align: center; }
  .report-date { display: none; }
  .impl-grid { grid-template-columns: 1fr; }
}

/* === Implementations Grid === */
.impl-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0.75rem; margin-top: 1.25rem; }
.impl-card { display: flex; align-items: center; gap: 0.75rem; background: var(--bg-card); border: 1px solid var(--border); border-radius: 8px; padding: 0.75rem 1rem; transition: border-color 0.2s, background 0.2s; color: var(--text); }
.impl-card:hover { border-color: var(--border-hover); background: var(--bg-card-hover); color: var(--text); }
.impl-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.impl-name { font-size: 0.875rem; font-weight: 500; }
.impl-badge { font-family: var(--mono); font-size: 0.625rem; font-weight: 600; color: var(--accent); background: var(--accent-glow); border: 1px solid rgba(34,197,94,0.3); padding: 0.15rem 0.4rem; border-radius: 4px; margin-left: auto; }
.impl-badge-learning { font-family: var(--mono); font-size: 0.625rem; font-weight: 600; color: #60a5fa; background: rgba(96,165,250,0.15); border: 1px solid rgba(96,165,250,0.3); padding: 0.15rem 0.4rem; border-radius: 4px; margin-left: auto; }
