/* ============================================================
   Fantasy Name Generator — Design System
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;600;700&family=Raleway:wght@300;400;500;600&display=swap');

/* ── Variables ─────────────────────────────────────────────── */
:root {
  --bg-primary:    #0f0e17;
  --bg-secondary:  #1a1a2e;
  --bg-card:       #16213e;
  --accent:        #c9a84c;
  --accent-hover:  #e8c96d;
  --accent-glow:   rgba(201, 168, 76, 0.25);
  --text-primary:  #fffffe;
  --text-secondary:#a7a9be;
  --border:        #2e2e4a;
  --border-accent: #c9a84c55;
  --shadow:        0 4px 24px rgba(0,0,0,0.5);
  --radius:        8px;
  --radius-lg:     14px;
}

/* ── Reset ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Raleway', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.7;
  min-height: 100vh;
}
a { color: var(--accent); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--accent-hover); }
img { max-width: 100%; display: block; }
ul { list-style: none; }

/* ── Typography ────────────────────────────────────────────── */
h1, h2, h3, h4 {
  font-family: 'Cinzel', serif;
  font-weight: 700;
  line-height: 1.25;
  color: var(--text-primary);
}
h1 { font-size: clamp(1.8rem, 4vw, 3rem); }
h2 { font-size: clamp(1.3rem, 3vw, 2rem); margin-bottom: 0.75rem; }
h3 { font-size: clamp(1.1rem, 2.5vw, 1.5rem); }
p  { color: var(--text-secondary); margin-bottom: 1rem; }
p:last-child { margin-bottom: 0; }

/* ── Layout ────────────────────────────────────────────────── */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.25rem;
}
.section { padding: 3rem 0; }
.section + .section { border-top: 1px solid var(--border); }

/* ── Header / Nav ──────────────────────────────────────────── */
.site-header {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  height: 64px;
}
.site-logo {
  font-family: 'Cinzel', serif;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--accent);
  white-space: nowrap;
}
.site-logo:hover { color: var(--accent-hover); }

.nav-links {
  display: flex;
  gap: 1.5rem;
  align-items: center;
}
.nav-links a {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: color 0.2s;
}
.nav-links a:hover { color: var(--accent); }

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  color: var(--text-primary);
}
.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: currentColor;
  margin: 5px 0;
  transition: 0.3s;
}

/* ── Ad Units ──────────────────────────────────────────────── */
.ad-unit {
  background: var(--bg-secondary);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.ad-leaderboard {
  width: 100%;
  max-width: 728px;
  height: 90px;
  margin: 1.5rem auto;
}
.ad-rectangle {
  width: 336px;
  height: 280px;
  margin: 1.5rem auto;
}

/* ── Hero (Homepage) ───────────────────────────────────────── */
.hero {
  padding: 5rem 0 4rem;
  text-align: center;
  background: radial-gradient(ellipse at 50% 0%, rgba(201,168,76,0.08) 0%, transparent 70%);
}
.hero h1 { margin-bottom: 1rem; }
.hero h2 {
  font-family: 'Raleway', sans-serif;
  font-weight: 400;
  font-size: clamp(1rem, 2.5vw, 1.3rem);
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
}
.hero p {
  max-width: 600px;
  margin: 0 auto 2rem;
  font-size: 1.05rem;
}
.hero-divider {
  width: 80px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  margin: 2rem auto 0;
}

/* ── Category Grid ─────────────────────────────────────────── */
.category-section { padding: 3rem 0; }
.category-section h2 {
  text-align: center;
  margin-bottom: 2rem;
  color: var(--accent);
}
.category-group { margin-bottom: 2.5rem; }
.category-group h3 {
  font-size: 0.8rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-accent);
}
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.75rem;
}
.card-link {
  display: block;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: border-color 0.2s, color 0.2s, transform 0.15s, box-shadow 0.2s;
  text-align: center;
}
.card-link:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px var(--accent-glow);
}

/* ── Generator Card ────────────────────────────────────────── */
.generator-wrapper {
  max-width: 720px;
  margin: 0 auto;
  padding: 2rem 0;
}
.generator-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-lg);
  padding: 2rem 2.5rem;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}
.generator-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
}

