:root {
  color-scheme: light dark;
  --bg: #f8f7ff;
  --panel: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;
  --label: #4b5563;
  --border: rgba(15, 15, 25, 0.07);
  --input-bg: #f8f9fa;
  --input-border: #e9ecef;

  --accent-from: #7c3aed;
  --accent-to: #6366f1;
  --accent-solid: #4c6ef5;
  --accent-strong: #4263eb;
  --accent-soft-bg: rgba(76, 110, 245, 0.1);
  --accent-contrast: #ffffff;

  --bubble-user: linear-gradient(45deg, #7c3aed 0%, #6366f1 100%);
  --bubble-bot: #f1f0fb;

  --shadow-card: 0 1px 3px rgba(20, 15, 45, 0.05), 0 36px 28px -7px rgba(20, 15, 45, 0.06), 0 17px 17px -7px rgba(20, 15, 45, 0.04);
  --shadow-card-hover: 0 1px 3px rgba(20, 15, 45, 0.07), 0 28px 32px -8px rgba(20, 15, 45, 0.14), 0 12px 16px -6px rgba(20, 15, 45, 0.08);
  --shadow-btn: 0 8px 20px rgba(124, 58, 237, 0.3);

  --radius-card: 16px;
  --radius-btn: 10px;
  --radius-pill: 999px;

  --header-bg: rgba(255, 255, 255, 0.75);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #131120;
    --panel: #1c1930;
    --text: #ede9fe;
    --muted: #a5a3b8;
    --label: #c4c1d6;
    --border: rgba(255, 255, 255, 0.08);
    --input-bg: #221f38;
    --input-border: rgba(255, 255, 255, 0.1);

    --accent-solid: #a5b4fc;
    --accent-strong: #c4b5fd;
    --accent-soft-bg: rgba(129, 140, 248, 0.16);
    --accent-contrast: #ffffff;

    --bubble-bot: #241f3d;

    --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.4), 0 24px 32px -10px rgba(0, 0, 0, 0.45);
    --shadow-card-hover: 0 1px 3px rgba(0, 0, 0, 0.5), 0 28px 36px -8px rgba(0, 0, 0, 0.55);
    --shadow-btn: 0 8px 24px rgba(124, 58, 237, 0.45);

    --header-bg: rgba(19, 17, 32, 0.75);
  }
}

* { box-sizing: border-box; }

html, body {
  min-height: 100%;
}

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

a { color: var(--accent-solid); }

/* ---------- Site nav ---------- */
#site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--header-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  max-width: 900px;
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.nav-inner .brand {
  font-weight: 800;
  font-size: 1.15rem;
  color: var(--accent-strong);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 22px;
}

.nav-links a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 600;
}

.nav-links a:hover {
  color: var(--text);
}

.nav-cta {
  background: var(--accent-soft-bg) !important;
  color: var(--accent-solid) !important;
  padding: 9px 20px;
  border-radius: var(--radius-pill);
  font-weight: 700 !important;
}

/* ---------- Footer ---------- */
#site-footer {
  max-width: 900px;
  margin: 40px auto 0;
  padding: 24px 20px 32px;
  text-align: center;
}

.footer-disclosure {
  font-size: 0.85rem;
  color: var(--muted);
  margin: 0 0 10px;
}

.footer-links {
  font-size: 0.82rem;
  color: var(--muted);
}

.footer-links a {
  color: var(--muted);
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--text);
}

.footer-copy {
  font-size: 0.78rem;
  color: var(--muted);
  opacity: 0.7;
  margin-top: 6px;
}

/* ---------- Hero / chat page ---------- */
.hero {
  max-width: 640px;
  margin: 0 auto;
  padding: 48px 20px 24px;
  text-align: center;
}

.hero h1 {
  font-size: 2rem;
  font-weight: 800;
  margin: 0 0 10px;
  letter-spacing: -0.02em;
}

.hero p {
  color: var(--muted);
  font-size: 1.05rem;
  margin: 0;
}

.chat-card {
  max-width: 640px;
  margin: 0 auto 40px;
  padding: 28px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
}

.chat {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 60px;
  max-height: 50vh;
  overflow-y: auto;
  margin-bottom: 16px;
}

.chat:empty {
  display: none;
}

.msg {
  max-width: 88%;
  padding: 11px 15px;
  border-radius: 16px;
  line-height: 1.45;
  white-space: pre-wrap;
  font-size: 0.95rem;
}

.msg.user {
  align-self: flex-end;
  background: var(--bubble-user);
  color: #fff;
  border-bottom-right-radius: 4px;
  font-weight: 500;
}

.msg.bot {
  align-self: flex-start;
  background: var(--bubble-bot);
  color: var(--text);
  border-bottom-left-radius: 4px;
}

.msg.error {
  align-self: center;
  background: #fde8e8;
  color: #9b1c1c;
}

.msg.typing {
  align-self: flex-start;
  color: var(--muted);
  font-style: italic;
  background: none;
  padding: 0 4px;
}

