/* Vintage Levi's Fit Finder — Stylesheet */
:root {
  --navy: #1a3a5c;
  --navy-dark: #0f2440;
  --navy-light: #2a5080;
  --tan: #c4956a;
  --tan-light: #e8d5c0;
  --tan-dark: #a07040;
  --cream: #faf6f0;
  --cream-dark: #f0e8da;
  --text: #2c2c2c;
  --text-light: #5a5a5a;
  --text-muted: #8a8a8a;
  --border: #d4c8b8;
  --border-light: #e8dfd2;
  --success: #3a7d44;
  --error: #b33a3a;
  --radius: 8px;
  --radius-sm: 4px;
  --shadow: 0 2px 8px rgba(26, 58, 92, 0.08);
  --shadow-lg: 0 4px 20px rgba(26, 58, 92, 0.12);
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, sans-serif;
  --max-width: 1100px;
}

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

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

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

a { color: var(--navy); text-decoration: underline; text-underline-offset: 2px; }
a:hover { color: var(--navy-light); }

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

/* Header */
.site-header {
  background: var(--navy);
  padding: 0.75rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 4px rgba(0,0,0,0.15);
}
.site-header .container { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 0.5rem; }
.logo { display: flex; align-items: center; gap: 0.5rem; color: #fff; text-decoration: none; font-weight: 700; font-size: 1.1rem; }
.logo:hover { color: var(--tan-light); }
.logo svg { flex-shrink: 0; }

.main-nav { display: flex; gap: 1.25rem; flex-wrap: wrap; }
.main-nav a { color: rgba(255,255,255,0.85); text-decoration: none; font-size: 0.9rem; font-weight: 500; }
.main-nav a:hover { color: #fff; text-decoration: underline; }

/* Hero */
.hero {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-dark) 100%);
  color: #fff;
  padding: 4rem 0 3.5rem;
  text-align: center;
}
.hero h1 { font-size: clamp(1.8rem, 4vw, 2.8rem); font-weight: 800; line-height: 1.2; margin-bottom: 1rem; }
.hero-sub { font-size: clamp(1rem, 2vw, 1.2rem); color: rgba(255,255,255,0.8); max-width: 600px; margin: 0 auto 2rem; }

