/* ================================================================
   ElvenScribe — DnD Elf Name Generator
   Aesthetic: Dark Forest / Ancient Tome — deep greens, gold, ivory
   ================================================================ */

:root {
  --bg-deep:      #0d1117;
  --bg-card:      #141b22;
  --bg-card2:     #1a2330;
  --border:       #2a3a4a;
  --gold:         #c9a84c;
  --gold-light:   #e8c97a;
  --gold-dim:     #7a5f2a;
  --green:        #3d7a5a;
  --green-light:  #5aab7e;
  --text-primary: #e8e0d0;
  --text-muted:   #8a9aaa;
  --text-dim:     #5a6a7a;
  --accent-red:   #8b3a3a;
  --font-display: 'Cinzel Decorative', serif;
  --font-title:   'Cinzel', serif;
  --font-body:    'Lato', sans-serif;
  --radius:       8px;
  --radius-lg:    16px;
  --shadow:       0 4px 24px rgba(0,0,0,0.5);
  --shadow-gold:  0 0 24px rgba(201,168,76,0.15);
  --transition:   0.25s ease;
}

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

html { scroll-behavior: smooth; }

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

/* ---- Utility ---- */
.container { max-width: 1100px; margin: 0 auto; padding: 0 1.5rem; }
.container--narrow { max-width: 760px; }

/* ================================================================
   NAVBAR
   ================================================================ */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(13, 17, 23, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav-logo {
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--gold);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  letter-spacing: 0.05em;
  transition: color var(--transition);
}
.nav-logo:hover { color: var(--gold-light); }
.logo-rune { font-size: 0.9rem; }
.nav-links {
  list-style: none;
  display: flex;
  gap: 2rem;
}
.nav-links a {
  font-family: var(--font-title);
  font-size: 0.85rem;
  color: var(--text-muted);
  text-decoration: none;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: color var(--transition);
}
.nav-links a:hover,
.nav-links a.active { color: var(--gold); }

/* ================================================================
   HERO
   ================================================================ */
.hero {
  position: relative;
  padding: 5rem 1.5rem 4rem;
  text-align: center;
  overflow: hidden;
}
.hero-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 50% 0%, rgba(61,122,90,0.18) 0%, transparent 70%),
    radial-gradient(ellipse 60% 40% at 20% 100%, rgba(201,168,76,0.08) 0%, transparent 60%);
  pointer-events: none;
}
.hero-content { position: relative; z-index: 1; }
.hero-eyebrow {
  font-family: var(--font-title);
  font-size: 0.8rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--green-light);
  margin-bottom: 1rem;
}
.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3.5rem);
  color: var(--gold);
  line-height: 1.2;
  margin-bottom: 1.2rem;
  text-shadow: 0 2px 20px rgba(201,168,76,0.3);
}
.hero-title--post { font-size: clamp(1.5rem, 4vw, 2.4rem); }
.hero-sub {
  max-width: 600px;
  margin: 0 auto;
  color: var(--text-muted);
  font-size: 1.05rem;
}

