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

:root {
  --bg: #0a0a0a;
  --surface: #141414;
  --surface-hover: #1e1e1e;
  --border: #222;
  --text: #e8e8e3;
  --text-muted: #777;
  --accent: #FF611B;
  --accent-glow: rgba(255, 97, 27, 0.15);
  --font: 'Inter', -apple-system, system-ui, sans-serif;
  --max-w: 1100px;
  --radius: 10px;
}

html { font-size: 15px; scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
}

/* ── Grain overlay ────────────────────────────────────── */
.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 128px 128px;
}

/* ── Header ───────────────────────────────────────────── */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10, 10, 10, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}

nav {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--text);
  text-decoration: none;
}

.accent { color: var(--accent); }

.nav-links { display: flex; gap: 1.5rem; }
.nav-links a {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s;
}
.nav-links a:hover { color: var(--text); }

.nav-logout {
  font-size: 0.8rem;
  color: var(--text-muted);
  background: none;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.25rem 0.6rem;
  cursor: pointer;
  font-family: var(--font);
  transition: color 0.2s, border-color 0.2s;
}
.nav-logout:hover { color: var(--text); border-color: var(--text-muted); }

/* ── Hero ─────────────────────────────────────────────── */
.hero {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 6rem 1.5rem 4rem;
}

.hero-content { max-width: 640px; }

.hero-line {
  width: 60px;
  height: 1px;
  background: var(--accent);
  margin-bottom: 2rem;
  animation: line-in 0.6s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes line-in {
  from { width: 0; opacity: 0; }
  to { width: 60px; opacity: 1; }
}

.hero h1 {
  font-size: 2.4rem;
  font-weight: 300;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin-bottom: 1rem;
  animation: fade-up 0.6s 0.15s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.hero-sub {
  font-size: 1rem;
  color: var(--text-muted);
  line-height: 1.7;
  max-width: 520px;
  animation: fade-up 0.6s 0.3s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes fade-up {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── Reports Section ──────────────────────────────────── */
.reports-section {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 2rem 1.5rem 6rem;
}

.section-header { margin-bottom: 2.5rem; }

.section-header h2 {
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.section-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  max-width: 560px;
  line-height: 1.6;
}

.reports-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1rem;
}

.no-reports {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
  padding: 3rem 0;
}

/* ── Report Card ──────────────────────────────────────── */
.report-card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.25s, box-shadow 0.25s, transform 0.25s;
}

.report-card:hover {
  border-color: color-mix(in srgb, var(--accent) 40%, transparent);
  box-shadow: 0 4px 24px var(--accent-glow);
  transform: translateY(-2px);
}

.report-card .card-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.report-card .card-type {
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent);
}

.report-card .card-score {
  display: flex;
  align-items: baseline;
  gap: 1px;
}

.report-card .score-value {
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1;
}

.report-card .score-max {
  font-size: 0.7rem;
  font-weight: 400;
  color: var(--text-muted);
}

.report-card h3 {
  font-size: 1.1rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
  line-height: 1.3;
}

.report-card .card-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 1rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.report-card .card-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.7rem;
  color: var(--text-muted);
}

.report-card .verdict {
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-weight: 500;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.verdict-buy { background: rgba(34, 197, 94, 0.12); color: #4ade80; }
.verdict-investigate { background: rgba(250, 204, 21, 0.12); color: #fbbf24; }
.verdict-reprice { background: rgba(251, 146, 60, 0.12); color: #fb923c; }
.verdict-pass { background: rgba(248, 113, 113, 0.12); color: #f87171; }

/* ── Report Detail Page ───────────────────────────────── */
.report-page {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 3rem 1.5rem 6rem;
}

.report-page .back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  text-decoration: none;
  margin-bottom: 2rem;
  transition: color 0.2s;
}
.report-page .back-link:hover { color: var(--text); }

.report-page .report-header-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 2rem;
}

.report-page .report-header-row > div:first-child { flex: 1; min-width: 0; }

.report-page .report-score {
  display: flex;
  align-items: baseline;
  gap: 2px;
  flex-shrink: 0;
  padding-top: 0.25rem;
}

.report-page .report-score-value {
  font-size: 3rem;
  font-weight: 300;
  color: var(--text);
  line-height: 1;
  letter-spacing: -0.03em;
}

.report-page .report-score-max {
  font-size: 1rem;
  font-weight: 400;
  color: var(--text-muted);
}

.report-page .report-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.report-page .report-meta .tag {
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0.25rem 0.6rem;
  border-radius: 4px;
  background: var(--accent-glow);
  color: var(--accent);
}

.report-page .report-meta .date {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.report-page h1 {
  font-size: 2rem;
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin-bottom: 2.5rem;
}

/* ── Report Content (Markdown) ────────────────────────── */
.report-content h2 {
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  margin-top: 3rem;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.report-content h3 {
  font-size: 0.95rem;
  font-weight: 600;
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}

.report-content p {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.75;
  margin-bottom: 1rem;
}

.report-content strong { color: var(--text); font-weight: 500; }

.report-content ul, .report-content ol {
  margin-bottom: 1rem;
  padding-left: 1.25rem;
}

.report-content li {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 0.35rem;
}

.report-content blockquote {
  border-left: 2px solid var(--accent);
  padding: 0.75rem 1.25rem;
  margin: 1.5rem 0;
  background: var(--surface);
  border-radius: 0 var(--radius) var(--radius) 0;
}

.report-content blockquote p {
  color: var(--text);
  margin-bottom: 0;
}

/* Score table */
.report-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.85rem;
}

.report-content th {
  text-align: left;
  font-weight: 500;
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--border);
}

.report-content td {
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
}

.report-content td:last-child { color: var(--text); font-weight: 500; }

/* ── Footer ───────────────────────────────────────────── */
footer {
  border-top: 1px solid var(--border);
  padding: 2rem 1.5rem;
}

.footer-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.footer-brand {
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.footer-copy {
  font-size: 0.7rem;
  color: var(--text-muted);
}

/* ── Login Wall ────────────────────────────────────────── */
.login-wall {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.login-box {
  width: 100%;
  max-width: 340px;
}

.login-line {
  width: 40px;
  height: 1px;
  background: var(--accent);
  margin-bottom: 1.5rem;
}

.login-brand {
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--text);
  margin-bottom: 2rem;
}

.login-box form { display: flex; flex-direction: column; gap: 0.75rem; }

.login-box input {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.7rem 0.85rem;
  font-size: 0.85rem;
  color: var(--text);
  font-family: var(--font);
  outline: none;
  transition: border-color 0.2s;
}

.login-box input::placeholder { color: var(--text-muted); }
.login-box input:focus { border-color: var(--accent); }

.login-box button {
  width: 100%;
  padding: 0.7rem;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 500;
  font-family: var(--font);
  cursor: pointer;
  transition: opacity 0.2s;
  margin-top: 0.25rem;
}

.login-box button:hover { opacity: 0.9; }

.login-error {
  font-size: 0.75rem;
  color: #f87171;
  min-height: 1rem;
  margin: 0;
}

/* ── Mobile ───────────────────────────────────────────── */
@media (max-width: 640px) {
  .hero { padding: 4rem 1.25rem 3rem; }
  .hero h1 { font-size: 1.8rem; }
  .reports-grid { grid-template-columns: 1fr; }
  .report-page h1 { font-size: 1.5rem; }
  .footer-inner { flex-direction: column; gap: 0.5rem; text-align: center; }
}