/* Buttons */
.btn-primary, .btn-secondary {
  display: inline-block;
  padding: 0.75rem 1.75rem;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.15s ease;
  text-decoration: none;
}
.btn-primary { background: var(--tan); color: var(--navy-dark); border-color: var(--tan); }
.btn-primary:hover { background: var(--tan-dark); color: #fff; border-color: var(--tan-dark); }
.btn-secondary { background: transparent; color: var(--navy); border-color: var(--navy); }
.btn-secondary:hover { background: var(--navy); color: #fff; }

/* Sections */
section { padding: 3rem 0; }
section:nth-child(even) { background: var(--cream-dark); }

.section-intro { color: var(--text-light); max-width: 680px; margin-bottom: 1.5rem; font-size: 1.05rem; }

h2 { font-size: 1.6rem; font-weight: 700; color: var(--navy); margin-bottom: 0.5rem; }
h3 { font-size: 1.15rem; font-weight: 600; color: var(--navy); margin-bottom: 0.5rem; }

/* Matcher */
.matcher-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; align-items: start; }

.matcher-form fieldset {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-bottom: 1.25rem;
  background: #fff;
}
.matcher-form legend { font-weight: 600; color: var(--navy); padding: 0 0.5rem; font-size: 1.05rem; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.field { margin-bottom: 0.75rem; }
.field label { display: block; font-weight: 600; font-size: 0.9rem; margin-bottom: 0.25rem; color: var(--text); }
.field .optional { font-weight: 400; color: var(--text-muted); font-size: 0.8rem; }
.field small { display: block; color: var(--text-muted); font-size: 0.8rem; margin-top: 0.15rem; }

input[type="number"], input[type="text"], select {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-family: var(--font);
  background: #fff;
  color: var(--text);
  transition: border-color 0.15s;
}
input:focus, select:focus { outline: none; border-color: var(--navy); box-shadow: 0 0 0 3px rgba(26,58,92,0.15); }

.checkbox-field { display: flex; align-items: center; gap: 0.5rem; margin-top: 0.5rem; }
.checkbox-field input[type="checkbox"] { width: 1.1rem; height: 1.1rem; accent-color: var(--navy); }
.checkbox-field label { margin-bottom: 0; font-weight: 500; }

.matcher-results {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  min-height: 200px;
}
.results-empty { text-align: center; color: var(--text-muted); padding: 2rem 1rem; }
.results-empty svg { margin-bottom: 0.75rem; opacity: 0.5; }

.result-card {
  background: var(--cream);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 1rem;
  margin-bottom: 0.75rem;
}
.result-card .result-era { font-weight: 700; color: var(--navy); font-size: 1.05rem; }
.result-card .result-model { color: var(--tan-dark); font-weight: 600; }
.result-card .result-detail { font-size: 0.9rem; color: var(--text-light); margin-top: 0.25rem; }
.result-card .result-why { font-size: 0.85rem; color: var(--text-muted); margin-top: 0.4rem; padding-top: 0.4rem; border-top: 1px dashed var(--border); }
.result-match { display: inline-block; background: var(--navy); color: #fff; font-size: 0.75rem; padding: 0.15rem 0.5rem; border-radius: 10px; font-weight: 600; margin-left: 0.5rem; vertical-align: middle; }
.result-match.good { background: var(--success); }
.result-match.partial { background: var(--tan-dark); }

/* Decoder */
.decoder-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; align-items: start; }
.decoder-controls { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 1.5rem; }
.decoder-controls .field { margin-bottom: 1rem; }

.decoder-results { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 1.5rem; min-height: 150px; }

/* Charts */
.chart-tabs { display: flex; gap: 0.25rem; margin-bottom: 1rem; flex-wrap: wrap; }
.chart-tab {
  padding: 0.5rem 1.25rem;
  border: 1px solid var(--border);
  background: #fff;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-light);
  transition: all 0.15s;
}
.chart-tab:hover { background: var(--cream-dark); }
.chart-tab.active { background: var(--navy); color: #fff; border-color: var(--navy); }

.chart-panel.hidden { display: none; }

.fit-table { width: 100%; border-collapse: collapse; background: #fff; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.fit-table caption { text-align: left; font-weight: 600; color: var(--navy); padding: 0.75rem 1rem; font-size: 0.95rem; }
.fit-table th { background: var(--navy); color: #fff; padding: 0.65rem 1rem; text-align: left; font-size: 0.85rem; font-weight: 600; }
.fit-table td { padding: 0.6rem 1rem; border-bottom: 1px solid var(--border-light); font-size: 0.9rem; }
.fit-table tr:last-child td { border-bottom: none; }
.fit-table tr:hover td { background: var(--cream); }

/* Guide */
.guide-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 1.25rem; }
.guide-card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem; }
.guide-card p { color: var(--text-light); font-size: 0.95rem; }

/* Notes */
.note-box { background: var(--tan-light); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.5rem; }
.note-box h3 { margin-bottom: 0.5rem; }
.note-box p { color: var(--text-light); font-size: 0.9rem; margin-bottom: 0.5rem; }
.note-box p:last-child { margin-bottom: 0; }

/* Footer */
.site-footer { background: var(--navy-dark); color: rgba(255,255,255,0.7); padding: 2.5rem 0 1.5rem; font-size: 0.9rem; }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 1.5rem; margin-bottom: 1.5rem; }
.footer-grid strong { color: #fff; display: block; margin-bottom: 0.5rem; }
.footer-grid a { display: block; color: rgba(255,255,255,0.65); text-decoration: none; margin-bottom: 0.25rem; font-size: 0.85rem; }
.footer-grid a:hover { color: #fff; text-decoration: underline; }
.footer-copy { text-align: center; color: rgba(255,255,255,0.4); font-size: 0.8rem; padding-top: 1rem; border-top: 1px solid rgba(255,255,255,0.1); }

/* Responsive */
@media (max-width: 768px) {
  .matcher-grid, .decoder-grid { grid-template-columns: 1fr; }
  .field-row { grid-template-columns: 1fr; }
  .hero { padding: 2.5rem 0 2rem; }
  section { padding: 2rem 0; }
  .main-nav { gap: 0.75rem; }
  .main-nav a { font-size: 0.85rem; }
  .fit-table { font-size: 0.8rem; }
  .fit-table th, .fit-table td { padding: 0.5rem 0.6rem; }
}

@media (max-width: 480px) {
  .container { padding: 0 1rem; }
  .chart-tab { padding: 0.4rem 0.8rem; font-size: 0.8rem; }
  .guide-grid { grid-template-columns: 1fr; }
}

/* Print */
@media print {
  .site-header, .site-footer, .btn-primary, .btn-secondary, .matcher-form, .decoder-controls { display: none; }
  body { background: #fff; color: #000; }
  .fit-table { box-shadow: none; border: 1px solid #ccc; }
  .fit-table th { background: #eee; color: #000; }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}

:focus-visible { outline: 2px solid var(--navy); 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;
}
