/* Capo Key Translator — Styles */
:root {
  --bg: #1a1410;
  --bg-surface: #241e18;
  --bg-panel: #2d241c;
  --bg-input: #382e24;
  --border: #4a3d30;
  --border-light: #5c4d3d;
  --text: #f0e8df;
  --text-muted: #b0a090;
  --text-dim: #8a7a6a;
  --accent: #e8a030;
  --accent-hover: #f0b040;
  --accent-dim: #c08020;
  --success: #60c060;
  --danger: #e06060;
  --fretboard-bg: #3d2e1e;
  --fret-line: #8a7a60;
  --string-line: #c0b098;
  --capo-color: #e8a030;
  --dot-color: #f0e8df;
  --font: 'Segoe UI', system-ui, -apple-system, sans-serif;
  --radius: 8px;
  --radius-lg: 12px;
  --shadow: 0 2px 12px rgba(0,0,0,0.3);
  --max-w: 1100px;
}

*, *::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 { color: var(--accent-hover); text-decoration: underline; }

/* Header */
.site-header {
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}
.header-inner {
  max-width: var(--max-w);
  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.6rem;
  color: var(--text);
  font-size: 1.25rem;
  font-weight: 700;
  text-decoration: none;
}
.logo:hover { text-decoration: none; color: var(--text); }
.logo-accent { color: var(--accent); }
.logo-icon { flex-shrink: 0; }

.main-nav {
  display: flex;
  gap: 1.5rem;
}
.main-nav a {
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  padding: 0.25rem 0;
  border-bottom: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}
.main-nav a:hover { color: var(--text); border-bottom-color: var(--accent); text-decoration: none; }

/* Hero */
.hero-section {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 3rem 1.5rem 1rem;
}
.hero-content h1 {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 0.75rem;
  color: var(--text);
}
.hero-sub {
  font-size: 1.1rem;
  color: var(--text-muted);
  max-width: 600px;
  line-height: 1.5;
}

/* App Shell */
.app-shell {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 1.5rem;
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 1.5rem;
  align-items: start;
}

/* Controls Panel */
.controls-panel {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  position: sticky;
  top: 70px;
}
.control-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.control-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.hint {
  font-size: 0.78rem;
  color: var(--text-dim);
}
.key-select, .capo-input {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 1rem;
  padding: 0.6rem 0.75rem;
  font-family: var(--font);
  outline: none;
  transition: border-color 0.15s;
  width: 100%;
}
.key-select:focus, .capo-input:focus { border-color: var(--accent); }
.capo-input-row {
  display: flex;
  gap: 0.5rem;
}
.capo-input { flex: 1; width: auto; }

.btn-primary {
  background: var(--accent);
  color: var(--bg);
  border: none;
  border-radius: var(--radius);
  padding: 0.7rem 1.5rem;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  font-family: var(--font);
}
.btn-primary:hover { background: var(--accent-hover); }
.btn-primary:active { transform: scale(0.98); }
.btn-secondary {
  background: var(--bg-input);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.6rem 1rem;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
  font-family: var(--font);
  white-space: nowrap;
}
.btn-secondary:hover { background: var(--border); }
.btn-icon {
  background: var(--bg-input);
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
  font-family: var(--font);
  padding: 0;
}
.btn-icon:hover { color: var(--text); background: var(--border); }

.action-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}
.action-row .btn-primary { flex: 1; }

/* Results Panel */
.results-panel {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  min-height: 400px;
}
.results-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  min-height: 300px;
  color: var(--text-dim);
  text-align: center;
  gap: 1rem;
}
.placeholder-icon { color: var(--text-dim); opacity: 0.5; }

.results-content h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
  margin-top: 1.5rem;
}
.results-content h3:first-child { margin-top: 0; }

.results-summary {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  font-size: 1.05rem;
  line-height: 1.5;
}
.results-summary strong { color: var(--accent); }

/* Fretboard */
.fretboard-wrap { margin-top: 1rem; }
.fretboard {
  width: 100%;
  max-width: 400px;
  height: auto;
  background: var(--fretboard-bg);
  border-radius: var(--radius);
  margin-top: 0.5rem;
}

