/* =========================================
   HEROFORGE — styles.css
   Aesthetic: Dark arcane / illuminated manuscript
   Fonts: Cinzel Decorative + Crimson Pro
   ========================================= */

/* ---- CSS Variables ---- */
:root {
  --bg:           #0d0b14;
  --surface:      #17132a;
  --surface-alt:  #1f1a36;
  --border:       #2e2550;
  --accent:       #c9a227;
  --accent-dim:   #8b6f14;
  --accent-glow:  rgba(201,162,39,0.18);
  --red:          #c94040;
  --text-primary: #ede8d5;
  --text-muted:   #8a8099;
  --text-faint:   #463e5f;
  --shadow:       rgba(0,0,0,0.6);

  --font-display: 'Cinzel Decorative', serif;
  --font-body:    'Crimson Pro', Georgia, serif;

  --radius:     12px;
  --radius-sm:  6px;
  --transition: 0.22s ease;
}

/* Light Mode */
body.light {
  --bg:           #f5f0e8;
  --surface:      #ffffff;
  --surface-alt:  #ede8d8;
  --border:       #d6cdb8;
  --accent:       #a07b10;
  --accent-dim:   #c9a227;
  --accent-glow:  rgba(160,123,16,0.12);
  --text-primary: #1a1530;
  --text-muted:   #5a5070;
  --text-faint:   #b0a898;
  --shadow:       rgba(0,0,0,0.12);
}

/* ---- Reset & Base ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 1.125rem;
  line-height: 1.7;
  transition: background var(--transition), color var(--transition);
  min-height: 100vh;
}

img { max-width: 100%; display: block; }
a { color: var(--accent); text-decoration: none; transition: opacity var(--transition); }
a:hover { opacity: 0.8; }

/* ---- Theme Toggle ---- */
.theme-toggle {
  position: fixed;
  top: 1.25rem;
  right: 1.25rem;
  z-index: 999;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 44px;
  height: 44px;
  cursor: pointer;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition), border-color var(--transition), transform 0.3s;
  box-shadow: 0 2px 12px var(--shadow);
}
.theme-toggle:hover { transform: rotate(20deg) scale(1.1); }

/* ---- Navbar ---- */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 2rem;
  background: rgba(13, 11, 20, 0.85);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}
body.light .navbar { background: rgba(245,240,232,0.9); }

.nav-logo {
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--accent);
  letter-spacing: 0.04em;
  font-weight: 700;
}

.nav-links {
  list-style: none;
  display: flex;
  gap: 2rem;
}

.nav-links a {
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-weight: 600;
  transition: color var(--transition);
}
.nav-links a:hover,
.nav-links a.active { color: var(--accent); opacity: 1; }

/* ---- Site Hero (Homepage) ---- */
.site-hero {
  position: relative;
  min-height: 52vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 5rem 2rem 4rem;
  overflow: hidden;
}

.site-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 80% 60% at 50% 40%, rgba(201,162,39,0.1) 0%, transparent 70%),
              radial-gradient(ellipse 60% 40% at 20% 80%, rgba(130,60,200,0.08) 0%, transparent 60%);
  pointer-events: none;
}

.hero-bg-runes {
  position: absolute;
  inset: 0;
  display: flex;
  justify-content: space-around;
  align-items: center;
  font-size: 2rem;
  opacity: 0.04;
  pointer-events: none;
  animation: runeFloat 8s ease-in-out infinite alternate;
}

@keyframes runeFloat {
  from { transform: translateY(0); }
  to   { transform: translateY(-10px); }
}

.hero-content {
  position: relative;
  z-index: 1;
}

.hero-eyebrow {
  font-family: var(--font-body);
  font-size: 0.9rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.75rem;
  font-style: italic;
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 7vw, 5rem);
  line-height: 1.05;
  color: var(--text-primary);
  margin-bottom: 1.25rem;
  text-shadow: 0 0 60px var(--accent-glow);
}

.hero-title em {
  font-style: italic;
  color: var(--accent);
  display: block;
}

.hero-subtitle {
  font-size: 1.2rem;
  color: var(--text-muted);
  max-width: 540px;
  margin: 0 auto;
  font-style: italic;
}

/* ---- Main Content ---- */
.main-content {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 1.5rem 5rem;
}

/* ---- Generator Card ---- */
.generator-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2.5rem 2rem;
  margin-bottom: 4rem;
  box-shadow: 0 8px 40px 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);
}

/* ---- Options Grid ---- */
.options-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.75rem;
  margin-bottom: 2rem;
}

.option-label {
  display: block;
  font-family: var(--font-body);
  font-size: 0.8rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.65rem;
  font-weight: 600;
}

.pill-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.pill {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 0.45rem 1rem;
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 0.95rem;
  cursor: pointer;
  transition: all var(--transition);
}

.pill:hover {
  border-color: var(--accent-dim);
  color: var(--text-primary);
}

.pill.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #0d0b14;
  font-weight: 600;
}