.example-link {
  display: inline-block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent-solid);
  text-decoration: none;
  margin: 2px 0 16px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
}

.example-link:hover {
  text-decoration: underline;
}

.budget-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--label);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin: 0 0 8px;
}

.budget-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}

.budget-pill {
  border: 1px solid var(--input-border);
  background: var(--input-bg);
  color: var(--text);
  padding: 7px 16px;
  border-radius: var(--radius-pill);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}

.budget-pill.active {
  background: var(--accent-soft-bg);
  border-color: transparent;
  color: var(--accent-solid);
}

.chat-form textarea {
  width: 100%;
  resize: none;
  padding: 14px 16px;
  border-radius: var(--radius-btn);
  border: 1px solid var(--input-border);
  background: var(--input-bg);
  color: var(--text);
  font-size: 0.98rem;
  font-family: inherit;
  line-height: 1.4;
}

.chat-form textarea:focus {
  outline: 2px solid var(--accent-solid);
  outline-offset: 1px;
}

.chat-form-actions {
  display: flex;
  gap: 10px;
  margin-top: 12px;
}

.btn-gradient {
  flex: 1;
  background: linear-gradient(45deg, var(--accent-from) 0%, var(--accent-to) 100%);
  color: #fff;
  border: none;
  border-radius: var(--radius-btn);
  padding: 13px 20px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: var(--shadow-btn);
}

.btn-gradient:disabled {
  opacity: 0.6;
  cursor: default;
  box-shadow: none;
}

.btn-surprise {
  background: var(--accent-soft-bg);
  color: var(--accent-solid);
  border: none;
  border-radius: var(--radius-btn);
  padding: 13px 18px;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.btn-surprise:disabled {
  opacity: 0.6;
  cursor: default;
}

.chat-tip {
  font-size: 0.78rem;
  color: var(--muted);
  margin: 14px 0 0;
  text-align: center;
}

/* ---------- Suggestion cards ---------- */
.suggestions {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
  margin-top: 2px;
}

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-shadow: 0 1px 3px rgba(20, 15, 45, 0.05);
}

.card h3 {
  margin: 0;
  font-size: 1rem;
}

.card p {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.card .price {
  font-weight: 700;
  color: var(--text);
}

.card a.buy {
  margin-top: auto;
  text-align: center;
  background: linear-gradient(45deg, var(--accent-from) 0%, var(--accent-to) 100%);
  color: #fff;
  text-decoration: none;
  padding: 9px 10px;
  border-radius: var(--radius-btn);
  font-size: 0.88rem;
  font-weight: 700;
}

.no-tag-note {
  font-size: 0.75rem;
  color: var(--muted);
  text-align: center;
  margin-top: 4px;
}

/* ---------- Generic content pages ---------- */
.page {
  max-width: 720px;
  margin: 0 auto;
  padding: 40px 20px 56px;
  line-height: 1.65;
}

.page h1 {
  font-size: 1.9rem;
  font-weight: 800;
  margin-bottom: 6px;
  letter-spacing: -0.01em;
}

.page h2 {
  font-size: 1.25rem;
  font-weight: 800;
  margin-top: 32px;
}

.page p, .page ul {
  color: var(--text);
}

.page .lede {
  color: var(--muted);
  font-size: 1.05rem;
  margin-top: 0;
}

/* ---------- Gift Ideas hub ---------- */
.ideas-hero {
  max-width: 900px;
  margin: 0 auto;
  padding: 44px 20px 8px;
  text-align: center;
}

.ideas-hero h1 {
  font-size: 2rem;
  font-weight: 800;
  margin: 0 0 8px;
}

.ideas-hero p {
  color: var(--muted);
  font-size: 1.05rem;
}

.idea-grid {
  max-width: 980px;
  margin: 28px auto 60px;
  padding: 0 20px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 22px;
}

.idea-card {
  display: block;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  text-decoration: none;
  color: var(--text);
  overflow: hidden;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.idea-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-card-hover);
}

.idea-thumb {
  aspect-ratio: 16 / 9;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
}

.idea-card-body {
  padding: 18px 18px 20px;
}

.idea-card-body h3 {
  margin: 0 0 6px;
  font-size: 1.05rem;
  font-weight: 800;
  line-height: 1.3;
}

.idea-card-body p {
  margin: 0;
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.5;
}

/* ---------- Guide article product CTAs ---------- */
.product-cta {
  display: inline-block;
  margin-top: 4px;
  background: var(--accent-soft-bg);
  color: var(--accent-solid);
  text-decoration: none;
  padding: 10px 18px;
  border-radius: var(--radius-pill);
  font-weight: 700;
  font-size: 0.9rem;
}

.cta-inline {
  display: inline-block;
  margin-top: 8px;
  background: linear-gradient(45deg, var(--accent-from) 0%, var(--accent-to) 100%);
  color: #fff;
  text-decoration: none;
  padding: 12px 22px;
  border-radius: var(--radius-btn);
  font-weight: 700;
  font-size: 0.95rem;
  box-shadow: var(--shadow-btn);
}
