/* Film Noir Detective Name Brewery — Styles */
:root {
  --bg-deep: #0d0a06;
  --bg-card: #1a1207;
  --bg-surface: #231a0e;
  --amber: #c8a96e;
  --amber-bright: #e0c48a;
  --amber-dim: #8a7245;
  --text-primary: #e8dcc8;
  --text-secondary: #b0a080;
  --text-muted: #7a6c52;
  --danger: #c0392b;
  --danger-hover: #e74c3c;
  --border: #3d2f18;
  --border-light: #4a3a20;
  --shadow: rgba(0, 0, 0, 0.5);
  --radius: 8px;
  --radius-lg: 14px;
  --font-stack: 'Georgia', 'Palatino Linotype', 'Times New Roman', serif;
  --font-ui: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

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

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

body {
  font-family: var(--font-stack);
  background-color: var(--bg-deep);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--amber); text-decoration: none; }
a:hover { color: var(--amber-bright); text-decoration: underline; }

/* Header */
.site-header {
  background: var(--bg-card);
  border-bottom: 2px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  max-width: 1100px;
  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(--amber);
  font-size: 1.2rem;
  font-weight: bold;
  text-decoration: none;
  flex-shrink: 0;
}

.logo:hover { color: var(--amber-bright); text-decoration: none; }

.logo-text { letter-spacing: 0.02em; }

.site-nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex-wrap: wrap;
}

.site-nav a {
  color: var(--text-secondary);
  font-family: var(--font-ui);
  font-size: 0.85rem;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius);
  text-decoration: none;
  transition: color 0.15s, background 0.15s;
}

.site-nav a:hover {
  color: var(--amber);
  background: var(--bg-surface);
  text-decoration: none;
}

/* Hero */
.hero-section {
  max-width: 1100px;
  margin: 0 auto;
  padding: 4rem 1.5rem 3rem;
  text-align: center;
  position: relative;
}

.hero-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 300px;
  background: radial-gradient(ellipse, rgba(200,169,110,0.08) 0%, transparent 70%);
  pointer-events: none;
}

.hero-title {
  font-size: clamp(2rem, 5vw, 3.2rem);
  color: var(--amber);
  line-height: 1.2;
  margin-bottom: 1rem;
  text-shadow: 0 0 40px rgba(200,169,110,0.15);
}

.hero-sub {
  font-size: 1.15rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto 2rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  font-family: var(--font-ui);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.6rem 1.4rem;
  border-radius: var(--radius);
  border: 2px solid transparent;
  cursor: pointer;
  transition: all 0.15s;
  text-decoration: none;
  line-height: 1.3;
}

.btn:hover { text-decoration: none; }

.btn-primary {
  background: var(--amber);
  color: var(--bg-deep);
  border-color: var(--amber);
}

.btn-primary:hover {
  background: var(--amber-bright);
  border-color: var(--amber-bright);
  color: var(--bg-deep);
}

.btn-secondary {
  background: transparent;
  color: var(--amber);
  border-color: var(--amber-dim);
}

.btn-secondary:hover {
  background: var(--bg-surface);
  border-color: var(--amber);
  color: var(--amber-bright);
}

.btn-danger {
  background: transparent;
  color: var(--danger);
  border-color: var(--danger);
}

.btn-danger:hover {
  background: var(--danger);
  color: #fff;
}

.btn-danger:disabled,
.btn-secondary:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn-lg { font-size: 1.05rem; padding: 0.8rem 2rem; }

/* Sections */
section {
  max-width: 1100px;
  margin: 0 auto;
  padding: 3rem 1.5rem;
}

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

.section-header h2 {
  font-size: 1.8rem;
  color: var(--amber);
  margin-bottom: 0.4rem;
}

.section-sub {
  color: var(--text-secondary);
  font-size: 1rem;
}

/* Controls */
.controls-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.control-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.control-label {
  font-family: var(--font-ui);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  font-weight: 600;
}

.mood-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.chip {
  font-family: var(--font-ui);
  font-size: 0.85rem;
  padding: 0.45rem 1.1rem;
  border-radius: 100px;
  border: 2px solid var(--border-light);
  background: var(--bg-surface);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s;
}

.chip:hover {
  border-color: var(--amber-dim);
  color: var(--text-primary);
}

.chip-active {
  background: var(--amber);
  color: var(--bg-deep);
  border-color: var(--amber);
  font-weight: 600;
}

.chip-active:hover {
  background: var(--amber-bright);
  color: var(--bg-deep);
  border-color: var(--amber-bright);
}

.select-input {
  font-family: var(--font-ui);
  font-size: 0.9rem;
  padding: 0.55rem 0.85rem;
  border-radius: var(--radius);
  border: 2px solid var(--border-light);
  background: var(--bg-surface);
  color: var(--text-primary);
  appearance: none;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23c8a96e' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2.25rem;
}

.select-input:focus {
  outline: none;
  border-color: var(--amber);
  box-shadow: 0 0 0 3px rgba(200,169,110,0.15);
}

.batch-input {
  width: 80px;
  text-align: center;
}

