:root {
  --ink: #1a1a2e;
  --ink-soft: #4a4a63;
  --muted: #7a7a8c;
  --bg: #fbfbfd;
  --card: #ffffff;
  --line: #e6e6ee;
  --accent: #7c3aed;
  --accent-dark: #6d28d9;
  --tag-bg: #f1ebff;
  --code-bg: #f5f5fa;
  --radius: 12px;
  --maxw: 760px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
}

.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 20px;
}

/* Header */
.site-header {
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
  color: #fff;
  padding: 56px 0 44px;
}
.site-header .kicker {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.78rem;
  font-weight: 600;
  opacity: 0.85;
  margin: 0 0 8px;
}
.site-header h1 {
  margin: 0 0 12px;
  font-size: 2.2rem;
  line-height: 1.15;
}
.site-header .lede {
  margin: 0;
  font-size: 1.1rem;
  max-width: 34em;
  opacity: 0.95;
}
.site-header .muted { opacity: 0.8; color: #fff; }

/* Sections */
main { padding: 40px 0 64px; }
section { margin-bottom: 44px; }
h2 { font-size: 1.5rem; margin: 0 0 6px; }
h3 { font-size: 1.08rem; margin: 0 0 10px; }

.muted { color: var(--muted); }
.small { font-size: 0.85rem; }

/* Prompt cards */
.prompt-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  margin: 16px 0;
  box-shadow: 0 1px 3px rgba(20, 20, 50, 0.04);
}
.prompt-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.tag {
  font-size: 0.74rem;
  font-weight: 600;
  background: var(--tag-bg);
  color: var(--accent-dark);
  padding: 3px 10px;
  border-radius: 999px;
}
.tag-task { background: #eafaf1; color: #1d7a4d; }

.prompt-text {
  background: var(--code-bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px 16px;
  overflow-x: auto;
  margin: 0 0 12px;
}
.prompt-text code {
  font-family: "SF Mono", ui-monospace, Menlo, Consolas, monospace;
  font-size: 0.86rem;
  white-space: pre-wrap;
  color: var(--ink);
}

/* Buttons */
.copy-btn {
  cursor: pointer;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 9px 18px;
  background: var(--accent);
  color: #fff;
  transition: background 0.15s ease;
}
.copy-btn:hover { background: var(--accent-dark); }
.copy-btn.copied { background: #1d7a4d; }

/* Unlock section */
.unlock {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
  text-align: center;
}

/* MailerLite embed — blend into the white unlock card.
   Targeted by class (not the #mlb2-… id) so it survives re-pasting the embed. */
.unlock .ml-form-embedContainer { width: 100% !important; }
.unlock .ml-form-embedWrapper {
  background: transparent !important;
  max-width: 360px !important;
  margin: 0 auto !important;
}
.unlock .ml-form-embedBody { padding: 18px 0 0 !important; }
.unlock .ml-form-embedContent { margin-bottom: 0 !important; }
.unlock .ml-form-fieldRow input,
.unlock .ml-form-embedSubmit button {
  border-radius: 8px !important;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif !important;
}
.unlock .ml-form-fieldRow input {
  border-color: var(--line) !important;
  padding: 11px 14px !important;
  font-size: 0.95rem !important;
}
.unlock .ml-form-embedSubmit { margin-bottom: 0 !important; }

/* Library hub — book cards */
.header-link { color: #fff; text-decoration: none; opacity: 0.9; }
.header-link:hover { text-decoration: underline; }
.book-list { display: grid; gap: 18px; }
.book-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: 0 1px 3px rgba(20, 20, 50, 0.04);
}
.book-card h2 { font-size: 1.25rem; margin: 2px 0 8px; }
.book-card p { margin: 0 0 16px; color: var(--ink-soft); }
.book-num {
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-dark);
  margin: 0;
}
.book-link {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  font-size: 0.92rem;
  padding: 10px 20px;
  border-radius: 8px;
  text-decoration: none;
  transition: background 0.15s ease;
}
.book-link:hover { background: var(--accent-dark); }
.book-card.is-upcoming { opacity: 0.85; }
.book-badge {
  display: inline-block;
  background: var(--tag-bg);
  color: var(--accent-dark);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 999px;
}

/* How-to callout */
.howto {
  background: #f4f3ff;
  border: 1px solid #ddd9ff;
  border-radius: var(--radius);
  padding: 20px 24px;
}
.howto h2 { font-size: 1.15rem; }
.howto ol { margin: 8px 0 0; padding-left: 20px; }
.howto li { margin-bottom: 4px; }

/* TOC */
.toc {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 28px;
}
.toc ul { margin: 8px 0 0; padding-left: 18px; }
.toc a { color: var(--accent); text-decoration: none; }
.toc a:hover { text-decoration: underline; }

/* Footer */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 24px 0;
  color: var(--muted);
  font-size: 0.85rem;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--ink);
  color: #fff;
  padding: 10px 20px;
  border-radius: 999px;
  font-size: 0.9rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* Accessibility helper */
.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;
}

@media (max-width: 520px) {
  .site-header h1 { font-size: 1.8rem; }
}
