/* ===========================================
   Namerator — Playful name-generator stylesheet
   =========================================== */

/* ---- Design tokens ---- */
:root {
  --c-primary: #6C5CE7;       /* vibrant purple */
  --c-primary-dark: #5346c4;
  --c-accent-pink: #FD79A8;
  --c-accent-teal: #00CEC9;
  --c-accent-gold: #FDCB6E;
  --c-accent-coral: #FF7675;
  --c-accent-mint: #55EFC4;
  --c-accent-sky: #74B9FF;

  --c-bg: #FFF9F3;
  --c-card: #FFFFFF;
  --c-text: #2D3436;
  --c-text-soft: #636E72;
  --c-border: #ECE5DA;

  --radius-sm: 10px;
  --radius-md: 18px;
  --radius-lg: 28px;

  --shadow-sm: 0 2px 8px rgba(45, 52, 54, 0.06);
  --shadow-md: 0 8px 24px rgba(45, 52, 54, 0.08);
  --shadow-lg: 0 16px 48px rgba(108, 92, 231, 0.18);

  --font-display: "Fredoka", "Baloo 2", system-ui, sans-serif;
  --font-body: "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
}

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

html { scroll-behavior: smooth; }

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

/* ---- Layout helpers ---- */
.container {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
}

main { flex: 1 0 auto; padding: 40px 0 60px; }

h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 600; line-height: 1.2; }
h1 { font-size: clamp(2rem, 5vw, 3rem); margin-bottom: 0.6em; }
h2 { font-size: clamp(1.5rem, 3.5vw, 2.2rem); margin-bottom: 0.5em; }
h3 { font-size: 1.3rem; margin-bottom: 0.4em; }

p { margin-bottom: 1em; color: var(--c-text-soft); }

a { color: var(--c-primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---- Header ---- */
.site-header {
  background: var(--c-card);
  border-bottom: 3px solid var(--c-border);
  padding: 16px 0;
  position: sticky;
  top: 0;
  z-index: 10;
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.logo {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.7rem;
  color: var(--c-primary);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.logo:hover { text-decoration: none; }
.logo-dot {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--c-accent-pink), var(--c-accent-gold));
}
.site-nav a {
  color: var(--c-text);
  font-weight: 600;
  margin-left: 18px;
  font-size: 0.95rem;
}
.site-nav a:hover { color: var(--c-primary); text-decoration: none; }

/* ---- Hero ---- */
.hero {
  background: linear-gradient(135deg, var(--c-primary) 0%, var(--c-accent-pink) 100%);
  color: white;
  padding: 60px 0 70px;
  text-align: center;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  margin-bottom: 40px;
  position: relative;
  overflow: hidden;
}
.hero::before, .hero::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  opacity: 0.2;
  background: white;
}
.hero::before { width: 180px; height: 180px; top: -60px; left: -60px; }
.hero::after { width: 220px; height: 220px; bottom: -80px; right: -80px; }
.hero h1 {
  color: white;
  margin-bottom: 16px;
  position: relative;
  z-index: 1;
}
.hero p {
  color: rgba(255,255,255,0.92);
  font-size: 1.15rem;
  max-width: 640px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

/* ---- Category grid (landing page) ---- */
.category-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 20px;
}
@media (min-width: 640px) {
  .category-grid { grid-template-columns: repeat(3, 1fr); gap: 20px; }
}
@media (min-width: 960px) {
  .category-grid { grid-template-columns: repeat(4, 1fr); }
}

.category-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 28px 16px;
  background: var(--c-card);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  border: 2px solid var(--c-border);
  text-decoration: none;
  color: var(--c-text);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
  min-height: 150px;
}
.category-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  text-decoration: none;
  border-color: var(--c-primary);
}
.category-card .emoji {
  font-size: 2.2rem;
  margin-bottom: 10px;
  display: block;
}
.category-card .label {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1rem;
  color: var(--c-text);
}