/* Hero leaves */
.hero-leaves { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.leaf {
  position: absolute;
  font-size: 1.5rem;
  opacity: 0.12;
  animation: drift 8s ease-in-out infinite alternate;
}
.l1 { top: 15%; left: 5%; animation-delay: 0s; }
.l2 { top: 40%; left: 8%; animation-delay: 1s; }
.l3 { top: 20%; right: 6%; animation-delay: 2s; }
.l4 { top: 60%; right: 10%; animation-delay: 0.5s; font-size: 1rem; }
.l5 { top: 75%; left: 15%; animation-delay: 1.5s; }
@keyframes drift {
  from { transform: translateY(0) rotate(-5deg); }
  to   { transform: translateY(-12px) rotate(5deg); }
}

/* Page hero (blog pages) */
.page-hero { padding: 3.5rem 1.5rem 3rem; position: relative; text-align: center; overflow: hidden; }
.page-hero--small { padding: 2.5rem 1.5rem 2.5rem; }

/* Breadcrumb */
.breadcrumb {
  font-family: var(--font-title);
  font-size: 0.78rem;
  letter-spacing: 0.05em;
  color: var(--text-dim);
  margin-bottom: 1rem;
}
.breadcrumb a { color: var(--text-dim); text-decoration: none; }
.breadcrumb a:hover { color: var(--gold); }
.breadcrumb span { margin: 0 0.4rem; }

/* ================================================================
   TOOL SECTION
   ================================================================ */
.tool-section { padding: 3rem 0; }

.section-title {
  font-family: var(--font-title);
  font-size: 1.5rem;
  color: var(--gold);
  text-align: center;
  margin-bottom: 2rem;
  letter-spacing: 0.05em;
}
.section-title::after {
  content: '';
  display: block;
  width: 60px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  margin: 0.6rem auto 0;
}

/* Tool Card */
.tool-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow), var(--shadow-gold);
  position: relative;
  overflow: hidden;
}
.tool-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--green), var(--gold), var(--green));
}

/* Controls */
.tool-controls {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1.2rem;
  margin-bottom: 1.8rem;
}
.control-group { display: flex; flex-direction: column; gap: 0.4rem; }
.control-group label {
  font-family: var(--font-title);
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold-dim);
}
.control-group select {
  background: var(--bg-card2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  padding: 0.6rem 0.9rem;
  font-family: var(--font-body);
  font-size: 0.95rem;
  appearance: none;
  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 fill='%23c9a84c' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.9rem center;
  padding-right: 2.2rem;
  cursor: pointer;
  transition: border-color var(--transition);
}
.control-group select:focus {
  outline: none;
  border-color: var(--gold);
}

/* Checkbox */
.checkbox-group { justify-content: flex-end; padding-bottom: 0.2rem; }
.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.9rem;
  color: var(--text-muted);
  cursor: pointer;
  text-transform: none !important;
  letter-spacing: 0 !important;
  font-family: var(--font-body) !important;
}
.checkbox-label input[type="checkbox"] { display: none; }
.checkmark {
  width: 18px;
  height: 18px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--bg-card2);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition), border-color var(--transition);
  flex-shrink: 0;
}
.checkbox-label input:checked + .checkmark {
  background: var(--gold);
  border-color: var(--gold);
}
.checkbox-label input:checked + .checkmark::after {
  content: '✓';
  font-size: 0.75rem;
  color: var(--bg-deep);
  font-weight: bold;
}

/* Generate Button */
.btn-generate {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.7rem;
  width: 100%;
  padding: 1rem 2rem;
  background: linear-gradient(135deg, var(--green) 0%, #2a5a40 100%);
  border: 1px solid var(--green-light);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-family: var(--font-title);
  font-size: 1.1rem;
  letter-spacing: 0.1em;
  cursor: pointer;
  transition: all var(--transition);
  box-shadow: 0 4px 16px rgba(61,122,90,0.3);
}
.btn-generate:hover {
  background: linear-gradient(135deg, var(--green-light) 0%, var(--green) 100%);
  box-shadow: 0 6px 24px rgba(90,171,126,0.4);
  transform: translateY(-1px);
}
.btn-generate:active { transform: translateY(0); }
.btn-generate--small { width: auto; font-size: 0.95rem; padding: 0.8rem 1.8rem; }
.btn-rune { font-size: 0.8rem; opacity: 0.7; }

/* Results Area */
.results-area {
  min-height: 120px;
  margin-top: 1.5rem;
  padding: 1.2rem;
  background: var(--bg-card2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  position: relative;
}
.results-placeholder {
  color: var(--text-dim);
  text-align: center;
  font-style: italic;
  padding: 1.5rem 0;
}
.names-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.6rem;
  animation: fadeIn 0.4s ease;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.name-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.7rem 1rem;
  font-family: var(--font-title);
  font-size: 0.92rem;
  color: var(--gold-light);
  letter-spacing: 0.04em;
  transition: border-color var(--transition), background var(--transition);
  cursor: default;
}
.name-item:hover {
  border-color: var(--gold-dim);
  background: var(--bg-card2);
}

/* Copy button */
.btn-copy {
  margin-top: 1rem;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 0.85rem;
  padding: 0.5rem 1.2rem;
  cursor: pointer;
  transition: all var(--transition);
}
.btn-copy:hover { border-color: var(--gold); color: var(--gold); }

/* Lore Box */
.lore-box {
  margin-top: 2.5rem;
  padding: 1.8rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--gold-dim);
  border-radius: var(--radius);
}
.lore-box h3 {
  font-family: var(--font-title);
  color: var(--gold);
  font-size: 1.05rem;
  margin-bottom: 0.8rem;
}
.lore-box p { color: var(--text-muted); font-size: 0.95rem; margin-bottom: 0.6rem; }
.lore-box p:last-child { margin-bottom: 0; }
.lore-box a { color: var(--green-light); text-decoration: none; border-bottom: 1px solid transparent; transition: border-color var(--transition); }
.lore-box a:hover { border-color: var(--green-light); }

