/* Vintage Lens Compatibility Finder — Styles */
:root {
  --bg: #1a1714;
  --bg-card: #232018;
  --bg-card-alt: #2a2520;
  --surface: #332e26;
  --border: #443d33;
  --border-light: #554d40;
  --text: #e8e0d4;
  --text-muted: #9a8f80;
  --text-dim: #6b6055;
  --accent: #d4a853;
  --accent-light: #e8c97a;
  --accent-dark: #a07830;
  --yes: #5cb85c;
  --caution: #d4a853;
  --no: #c94444;
  --radius: 8px;
  --radius-lg: 12px;
  --shadow: 0 2px 12px rgba(0,0,0,0.4);
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; 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); text-decoration: none; }
a:hover, a:focus { color: var(--accent-light); text-decoration: underline; }

/* Header */
.site-header {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}
.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--accent);
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: 0.5px;
}
.logo:hover { color: var(--accent-light); text-decoration: none; }
.main-nav { display: flex; gap: 24px; }
.main-nav a {
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  padding: 4px 0;
  border-bottom: 2px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}
.main-nav a:hover, .main-nav a:focus {
  color: var(--text);
  border-bottom-color: var(--accent);
  text-decoration: none;
}

/* Hero */
.hero {
  background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg) 100%);
  border-bottom: 1px solid var(--border);
  padding: 60px 24px 48px;
}
.hero-inner { max-width: 720px; margin: 0 auto; text-align: center; }
.hero h1 {
  font-size: 2.4rem;
  font-weight: 800;
  line-height: 1.2;
  color: var(--text);
  margin-bottom: 16px;
}
.hero-sub {
  font-size: 1.1rem;
  color: var(--text-muted);
  margin-bottom: 20px;
}
.vintage-count {
  display: inline-block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 6px 18px;
  font-size: 0.85rem;
  color: var(--text-muted);
}
.vintage-count strong { color: var(--accent); }

/* Finder Section */
.finder-section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 48px 24px;
}
.finder-layout {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 32px;
  align-items: start;
}
.finder-controls {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  position: sticky;
  top: 80px;
}
.control-group { margin-bottom: 20px; }
.control-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.control-select {
  width: 100%;
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 0.95rem;
  font-family: var(--font);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2 4l4 4 4-4' fill='none' stroke='%239a8f80' stroke-width='1.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  cursor: pointer;
  transition: border-color 0.2s;
}
.control-select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(212,168,83,0.15);
}
.control-hint {
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-top: 4px;
  min-height: 1.2em;
}
.preset-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 8px;
}
.preset-label {
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-right: 4px;
}
.preset-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 4px 12px;
  font-size: 0.78rem;
  color: var(--text-muted);
  cursor: pointer;
  font-family: var(--font);
  transition: all 0.2s;
}
.preset-btn:hover, .preset-btn:focus {
  background: var(--accent-dark);
  border-color: var(--accent);
  color: var(--text);
}

/* Results */
.finder-results {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  min-height: 300px;
}
.result-empty {
  text-align: center;
  color: var(--text-dim);
  padding: 40px 0;
}
.empty-icon { margin-bottom: 16px; opacity: 0.5; }

.result-verdict {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}
.verdict-badge {
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.verdict-yes { background: rgba(92,184,92,0.15); color: var(--yes); border: 1px solid rgba(92,184,92,0.3); }
.verdict-caution { background: rgba(212,168,83,0.15); color: var(--caution); border: 1px solid rgba(212,168,83,0.3); }
.verdict-no { background: rgba(201,68,68,0.15); color: var(--no); border: 1px solid rgba(201,68,68,0.3); }
.verdict-title { font-size: 1.3rem; font-weight: 700; }

.result-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 24px;
}
.result-block {
  background: var(--bg-card-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}
.result-block h3 {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-dim);
  margin-bottom: 8px;
}
.result-block p, .result-block li {
  font-size: 0.9rem;
  color: var(--text-muted);
}
.result-block ul { list-style: none; }
.result-block li { padding: 2px 0; }
.result-block li::before { content: "→ "; color: var(--accent); }

.result-notes {
  background: var(--bg-card-alt);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 16px 20px;
  margin-bottom: 20px;
}
.result-notes h3 {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--accent);
  margin-bottom: 6px;
}
.result-notes p { font-size: 0.9rem; color: var(--text-muted); }

.result-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.btn-action {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 16px;
  font-size: 0.85rem;
  color: var(--text-muted);
  cursor: pointer;
  font-family: var(--font);
  transition: all 0.2s;
}
.btn-action:hover, .btn-action:focus {
  background: var(--accent-dark);
  border-color: var(--accent);
  color: var(--text);
}

