/* Dubname — single hand-written stylesheet. System fonts, mobile-first, WCAG-AA. */

:root {
  --bg: #fbfaff;
  --surface: #ffffff;
  --ink: #1d1b2e;
  --muted: #5d5a72;
  --line: #e7e4f1;
  --brand: #6d4aff;
  --brand-ink: #ffffff;
  --brand-soft: #efeaff;
  --accent: #ff5fa2;
  --green: #1a8a4a;
  --green-bg: #e6f6ec;
  --red: #c2334d;
  --red-bg: #fdebee;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(29, 27, 46, 0.06), 0 8px 24px rgba(29, 27, 46, 0.06);
  --maxw: 1080px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial,
    sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  font-size: 17px;
}

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

/* Form controls inherit theme colours (fixes black text on dark backgrounds). */
input, select, textarea { color: var(--ink); background-color: var(--surface); }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 1; }

h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 0.5em; }
h1 { font-size: clamp(1.9rem, 5vw, 2.9rem); letter-spacing: -0.02em; }
h2 { font-size: clamp(1.4rem, 3vw, 1.9rem); letter-spacing: -0.01em; }
p { margin: 0 0 1em; }

.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }
.section { padding: 40px 0; }
.section-sub { margin-top: -0.4em; }
.muted { color: var(--muted); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  font: inherit;
  font-weight: 600;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  padding: 0.7em 1.2em;
  border-radius: 999px;
  cursor: pointer;
  transition: transform 0.08s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.btn:hover { text-decoration: none; box-shadow: var(--shadow); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.6; cursor: default; }
.btn-primary { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.btn-ai { background: var(--brand-soft); color: var(--brand); border-color: transparent; }

/* ---------- header / footer ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(251, 250, 255, 0.85);
  backdrop-filter: saturate(160%) blur(8px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.logo { font-weight: 800; font-size: 1.2rem; color: var(--ink); display: inline-flex; align-items: center; gap: 0.4em; }
.logo:hover { text-decoration: none; }
.logo-mark { color: var(--brand); }
.nav { display: flex; gap: 4px; flex-wrap: wrap; }
.nav a { color: var(--muted); font-weight: 600; padding: 0.4em 0.7em; border-radius: 999px; }
.nav a:hover, .nav a.active { color: var(--ink); background: var(--brand-soft); text-decoration: none; }

.site-footer { border-top: 1px solid var(--line); margin-top: 48px; background: var(--surface); }
.footer-inner { display: grid; grid-template-columns: 1fr; gap: 28px; padding: 40px 0 24px; }
.footer-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(132px, 1fr)); gap: 24px; }
.footer-cols h4 { margin-bottom: 0.6em; }
.footer-cols a { display: block; color: var(--muted); padding: 3px 0; font-size: 0.95rem; }
.footer-cols a:hover { color: var(--ink); }
.footer-all { margin-top: 6px; color: var(--brand) !important; font-weight: 600; }
.copyright { padding: 16px 20px 32px; font-size: 0.85rem; }

/* ---------- hero ---------- */
.hero { padding: 64px 0 32px; text-align: center; }
.hero .lead { max-width: 640px; margin: 0 auto 1.5em; font-size: 1.15rem; }
.grad { background: linear-gradient(90deg, var(--brand), var(--accent)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lead { font-size: 1.1rem; color: var(--muted); }

/* ---------- generator grid (home) ---------- */
.gen-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.gen-card {
  display: flex; flex-direction: column; gap: 4px;
  padding: 20px; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); color: var(--ink); transition: transform 0.1s ease, box-shadow 0.15s ease;
}
.gen-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); text-decoration: none; }
.gen-icon { font-size: 1.6rem; }
.gen-name { font-weight: 700; }
.gen-tag { font-size: 0.9rem; }

.post-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.post-card { display: flex; flex-direction: column; gap: 6px; padding: 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); color: var(--ink); }
.post-card:hover { box-shadow: var(--shadow); text-decoration: none; }
.post-title { font-weight: 700; font-size: 1.05rem; }
.post-excerpt { font-size: 0.95rem; }
.post-meta { font-size: 0.82rem; }

.how-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 20px; }
.how-grid h3 { font-size: 1.1rem; }

/* ---------- generator page ---------- */
.gen-hero { padding: 32px 0 8px; }
.crumbs { font-size: 0.85rem; margin-bottom: 1em; }
.gen-icon-lg { font-size: 1.5em; }

.generator { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
.seed-row { margin-bottom: 16px; }
.seed-row input { width: 100%; font: inherit; padding: 0.75em 0.9em; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); }
.seed-row input:focus { outline: 2px solid var(--brand); outline-offset: 1px; border-color: var(--brand); }
.seed-note { margin: 6px 2px 0; font-size: 0.82rem; }
.gen-controls { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.count-label { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; color: var(--muted); }
.count-label select { font: inherit; padding: 0.5em 0.6em; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); }

