@import url('https://fonts.googleapis.com/css2?family=Lora:ital,wght@0,500;1,400&family=Inter:wght@400;500&display=swap');

/* ── Design tokens — Claude/Anthropic palette ──────────────────────────────── */
:root {
  --parchment:    #f5f4ed;
  --ivory:        #faf9f5;
  --white:        #ffffff;
  --warm-sand:    #e8e6dc;
  --dark-surface: #30302e;
  --near-black:   #141413;

  --terracotta:   #c96442;
  --coral:        #d97757;

  --text-primary:   #141413;
  --text-secondary: #5e5d59;
  --text-tertiary:  #87867f;
  --text-warm:      #3d3d3a;
  --text-light:     #b0aea5;

  --border-cream: #f0eee6;
  --border-warm:  #e8e6dc;
  --border-dark:  #30302e;
  --ring:         #d1cfc5;

  --font-serif: 'Lora', Georgia, serif;
  --font-sans:  'Inter', system-ui, sans-serif;

  --shadow-whisper: rgba(0,0,0,0.05) 0px 4px 24px;
  --shadow-ring:    0px 0px 0px 1px var(--ring);

  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-2xl: 32px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  background: var(--parchment);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ── Typography ─────────────────────────────────────────────────────────────── */
h1, h2, h3, h4, .serif { font-family: var(--font-serif); font-weight: 500; }

/* ── Layout ──────────────────────────────────────────────────────────────────── */
.container { max-width: 1100px; margin: 0 auto; padding: 0 clamp(20px, 5vw, 48px); }
.container--narrow { max-width: 720px; margin: 0 auto; padding: 0 clamp(20px, 5vw, 48px); }

section { padding: clamp(64px, 10vw, 120px) 0; }

/* ── Buttons ─────────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 20px; border-radius: var(--radius-lg);
  font-family: var(--font-sans); font-size: 0.9375rem; font-weight: 500;
  cursor: pointer; border: none; text-decoration: none;
  transition: all 140ms ease;
}

.btn--primary {
  background: var(--terracotta); color: var(--ivory);
  box-shadow: var(--terracotta) 0px 0px 0px 0px, var(--terracotta) 0px 0px 0px 1px;
}
.btn--primary:hover {
  background: #b5593a;
  box-shadow: var(--terracotta) 0px 0px 0px 0px, #a04f33 0px 0px 0px 1px;
}

.btn--sand {
  background: var(--warm-sand); color: var(--text-warm);
  box-shadow: var(--warm-sand) 0px 0px 0px 0px, var(--ring) 0px 0px 0px 1px;
}
.btn--sand:hover { background: #dddad0; }

.btn--dark {
  background: var(--near-black); color: var(--ivory);
  border: 1px solid var(--dark-surface);
}
.btn--dark:hover { background: var(--dark-surface); }

.btn--large { padding: 13px 28px; font-size: 1rem; border-radius: var(--radius-lg); }

.btn svg { width: 18px; height: 18px; flex-shrink: 0; }

/* ── Cards ───────────────────────────────────────────────────────────────────── */
.card {
  background: var(--ivory);
  border: 1px solid var(--border-cream);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-whisper);
}

/* ── Icon ────────────────────────────────────────────────────────────────────── */
.icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px;
  background: var(--warm-sand); border-radius: var(--radius-md);
}
.icon svg { width: 22px; height: 22px; }

/* ── Inline SVG colour ───────────────────────────────────────────────────────── */
img.icon-svg { width: 22px; height: 22px; opacity: 0.7; }

/* ── Section heading block ───────────────────────────────────────────────────── */
.section-label {
  display: inline-block;
  font-size: 0.625rem; font-weight: 500; letter-spacing: 0.5px;
  text-transform: uppercase; color: var(--terracotta);
  margin-bottom: 14px;
}
.section-title { font-size: clamp(1.75rem, 4vw, 2.75rem); line-height: 1.2; margin-bottom: 16px; }
.section-sub { font-size: 1.0625rem; color: var(--text-secondary); line-height: 1.7; max-width: 520px; }
.section-sub--center { margin: 0 auto; text-align: center; }

/* ── Nav ─────────────────────────────────────────────────────────────────────── */
.site-nav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(245, 244, 237, 0.92); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-cream);
}
.site-nav .container {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: 16px; padding-bottom: 16px;
}
.logo {
  font-family: var(--font-serif); font-size: 1.125rem; font-weight: 500;
  color: var(--text-primary); text-decoration: none;
}
.logo span { color: var(--terracotta); }