/* ---- Generate Button ---- */
.generate-btn {
  width: 100%;
  background: linear-gradient(135deg, var(--accent) 0%, #e8b830 100%);
  color: #0d0b14;
  border: none;
  border-radius: var(--radius-sm);
  padding: 1.1rem 2rem;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  transition: transform 0.15s, box-shadow 0.15s;
  box-shadow: 0 4px 20px rgba(201,162,39,0.35);
  margin-bottom: 2rem;
}

.generate-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(201,162,39,0.5);
}

.generate-btn:active {
  transform: translateY(0);
}

.btn-icon { font-size: 1.2rem; }

/* ---- Results ---- */
.results-section { min-height: 120px; }

.results-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 120px;
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-faint);
  font-style: italic;
  font-size: 1rem;
}

.names-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
}

.name-card {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1.1rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  animation: cardIn 0.35s ease both;
  transition: border-color var(--transition);
}

.name-card:hover { border-color: var(--accent-dim); }

@keyframes cardIn {
  from { opacity: 0; transform: translateY(12px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.name-card-text {
  font-family: var(--font-display);
  font-size: 0.95rem;
  color: var(--text-primary);
  line-height: 1.3;
  flex: 1;
}

.name-card-actions {
  display: flex;
  gap: 0.5rem;
}

.action-btn {
  flex: 1;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.35rem 0.5rem;
  font-size: 0.78rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition);
  font-family: var(--font-body);
}
.action-btn:hover { border-color: var(--accent-dim); color: var(--accent); }
.action-btn.fav-active { color: var(--accent); border-color: var(--accent); }
.action-btn.copied { color: #4caf50; border-color: #4caf50; }

/* ---- How It Works ---- */
.how-section { margin-bottom: 4rem; }

.section-title {
  font-family: var(--font-display);
  font-size: 1.4rem;
  color: var(--accent);
  margin-bottom: 2rem;
  letter-spacing: 0.05em;
}

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

.step-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem 1.5rem;
  position: relative;
  overflow: hidden;
}

.step-num {
  font-family: var(--font-display);
  font-size: 2.5rem;
  color: var(--text-faint);
  display: block;
  margin-bottom: 0.5rem;
  line-height: 1;
}

.step-card h3 {
  font-family: var(--font-display);
  font-size: 0.9rem;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  letter-spacing: 0.04em;
}

.step-card p {
  font-size: 0.95rem;
  color: var(--text-muted);
}

/* ---- Favorites ---- */
.favorites-section { margin-bottom: 4rem; }

.favorites-list {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  min-height: 80px;
}

.fav-empty {
  color: var(--text-faint);
  font-style: italic;
  font-size: 1rem;
}

.fav-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.fav-tag {
  background: var(--surface-alt);
  border: 1px solid var(--accent-dim);
  border-radius: 100px;
  padding: 0.3rem 0.9rem;
  font-family: var(--font-display);
  font-size: 0.75rem;
  color: var(--accent);
  cursor: pointer;
  transition: background var(--transition);
}

.fav-tag:hover { background: var(--accent-glow); }

.clear-fav-btn {
  margin-top: 1rem;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.5rem 1.25rem;
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 0.9rem;
  cursor: pointer;
  transition: all var(--transition);
}
.clear-fav-btn:hover { border-color: var(--red); color: var(--red); }

/* ---- Blog Teaser ---- */
.blog-teaser {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 3rem 2.5rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.blog-teaser::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
}

.teaser-tag {
  display: inline-block;
  background: var(--accent-glow);
  border: 1px solid var(--accent-dim);
  border-radius: 100px;
  padding: 0.3rem 1rem;
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1.25rem;
}

.blog-teaser h2 {
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 3vw, 2rem);
  margin-bottom: 1rem;
  color: var(--text-primary);
}

.blog-teaser p {
  color: var(--text-muted);
  max-width: 480px;
  margin: 0 auto 1.75rem;
  font-style: italic;
}

.teaser-btn {
  display: inline-block;
  background: var(--accent);
  color: #0d0b14;
  padding: 0.7rem 2rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  transition: transform var(--transition), box-shadow var(--transition);
  opacity: 1;
}
.teaser-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px var(--accent-glow);
  opacity: 1;
}

/* ============================================
   BLOG PAGE
   ============================================ */

.blog-hero {
  background: linear-gradient(180deg, var(--surface-alt) 0%, var(--bg) 100%);
  border-bottom: 1px solid var(--border);
  padding: 5rem 2rem 4rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.blog-hero::before {
  content: '📜';
  position: absolute;
  top: 1.5rem; right: 2rem;
  font-size: 4rem;
  opacity: 0.06;
}

.blog-hero-inner { position: relative; z-index: 1; }

.blog-tag {
  display: inline-block;
  background: var(--accent-glow);
  border: 1px solid var(--accent-dim);
  border-radius: 100px;
  padding: 0.3rem 1rem;
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1.25rem;
}

.blog-hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3.5rem);
  line-height: 1.1;
  margin-bottom: 0.75rem;
}

.blog-hero h1 em { font-style: italic; color: var(--accent); }