/* Alternating card tints for visual variety */
.category-card:nth-child(8n+1) { background: linear-gradient(160deg, #fff, #f3eeff); }
.category-card:nth-child(8n+2) { background: linear-gradient(160deg, #fff, #ffeef6); }
.category-card:nth-child(8n+3) { background: linear-gradient(160deg, #fff, #e6fafa); }
.category-card:nth-child(8n+4) { background: linear-gradient(160deg, #fff, #fff5e0); }
.category-card:nth-child(8n+5) { background: linear-gradient(160deg, #fff, #ffeceb); }
.category-card:nth-child(8n+6) { background: linear-gradient(160deg, #fff, #e7fcf3); }
.category-card:nth-child(8n+7) { background: linear-gradient(160deg, #fff, #eaf3ff); }
.category-card:nth-child(8n+0) { background: linear-gradient(160deg, #fff, #fdf0d1); }

/* ---- Generator page ---- */
.gen-header {
  text-align: center;
  padding: 40px 20px 24px;
  background: var(--c-card);
  border-radius: var(--radius-lg);
  margin-bottom: 28px;
  box-shadow: var(--shadow-sm);
  border: 2px solid var(--c-border);
}
.gen-header .emoji { font-size: 3rem; display: block; margin-bottom: 12px; }
.gen-intro {
  max-width: 720px;
  margin: 0 auto 24px;
  font-size: 1.05rem;
  text-align: center;
}

.controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px 20px;
  margin-bottom: 20px;
  padding: 16px;
  background: #fff;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  border: 2px solid var(--c-border);
}
.controls label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: var(--c-text);
  font-size: 0.95rem;
}
.controls select,
.controls input[type="number"] {
  font-family: var(--font-body);
  font-size: 0.95rem;
  padding: 6px 10px;
  border: 2px solid var(--c-border);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--c-text);
}
.controls input[type="number"] { width: 72px; }

.filter-warning {
  display: none;
  background: #fff4d6;
  border: 2px solid var(--c-accent-gold);
  color: var(--c-text);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
  margin: 0 auto 14px;
  text-align: center;
  max-width: 600px;
}

.btn {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  color: white;
  background: linear-gradient(135deg, var(--c-primary), var(--c-accent-pink));
  border: none;
  border-radius: 999px;
  padding: 14px 38px;
  cursor: pointer;
  box-shadow: var(--shadow-md);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.btn:active { transform: translateY(0); }

.btn-wrap { text-align: center; margin: 20px 0 30px; }

/* Results */
.results {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 12px;
  margin-top: 16px;
}
.result {
  background: #fff;
  border: 2px solid var(--c-border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.15s ease, transform 0.15s ease;
  animation: fadeIn 0.3s ease;
}
.result:hover { border-color: var(--c-primary); transform: translateY(-1px); }
.result-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--c-text);
}
.copy-btn {
  background: var(--c-bg);
  border: 1.5px solid var(--c-border);
  color: var(--c-text-soft);
  font-size: 0.82rem;
  font-weight: 700;
  padding: 5px 10px;
  border-radius: 999px;
  cursor: pointer;
  font-family: var(--font-body);
  transition: all 0.15s ease;
}
.copy-btn:hover { background: var(--c-primary); color: white; border-color: var(--c-primary); }
.copy-btn.copied { background: var(--c-accent-mint); color: var(--c-text); border-color: var(--c-accent-mint); }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---- Ad slot placeholder ---- */
.ad-slot {
  margin: 28px auto;
  padding: 24px;
  background: repeating-linear-gradient(45deg, #f7f2ea, #f7f2ea 10px, #fff9f3 10px, #fff9f3 20px);
  border: 2px dashed var(--c-border);
  border-radius: var(--radius-md);
  text-align: center;
  color: var(--c-text-soft);
  font-size: 0.85rem;
  max-width: 728px;
}
.ad-slot.is-live { background: transparent; border: none; padding: 0; }

/* ---- Content prose on about/privacy/contact ---- */
.prose {
  background: var(--c-card);
  padding: 32px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  border: 2px solid var(--c-border);
  max-width: 780px;
  margin: 0 auto;
}
.prose h2 { margin-top: 1.2em; }
.prose h2:first-child { margin-top: 0; }
.prose p, .prose li { color: var(--c-text); }
.prose ul, .prose ol { margin: 0 0 1em 1.4em; }
.prose li { margin-bottom: 0.35em; }

/* ---- Footer ---- */
.site-footer {
  flex-shrink: 0;
  background: var(--c-text);
  color: rgba(255,255,255,0.85);
  padding: 30px 0;
  margin-top: 60px;
  font-size: 0.9rem;
}
.site-footer .container {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}
.site-footer a { color: var(--c-accent-gold); font-weight: 600; }
.site-footer a:hover { color: white; }
.footer-links a { margin-left: 14px; }

/* ---- Mobile tweaks ---- */
@media (max-width: 540px) {
  .site-header .container { justify-content: center; }
  .site-nav { text-align: center; width: 100%; }
  .site-nav a { margin: 0 10px; }
  .footer-links a { margin: 0 8px; }
}