/* ================================================================
   FAQ SECTION
   ================================================================ */
.faq-section {
  padding: 3rem 0;
  background: linear-gradient(180deg, transparent 0%, rgba(26,35,48,0.5) 100%);
}
.faq-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.2rem;
}
.faq-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.4rem;
}
.faq-item h3 {
  font-family: var(--font-title);
  font-size: 0.95rem;
  color: var(--gold-light);
  margin-bottom: 0.6rem;
}
.faq-item p { color: var(--text-muted); font-size: 0.9rem; }

/* ================================================================
   BLOG CTA SECTION
   ================================================================ */
.blog-cta-section { padding: 3rem 0; }
.blog-cta-card {
  background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-card2) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2.5rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  flex-wrap: wrap;
  position: relative;
  overflow: hidden;
}
.blog-cta-card::after {
  content: '✦';
  position: absolute;
  right: 2rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 6rem;
  color: var(--gold);
  opacity: 0.04;
  pointer-events: none;
  font-family: serif;
}
.blog-cta-text h2 {
  font-family: var(--font-title);
  font-size: 1.3rem;
  color: var(--gold);
  margin-bottom: 0.5rem;
}
.blog-cta-text p { color: var(--text-muted); font-size: 0.95rem; }

.btn-outline {
  display: inline-block;
  padding: 0.75rem 1.8rem;
  border: 1px solid var(--gold-dim);
  border-radius: var(--radius);
  color: var(--gold);
  font-family: var(--font-title);
  font-size: 0.9rem;
  letter-spacing: 0.06em;
  text-decoration: none;
  white-space: nowrap;
  transition: all var(--transition);
}
.btn-outline:hover {
  background: rgba(201,168,76,0.1);
  border-color: var(--gold);
  box-shadow: 0 0 12px rgba(201,168,76,0.2);
}

/* ================================================================
   BLOG LISTING
   ================================================================ */
.blog-listing { padding: 3rem 0; }
.blog-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1.5rem; margin-bottom: 2.5rem; }
.blog-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.8rem;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.blog-card:hover { border-color: var(--gold-dim); box-shadow: var(--shadow-gold); }
.blog-card--coming { opacity: 0.6; }
.blog-card-meta { display: flex; align-items: center; gap: 1rem; }
.blog-tag {
  display: inline-block;
  padding: 0.2rem 0.7rem;
  background: rgba(61,122,90,0.2);
  border: 1px solid var(--green);
  border-radius: 50px;
  font-size: 0.75rem;
  font-family: var(--font-title);
  letter-spacing: 0.06em;
  color: var(--green-light);
  text-transform: uppercase;
}
.blog-card-meta time { font-size: 0.8rem; color: var(--text-dim); }
.blog-card-title { font-family: var(--font-title); font-size: 1.1rem; line-height: 1.4; }
.blog-card-title a { color: var(--gold-light); text-decoration: none; transition: color var(--transition); }
.blog-card-title a:hover { color: var(--gold); }
.blog-card-excerpt { color: var(--text-muted); font-size: 0.9rem; line-height: 1.6; flex: 1; }
.read-more-link { color: var(--green-light); font-size: 0.88rem; text-decoration: none; font-family: var(--font-title); letter-spacing: 0.04em; transition: color var(--transition); }
.read-more-link:hover { color: var(--gold); }