/* Chord Table */
.chord-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
  margin-top: 0.5rem;
}
.chord-table th {
  text-align: left;
  padding: 0.5rem 0.75rem;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-dim);
  border-bottom: 1px solid var(--border);
}
.chord-table td {
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid rgba(74,61,48,0.4);
}
.chord-table tr:last-child td { border-bottom: none; }
.chord-table tr:hover td { background: rgba(232,160,48,0.06); }
.chord-table td:first-child { color: var(--accent); font-weight: 600; }
.chord-table td:last-child { color: var(--text); }

/* Chord Diagrams */
.diagram-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 1rem;
  margin-top: 0.75rem;
}
.chord-diagram {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem;
  text-align: center;
}
.chord-diagram .diagram-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 0.25rem;
}
.chord-diagram .diagram-sub {
  font-size: 0.75rem;
  color: var(--text-dim);
}
.chord-diagram svg { margin-top: 0.25rem; }

/* Presets Section */
.presets-section {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 3rem 1.5rem;
}
.presets-section h2 {
  font-size: 1.6rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
}
.section-lead {
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  max-width: 550px;
}
.preset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.75rem;
}
.preset-card {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  font-family: var(--font);
  color: var(--text);
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.preset-card:hover { border-color: var(--accent); background: var(--bg-input); }
.preset-fret { font-size: 1.1rem; font-weight: 700; color: var(--accent); }
.preset-keys { font-size: 0.95rem; font-weight: 600; }
.preset-chords { font-size: 0.8rem; color: var(--text-dim); }

/* Guide Section */
.guide-section {
  background: var(--bg-surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 3rem 0;
}
.section-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1.5rem;
}
.guide-section h2 {
  font-size: 1.6rem;
  font-weight: 800;
  margin-bottom: 1.5rem;
}
.guide-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.25rem;
}
.guide-card {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
}
.guide-card h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--accent);
}
.guide-card p {
  font-size: 0.93rem;
  color: var(--text-muted);
  line-height: 1.55;
}

/* FAQ Section */
.faq-section {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 3rem 1.5rem;
}
.faq-section h2 {
  font-size: 1.6rem;
  font-weight: 800;
  margin-bottom: 1.5rem;
}
.faq-list {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}
.faq-list dt {
  font-weight: 700;
  font-size: 1rem;
  color: var(--accent);
  margin-bottom: 0.3rem;
}
.faq-list dd {
  color: var(--text-muted);
  font-size: 0.93rem;
  line-height: 1.55;
  padding-left: 0;
}

/* Footer */
.site-footer {
  background: var(--bg-surface);
  border-top: 1px solid var(--border);
  padding: 2rem 1.5rem;
}
.footer-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-dim);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.footer-links { display: flex; gap: 0.75rem; justify-content: center; }
.footer-links a { color: var(--text-muted); }
.footer-note { font-size: 0.78rem; }

/* Responsive */
@media (max-width: 860px) {
  .app-shell { grid-template-columns: 1fr; }
  .controls-panel { position: static; }
  .header-inner { padding: 0.6rem 1rem; }
  .main-nav { gap: 1rem; }
  .main-nav a { font-size: 0.82rem; }
  .hero-section { padding: 2rem 1rem 0.5rem; }
  .diagram-grid { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); }
}
@media (max-width: 480px) {
  .preset-grid { grid-template-columns: repeat(2, 1fr); }
  .guide-grid { grid-template-columns: 1fr; }
  .results-panel { padding: 1rem; }
  .controls-panel { padding: 1rem; }
}

/* Print */
@media print {
  .site-header, .controls-panel, .presets-section, .guide-section, .faq-section, .site-footer, .action-row { display: none !important; }
  body { background: #fff; color: #000; }
  .results-panel { border: none; padding: 0; background: #fff; }
  .chord-table { font-size: 11pt; }
  .chord-table td:first-child { color: #000; }
  .results-summary { border: 1px solid #ccc; background: #f5f5f5; color: #000; }
  .results-summary strong { color: #000; }
  .fretboard { background: #f0e8d8; max-width: 300px; }
}

/* Toast */
.toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: var(--bg-panel);
  border: 1px solid var(--accent);
  color: var(--text);
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius);
  font-size: 0.9rem;
  z-index: 200;
  box-shadow: var(--shadow);
  animation: fadeIn 0.2s ease;
}
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* Chord shape chip */
.shape-chip {
  display: inline-block;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.15rem 0.5rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent);
  margin: 0 0.15rem;
}



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