.ai-panel { margin-top: 16px; padding: 16px; background: var(--brand-soft); border-radius: var(--radius); display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.ai-label { flex-basis: 100%; font-weight: 600; font-size: 0.95rem; margin: 0; }
.ai-panel input { flex: 1 1 240px; font: inherit; padding: 0.7em 0.9em; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); }
.ai-note { flex-basis: 100%; font-size: 0.82rem; margin: 0; }

/* AI "Top picks" — recommended names with reasons + auto .com check */
.ai-picks { margin-top: 16px; padding: 18px; background: var(--surface); border: 1px solid var(--brand); border-radius: var(--radius); box-shadow: var(--shadow); }
.picks-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.picks-head h3 { margin: 0; font-size: 1.1rem; }
.picks-sub { font-size: 0.85rem; }
.ai-pick { display: flex; align-items: flex-start; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.pick-rank { flex: 0 0 auto; width: 26px; height: 26px; border-radius: 999px; background: var(--brand); color: var(--brand-ink); font-weight: 700; font-size: 0.85rem; display: inline-flex; align-items: center; justify-content: center; margin-top: 2px; }
.pick-main { flex: 1 1 auto; min-width: 0; }
.pick-name { display: inline-block; font: inherit; font-weight: 700; font-size: 1.05rem; color: var(--ink); background: transparent; border: 0; padding: 0; cursor: pointer; overflow-wrap: break-word; }
.pick-name:hover { color: var(--brand); }
.pick-name.copied { color: var(--green); }
.pick-reason { margin: 2px 0 0; font-size: 0.9rem; }
.pick-aside { flex: 0 0 auto; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.pick-domain { font-size: 0.82rem; padding: 0.3em 0.6em; border-radius: 8px; border: 1px solid var(--line); white-space: nowrap; }
.pick-domain.checking, .pick-domain.unknown { color: var(--muted); }
.pick-domain.free { color: var(--green); background: var(--green-bg); border-color: transparent; font-weight: 600; }
.pick-domain.taken { color: var(--red); background: var(--red-bg); border-color: transparent; }
.pick-aside .result-check { border: 1px solid var(--line); border-radius: 8px; }
@media (max-width: 560px) {
  .ai-pick { flex-wrap: wrap; }
  .pick-aside { flex-direction: row; align-items: center; width: 100%; padding-left: 38px; }
}

.results { list-style: none; margin: 20px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; }
.result { display: flex; align-items: stretch; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--bg); }
/* Break only when a word genuinely can't fit (never mid-word for names that fit). */
.result-name { flex: 1 1 auto; min-width: 0; text-align: left; font: inherit; font-weight: 600; border: 0; background: transparent; padding: 0.6em 0.7em; cursor: pointer; color: var(--ink); overflow-wrap: break-word; }
.result-name:hover { background: var(--brand-soft); }
.result-name.copied { color: var(--green); }
.result-check { flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; white-space: nowrap; border: 0; border-left: 1px solid var(--line); background: var(--surface); font: inherit; font-size: 0.92rem; color: var(--muted); padding: 0 0.6em; cursor: pointer; transition: background 0.12s ease, color 0.12s ease; }
.result-check::before { content: "🔎"; }
.result:hover .result-check { background: var(--brand-soft); color: var(--brand); }
.result-check:hover { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.results-hint { margin-top: 16px; font-size: 0.9rem; }

/* ---------- availability tray ---------- */
.avail-tray { margin-top: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.tray-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.tray-head h3 { margin: 0; font-size: 1.1rem; }
.tray-close { border: 0; background: transparent; font-size: 1.4rem; line-height: 1; cursor: pointer; color: var(--muted); padding: 0 4px; }
.tray-close:hover { color: var(--ink); }
.tray-domains, .tray-platforms { margin-top: 14px; }
.tray-domains h4, .tray-platforms h4 { margin: 0 0 8px; font-size: 0.95rem; }
.domain-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; }
.domain-row { font-size: 0.9rem; padding: 0.45em 0.7em; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); }
.domain-row.checking { color: var(--muted); }
.domain-row.free { color: var(--green); background: var(--green-bg); border-color: transparent; font-weight: 600; }
.domain-row.taken { color: var(--red); background: var(--red-bg); border-color: transparent; }
.domain-row.unknown { color: var(--muted); }
.platform-links { display: flex; flex-wrap: wrap; gap: 8px; }
.platform-link { padding: 0.45em 0.9em; border-radius: 999px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); font-size: 0.9rem; font-weight: 600; }
.platform-link:hover { background: var(--brand-soft); color: var(--brand); text-decoration: none; }

