/* ---------- design tokens ---------- */
:root {
  --bg: #fff8f1;
  --surface: #ffffff;
  --ink: #2a2320;
  --ink-soft: #6b5e57;
  --muted: #f3e7d8;
  --line: #ecd9c1;
  --brand: #ff8a3d;       /* warm orange */
  --brand-ink: #b54e10;
  --accent: #3aa3a3;      /* soft teal */
  --leaf: #7cb274;        /* friendly green */
  --shadow: 0 6px 20px rgba(60, 32, 12, 0.08);
  --radius: 14px;
  --radius-sm: 10px;
  --space: 1rem;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Nunito", sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
  padding-bottom: 88px; /* room for sticky mobile ad */
}

img, svg { max-width: 100%; }

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0);
  white-space: nowrap; border: 0;
}

.container {
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: 0 1.1rem;
}

/* ---------- header ---------- */
.site-header {
  padding: 1rem 0;
  background: linear-gradient(180deg, #fff4e6 0%, transparent 100%);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  text-decoration: none;
  color: var(--brand-ink);
  font-weight: 800;
  font-size: 1.15rem;
}
.brand-icon { font-size: 1.4rem; }

/* ---------- hero ---------- */
.hero { text-align: center; margin: 1rem 0 1.4rem; }
.hero h1 {
  margin: .2rem 0 .4rem;
  font-size: clamp(1.8rem, 5vw, 2.6rem);
  line-height: 1.15;
  color: var(--brand-ink);
}
.tagline { color: var(--ink-soft); margin: 0; font-size: 1.05rem; }

/* ---------- card / form ---------- */
.card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.25rem;
  border: 1px solid var(--line);
}

.generator { margin-bottom: 1.5rem; }

.field { margin-bottom: 1rem; }
.field label, .field legend {
  display: block;
  font-weight: 700;
  font-size: .92rem;
  color: var(--ink);
  margin-bottom: .4rem;
  padding: 0;
}

select {
  width: 100%;
  padding: .7rem .8rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: #fffdfa;
  font: inherit;
  color: var(--ink);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23b54e10' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right .9rem center;
}
select:focus { outline: 2px solid var(--brand); outline-offset: 1px; }

fieldset.field {
  border: 0;
  padding: 0;
  margin: 0 0 1rem;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
}
.chip {
  position: relative;
  display: inline-flex;
  align-items: center;
  padding: .45rem .8rem;
  border-radius: 999px;
  background: var(--muted);
  border: 1px solid transparent;
  cursor: pointer;
  font-size: .92rem;
  user-select: none;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip:hover { background: #fbe1c1; }
.chip:has(input:checked) {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand-ink);
}
.chip input:focus-visible ~ span {
  outline: 2px solid var(--brand-ink);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  border: 0;
  border-radius: var(--radius-sm);
  padding: .85rem 1.2rem;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: transform .04s ease, box-shadow .15s ease, background .15s ease;
}
.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--brand);
  color: #fff;
  width: 100%;
  font-size: 1.05rem;
  box-shadow: 0 4px 12px rgba(255, 138, 61, .35);
}
.btn-primary:hover { background: #ff7a23; }

.button-group {
  display: grid;
  grid-template-columns: 1fr;
  gap: .5rem;
  margin-top: .25rem;
}
@media (min-width: 520px) {
  .button-group { grid-template-columns: 1fr 1fr; }
}

.btn-ai {
  width: 100%;
  font-size: 1.02rem;
  color: #fff;
  background: linear-gradient(135deg, #7c4dff 0%, #ad55e6 50%, #ff6fa3 100%);
  box-shadow: 0 4px 12px rgba(124, 77, 255, .3);
}
.btn-ai:hover { filter: brightness(1.05); }
.btn-ai .btn-counter {
  display: inline-block;
  font-size: .8rem;
  font-weight: 600;
  opacity: .85;
  margin-left: .25rem;
}
.btn-ai[data-exhausted="true"] {
  background: linear-gradient(135deg, #9b8ec0 0%, #b4a5c3 100%);
  box-shadow: none;
}

.btn[disabled], .btn.is-loading {
  opacity: .7;
  cursor: not-allowed;
  filter: saturate(.8);
}
.btn.is-loading .btn-label::after {
  content: "…";
}
.btn.is-loading [aria-hidden="true"] {
  display: inline-block;
  animation: spin 1.2s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

.btn-ghost {
  background: transparent;
  color: var(--ink-soft);
  border: 1px solid var(--line);
  padding: .4rem .7rem;
  font-size: .85rem;
}
.btn-ghost:hover { background: var(--muted); }

.btn-generate { margin-top: .25rem; }

.icon-btn {
  background: transparent;
  border: 0;
  cursor: pointer;
  padding: .35rem .45rem;
  border-radius: 8px;
  font-size: 1.1rem;
  line-height: 1;
}
.icon-btn:hover { background: var(--muted); }
.icon-btn:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }

/* ---------- results ---------- */
.results { margin: 0 0 1.5rem; }
.results h2, .recent h2, .seo-content h2, .faq h2 {
  font-size: 1.2rem;
  color: var(--brand-ink);
  margin: 0 0 .7rem;
}
.seo-content h3 { color: var(--ink); font-size: 1.05rem; margin-top: 1.2rem; }

.results-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: .55rem;
}
@media (min-width: 560px) {
  .results-grid { grid-template-columns: 1fr 1fr; }
}

.name-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: .7rem .85rem;
  box-shadow: 0 2px 6px rgba(60, 32, 12, 0.04);
}
.name-text {
  font-weight: 700;
  color: var(--ink);
  font-size: 1.02rem;
}
.name-actions { display: flex; gap: .15rem; }

.empty {
  list-style: none;
  background: var(--muted);
  padding: .8rem 1rem;
  border-radius: var(--radius-sm);
  color: var(--ink-soft);
  text-align: center;
}

/* ---------- recent ---------- */
.recent { margin-bottom: 1.5rem; }
.recent-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  margin-bottom: .5rem;
}
.recent-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
}
.recent-item {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: .25rem .35rem .25rem .7rem;
  font-size: .9rem;
}