/* ── Hero ────────────────────────────────────────────────────────────────────── */
.hero { padding: clamp(72px, 12vw, 120px) 0 clamp(48px, 8vw, 80px); text-align: center; }
.hero-overline {
  font-size: 0.75rem; font-weight: 500; letter-spacing: 0.5px;
  text-transform: uppercase; color: var(--terracotta); margin-bottom: 20px; display: block;
}
.hero-title {
  font-size: clamp(2.4rem, 6vw, 4rem); line-height: 1.1;
  color: var(--text-primary); margin-bottom: 22px;
}
.hero-title em { font-style: italic; color: var(--terracotta); }
.hero-body {
  font-size: clamp(1rem, 2vw, 1.1875rem); color: var(--text-secondary);
  line-height: 1.7; max-width: 520px; margin: 0 auto 36px;
}
.hero-note { font-size: 0.8125rem; color: var(--text-tertiary); margin-top: 12px; }

/* ── Book preview grid ───────────────────────────────────────────────────────── */
.book-previews {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 20px; max-width: 960px; margin: 52px auto 0;
}
.book-previews img {
  width: 100%; aspect-ratio: 13 / 16; object-fit: cover; object-position: top center;
  border-radius: var(--radius-xl);
  box-shadow: 0 8px 32px rgba(0,0,0,0.10), 0px 0px 0px 1px var(--border-cream);
  transition: transform 200ms ease, box-shadow 200ms ease;
}
.book-previews img:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 48px rgba(0,0,0,0.14), 0px 0px 0px 1px var(--border-cream);
}
.book-caption {
  text-align: center; margin-top: 16px;
  font-family: var(--font-serif); font-style: italic;
  font-size: 0.875rem; color: var(--text-tertiary);
}

/* ── How it works ────────────────────────────────────────────────────────────── */
.steps-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 2px; margin-top: 52px;
  background: var(--border-cream); border: 1px solid var(--border-cream);
  border-radius: var(--radius-xl); overflow: hidden;
}
.step-item {
  background: var(--ivory); padding: clamp(28px, 4vw, 40px);
  display: flex; flex-direction: column; gap: 16px;
}
.step-number {
  font-family: var(--font-serif); font-size: 0.75rem;
  color: var(--terracotta); letter-spacing: 0.3px;
}
.step-item h3 { font-size: 1.1875rem; line-height: 1.3; }
.step-item p { font-size: 0.9375rem; color: var(--text-secondary); line-height: 1.7; }

/* ── Style cards (3 preview images) ─────────────────────────────────────────── */
.styles-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 20px; margin-top: 52px;
}
.style-card {
  border-radius: var(--radius-xl); overflow: hidden;
  border: 1px solid var(--border-cream);
  box-shadow: var(--shadow-whisper);
}
.style-card img {
  width: 100%; aspect-ratio: 2 / 3; object-fit: cover; display: block;
}
.style-card-info { background: var(--ivory); padding: 18px 20px; }
.style-card-name { font-family: var(--font-serif); font-size: 1rem; font-weight: 500; margin-bottom: 4px; }
.style-card-desc { font-size: 0.8125rem; color: var(--text-secondary); }

/* ── Dark section ────────────────────────────────────────────────────────────── */
.section--dark {
  background: var(--near-black); color: var(--ivory);
}
.section--dark .section-title { color: var(--ivory); }
.section--dark .section-sub { color: var(--text-light); }
.section--dark .section-label { color: var(--coral); }

/* ── Feature list ────────────────────────────────────────────────────────────── */
.feature-list {
  display: flex; flex-direction: column;
  border-top: 1px solid var(--border-warm); margin-top: 40px;
}
.feature-item {
  display: flex; align-items: flex-start; gap: 16px;
  padding: 20px 0; border-bottom: 1px solid var(--border-warm);
}
.feature-item img { width: 20px; height: 20px; flex-shrink: 0; margin-top: 2px; opacity: 0.55; }
.feature-item-text h4 { font-size: 0.9375rem; font-weight: 500; margin-bottom: 3px; }
.feature-item-text p { font-size: 0.875rem; color: var(--text-secondary); line-height: 1.6; }