/* ---------- tips / faq / pills ---------- */
.tips-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.tip { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.tip h3 { font-size: 1.05rem; }
.faq { display: flex; flex-direction: column; gap: 10px; }
.faq-item { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 18px; }
.faq-item summary { font-weight: 600; cursor: pointer; }
.faq-item p { margin: 0.7em 0 0; }
.pills { display: flex; flex-wrap: wrap; gap: 10px; }
.pill { padding: 0.5em 1em; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font-weight: 600; font-size: 0.92rem; }
.pill:hover { background: var(--brand-soft); color: var(--brand); text-decoration: none; }

/* ---------- article ---------- */
.article { max-width: 720px; padding-top: 24px; }
.article h2 { margin-top: 1.4em; }
.article-meta { font-size: 0.88rem; }
.inline-cta { margin: 1.5em 0; }
.article-related { margin-top: 2.5em; padding-top: 1.5em; border-top: 1px solid var(--line); }

/* ---------- ads ---------- */
.ad-placeholder {
  display: flex; align-items: center; justify-content: center;
  min-height: 90px; margin: 24px 0;
  border: 1px dashed var(--line); border-radius: var(--radius);
  color: var(--muted); font-size: 0.85rem; background: var(--surface);
}

/* ---------- responsive ---------- */
@media (min-width: 760px) {
  .footer-inner { grid-template-columns: 1.2fr 2fr; }
}
@media (max-width: 640px) {
  /* Stack the logo above a single horizontally-scrollable nav row so items
     (like About) never wrap onto an awkward second line. */
  .header-inner { height: auto; flex-direction: column; align-items: stretch; gap: 8px; padding: 10px 0; }
  .header-right { width: 100%; gap: 8px; }
  .nav { flex: 1 1 auto; min-width: 0; flex-wrap: nowrap; overflow-x: auto; gap: 2px; padding-bottom: 2px; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .nav::-webkit-scrollbar { display: none; }
  .nav a { white-space: nowrap; padding: 0.4em 0.6em; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}

/* ---------- dark mode ---------- */
:root[data-theme="dark"] {
  --bg: #14131c;
  --surface: #1d1b2a;
  --ink: #ece9f5;
  --muted: #a39fbb;
  --line: #2e2b40;
  --brand: #9b82ff;
  --brand-ink: #14131c;
  --brand-soft: #271f3f;
  --accent: #ff7db0;
  --green: #5fd08a;
  --green-bg: #16321f;
  --red: #ff7d92;
  --red-bg: #3a1620;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.35);
}
:root[data-theme="dark"] .site-header { background: rgba(20, 19, 28, 0.85); }

/* ---------- header actions + theme toggle ---------- */
.header-right { display: flex; align-items: center; gap: 12px; }
.theme-toggle {
  flex: 0 0 auto; width: 38px; height: 38px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  font-size: 1rem; line-height: 1; cursor: pointer; display: inline-flex;
  align-items: center; justify-content: center;
}
.theme-toggle:hover { background: var(--brand-soft); }

/* ---------- vibe filters ---------- */
.filters { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; margin-top: 14px; padding: 12px 14px; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; }
.filters-label { font-weight: 600; font-size: 0.85rem; }
.filter-field { display: inline-flex; align-items: center; gap: 6px; font-size: 0.9rem; color: var(--muted); }
.filter-field select, .filter-field input { font: inherit; padding: 0.4em 0.55em; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); }
.filter-field input { width: 3.2em; text-transform: lowercase; }
.filter-check { display: inline-flex; align-items: center; gap: 6px; font-size: 0.9rem; color: var(--muted); cursor: pointer; }

/* ---------- result heart ---------- */
.result-fav { flex: 0 0 auto; border: 0; background: transparent; font-size: 1.05rem; line-height: 1; color: var(--muted); padding: 0 0.5em; cursor: pointer; }
.result-fav:hover { color: var(--accent); }
.result-fav.on { color: var(--accent); }

/* ---------- favorites / shortlist ---------- */
.favorites { margin-top: 16px; padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.favorites-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.favorites-head h3 { margin: 0; font-size: 1.05rem; }
.favorites-actions { display: flex; gap: 8px; }
.btn-sm { padding: 0.4em 0.8em; font-size: 0.85rem; }
.fav-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.fav-chip { display: inline-flex; align-items: stretch; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; background: var(--bg); }
.fav-chip-name { font: inherit; font-weight: 600; font-size: 0.9rem; border: 0; background: transparent; color: var(--ink); padding: 0.4em 0.4em 0.4em 0.9em; cursor: pointer; }
.fav-chip-name:hover { color: var(--brand); }
.fav-chip-remove { border: 0; background: transparent; color: var(--muted); font-size: 1rem; line-height: 1; padding: 0 0.6em; cursor: pointer; }
.fav-chip-remove:hover { color: var(--red); }
