/* ===========================================================
   HobbyPub Books — bookish, warm, trustworthy
   Palette: forest green / amber gold / cream paper
   =========================================================== */

:root {
  --green: #1F4D3E;
  --green-dark: #163A2E;
  --amber: #D97706;
  --amber-dark: #B45309;
  --cream: #FAF9F6;
  --ink: #1C1917;
  --muted: #57534E;
  --border: #E7E5E4;
  --card: #FFFDF9;
  --banner-bg: #FEF3C7;
  --banner-text: #92400E;
  --radius: 6px;
  --shadow: 0 1px 2px rgba(28, 25, 23, 0.04), 0 4px 14px rgba(28, 25, 23, 0.06);
  --shadow-sm: 0 1px 3px rgba(28, 25, 23, 0.07);
  --maxw: 720px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  font-size: 17px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .wordmark {
  font-family: 'Lora', Georgia, 'Times New Roman', serif;
  color: var(--green);
  line-height: 1.25;
}

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

a { color: var(--green); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- Header ---------- */
.site-header {
  border-bottom: 1px solid var(--border);
  background: rgba(250, 249, 246, 0.92);
  backdrop-filter: saturate(180%) blur(6px);
  position: sticky;
  top: 0;
  z-index: 20;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}
.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--green);
}
.wordmark:hover { text-decoration: none; }
.wordmark-icon { display: inline-flex; }
.wordmark-light { color: var(--amber); font-weight: 600; }
.site-nav { display: flex; gap: 22px; font-size: 0.95rem; font-weight: 500; }
.site-nav a { color: var(--muted); }
.site-nav a:hover { color: var(--green); }

/* ---------- Hero ---------- */
.hero {
  text-align: center;
  padding: 56px 20px 28px;
}
.hero-icon { margin-bottom: 14px; }
.hero h1 {
  font-size: 52px;
  font-weight: 700;
  margin: 0 0 14px;
  letter-spacing: -0.5px;
}
.hero-sub {
  font-size: 1.15rem;
  color: var(--muted);
  max-width: 560px;
  margin: 0 auto;
}

/* ---------- Honesty banner ---------- */
.honesty-banner {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: var(--banner-bg);
  color: var(--banner-text);
  border: 1px solid #FCD34D;
  border-radius: var(--radius);
  padding: 14px 16px;
  margin: 8px 0 28px;
}
.honesty-banner p { margin: 0; font-size: 0.96rem; line-height: 1.6; }
.honesty-icon { font-size: 1.1rem; line-height: 1.5; flex-shrink: 0; }
.honesty-dismiss {
  margin-left: auto;
  background: none;
  border: none;
  color: var(--banner-text);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 2px;
  opacity: 0.7;
}
.honesty-dismiss:hover { opacity: 1; }

/* ---------- Converter ---------- */
.converter { padding-bottom: 8px; }

.drop-zone {
  position: relative;
  border: 2px dashed #C7CEC9;
  border-radius: 12px;
  background:
    linear-gradient(180deg, rgba(31,77,62,0.015), rgba(217,119,6,0.02)),
    repeating-linear-gradient(180deg, transparent, transparent 26px, rgba(31,77,62,0.04) 27px, transparent 28px),
    var(--card);
  padding: 48px 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.18s, background 0.18s, transform 0.05s;
  outline: none;
}
.drop-zone:hover,
.drop-zone:focus-visible { border-color: var(--green); }
.drop-zone.dragover {
  border-color: var(--amber);
  background:
    linear-gradient(180deg, rgba(217,119,6,0.06), rgba(217,119,6,0.04)),
    var(--card);
}
.drop-icon { display: inline-flex; margin-bottom: 8px; }
.drop-title { font-size: 1.15rem; font-weight: 600; margin: 4px 0; color: var(--ink); }
.drop-or { margin: 4px 0; color: var(--muted); }
.drop-hint { font-size: 0.85rem; color: var(--muted); margin: 8px 0 0; opacity: 0.8; }
.link-btn {
  background: none;
  border: none;
  color: var(--amber-dark);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
}

/* ---------- File card ---------- */
.file-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 14px 16px;
  margin-top: 18px;
}
.file-card-icon { font-size: 1.6rem; }
.file-card-info { flex: 1; min-width: 0; }
.file-card-name {
  margin: 0;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.file-card-meta { margin: 2px 0 0; font-size: 0.88rem; color: var(--muted); }
.remove-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--muted);
  padding: 6px 12px;
  font: inherit;
  font-size: 0.88rem;
  cursor: pointer;
  transition: all 0.15s;
}
.remove-btn:hover { border-color: #DC2626; color: #DC2626; }

/* ---------- Metadata form ---------- */
.meta-form {
  margin-top: 18px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 18px;
}
.meta-title { font-size: 1.05rem; margin: 0 0 14px; }
.meta-optional { font-family: 'Inter', sans-serif; font-weight: 400; font-size: 0.85rem; color: var(--muted); }
.meta-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 5px; font-size: 0.85rem; font-weight: 500; color: var(--muted); }
.field input, .field select {
  font: inherit;
  font-size: 0.95rem;
  color: var(--ink);
  padding: 9px 11px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.field input:focus, .field select:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(31, 77, 62, 0.1);
}
.field:last-child { grid-column: 1 / -1; }

