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

:root {
  --bg: #F8F5F0;
  --bg-alt: #EFEBE4;
  --fg: #18160F;
  --fg-muted: #6B6459;
  --accent: #C8521A;
  --accent-light: #F0D9CC;
  --green: #1A4D2E;
  --green-light: #2A6B3F;
  --card-bg: #FFFFFF;
  --border: #D9D3C8;
  --font-display: 'Fraunces', Georgia, serif;
  --font-body: 'Plus Jakarta Sans', system-ui, sans-serif;
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ── NAV ── */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(248, 245, 240, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 0 48px;
}

.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.25rem;
  letter-spacing: -0.03em;
  color: var(--fg);
}

.nav-tagline {
  font-size: 0.8125rem;
  color: var(--fg-muted);
  font-weight: 500;
}

.nav-cta {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
  transition: opacity 0.15s ease;
}

.nav-cta:hover { opacity: 0.75; }

/* ── HERO ── */
.hero {
  max-width: 1200px;
  margin: 0 auto;
  padding: 96px 48px 80px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: center;
}

.hero-eyebrow {
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 20px;
}

.hero-headline {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(2.2rem, 4vw, 3.5rem);
  line-height: 1.08;
  letter-spacing: -0.03em;
  color: var(--fg);
  margin-bottom: 28px;
}

.hero-headline em {
  font-style: italic;
  color: var(--accent);
}

.hero-lede {
  font-size: 1.125rem;
  color: var(--fg-muted);
  line-height: 1.65;
  margin-bottom: 36px;
  max-width: 480px;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.hero-badge {
  font-size: 0.75rem;
  font-weight: 600;
  background: var(--accent-light);
  color: var(--accent);
  padding: 6px 14px;
  border-radius: 100px;
  letter-spacing: 0.02em;
}

/* ── HERO CARDS ── */
.hero-visual { display: flex; align-items: center; justify-content: center; }

.hero-card-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  max-width: 400px;
  position: relative;
}

.hero-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px 22px;
  box-shadow: 0 2px 12px rgba(24, 22, 15, 0.06);
  transform: rotate(-0.5deg);
  transition: transform 0.2s ease;
}

.hero-card:hover { transform: rotate(0deg) translateY(-2px); }
.hero-card-1 { transform: rotate(-1.5deg); }
.hero-card-2 { transform: rotate(0.8deg); border-left: 3px solid var(--green); }
.hero-card-3 { transform: rotate(-0.3deg); }
.hero-card-4 { transform: rotate(0.4deg); border-left: 3px solid var(--accent); }

.card-label {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--fg-muted);
  margin-bottom: 6px;
}

.card-content {
  font-size: 0.9375rem;
  color: var(--fg);
  font-weight: 500;
}

.card-status {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border);
  margin-top: 10px;
}

.card-status--active {
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(26, 77, 46, 0.15);
  animation: pulse 2s infinite;
}

.card-status--done { background: var(--accent); }

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 4px rgba(26, 77, 46, 0.15); }
  50% { box-shadow: 0 0 0 8px rgba(26, 77, 46, 0.05); }
}

/* ── SECTION SHARED ── */
.section-label {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 16px;
}

.section-headline {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.75rem, 3vw, 2.75rem);
  line-height: 1.15;
  letter-spacing: -0.025em;
  color: var(--fg);
}

/* ── WHAT IT DOES ── */
.what-it-does {
  background: var(--bg-alt);
  padding: 96px 48px;
}

.what-it-does .section-headline { margin-bottom: 64px; max-width: 600px; }

.does-grid {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 40px;
}

.does-item {}

.does-icon {
  width: 48px;
  height: 48px;
  background: var(--green);
  color: white;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.125rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  margin-bottom: 20px;
}

.does-item h3 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.25rem;
  margin-bottom: 10px;
  color: var(--fg);
}

.does-item p {
  font-size: 0.9375rem;
  color: var(--fg-muted);
  line-height: 1.6;
}