/* Reference Table */
.reference-section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 48px 24px;
}
.reference-section h2, .adapter-section h2, .iq-section h2, .mistakes-section h2, .history-section h2 {
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 8px;
}
.section-intro {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 24px;
  max-width: 680px;
}
.table-wrap { overflow-x: auto; margin-bottom: 16px; }
.compat-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}
.compat-table th {
  background: var(--bg-card-alt);
  padding: 12px 16px;
  text-align: left;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-dim);
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
}
.compat-table td {
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  text-align: center;
}
.compat-table td:first-child {
  text-align: left;
  color: var(--text);
  font-weight: 500;
  white-space: nowrap;
}
.compat-table tr:hover td { background: rgba(212,168,83,0.04); }

.dot {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 50%;
}
.dot-yes { background: var(--yes); }
.dot-caution { background: var(--caution); }
.dot-no { background: var(--no); }

.table-key {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  font-size: 0.8rem;
  color: var(--text-dim);
}
.key-item { display: flex; align-items: center; gap: 6px; }

/* Adapter Tiers */
.adapter-section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 48px 24px;
}
.adapter-tiers {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.tier-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
}
.tier-budget { border-top: 3px solid var(--no); }
.tier-mid { border-top: 3px solid var(--caution); }
.tier-premium { border-top: 3px solid var(--yes); }
.tier-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.tier-header h3 { font-size: 1.1rem; }
.tier-price {
  font-size: 0.85rem;
  color: var(--accent);
  font-weight: 600;
}
.tier-card p { font-size: 0.9rem; color: var(--text-muted); margin-bottom: 12px; }
.tier-card ul { list-style: none; }
.tier-card li {
  font-size: 0.85rem;
  color: var(--text-muted);
  padding: 2px 0;
}
.tier-card li::before { content: "• "; color: var(--accent); }

/* IQ Section */
.iq-section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 48px 24px;
}
.iq-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}
.iq-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
}
.iq-card h3 {
  font-size: 1rem;
  color: var(--accent);
  margin-bottom: 8px;
}
.iq-card p { font-size: 0.9rem; color: var(--text-muted); margin-bottom: 12px; }
.iq-tag {
  display: inline-block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 3px 12px;
  font-size: 0.78rem;
  color: var(--text-dim);
}

/* Mistakes */
.mistakes-section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 48px 24px;
}
.mistake-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.mistake-list details {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.mistake-list summary {
  padding: 16px 20px;
  font-weight: 600;
  cursor: pointer;
  color: var(--text);
  font-size: 0.95rem;
  transition: background 0.2s;
}
.mistake-list summary:hover { background: var(--bg-card-alt); }
.mistake-list details[open] summary {
  border-bottom: 1px solid var(--border);
  color: var(--accent);
}
.mistake-list details p {
  padding: 16px 20px;
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* History */
.history-section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 48px 24px;
}
.history-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.history-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  font-size: 0.85rem;
}
.history-item .hl { color: var(--accent); font-weight: 600; }
.history-item .hc { color: var(--text-muted); }
.history-item .ht { color: var(--text-dim); font-size: 0.78rem; }
.history-item button {
  background: none;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 4px 10px;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 0.78rem;
  font-family: var(--font);
}
.history-item button:hover { border-color: var(--accent); color: var(--accent); }
.history-empty { color: var(--text-dim); font-size: 0.9rem; }

/* Footer */
.site-footer {
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  margin-top: 48px;
  padding: 32px 24px;
}
.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}
.footer-brand { font-size: 0.9rem; color: var(--text-muted); }
.footer-brand strong { color: var(--text); }
.footer-links { display: flex; gap: 20px; }
.footer-links a { font-size: 0.85rem; color: var(--text-dim); }
.footer-links a:hover { color: var(--accent); }
.footer-meta {
  display: flex;
  gap: 16px;
  font-size: 0.78rem;
  color: var(--text-dim);
}

/* Responsive */
@media (max-width: 900px) {
  .finder-layout { grid-template-columns: 1fr; }
  .finder-controls { position: static; }
  .adapter-tiers { grid-template-columns: 1fr; }
  .iq-grid { grid-template-columns: 1fr; }
  .result-grid { grid-template-columns: 1fr; }
  .hero h1 { font-size: 1.8rem; }
  .header-inner { padding: 0 16px; }
  .finder-section, .reference-section, .adapter-section, .iq-section, .mistakes-section, .history-section { padding: 32px 16px; }
}
@media (max-width: 600px) {
  .main-nav { gap: 12px; }
  .main-nav a { font-size: 0.8rem; }
  .hero { padding: 40px 16px 32px; }
  .hero h1 { font-size: 1.5rem; }
  .preset-row { flex-direction: column; align-items: flex-start; }
  .footer-inner { flex-direction: column; align-items: flex-start; }
  .footer-meta { flex-wrap: wrap; }
}

/* Print */
@media print {
  .site-header, .finder-controls, .preset-row, .result-actions, .history-section, .site-footer { display: none; }
  body { background: #fff; color: #000; }
  .finder-results, .tier-card, .iq-card, .result-block { border: 1px solid #ccc; background: #fff; }
}

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

/* Scrollbar */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-light); }


/* 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;
}