/* Gender Toggle */
.gender-toggle {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  background: var(--bg-primary);
  border-radius: 50px;
  padding: 4px;
  width: fit-content;
}
.gender-btn {
  background: none;
  border: none;
  border-radius: 50px;
  padding: 0.45rem 1.25rem;
  font-family: 'Raleway', sans-serif;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.gender-btn.active {
  background: var(--accent);
  color: var(--bg-primary);
  font-weight: 600;
}
.gender-btn:hover:not(.active) { color: var(--text-primary); }

/* Generate Button */
.btn-generate {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  background: var(--accent);
  color: var(--bg-primary);
  border: none;
  border-radius: 50px;
  padding: 0.85rem 2.5rem;
  font-family: 'Cinzel', serif;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, box-shadow 0.2s, transform 0.15s;
  box-shadow: 0 0 20px var(--accent-glow);
  margin-bottom: 2rem;
  letter-spacing: 0.04em;
}
.btn-generate:hover {
  background: var(--accent-hover);
  box-shadow: 0 0 32px rgba(201,168,76,0.45);
  transform: translateY(-1px);
}
.btn-generate:active { transform: translateY(0); }
.btn-generate svg { width: 18px; height: 18px; }

/* Results */
.results-list {
  display: grid;
  gap: 0.6rem;
}
.result-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  transition: border-color 0.2s;
}
.result-item:hover { border-color: var(--border-accent); }
.result-name {
  font-family: 'Cinzel', serif;
  font-size: 1.05rem;
  color: var(--text-primary);
}
.btn-copy {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.3rem 0.75rem;
  font-size: 0.78rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
  font-family: 'Raleway', sans-serif;
}
.btn-copy:hover { border-color: var(--accent); color: var(--accent); }
.btn-copy.copied { border-color: #4caf50; color: #4caf50; }

/* Empty state */
.results-empty {
  text-align: center;
  padding: 2rem;
  color: var(--text-secondary);
  font-style: italic;
}

/* ── Content Sections ──────────────────────────────────────── */
.content-section {
  max-width: 720px;
  margin: 0 auto;
  padding: 2.5rem 0;
}
.content-section h2 { margin-bottom: 1rem; }

/* Lore box */
.lore-box {
  background: var(--bg-secondary);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 1.5rem;
  margin: 1.5rem 0;
}
.lore-box p { margin: 0; }

/* ── FAQ ───────────────────────────────────────────────────── */
.faq-section {
  max-width: 720px;
  margin: 0 auto;
  padding: 2.5rem 0;
}
.faq-section h2 { margin-bottom: 1.5rem; }
.faq-item {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 0.75rem;
  overflow: hidden;
}
.faq-question {
  width: 100%;
  background: var(--bg-secondary);
  border: none;
  padding: 1rem 1.25rem;
  text-align: left;
  font-family: 'Raleway', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background 0.2s;
}
.faq-question:hover { background: var(--bg-card); }
.faq-question .faq-icon {
  color: var(--accent);
  font-size: 1.2rem;
  font-weight: 300;
  transition: transform 0.3s;
  flex-shrink: 0;
}
.faq-item.open .faq-icon { transform: rotate(45deg); }
.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease, padding 0.3s;
  background: var(--bg-card);
}
.faq-item.open .faq-answer { max-height: 300px; padding: 1rem 1.25rem; }
.faq-answer p { margin: 0; font-size: 0.9rem; }

/* ── Related Generators ────────────────────────────────────── */
.related-section {
  max-width: 720px;
  margin: 0 auto;
  padding: 2.5rem 0;
}
.related-section h2 { margin-bottom: 1.25rem; }
.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.75rem;
}
.related-link {
  display: block;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-align: center;
  transition: border-color 0.2s, color 0.2s;
}
.related-link:hover { border-color: var(--accent); color: var(--accent); }

/* ── Footer ────────────────────────────────────────────────── */
.site-footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  padding: 3rem 0 2rem;
  margin-top: 4rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 2rem;
  margin-bottom: 2rem;
}
.footer-brand .site-logo { display: inline-block; margin-bottom: 0.75rem; }
.footer-brand p { font-size: 0.9rem; }
.footer-col h4 {
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1rem;
}
.footer-col ul li { margin-bottom: 0.5rem; }
.footer-col ul li a { font-size: 0.9rem; color: var(--text-secondary); }
.footer-col ul li a:hover { color: var(--accent); }
.footer-bottom {
  border-top: 1px solid var(--border);
  padding-top: 1.5rem;
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

/* ── Breadcrumb ────────────────────────────────────────────── */
.breadcrumb {
  padding: 0.75rem 0;
  font-size: 0.85rem;
  color: var(--text-secondary);
}
.breadcrumb a { color: var(--text-secondary); }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb span { margin: 0 0.4rem; }

/* ── Page Header (subpages) ─────────────────────────────────── */
.page-header {
  padding: 2.5rem 0 1.5rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0.5rem;
}
.page-header h1 { margin-bottom: 0.75rem; }
.page-header .lead {
  max-width: 620px;
  font-size: 1.05rem;
}

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 768px) {
  .nav-links { display: none; flex-direction: column; position: absolute; top: 64px; left: 0; right: 0; background: var(--bg-secondary); border-bottom: 1px solid var(--border); padding: 1rem 1.25rem; gap: 1rem; }
  .nav-links.open { display: flex; }
  .nav-toggle { display: block; }
  .site-header { position: relative; }

  .footer-grid { grid-template-columns: 1fr; }
  .generator-card { padding: 1.5rem 1.25rem; }
  .ad-leaderboard { height: 60px; font-size: 0.7rem; }
  .card-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
}

@media (max-width: 480px) {
  .gender-toggle { width: 100%; justify-content: center; }
  .btn-generate { width: 100%; justify-content: center; }
}