/* ── HOW IT WORKS ── */
.how-it-works {
  max-width: 1200px;
  margin: 0 auto;
  padding: 96px 48px;
}

.how-it-works .section-headline { margin-bottom: 64px; }

.steps {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.step {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 40px;
  padding: 40px 0;
  border-bottom: 1px solid var(--border);
  align-items: start;
}

.step:last-child { border-bottom: none; }

.step-number {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 3rem;
  color: var(--accent-light);
  line-height: 1;
  padding-top: 4px;
}

.step-content h3 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.5rem;
  margin-bottom: 12px;
  color: var(--fg);
}

.step-content p {
  font-size: 1rem;
  color: var(--fg-muted);
  max-width: 600px;
  line-height: 1.65;
}

/* ── DIFFERENCE ── */
.difference {
  background: var(--green);
  padding: 96px 48px;
}

.difference-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: center;
}

.diff-headline {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(2rem, 3.5vw, 3rem);
  line-height: 1.1;
  letter-spacing: -0.025em;
  color: white;
  margin-bottom: 24px;
}

.diff-body {
  font-size: 1.0625rem;
  color: rgba(255,255,255,0.75);
  line-height: 1.7;
}

.diff-left .section-label { color: rgba(255,255,255,0.6); }

/* VS TABLE */
.vs-table {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 16px;
  overflow: hidden;
}

.vs-header {
  display: grid;
  grid-template-columns: 1fr 120px 120px;
  padding: 16px 24px;
  background: rgba(255,255,255,0.1);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,0.6);
  text-transform: uppercase;
}

.vs-row {
  display: grid;
  grid-template-columns: 1fr 120px 120px;
  padding: 14px 24px;
  border-top: 1px solid rgba(255,255,255,0.08);
  font-size: 0.9375rem;
  align-items: center;
  color: rgba(255,255,255,0.85);
}

.vs-yes, .vs-no {
  font-weight: 700;
  font-size: 0.875rem;
  text-align: center;
}

.vs-yes { color: #7EDB9E; }
.vs-no { color: rgba(255,255,255,0.35); }

/* ── CLOSING ── */
.closing {
  background: var(--bg);
  padding: 120px 48px;
  text-align: center;
}

.closing-inner { max-width: 800px; margin: 0 auto; }

.closing-headline {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(1.75rem, 3vw, 2.75rem);
  line-height: 1.2;
  letter-spacing: -0.025em;
  color: var(--fg);
  margin-bottom: 24px;
}

.closing-sub {
  font-size: 1.125rem;
  color: var(--fg-muted);
  line-height: 1.65;
}

.closing-cta {
  display: inline-block;
  padding: 14px 32px;
  background: var(--green);
  color: white;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 1rem;
  border-radius: 10px;
  text-decoration: none;
  letter-spacing: 0.01em;
  transition: background 0.15s ease;
}

.closing-cta:hover { background: var(--green-light); }

/* ── FOOTER ── */
.footer {
  background: var(--fg);
  padding: 40px 48px;
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.footer-logo {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.125rem;
  color: white;
  display: block;
  margin-bottom: 4px;
}

.footer-desc {
  font-size: 0.8125rem;
  color: rgba(255,255,255,0.45);
}

.footer-note {
  font-size: 0.8125rem;
  color: rgba(255,255,255,0.3);
}

/* ── RESPONSIVE ── */
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; gap: 48px; padding: 64px 32px; }
  .hero-visual { order: -1; }
  .hero-card-stack { max-width: 320px; }
  .does-grid { grid-template-columns: repeat(2, 1fr); }
  .difference-inner { grid-template-columns: 1fr; }
  .step { grid-template-columns: 80px 1fr; }
  .what-it-does, .how-it-works, .difference, .closing { padding: 72px 32px; }
  .nav { padding: 0 24px; }
}

/* ── APP UI ── */
.app-wrapper {
  max-width: 860px;
  margin: 0 auto;
  padding: 64px 48px 96px;
}