/* ---------- ad slots ---------- */
.ad-slot { margin: 1.2rem 0; }
.ad-placeholder {
  border: 2px dashed var(--line);
  border-radius: var(--radius-sm);
  padding: 1.5rem;
  text-align: center;
  color: var(--ink-soft);
  font-size: .9rem;
  background: repeating-linear-gradient(
    45deg,
    transparent 0 8px,
    rgba(255, 138, 61, 0.04) 8px 16px
  );
}
.ad-sticky-mobile {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  margin: 0;
  background: var(--surface);
  border-top: 1px solid var(--line);
  padding: .35rem .5rem;
  z-index: 50;
}
.ad-sticky-mobile .ad-placeholder {
  padding: .6rem;
  font-size: .8rem;
  border: 1px dashed var(--line);
}
@media (min-width: 768px) {
  .ad-sticky-mobile { display: none; }
  body { padding-bottom: 0; }
}

/* ---------- SEO + FAQ ---------- */
.seo-content {
  margin: 1.5rem 0;
  color: var(--ink);
}
.seo-content p { margin: .6rem 0; }

.faq { margin: 1.5rem 0 2rem; }
.faq details {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: .6rem .9rem;
  margin-bottom: .5rem;
}
.faq summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--ink);
  list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  float: right;
  color: var(--brand-ink);
  font-weight: 800;
}
.faq details[open] summary::after { content: "−"; }
.faq p { margin: .5rem 0 0; color: var(--ink-soft); }

/* ---------- footer ---------- */
.site-footer {
  margin-top: 2rem;
  padding: 1rem 0 4.5rem;
  color: var(--ink-soft);
  text-align: center;
  font-size: .9rem;
}
.site-footer a { color: var(--brand-ink); }
@media (min-width: 768px) {
  .site-footer { padding-bottom: 1.5rem; }
}

/* ---------- toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 96px;
  transform: translateX(-50%) translateY(8px);
  background: var(--ink);
  color: #fff;
  padding: .55rem .9rem;
  border-radius: 999px;
  font-size: .9rem;
  box-shadow: var(--shadow);
  opacity: 0;
  transition: opacity .2s ease, transform .2s ease;
  z-index: 100;
  pointer-events: none;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
@media (min-width: 768px) {
  .toast { bottom: 24px; }
}

/* ---------- share menu ---------- */
.share-menu {
  position: fixed;
  inset: 0;
  background: rgba(42, 35, 32, 0.4);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 200;
  padding: 1rem;
}
.share-menu[hidden] { display: none; }
.share-card {
  background: var(--surface);
  border-radius: 18px 18px 6px 6px;
  padding: 1.1rem 1.2rem 1.3rem;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow);
}
@media (min-width: 600px) {
  .share-menu { align-items: center; }
  .share-card { border-radius: 14px; }
}
.share-card h3 {
  margin: 0 0 .8rem;
  color: var(--brand-ink);
  font-size: 1.1rem;
}
.share-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .5rem;
  margin-bottom: .8rem;
}
.share-buttons a, .share-buttons button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: .65rem .9rem;
  border-radius: var(--radius-sm);
  background: var(--muted);
  color: var(--ink);
  text-decoration: none;
  font: inherit;
  font-weight: 700;
  border: 0;
  cursor: pointer;
}
.share-buttons a:hover, .share-buttons button:hover { background: #fbe1c1; }
.share-close {
  width: 100%;
  background: transparent;
  color: var(--ink-soft);
  border: 1px solid var(--line);
  padding: .55rem;
  border-radius: var(--radius-sm);
  font: inherit;
  cursor: pointer;
}

/* ---------- legal pages ---------- */
.legal-page {
  max-width: 720px;
  margin: 0 auto;
  padding: 1rem 1.1rem 3rem;
}
.legal-page h1 { color: var(--brand-ink); }
.legal-page h2 { font-size: 1.1rem; margin-top: 1.4rem; }
.legal-page p, .legal-page li { color: var(--ink); }

/* ---------- reduce motion ---------- */
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
