/* Film Stock Comparator — Styles */
:root {
  --bg: #0f0f0f;
  --bg-surface: #1a1a1a;
  --bg-card: #222;
  --bg-card-hover: #2a2a2a;
  --border: #333;
  --border-light: #444;
  --text: #e8e0d4;
  --text-muted: #9a9088;
  --text-dim: #6b635c;
  --accent: #d4a853;
  --accent-light: #e8c97a;
  --accent-dim: #a07830;
  --red: #c94f4f;
  --green: #5fa85f;
  --blue: #5a8abf;
  --radius: 8px;
  --radius-lg: 12px;
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'SF Mono', 'Fira Code', monospace;
  --shadow: 0 2px 12px rgba(0,0,0,0.4);
  --max-width: 1200px;
}

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

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

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 { color: var(--accent-light); }

.container { max-width: var(--max-width); margin: 0 auto; padding: 0 1.5rem; }

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(15,15,15,0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text);
  font-weight: 700;
  font-size: 1rem;
}
.logo:hover { color: var(--accent); }
.logo-icon { color: var(--accent); flex-shrink: 0; }
.site-nav {
  display: flex;
  gap: 1.5rem;
}
.site-nav a {
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 500;
}
.site-nav a:hover { color: var(--text); }

/* Hero */
.hero {
  padding: 5rem 1.5rem 4rem;
  text-align: center;
  background: linear-gradient(180deg, #1a1510 0%, var(--bg) 100%);
}
.hero h1 {
  font-size: clamp(1.75rem, 4vw, 2.75rem);
  font-weight: 800;
  line-height: 1.2;
  max-width: 640px;
  margin: 0 auto 1rem;
  color: var(--text);
}
.hero-sub {
  font-size: 1.1rem;
  color: var(--text-muted);
  max-width: 520px;
  margin: 0 auto 2rem;
}
.hero-actions { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s ease;
  font-family: var(--font);
}
.btn-primary {
  background: var(--accent);
  color: #1a1200;
  border-color: var(--accent);
}
.btn-primary:hover { background: var(--accent-light); color: #1a1200; }
.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border-color: var(--border-light);
}
.btn-ghost:hover { color: var(--text); border-color: var(--text-dim); }
.btn-sm { padding: 0.4rem 0.85rem; font-size: 0.8rem; }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* Chips */
.filter-chips { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.chip {
  padding: 0.35rem 0.85rem;
  border-radius: 100px;
  border: 1px solid var(--border-light);
  background: transparent;
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: var(--font);
}
.chip:hover { border-color: var(--accent-dim); color: var(--text); }
.chip.active {
  background: var(--accent);
  color: #1a1200;
  border-color: var(--accent);
}

/* Compare Section */
.section-compare { padding: 2rem 0 4rem; }
.compare-controls { margin-bottom: 1.5rem; }
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin-bottom: 1rem;
}
.filter-group { display: flex; flex-direction: column; gap: 0.4rem; }
.filter-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  font-weight: 600;
}
.preset-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

/* Stock Grid */
.stock-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}
.stock-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  cursor: pointer;
  transition: all 0.15s ease;
  position: relative;
}
.stock-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent-dim);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.stock-card.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}
.stock-card.favorite::after {
  content: '★';
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  color: var(--accent);
  font-size: 0.85rem;
}
.stock-name {
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: 0.25rem;
}
.stock-brand {
  font-size: 0.75rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.75rem;
}
.stock-meta {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}
.stock-tag {
  font-size: 0.7rem;
  padding: 0.15rem 0.5rem;
  border-radius: 100px;
  background: var(--bg-surface);
  color: var(--text-muted);
  border: 1px solid var(--border);
}
.stock-tag.iso { color: var(--accent); border-color: var(--accent-dim); }
.stock-ratings {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.4rem;
  font-size: 0.75rem;
}
.stock-ratings span { color: var(--text-muted); }
.stock-ratings .bar {
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  margin-top: 0.2rem;
  overflow: hidden;
}
.stock-ratings .bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
}

/* Comparison Panel */
.comparison-panel {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
}
.comparison-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  gap: 0.75rem;
}
.comparison-header h2 { font-size: 1.1rem; }
.comparison-actions { display: flex; gap: 0.5rem; }
.comparison-empty {
  text-align: center;
  padding: 2rem;
  color: var(--text-dim);
  font-size: 0.9rem;
}
.comparison-table-wrap { overflow-x: auto; }
.comparison-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}
.comparison-table th,
.comparison-table td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.comparison-table th {
  color: var(--text-dim);
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}
.comparison-table td:first-child {
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
}
.comp-stock-name { font-weight: 700; }
.comp-stock-brand { font-size: 0.7rem; color: var(--text-dim); }