.app-header {
  margin-bottom: 48px;
}

.app-title {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 2rem;
  letter-spacing: -0.03em;
  color: var(--fg);
  margin-bottom: 8px;
}

.app-subtitle {
  font-size: 1rem;
  color: var(--fg-muted);
}

/* ── GENERATE FORM ── */
.generate-form {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 36px;
  margin-bottom: 40px;
  box-shadow: 0 2px 12px rgba(24, 22, 15, 0.06);
}

.form-section {
  margin-bottom: 24px;
}

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--fg);
  margin-bottom: 8px;
  letter-spacing: 0.01em;
}

.form-input {
  width: 100%;
  padding: 14px 16px;
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--fg);
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  outline: none;
  transition: border-color 0.15s ease;
}

.form-input:focus {
  border-color: var(--accent);
}

.format-options {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.format-btn {
  flex: 1;
  min-width: 160px;
  padding: 14px 20px;
  border: 2px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
  color: var(--fg-muted);
  font-family: var(--font-body);
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  transition: all 0.15s ease;
  appearance: none;
}

.format-btn input[type="radio"] {
  display: none;
}

.format-btn.selected,
.format-btn:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-light);
  color: var(--accent);
}

.submit-btn {
  width: 100%;
  padding: 16px;
  background: var(--green);
  color: white;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 700;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  letter-spacing: 0.01em;
  transition: background 0.15s ease;
}

.submit-btn:hover { background: var(--green-light); }
.submit-btn:disabled { background: var(--border); cursor: not-allowed; }

/* Loading spinner */
.spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2.5px solid rgba(255,255,255,0.4);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  vertical-align: middle;
  margin-right: 8px;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ── RESULT ── */
.result-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 40px;
  box-shadow: 0 2px 12px rgba(24, 22, 15, 0.06);
}

.result-meta {
  padding: 16px 28px;
  background: var(--bg-alt);
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8125rem;
  color: var(--fg-muted);
}

.result-badge {
  background: var(--accent-light);
  color: var(--accent);
  font-weight: 700;
  font-size: 0.75rem;
  padding: 4px 10px;
  border-radius: 100px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.result-content {
  padding: 32px 28px;
  font-size: 1rem;
  line-height: 1.75;
  color: var(--fg);
  white-space: pre-wrap;
}

.result-actions {
  padding: 20px 28px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.result-actions button {
  padding: 10px 20px;
  border-radius: 8px;
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.copy-btn {
  background: var(--green);
  color: white;
  border: none;
}

.copy-btn:hover { background: var(--green-light); }

.regenerate-btn {
  background: transparent;
  color: var(--fg-muted);
  border: 1.5px solid var(--border);
}

.regenerate-btn:hover { border-color: var(--fg-muted); color: var(--fg); }

/* ── ERROR ── */
.error-msg {
  background: #fff0ed;
  border: 1px solid #ffcdc4;
  border-radius: 10px;
  padding: 14px 18px;
  color: #c0391b;
  font-size: 0.9375rem;
  margin-bottom: 24px;
}

/* ── HISTORY ── */
.history-section { margin-top: 64px; }

.history-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--fg);
  margin-bottom: 20px;
}

.history-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.history-item {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.history-item:hover {
  border-color: var(--accent);
  transform: translateX(2px);
}

.history-topic {
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--fg);
  max-width: 500px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.history-meta {
  font-size: 0.8125rem;
  color: var(--fg-muted);
  display: flex;
  gap: 16px;
  align-items: center;
  flex-shrink: 0;
}

.history-badge {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 3px 8px;
  border-radius: 100px;
  background: var(--bg-alt);
  color: var(--fg-muted);
}

.history-badge.blog { background: var(--accent-light); color: var(--accent); }
.history-badge.linkedin { background: var(--green); color: white; }

@media (max-width: 600px) {
  .app-wrapper { padding: 40px 24px 72px; }
  .generate-form { padding: 24px; }
  .result-content { padding: 24px; }
}