/* ── Pricing card ────────────────────────────────────────────────────────────── */
.pricing-wrap { max-width: 440px; margin: 0 auto; }
.pricing-card {
  background: var(--ivory); border: 1px solid var(--border-warm);
  border-radius: var(--radius-2xl); padding: clamp(32px, 5vw, 52px);
  box-shadow: var(--shadow-whisper);
}
.price-badge {
  display: inline-block; padding: 4px 12px;
  background: var(--warm-sand); color: var(--text-secondary);
  border-radius: 999px; font-size: 0.75rem; font-weight: 500;
  letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 20px;
}
.price-amount {
  font-family: var(--font-serif); font-size: 3.5rem; font-weight: 500;
  line-height: 1; color: var(--text-primary); margin-bottom: 6px;
}
.price-desc { font-size: 0.875rem; color: var(--text-tertiary); margin-bottom: 32px; }
.price-features { list-style: none; margin-bottom: 32px; display: flex; flex-direction: column; gap: 13px; }
.price-features li {
  display: flex; align-items: flex-start; gap: 10px;
  font-size: 0.9375rem; color: var(--text-secondary);
}
.price-features li img { width: 18px; height: 18px; flex-shrink: 0; margin-top: 2px; opacity: 0.5; }
.price-cta { width: 100%; justify-content: center; font-size: 1rem; padding: 14px 24px; }
.price-legal { font-size: 0.75rem; color: var(--text-tertiary); text-align: center; margin-top: 14px; }

/* ── FAQ ─────────────────────────────────────────────────────────────────────── */
.faq-list { margin-top: 48px; display: flex; flex-direction: column; }
details { border-top: 1px solid var(--border-warm); }
details:last-child { border-bottom: 1px solid var(--border-warm); }
summary {
  padding: 20px 0; cursor: pointer; font-weight: 500; font-size: 0.9375rem;
  list-style: none; display: flex; justify-content: space-between; align-items: center;
  gap: 16px;
}
summary::-webkit-details-marker { display: none; }
.summary-icon {
  width: 22px; height: 22px; flex-shrink: 0;
  border-radius: 50%; background: var(--warm-sand);
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem; line-height: 1; color: var(--text-secondary);
  transition: transform 140ms ease, background 140ms ease;
}
details[open] .summary-icon { transform: rotate(45deg); background: var(--terracotta); color: var(--ivory); }
details > div {
  padding: 0 0 20px; font-size: 0.9375rem; color: var(--text-secondary); line-height: 1.7;
}
details > div a { color: var(--terracotta); text-underline-offset: 3px; }

/* ── Tool page ───────────────────────────────────────────────────────────────── */
.tool-nav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(245, 244, 237, 0.92); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-cream);
  padding: 14px 0;
}
.tool-nav .container { display: flex; align-items: center; justify-content: space-between; }

.tool-wrap { max-width: 760px; margin: 0 auto; padding: clamp(32px, 5vw, 56px) clamp(20px, 5vw, 48px); }
.tool-section { padding: clamp(28px, 4vw, 44px) 0; border-bottom: 1px solid var(--border-cream); }
.tool-section:last-child { border-bottom: none; }
.tool-section[data-locked] { opacity: 0.4; pointer-events: none; }

.step-meta { display: flex; align-items: baseline; gap: 10px; margin-bottom: 8px; }
.step-tag {
  font-size: 0.6875rem; font-weight: 500; letter-spacing: 0.4px;
  text-transform: uppercase; color: var(--terracotta);
}
.step-heading { font-family: var(--font-serif); font-size: 1.3125rem; font-weight: 500; }
.step-body { font-size: 0.9375rem; color: var(--text-secondary); line-height: 1.7; margin-bottom: 24px; max-width: 560px; }

/* ── Selector cards ──────────────────────────────────────────────────────────── */
.selector-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.selector-card {
  cursor: pointer; padding: 0; text-align: left;
  background: var(--ivory); border: 2px solid var(--border-cream);
  border-radius: var(--radius-lg); transition: all 140ms ease;
  font-family: var(--font-sans); position: relative;
  overflow: hidden;
}
.selector-card:hover { border-color: var(--ring); transform: translateY(-2px); box-shadow: 0 4px 16px rgba(0,0,0,0.10); }
.selector-card.selected { border-color: var(--terracotta); box-shadow: var(--terracotta) 0px 0px 0px 2px; }

/* Image fills the card */
.selector-card .card-preview {
  width: 100%;
  aspect-ratio: 3/4;
  overflow: hidden;
  background: var(--sand);
  display: block;
}
.selector-card .card-preview img {
  width: 100%; height: 100%;
  object-fit: cover; object-position: top center;
  display: block;
  transition: transform 240ms ease;
}
.selector-card:hover .card-preview img { transform: scale(1.03); }

/* Label strip at the bottom */
.selector-card .card-label {
  font-weight: 600; font-size: 0.875rem;
  padding: 10px 14px 4px;
  color: var(--text-primary);
}
.selector-card .card-desc {
  font-size: 0.775rem; color: var(--text-secondary);
  padding: 0 14px 12px; line-height: 1.4;
}

/* Hide old icon element if still present */
.selector-card .card-icon { display: none; }

/* Checkmark overlays image */
.selector-card .check-mark {
  position: absolute; top: 10px; right: 10px;
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--terracotta); color: #fff;
  display: none; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700;
  box-shadow: 0 2px 8px rgba(0,0,0,0.25);
}
.selector-card.selected .check-mark { display: flex; }