.back-to-tool {
  text-align: center;
  padding: 1.5rem;
  border-top: 1px solid var(--border);
}
.back-to-tool a { color: var(--gold); text-decoration: none; font-family: var(--font-title); }
.back-to-tool a:hover { color: var(--gold-light); }

/* ================================================================
   BLOG POST
   ================================================================ */
.post-container { padding: 3rem 0 4rem; }

.inline-cta {
  background: rgba(61,122,90,0.12);
  border: 1px solid var(--green);
  border-radius: var(--radius);
  padding: 1rem 1.4rem;
  margin-bottom: 2.5rem;
  font-size: 0.92rem;
  color: var(--text-muted);
}
.inline-cta a { color: var(--green-light); text-decoration: none; border-bottom: 1px solid transparent; transition: border-color var(--transition); }
.inline-cta a:hover { border-color: var(--green-light); }
.inline-cta--bottom {
  background: var(--bg-card);
  border-color: var(--gold-dim);
  margin-top: 3rem;
  text-align: center;
}
.inline-cta--bottom h3 { font-family: var(--font-title); color: var(--gold); margin-bottom: 0.5rem; }
.inline-cta--bottom p { margin-bottom: 1.2rem; }

.post-section { margin-bottom: 2.5rem; }
.post-section h2 {
  font-family: var(--font-title);
  font-size: 1.35rem;
  color: var(--gold);
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}
.post-section p { color: var(--text-muted); margin-bottom: 0.8rem; }

.post-list {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-top: 0.8rem;
}
.post-list li {
  padding: 0.7rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-muted);
  font-size: 0.92rem;
}
.post-list li strong { color: var(--gold-light); font-family: var(--font-title); margin-right: 0.3rem; }

/* Placeholder styling */
.placeholder-text {
  font-style: italic;
  color: var(--text-dim) !important;
  background: rgba(255,255,255,0.03);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 1rem !important;
  font-size: 0.88rem !important;
}

.related-posts {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}
.related-posts h3 { font-family: var(--font-title); color: var(--text-muted); font-size: 0.9rem; }

/* ================================================================
   FOOTER
   ================================================================ */
.site-footer {
  margin-top: 4rem;
  border-top: 1px solid var(--border);
  padding: 2.5rem 0 1.5rem;
  background: var(--bg-card);
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 2rem;
  margin-bottom: 2rem;
}
.footer-brand {
  font-family: var(--font-display);
  font-size: 1rem;
  color: var(--gold);
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.footer-brand p { font-family: var(--font-body); font-size: 0.85rem; color: var(--text-dim); }
.footer-nav { display: flex; flex-direction: column; gap: 0.5rem; }
.footer-nav a { color: var(--text-muted); text-decoration: none; font-size: 0.88rem; transition: color var(--transition); }
.footer-nav a:hover { color: var(--gold); }
.footer-copy { font-size: 0.78rem; color: var(--text-dim); text-align: center; }

/* ================================================================
   RESPONSIVE
   ================================================================ */
@media (max-width: 640px) {
  .tool-controls { grid-template-columns: 1fr 1fr; }
  .blog-cta-card { flex-direction: column; text-align: center; }
  .footer-inner { flex-direction: column; }
  .hero-title { font-size: 1.8rem; }
  .navbar .nav-links { gap: 1.2rem; }
}
@media (max-width: 420px) {
  .tool-controls { grid-template-columns: 1fr; }
}

/* ================================================================
   SCROLLBAR
   ================================================================ */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-deep); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--gold-dim); }

/* ================================================================
   LINKS (global)
   ================================================================ */
a { color: var(--gold); }