/* Toggle */
.toggle-wrap {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.toggle-input { position: absolute; opacity: 0; width: 0; height: 0; }

.toggle-visual {
  width: 44px;
  height: 24px;
  background: var(--bg-surface);
  border: 2px solid var(--border-light);
  border-radius: 12px;
  display: flex;
  align-items: center;
  padding: 2px;
  cursor: pointer;
  transition: all 0.2s;
  flex-shrink: 0;
}

.toggle-knob {
  width: 16px;
  height: 16px;
  background: var(--text-muted);
  border-radius: 50%;
  transition: all 0.2s;
}

.toggle-input:checked + .toggle-visual {
  background: rgba(200,169,110,0.2);
  border-color: var(--amber);
}

.toggle-input:checked + .toggle-visual .toggle-knob {
  background: var(--amber);
  transform: translateX(20px);
}

.toggle-input:focus-visible + .toggle-visual {
  box-shadow: 0 0 0 3px rgba(200,169,110,0.3);
}

.toggle-status {
  font-family: var(--font-ui);
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Result Card */
.result-card {
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  text-align: center;
  position: relative;
  box-shadow: 0 20px 60px var(--shadow);
}

.result-name-wrap {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.name-part-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  padding: 0.75rem 1.25rem;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-surface);
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.15s;
  font-family: var(--font-stack);
  position: relative;
}

.name-part-btn:hover {
  border-color: var(--amber);
  background: rgba(200,169,110,0.08);
}

.name-part-btn:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 2px;
}

.name-label {
  font-family: var(--font-ui);
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
}

.name-value {
  font-size: 1.4rem;
  color: var(--amber-bright);
}

.name-part-btn-nick .name-value {
  font-size: 1.1rem;
  font-style: italic;
  color: var(--text-secondary);
}

.reroll-icon {
  position: absolute;
  top: 4px;
  right: 4px;
  color: var(--text-muted);
  opacity: 0.5;
  transition: opacity 0.15s;
}

.name-part-btn:hover .reroll-icon { opacity: 1; color: var(--amber); }

.full-name-display {
  font-size: 2rem;
  color: var(--amber-bright);
  font-weight: bold;
  margin-bottom: 0.75rem;
  text-shadow: 0 0 30px rgba(200,169,110,0.15);
}

.hook-display {
  font-size: 1.05rem;
  color: var(--text-secondary);
  font-style: italic;
  max-width: 600px;
  margin: 0 auto 2rem;
  line-height: 1.5;
}

.result-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.copied-toast {
  position: absolute;
  bottom: 1rem;
  right: 1.5rem;
  font-family: var(--font-ui);
  font-size: 0.8rem;
  color: var(--amber);
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}

.copied-toast.show { opacity: 1; }

/* Batch Section */
.batch-section {
  border-top: 1px solid var(--border);
}

.batch-controls {
  display: flex;
  align-items: flex-end;
  gap: 1rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.batch-results {
  display: grid;
  gap: 1rem;
}

.batch-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

.batch-item-info { flex: 1; }

.batch-item-name {
  font-size: 1.15rem;
  color: var(--amber-bright);
  font-weight: bold;
  margin-bottom: 0.25rem;
}

.batch-item-name .batch-nick {
  font-weight: normal;
  font-style: italic;
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.batch-item-hook {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-style: italic;
}

.batch-item-mood {
  font-family: var(--font-ui);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--amber-dim);
  margin-bottom: 0.25rem;
}

.batch-item-actions {
  display: flex;
  gap: 0.4rem;
  flex-shrink: 0;
}

.btn-sm {
  font-size: 0.8rem;
  padding: 0.35rem 0.8rem;
}

/* Saved Section */
.saved-section {
  border-top: 1px solid var(--border);
}

.saved-actions-bar {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.saved-list {
  display: grid;
  gap: 0.75rem;
}

.saved-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.saved-item-name {
  font-size: 1.1rem;
  color: var(--amber-bright);
  font-weight: bold;
}

.saved-item-name .saved-nick {
  font-weight: normal;
  font-style: italic;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.saved-item-hook {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-style: italic;
  margin-top: 0.15rem;
}

.saved-item-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.empty-state {
  text-align: center;
  color: var(--text-muted);
  padding: 2rem;
  font-style: italic;
}

/* About Section */
.about-section {
  border-top: 1px solid var(--border);
}

.about-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
}

.about-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
}

.about-card h3 {
  color: var(--amber);
  font-size: 1.1rem;
  margin-bottom: 0.75rem;
}

.about-card p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.6;
}

/* Footer */
.site-footer {
  margin-top: auto;
  background: var(--bg-card);
  border-top: 2px solid var(--border);
  padding: 2rem 1.5rem;
}

.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  text-align: center;
}

.footer-brand {
  color: var(--amber);
  font-weight: bold;
  margin-bottom: 0.3rem;
}

.footer-meta {
  font-family: var(--font-ui);
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.footer-nav {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.footer-nav a {
  font-family: var(--font-ui);
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.footer-nav a:hover { color: var(--amber); }

/* Responsive */
@media (max-width: 768px) {
  .header-inner {
    flex-direction: column;
    padding: 0.75rem 1rem;
  }

  .site-nav {
    gap: 0.15rem;
    justify-content: center;
  }

  .site-nav a {
    font-size: 0.8rem;
    padding: 0.3rem 0.55rem;
  }

  .hero-section {
    padding: 2.5rem 1rem 2rem;
  }

  section {
    padding: 2rem 1rem;
  }

  .result-card {
    padding: 1.75rem 1.25rem;
  }

  .full-name-display {
    font-size: 1.5rem;
  }

  .batch-item {
    flex-direction: column;
    align-items: flex-start;
  }

  .saved-item {
    flex-direction: column;
    align-items: flex-start;
  }

  .batch-controls {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 480px) {
  .controls-grid {
    grid-template-columns: 1fr;
  }

  .about-grid {
    grid-template-columns: 1fr;
  }

  .result-name-wrap {
    flex-direction: column;
    align-items: stretch;
  }
}

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

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



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