/* book-creator — warm, kid-friendly idea generator
   System font stack only (no external origins). */

:root {
  --bg: #FBF3E4;
  --bg-alt: #F7E9D2;
  --surface: #FFFFFF;
  --surface-soft: #FFF8EE;
  --border: #EBD9BC;
  --text: #3D2B1F;
  --text-muted: #7A6A57;
  --primary: #A9472B;
  --primary-hover: #8F3A24;
  --primary-soft: #FCE4D9;
  --accent: #F4B942;
  --accent-soft: #FCEFC5;
  --teal: #2F6B72;
  --teal-soft: #D5ECEE;
  --shadow: 0 6px 24px rgba(61, 43, 31, 0.10);
  --shadow-sm: 0 3px 10px rgba(61, 43, 31, 0.08);
  --radius: 18px;
  --radius-lg: 26px;
  --radius-pill: 999px;
  --maxw: 880px;
  --font: ui-rounded, "SF Pro Rounded", "Segoe UI", Roboto, "Helvetica Neue",
    Arial, "Noto Sans", sans-serif;
}

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

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

body {
  margin: 0;
  font-family: var(--font);
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 1.0625rem;
  background-image:
    radial-gradient(circle at 12% 18%, var(--accent-soft) 0, transparent 28%),
    radial-gradient(circle at 88% 12%, var(--primary-soft) 0, transparent 26%),
    radial-gradient(circle at 80% 88%, var(--teal-soft) 0, transparent 30%);
  background-attachment: fixed;
  min-height: 100vh;
}

a { color: var(--teal); text-decoration: underline; text-underline-offset: 2px; }
a:hover { color: #1F555C; }

/* ---------- Skip link ---------- */
.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--text);
  color: #fff;
  padding: 0.6rem 1rem;
  border-radius: 0 0 8px 0;
  z-index: 100;
  font-weight: 600;
}
.skip-link:focus { left: 0; color: #fff; }

/* ---------- Layout ---------- */
.page {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 1.25rem;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem 1.25rem;
  max-width: var(--maxw);
  margin: 0 auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--text);
  text-decoration: none;
}
.brand svg { width: 38px; height: 38px; flex-shrink: 0; }

.site-nav ul {
  list-style: none;
  display: flex;
  gap: 0.35rem;
  margin: 0;
  padding: 0;
}
.site-nav a {
  display: inline-block;
  padding: 0.45rem 0.9rem;
  border-radius: var(--radius-pill);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text);
  transition: background 0.18s ease;
}
.site-nav a:hover { background: var(--primary-soft); }
.site-nav a[aria-current="page"] {
  background: var(--primary);
  color: #fff;
}

/* ---------- Hero ---------- */
.hero {
  text-align: center;
  padding: 2.5rem 0 1.5rem;
}
.hero h1 {
  font-size: clamp(2.1rem, 6vw, 3.2rem);
  line-height: 1.1;
  margin: 0 0 0.75rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}
.hero .lede {
  font-size: 1.15rem;
  color: var(--text-muted);
  max-width: 34rem;
  margin: 0 auto 1.75rem;
}

.sparkle {
  display: inline-block;
  font-size: 1.4em;
  color: var(--accent);
}

/* ---------- Spark button ---------- */
.spark-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: inherit;
  font-size: 1.15rem;
  font-weight: 700;
  color: #fff;
  background: var(--primary);
  border: none;
  padding: 0.95rem 2rem;
  border-radius: var(--radius-pill);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease, background 0.18s ease, box-shadow 0.18s ease;
}
.spark-btn:hover { background: var(--primary-hover); }
.spark-btn:active { transform: scale(0.97); }
.spark-btn .ico { font-size: 1.2em; }

/* ---------- Mood chips ---------- */
.moods {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  margin: 1.75rem 0 0.25rem;
}
.mood-label {
  width: 100%;
  text-align: center;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
  letter-spacing: 0.02em;
}
.chip {
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  background: var(--surface);
  border: 2px solid var(--border);
  padding: 0.45rem 1rem;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.chip:hover { border-color: var(--primary); }
.chip[aria-pressed="true"] {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

/* ---------- Idea card ---------- */
.idea-region {
  margin-top: 2rem;
  margin-bottom: 1rem;
}
.idea-region:empty { display: none; }

.idea-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.85rem 1.85rem 1.6rem;
  box-shadow: var(--shadow);
  animation: pop 0.32s ease;
}
@keyframes pop {
  from { opacity: 0; transform: translateY(10px) scale(0.985); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .idea-card { animation: none; }
  .spark-btn:active { transform: none; }
}

.idea-mood {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: var(--accent-soft);
  color: #8a6a1a;
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius-pill);
  margin-bottom: 0.85rem;
}
.idea-title {
  font-size: clamp(1.5rem, 4vw, 2rem);
  line-height: 1.2;
  margin: 0 0 1.25rem;
  font-weight: 800;
  color: var(--text);
}
.idea-field { margin-bottom: 1rem; }
.idea-field:last-child { margin-bottom: 0; }
.idea-field .label {
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 0.2rem;
}
.idea-field .value { color: var(--text); }
.idea-field .value.opener {
  font-style: italic;
  border-left: 3px solid var(--accent);
  padding-left: 0.85rem;
  margin-left: 0.1rem;
}
.prompts {
  margin: 0;
  padding-left: 1.25rem;
}
.prompts li { margin-bottom: 0.3rem; }

.idea-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px dashed var(--border);
}
.btn-soft {
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text);
  background: var(--surface-soft);
  border: 1.5px solid var(--border);
  padding: 0.5rem 1.05rem;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.btn-soft:hover { background: var(--primary-soft); border-color: var(--primary); }

/* ---------- Empty state ---------- */
.empty-hint {
  text-align: center;
  color: var(--text-muted);
  background: var(--surface-soft);
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: 2.25rem 1.5rem;
  margin-top: 2rem;
}
.empty-hint p { margin: 0.3rem 0; }
.empty-hint .big { font-size: 1.1rem; font-weight: 600; color: var(--text); }

/* ---------- Footer ---------- */
.site-footer {
  text-align: center;
  padding: 2.5rem 1.25rem 2rem;
  color: var(--text-muted);
  font-size: 0.9rem;
  max-width: var(--maxw);
  margin: 2rem auto 0;
}
.site-footer p { margin: 0.3rem 0; }

/* ---------- About page ---------- */
.prose {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem 2.25rem;
  box-shadow: var(--shadow-sm);
  margin: 1.5rem 0 2rem;
}
.prose h1 { margin-top: 0; }
.prose h2 { margin-top: 1.75rem; }
.prose ul { padding-left: 1.25rem; }
.prose li { margin-bottom: 0.4rem; }

/* ---------- 404 ---------- */
.error-page {
  text-align: center;
  padding: 4rem 1.25rem;
}
.error-page h1 {
  font-size: clamp(3rem, 12vw, 6rem);
  margin: 0;
  color: var(--primary);
  font-weight: 800;
}
.error-page .emoji { font-size: 3rem; }

/* ---------- Focus ---------- */
:focus-visible {
  outline: 3px solid var(--teal);
  outline-offset: 2px;
  border-radius: 4px;
}
.spark-btn:focus-visible,
.chip:focus-visible,
.btn-soft:focus-visible,
.site-nav a:focus-visible,
.brand:focus-visible {
  outline-offset: 3px;
}

/* ---------- Responsive ---------- */
@media (max-width: 560px) {
  .site-header { flex-direction: column; align-items: flex-start; }
  .prose { padding: 1.5rem 1.25rem; }
  .idea-card { padding: 1.4rem 1.25rem; }
}