/* ── Fields ──────────────────────────────────────────────────────────────────── */
.fields-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin-bottom: 16px; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
label { font-size: 0.8125rem; font-weight: 500; color: var(--text-secondary); }

input[type="text"], input[type="email"], select {
  padding: 9px 12px; border: 1px solid var(--border-warm);
  border-radius: var(--radius-lg); font-family: var(--font-sans); font-size: 0.9375rem;
  color: var(--text-primary); background: var(--white);
  transition: border-color 140ms ease, box-shadow 140ms ease; outline: none; width: 100%;
}
input:focus, select:focus {
  border-color: #3898ec;
  box-shadow: #3898ec 0px 0px 0px 1px;
}

/* ── Prompt panel ────────────────────────────────────────────────────────────── */
.prompt-panel {
  background: var(--white); border: 1px solid var(--border-warm);
  border-radius: var(--radius-lg); overflow: hidden; margin-top: 4px;
}
.prompt-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; border-bottom: 1px solid var(--border-cream);
  background: var(--ivory);
}
.prompt-label {
  font-size: 0.6875rem; font-weight: 500; text-transform: uppercase;
  letter-spacing: 0.4px; color: var(--text-tertiary);
}
.prompt-actions { display: flex; gap: 8px; align-items: center; }
.prompt-body {
  padding: 18px; font-size: 0.875rem; line-height: 1.75;
  color: var(--text-secondary); white-space: pre-wrap;
  max-height: 280px; overflow-y: auto;
}

.copy-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: var(--radius-sm); font-size: 0.8125rem; font-weight: 500;
  cursor: pointer; border: 1px solid var(--border-warm); background: var(--warm-sand);
  color: var(--text-warm); transition: all 140ms ease;
}
.copy-btn img { width: 14px; height: 14px; opacity: 0.6; }
.copy-btn:hover { background: var(--border-warm); }
.copy-btn.copied { background: #e6f0e6; border-color: #b8d4b8; color: #3a6b3a; }

.open-link {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 6px 12px; border-radius: var(--radius-sm); font-size: 0.8125rem; font-weight: 500;
  color: var(--terracotta); border: 1px solid rgba(201,100,66,0.2);
  background: rgba(201,100,66,0.06); text-decoration: none; transition: all 140ms ease;
}
.open-link img { width: 13px; height: 13px; opacity: 0.7; }
.open-link:hover { background: rgba(201,100,66,0.12); }

/* ── Tool links row ──────────────────────────────────────────────────────────── */
.tool-links { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 8px; }

/* ── Instructions block ──────────────────────────────────────────────────────── */
.instructions {
  background: var(--ivory); border: 1px solid var(--border-cream);
  border-left: 3px solid var(--terracotta); border-radius: 0 var(--radius-md) var(--radius-md) 0;
  padding: 18px 22px; margin: 16px 0; font-size: 0.9rem; color: var(--text-secondary); line-height: 1.8;
}
.instructions ol { padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }
.instructions code {
  font-family: 'Fira Code', monospace; font-size: 0.82em;
  background: var(--warm-sand); padding: 2px 6px; border-radius: 4px;
  color: var(--text-warm);
}

/* ── Loading overlay ─────────────────────────────────────────────────────────── */
.loading-overlay {
  position: fixed; inset: 0; background: var(--parchment);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 18px; z-index: 1000;
}
.loading-spinner {
  width: 40px; height: 40px; border: 2px solid var(--border-warm);
  border-top-color: var(--terracotta); border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Step dots (tool header) ─────────────────────────────────────────────────── */
.step-dots { display: flex; gap: 6px; align-items: center; }
.step-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--border-warm); transition: all 140ms ease; }
.step-dot.active { background: var(--terracotta); transform: scale(1.3); }
.step-dot.done { background: #8aad8a; }

/* ── Footer ──────────────────────────────────────────────────────────────────── */
.site-footer {
  padding: 36px 0; border-top: 1px solid var(--border-cream);
}
.site-footer p { font-size: 0.8125rem; color: var(--text-tertiary); text-align: center; }
.site-footer a { color: var(--text-secondary); text-underline-offset: 3px; }

/* ── Responsive ──────────────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .book-previews { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .styles-grid { grid-template-columns: 1fr; }
  .selector-grid { grid-template-columns: 1fr 1fr; }
  .steps-grid { grid-template-columns: 1fr; }
}
@media (max-width: 420px) {
  .book-previews { grid-template-columns: repeat(2, 1fr); }
  .book-previews img:last-child { display: none; }
  .selector-grid { grid-template-columns: 1fr; }
}