.blog-meta {
  color: var(--text-muted);
  font-size: 0.95rem;
  font-style: italic;
}

.blog-main {
  max-width: 800px;
  margin: 0 auto;
  padding: 3rem 1.5rem 5rem;
}

.blog-article { font-size: 1.1rem; }

.blog-lead {
  font-size: 1.2rem;
  line-height: 1.8;
  color: var(--text-primary);
  margin-bottom: 2rem;
  font-style: italic;
}

.cta-inline {
  background: var(--surface);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 1rem 1.5rem;
  margin-bottom: 2.5rem;
  font-size: 1rem;
}

/* TOC */
.toc {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem 2rem;
  margin-bottom: 3rem;
}

.toc-title {
  font-family: var(--font-display);
  font-size: 0.9rem;
  letter-spacing: 0.1em;
  color: var(--accent);
  margin-bottom: 0.75rem;
  text-transform: uppercase;
}

.toc-list {
  list-style: none;
  counter-reset: toc;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.35rem;
}

.toc-list li { counter-increment: toc; }

.toc-list a {
  font-size: 0.95rem;
  color: var(--text-muted);
  transition: color var(--transition);
}
.toc-list a:hover { color: var(--accent); }

/* Blog Sections */
.blog-article section { margin-bottom: 3rem; }

.blog-article h2 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--text-primary);
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.blog-article h3 {
  font-family: var(--font-display);
  font-size: 1rem;
  color: var(--accent);
  margin: 1.5rem 0 0.5rem;
}

.blog-article p { margin-bottom: 1rem; color: var(--text-muted); }

/* Name Table */
.name-table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  margin: 1.25rem 0;
}

.name-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.name-table thead tr {
  background: var(--surface-alt);
}

.name-table th {
  padding: 0.75rem 1rem;
  text-align: left;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}

.name-table td {
  padding: 0.65rem 1rem;
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
  vertical-align: top;
}

.name-table tr:last-child td { border-bottom: none; }
.name-table tbody tr:hover { background: var(--surface-alt); }

.name-table td:first-child { color: var(--text-faint); font-size: 0.85rem; width: 40px; }

/* Name List */
.name-list {
  list-style: none;
  display: grid;
  gap: 0.5rem;
}

.name-list li {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  font-size: 0.95rem;
  color: var(--text-muted);
  transition: border-color var(--transition);
}

.name-list li:hover { border-color: var(--accent-dim); }

/* Blog CTA */
.blog-cta {
  background: linear-gradient(135deg, var(--surface) 0%, var(--surface-alt) 100%);
  border: 1px solid var(--accent-dim);
  border-radius: var(--radius);
  padding: 3rem 2rem;
  text-align: center;
  margin-top: 3rem;
  box-shadow: 0 0 40px var(--accent-glow);
}

.blog-cta h2 {
  font-family: var(--font-display);
  font-size: 1.6rem;
  color: var(--text-primary);
  margin-bottom: 0.75rem;
  border: none;
  padding: 0;
}

.blog-cta p {
  color: var(--text-muted);
  max-width: 460px;
  margin: 0 auto 1.75rem;
}

.blog-cta-btn {
  display: inline-block;
  background: var(--accent);
  color: #0d0b14;
  padding: 0.85rem 2.25rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  transition: transform var(--transition), box-shadow var(--transition);
  opacity: 1;
}
.blog-cta-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px var(--accent-glow);
  opacity: 1;
}

/* ---- Footer ---- */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 2.5rem 2rem;
  text-align: center;
}

.footer-inner { display: flex; flex-direction: column; align-items: center; gap: 1rem; }

.footer-logo {
  font-family: var(--font-display);
  font-size: 1rem;
  color: var(--accent);
  letter-spacing: 0.05em;
}

.footer-nav {
  display: flex;
  gap: 2rem;
}

.footer-nav a {
  font-size: 0.9rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
}

.footer-nav a:hover { color: var(--accent); opacity: 1; }

.footer-copy {
  font-size: 0.8rem;
  color: var(--text-faint);
}

/* ---- Responsive ---- */
@media (max-width: 600px) {
  .navbar { padding: 0.85rem 1rem; }
  .nav-links { gap: 1rem; }
  .nav-links a { font-size: 0.85rem; }
  .site-hero { padding: 4rem 1.25rem 3rem; }
  .generator-card { padding: 1.75rem 1.25rem; }
  .options-grid { grid-template-columns: 1fr; gap: 1.25rem; }
  .main-content { padding: 0 1rem 4rem; }
  .blog-main { padding: 2rem 1rem 4rem; }
  .blog-hero { padding: 4rem 1.25rem 3rem; }
  .blog-teaser { padding: 2rem 1.25rem; }
  .toc-list { grid-template-columns: 1fr; }
  .footer-nav { gap: 1.25rem; flex-wrap: wrap; justify-content: center; }
  .theme-toggle { top: 0.75rem; right: 0.75rem; }
  .names-grid { grid-template-columns: 1fr; }
}