/* ---------- Buttons ---------- */
.cta-btn {
  display: block;
  width: 100%;
  margin-top: 20px;
  background: var(--green);
  color: #fff;
  font: inherit;
  font-weight: 600;
  font-size: 1.05rem;
  border: none;
  border-radius: var(--radius);
  padding: 15px 20px;
  cursor: pointer;
  transition: background 0.15s, transform 0.05s, box-shadow 0.15s;
  box-shadow: var(--shadow-sm);
}
.cta-btn:hover:not(:disabled) { background: var(--green-dark); box-shadow: var(--shadow); }
.cta-btn:active:not(:disabled) { transform: translateY(1px); }
.cta-btn:disabled { background: #B7C2BD; cursor: not-allowed; box-shadow: none; }

.ghost-btn {
  display: block;
  width: 100%;
  margin-top: 10px;
  background: transparent;
  color: var(--green);
  font: inherit;
  font-weight: 600;
  border: 1px solid var(--green);
  border-radius: var(--radius);
  padding: 13px 20px;
  cursor: pointer;
  transition: background 0.15s;
}
.ghost-btn:hover { background: rgba(31, 77, 62, 0.06); }

/* ---------- Progress ---------- */
.progress-wrap { margin-top: 18px; }
.progress-track {
  height: 10px;
  background: #EAE8E3;
  border-radius: 999px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--green), var(--amber));
  border-radius: 999px;
  transition: width 0.25s ease;
}
.progress-label { font-size: 0.88rem; color: var(--muted); margin: 8px 0 0; text-align: center; }

/* ---------- Message box ---------- */
.message-box {
  margin-top: 18px;
  padding: 14px 16px;
  border-radius: var(--radius);
  font-size: 0.95rem;
  border: 1px solid;
}
.message-box.error { background: #FEF2F2; border-color: #FECACA; color: #991B1B; }
.message-box.warn { background: var(--banner-bg); border-color: #FCD34D; color: var(--banner-text); }

/* ---------- Preview ---------- */
.preview-section {
  margin-top: 26px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
}
.preview-title { font-size: 1.3rem; margin: 0 0 6px; }
.preview-help { color: var(--muted); font-size: 0.95rem; margin: 0 0 14px; }
.preview-text {
  font-family: 'Lora', Georgia, serif;
  font-size: 1rem;
  line-height: 1.7;
  background: var(--cream);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 240px;
  overflow-y: auto;
  color: var(--ink);
}
.preview-stats { font-size: 0.85rem; color: var(--muted); margin: 10px 0 16px; }
.preview-actions { display: flex; flex-direction: column; }
.preview-actions .cta-btn { margin-top: 0; }

/* ---------- Feature cards ---------- */
.features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  padding-top: 44px;
  padding-bottom: 12px;
}
.feature-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 22px 18px;
  text-align: center;
}
.feature-emoji { font-size: 1.8rem; display: block; margin-bottom: 8px; }
.feature-card h3 { font-size: 1.05rem; margin: 0 0 6px; }
.feature-card p { margin: 0; font-size: 0.92rem; color: var(--muted); }

/* ---------- Sections ---------- */
.section-title {
  font-size: 1.8rem;
  text-align: center;
  margin: 0 0 28px;
}
.how, .faq, .about { padding-top: 56px; }

/* ---------- Steps ---------- */
.steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 18px; }
.step {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 18px 20px;
}
.step-num {
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--green);
  color: #fff;
  font-family: 'Lora', serif;
  font-weight: 700;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
}
.step h3 { margin: 2px 0 4px; font-size: 1.1rem; }
.step p { margin: 0; color: var(--muted); }

/* ---------- FAQ ---------- */
.faq-item {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow-sm);
  margin-bottom: 12px;
  padding: 0 18px;
}
.faq-item summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 1.02rem;
  padding: 16px 0;
  list-style: none;
  position: relative;
  padding-right: 28px;
  color: var(--green);
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: '+';
  position: absolute;
  right: 2px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.3rem;
  color: var(--amber);
  transition: transform 0.2s;
}
.faq-item[open] summary::after { content: '−'; }
.faq-item p { margin: 0 0 16px; color: var(--muted); }
.faq-item code {
  background: #F0EFEA;
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 0.88em;
}

/* ---------- About ---------- */
.about p { color: var(--muted); max-width: 620px; margin: 0 auto; text-align: center; }

/* ---------- Footer ---------- */
.site-footer {
  margin-top: 64px;
  border-top: 1px solid var(--border);
  padding: 28px 0;
  text-align: center;
}
.site-footer p { margin: 4px 0; font-size: 0.9rem; color: var(--muted); }
.footer-privacy { opacity: 0.85; }
.footer-contact { margin-top: 8px; }
.site-footer a { color: var(--green); font-weight: 500; }

/* ---------- Responsive ---------- */
@media (max-width: 600px) {
  body { font-size: 16px; }
  .hero { padding-top: 40px; }
  .hero h1 { font-size: 38px; }
  .hero-sub { font-size: 1.05rem; }
  .site-nav { gap: 14px; font-size: 0.88rem; }
  .features { grid-template-columns: 1fr; }
  .meta-grid { grid-template-columns: 1fr; }
  .field:last-child { grid-column: auto; }
  .section-title { font-size: 1.5rem; }
}

@media (max-width: 380px) {
  .site-nav a:nth-child(3) { display: none; }
}