/* Sample Images */
.comparison-samples { margin-top: 2rem; padding-top: 1.5rem; border-top: 1px solid var(--border); }
.comparison-samples h3 { font-size: 1rem; margin-bottom: 0.75rem; }
.sample-filters { display: flex; gap: 0.4rem; flex-wrap: wrap; margin-bottom: 1rem; }
.sample-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
}
.sample-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.sample-card-img {
  width: 100%;
  aspect-ratio: 3/2;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  color: var(--text-dim);
  position: relative;
}
.sample-card-img .grain-overlay {
  position: absolute;
  inset: 0;
  opacity: 0.15;
  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-size: 150px;
  pointer-events: none;
}
.sample-card-label {
  padding: 0.5rem 0.75rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}
.sample-card-stock {
  font-weight: 600;
  color: var(--text);
}

/* Samples Section */
.section-samples { padding: 4rem 0; background: var(--bg-surface); }
.section-samples h2 { font-size: 1.5rem; margin-bottom: 0.5rem; }
.section-lead { color: var(--text-muted); max-width: 680px; margin-bottom: 2rem; }
.sample-conditions {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.25rem;
}
.condition-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
}
.condition-icon {
  color: var(--accent);
  margin-bottom: 0.75rem;
}
.condition-card h3 { font-size: 1rem; margin-bottom: 0.4rem; }
.condition-card p { font-size: 0.85rem; color: var(--text-muted); }

/* Guide Section */
.section-guide { padding: 4rem 0; }
.section-guide h2 { font-size: 1.5rem; margin-bottom: 2rem; }
.guide-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.25rem;
  margin-bottom: 3rem;
}
.guide-block {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
}
.guide-block h3 { font-size: 1rem; margin-bottom: 0.5rem; color: var(--accent); }
.guide-block p { font-size: 0.875rem; color: var(--text-muted); }

.guide-notes {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.25rem;
  margin-bottom: 3rem;
}
.note-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
}
.note-card h3 { font-size: 1rem; margin-bottom: 0.75rem; }
.note-card p, .note-card li { font-size: 0.875rem; color: var(--text-muted); }
.note-card ul { padding-left: 1.25rem; }
.note-card li { margin-bottom: 0.5rem; }
.note-card strong { color: var(--text); }

.quick-ref { background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1.5rem; }
.quick-ref h3 { font-size: 1rem; margin-bottom: 0.25rem; }
.quick-ref > p { font-size: 0.85rem; color: var(--text-dim); margin-bottom: 1rem; }
.ref-table-wrap { overflow-x: auto; margin-bottom: 1rem; }
.ref-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.ref-table th, .ref-table td { padding: 0.6rem 0.75rem; text-align: left; border-bottom: 1px solid var(--border); }
.ref-table th { color: var(--text-dim); font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.05em; }
.ref-table td { color: var(--text-muted); }
.ref-table tr:last-child td { border-bottom: none; }

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 3rem 0 2rem;
  background: var(--bg-surface);
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 2rem;
  margin-bottom: 2rem;
}
.footer-brand { font-weight: 700; font-size: 1rem; margin-bottom: 0.25rem; }
.footer-note { font-size: 0.8rem; color: var(--text-dim); max-width: 300px; }
.footer-heading { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-dim); margin-bottom: 0.5rem; }
.footer-grid a { display: block; font-size: 0.85rem; color: var(--text-muted); margin-bottom: 0.3rem; }
.footer-grid a:hover { color: var(--text); }
.footer-copy { font-size: 0.75rem; color: var(--text-dim); text-align: center; }
.footer-copy a { color: var(--text-dim); }

/* Responsive */
@media (max-width: 768px) {
  .header-inner { padding: 0.6rem 1rem; }
  .site-nav { gap: 1rem; }
  .site-nav a { font-size: 0.8rem; }
  .hero { padding: 3rem 1rem 2.5rem; }
  .filter-bar { flex-direction: column; gap: 1rem; }
  .stock-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
  .comparison-header { flex-direction: column; align-items: flex-start; }
  .footer-grid { grid-template-columns: 1fr; gap: 1.5rem; }
  .guide-notes { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .stock-grid { grid-template-columns: 1fr 1fr; gap: 0.6rem; }
  .stock-card { padding: 1rem; }
  .sample-grid { grid-template-columns: 1fr 1fr; }
}

/* Print */
@media print {
  .site-header, .hero, .compare-controls, .site-footer, .section-samples, .guide-grid { display: none; }
  body { background: #fff; color: #000; }
  .comparison-panel { border: 1px solid #ccc; }
  .quick-ref { page-break-inside: avoid; }
}

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

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

/* Hidden utility */
[hidden] { display: none !important; }



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