@import url("https://fonts.googleapis.com/css2?family=Archivo+Black&family=Inter:wght@400;500;600;700;800;900&display=swap");

:root {
  color-scheme: light;
  --paper: #fffdf7;
  --surface: #ffffff;
  --ink: #101010;
  --muted: #5f5a50;
  --faint: #8f8b84;
  --line: #ded5c3;
  --divider: rgba(26, 24, 21, 0.12);
  --line-strong: #111111;
  --accent: #111111;
  --focus: #3158d4;
  --cream: #f4edd4;
  --yellow: #f4c63d;
  --gold: #e9a635;
  --pink: #dd86a0;
  --orange: #ee7d38;
  --blue: #4a68ff;
  --green: #a7c958;
  --radius: 10px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-width: 320px;
  overflow-x: hidden;
  color: var(--ink);
  background: var(--paper);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button, input, textarea { font: inherit; }
button { cursor: pointer; }

/* ── Topbar ─────────────────────────────────────────────────────────────────── */

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 16px clamp(18px, 4vw, 52px);
  background: rgba(255, 253, 247, 0.9);
  border-bottom: 1px solid var(--divider);
  backdrop-filter: blur(14px);
}

.brand, .nav-links a { color: inherit; text-decoration: none; }

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  font-weight: 800;
}

.brand-logo {
  display: block;
  flex-shrink: 0;
  mix-blend-mode: multiply;
}

.brand-logo-full {
  height: 36px;
  width: auto;
}

.ai-badge .brand-logo-full {
  height: 48px;
  width: auto;
}

.nav-links {
  display: flex;
  gap: 24px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 650;
}

.nav-links a:hover { color: var(--ink); }

/* ── Buttons ─────────────────────────────────────────────────────────────────── */

.ghost-button,
.primary-button,
.generate-button,
.html-export-button {
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  color: var(--surface);
  background: var(--ink);
  font-weight: 500;
  transition: transform 160ms ease, background 160ms ease, color 160ms ease;
}

.ghost-button {
  padding: 10px 14px;
  color: var(--ink);
  background: var(--surface);
  box-shadow: 3px 3px 0 var(--ink);
}

.ghost-button:hover { color: var(--surface); background: var(--ink); transform: translateY(-1px); }

.primary-button, .generate-button, .html-export-button {
  padding: 7px 7px 7px 20px;
}

.generate-button, .html-export-button { padding: 14px 18px; }

.primary-button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.button-orb {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: var(--radius);
  background: var(--cream);
  color: var(--ink);
  font-size: 13px;
}

.primary-button:hover, .generate-button:hover { transform: translateY(-1px); }

.sample-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 43px;
  padding: 0 21px;
  border: 1px solid rgba(26, 24, 21, 0.1);
  border-radius: var(--radius);
  color: var(--ink);
  background: transparent;
  font-weight: 500;
  text-decoration: none;
}

/* ── Hero ─────────────────────────────────────────────────────────────────── */

.hero {
  padding: clamp(34px, 4.5vw, 58px) clamp(32px, 7vw, 100px) 38px;
  border-bottom: 1px solid var(--divider);
  overflow: hidden;
}

.hero-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 0.56fr);
  gap: clamp(20px, 3vw, 42px);
  align-items: center;
}

.hero-copy { max-width: 660px; }

.label-row {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin-top: 38px;
}

.label-row span {
  display: inline-flex;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.label-row span::before {
  content: "";
  width: 5px;
  height: 5px;
  margin-right: 8px;
  border-radius: var(--radius);
  background: #e2563a;
}

h1, h2, h3, h4, p { margin-top: 0; }

h1 {
  max-width: 650px;
  margin-bottom: 30px;
  font-size: clamp(40px, 5vw, 62px);
  line-height: 1.04;
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-weight: 650;
}

.hero-copy h2 {
  max-width: 640px;
  margin-bottom: 20px;
  font-size: clamp(32px, 4vw, 52px);
  font-weight: 650;
  line-height: 1.06;
  letter-spacing: -0.01em;
}

.hero-copy p {
  max-width: 560px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.55;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  align-items: center;
  margin-top: 40px;
}

.ai-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 32px;
  padding: 8px 12px 8px 8px;
  border: 1px solid rgba(26, 24, 21, 0.12);
  border-radius: var(--radius);
  background: #fbfaf6;
  box-shadow: 0 1px 2px rgba(26, 24, 21, 0.06);
}

.ai-badge .brand-logo {
  width: 32px;
  height: 32px;
}

.ai-badge span:last-child { display: grid; gap: 1px; }
.ai-badge strong { color: #1a1815; font-size: 12px; line-height: 1; }
.ai-badge small { color: #e2563a; font-size: 11px; line-height: 1; }

/* ── Hero stack ──────────────────────────────────────────────────────────────── */

.hero-stack {
  position: relative;
  justify-self: center;
  width: min(100%, 380px);
  min-height: 342px;
}

.messy-note-card, .generated-card, .missing-card { border-radius: 14px; }

.messy-note-card {
  position: absolute;
  top: 0; left: 0;
  z-index: 1;
  width: min(100%, 230px);
  padding: 22px 28px 20px 18px;
  border: 1px solid rgba(26, 24, 21, 0.1);
  background: #fbfaf6;
  box-shadow: 0 16px 34px rgba(26, 24, 21, 0.08);
  transform: rotate(-6deg);
}

.messy-note-card span { display: block; margin-bottom: 10px; color: #6b6557; font-size: 12px; }
.messy-note-card p { margin: 0 0 7px; color: var(--ink); font-size: 11px; line-height: 1.35; }
.messy-note-card p:nth-child(3), .messy-note-card p:nth-child(5) { margin-left: 18px; }

.generated-card {
  position: absolute;
  top: 46px;
  left: clamp(26px, 5vw, 76px);
  z-index: 2;
  width: min(100%, 285px);
  padding: 20px 21px 22px;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: #f6f3ed;
  box-shadow: 0 22px 46px rgba(26, 24, 21, 0.24);
  transform: rotate(4deg);
}

.generated-topline {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.generated-topline span:first-child {
  padding: 5px 12px;
  border: 1px solid rgba(246, 243, 237, 0.18);
  border-radius: var(--radius);
  font-size: 11px;
}

.generated-card h2 {
  margin: 0 0 10px;
  color: #f6f3ed;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(22px, 2vw, 27px);
  font-weight: 520;
  line-height: 1.06;
}

.generated-card p {
  width: min(100%, 242px);
  color: rgba(246, 243, 237, 0.82);
  font-size: clamp(12px, 1.05vw, 14px);
  line-height: 1.45;
}

.hero-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  align-items: end;
}

.hero-metrics div {
  padding: 8px;
  border-radius: 7px;
  background: rgba(246, 243, 237, 0.1);
}

.hero-metrics div:nth-child(2) { transform: translateY(8px); }

.hero-metrics span { display: block; color: rgba(246, 243, 237, 0.78); font-size: 11px; }

.hero-metrics strong {
  display: block;
  margin-top: 3px;
  color: #f6f3ed;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(17px, 1.5vw, 21px);
  font-weight: 520;
}

.missing-card {
  position: absolute;
  left: clamp(18px, 4vw, 52px);
  top: 248px;
  z-index: 3;
  width: min(100%, 250px);
  padding: 14px 16px;
  background: #e2563a;
  color: #fbfaf6;
  box-shadow: 0 18px 38px rgba(26, 24, 21, 0.18);
}

.missing-card div {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  font-size: 12px;
}

.alert-dot {
  display: grid;
  width: 14px;
  height: 14px;
  place-items: center;
  border-radius: var(--radius);
  background: #fbfaf6;
  color: #e2563a;
  font-size: 10px;
  font-weight: 900;
}

.missing-card p {
  width: min(100%, 215px);
  margin: 0;
  color: #fbfaf6;
  font-size: clamp(15px, 1.25vw, 18px);
  line-height: 1.28;
}

/* ── Typography helpers ──────────────────────────────────────────────────────── */

.mini-kicker, .eyebrow, .field-title {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.wrw {
  display: inline;
  opacity: 0.1;
  transition: opacity 100ms linear;
}

@media (prefers-reduced-motion: reduce) { .wrw { opacity: 1 !important; transition: none; } }

/* ── App shell ──────────────────────────────────────────────────────────────── */

.app-shell {
  max-width: 1380px;
  margin-inline: auto;
  padding: 44px clamp(16px, 7vw, 100px) 72px;
}

.section-heading {
  max-width: 720px;
  margin-bottom: 44px;
}

.section-heading .eyebrow {
  display: block;
  margin-bottom: 20px;
}

.section-lede {
  margin: 0 0 22px;
  color: var(--ink);
  font-size: clamp(28px, 3.2vw, 44px);
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: -0.01em;
}

.section-heading p:not(.section-lede) {
  margin: 0;
  color: var(--ink);
  font-size: clamp(18px, 2vw, 24px);
  font-weight: 400;
  line-height: 1.45;
  letter-spacing: -0.005em;
}

/* ── Workspace grid ──────────────────────────────────────────────────────────── */

.workspace-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(16px, 2.5vw, 32px);
  align-items: start;
  width: 100%;
  max-width: 100%;
}

@keyframes slideInPanel {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

.preview-column {
  display: none;
  gap: 22px;
}

.workspace-grid.preview-open .preview-column {
  display: grid;
  animation: slideInPanel 280ms ease forwards;
}

/* ── Builder panel ─────────────────────────────────────────────────────────── */

.builder-panel {
  width: 100%;
  max-width: 680px;
}

.panel-header, .preview-toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 22px;
}

.panel-header h3 {
  margin: 5px 0 0;
  font-size: 24px;
  line-height: 1.1;
}

.compact { margin-bottom: 12px; }

/* ── Form fields ─────────────────────────────────────────────────────────── */

.field {
  display: grid;
  gap: 8px;
  margin-bottom: 17px;
}

.field > span {
  color: #3e3b36;
  font-size: 13px;
  font-weight: 750;
}

.optional-tag {
  margin-left: 5px;
  color: var(--faint);
  font-size: 11px;
  font-style: normal;
  font-weight: 500;
}

input, textarea {
  width: 100%;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  outline: 0;
  transition: border 160ms ease, box-shadow 160ms ease;
}

input { height: 46px; padding: 0 12px; }

textarea {
  min-height: 200px;
  resize: vertical;
  padding: 13px;
  line-height: 1.55;
}

input:focus, textarea:focus {
  border-color: var(--focus);
  box-shadow: 0 0 0 3px rgba(49, 88, 212, 0.12);
}

/* ── Upload ─────────────────────────────────────────────────────────────── */

.upload-group {
  margin-bottom: 18px;
}

.upload-area {
  position: relative;
  display: flex;
  gap: 14px;
  align-items: center;
  margin: 4px 0 12px;
  padding: 18px;
  border: 2px dashed var(--ink);
  border-radius: var(--radius);
  background: transparent;
  transition: border 160ms ease, background 160ms ease;
  cursor: pointer;
}

.upload-area:hover, .upload-area.dragging {
  background: rgba(255, 255, 255, 0.48);
}

.upload-area input {
  position: absolute;
  inset: 0;
  height: auto;
  opacity: 0;
  cursor: pointer;
}

.upload-icon {
  display: grid;
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  background: var(--yellow);
  color: var(--ink);
  font-size: 25px;
  font-weight: 450;
}

.upload-area p { color: var(--muted); line-height: 1.4; margin: 0; font-size: 13px; }
.upload-area strong { display: block; font-size: 14px; margin-bottom: 2px; }

.upload-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 0;
  margin-bottom: 4px;
}

.upload-list span {
  max-width: 100%;
  padding: 5px 9px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: var(--radius);
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── Info icons + tooltips ───────────────────────────────────────────────── */

.info-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border: none;
  border-radius: 50%;
  background: none;
  color: var(--faint);
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  position: relative;
  vertical-align: middle;
  margin-left: 4px;
  transition: color 0.15s;
}

.info-icon:hover { color: var(--ink); }

.info-icon::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  width: 220px;
  background: var(--ink);
  color: #fff;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.5;
  padding: 8px 10px;
  border-radius: 8px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s;
  z-index: 100;
  text-align: left;
  white-space: normal;
}

.info-icon:hover::after,
.info-icon.tooltip-open::after {
  opacity: 1;
}

/* ── Chips / pills ────────────────────────────────────────────────────────── */

.save-chip, .status-pill, .critique-count {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 6px 10px;
  border: none;
  border-radius: var(--radius);
  color: var(--muted);
  background: rgba(26, 24, 21, 0.07);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}

/* ── Goal tabs ────────────────────────────────────────────────────────────── */

.mode-block {
  display: grid;
  gap: 10px;
  margin-bottom: 20px;
}

.audience-block {
  display: grid;
  gap: 10px;
  margin-bottom: 20px;
}

.audience-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.audience-chip {
  padding: 5px 12px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  transition: all 140ms ease;
}

.audience-chip:hover {
  border-color: var(--ink);
  color: var(--ink);
}

.audience-chip.active {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}

.tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.tab {
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: transparent;
  color: #3f3b36;
  font-size: 12px;
  font-weight: 500;
  text-align: left;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease;
}

.tab:hover { border-color: var(--ink); }

.tab.active {
  border-color: var(--ink);
  background: var(--yellow);
  color: var(--ink);
  font-weight: 650;
}

/* ── Generate row ─────────────────────────────────────────────────────────── */

.generate-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: stretch;
}

.generate-button {
  min-height: 52px;
  font-size: 15px;
  font-weight: 600;
}

.model-select-label {
  position: relative;
  display: grid;
  min-width: 170px;
  border: 1px solid rgba(26, 24, 21, 0.14);
  border-radius: var(--radius);
  background: #ece7dc;
}

.model-select-label > span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.model-select-label select {
  width: 100%;
  height: 52px;
  padding: 0 36px 0 14px;
  border: 0;
  border-radius: var(--radius);
  appearance: none;
  background: transparent;
  color: #1a1815;
  font-size: 13px;
  font-weight: 500;
  outline: 0;
}

.model-select-label::after {
  content: "⌄";
  position: absolute;
  right: 14px;
  top: 50%;
  color: #6b6557;
  font-size: 18px;
  pointer-events: none;
  transform: translateY(-55%);
}

.generate-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* ── Preview toolbar ─────────────────────────────────────────────────────── */

.preview-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--divider);
  margin-bottom: 0;
  flex-wrap: wrap;
  gap: 10px;
}

.toolbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.copy-all-button {
  padding: 7px 14px;
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  background: var(--ink);
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  transition: opacity 160ms ease;
}

.copy-all-button:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.export-button {
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  transition: all 160ms ease;
}

.export-button:hover:not(:disabled) {
  border-color: var(--ink);
  color: var(--ink);
}

.export-button:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

/* ── Draft document ──────────────────────────────────────────────────────── */

.draft-empty {
  display: grid;
  min-height: 480px;
  place-items: center;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  margin-top: 18px;
  background: rgba(244, 237, 212, 0.18);
}

.empty-draft {
  max-width: 380px;
  padding: 32px;
  text-align: center;
}

.empty-draft h4 {
  margin-bottom: 10px;
  font-size: 20px;
  line-height: 1.15;
}

.empty-draft p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.55;
}

.draft-doc {
  display: grid;
  gap: 1px;
  margin-top: 18px;
  border: 1px solid var(--divider);
  border-radius: var(--radius);
  background: var(--divider);
  overflow: hidden;
  animation: riseIn 360ms ease both;
}

@keyframes riseIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes sectionReveal {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

.draft-section {
  background: var(--surface);
  opacity: 0;
  animation: sectionReveal 0.28s ease forwards;
}

/* ── Feedback bar ────────────────────────────────────────────────────────── */

.feedback-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--divider);
  background: var(--paper);
  font-size: 12px;
  color: var(--muted);
}

.feedback-buttons { display: flex; gap: 6px; }

.feedback-btn {
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: transparent;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  transition: background 140ms ease, border-color 140ms ease;
}

.feedback-btn:hover { background: var(--cream); border-color: var(--ink); }
.feedback-btn:disabled { opacity: 0.5; cursor: default; }

/* ── Score panel ─────────────────────────────────────────────────────────── */

.score-panel {
  padding: 16px;
  border-bottom: 1px solid var(--divider);
  display: grid;
  gap: 12px;
}

.score-overall {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.score-number {
  font-size: 32px;
  font-weight: 800;
  line-height: 1;
  color: var(--ink);
}

.score-label {
  font-size: 14px;
  color: var(--muted);
  font-weight: 500;
}

.score-badge {
  margin-left: 4px;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.badge-strong { background: #d4f7d4; color: #1a6b1a; }
.badge-good   { background: #fff4cc; color: #7a5a00; }
.badge-weak   { background: #ffe4e4; color: #8b1a1a; }

.score-bars { display: grid; gap: 8px; }

.score-row {
  display: grid;
  grid-template-columns: 80px 1fr 24px;
  align-items: center;
  gap: 10px;
}

.score-row-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}

.score-bar-track {
  height: 6px;
  border-radius: 3px;
  background: var(--line);
  overflow: hidden;
}

.score-bar-fill {
  height: 100%;
  border-radius: 3px;
  background: var(--ink);
  width: 0%;
  transition: width 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}

.score-row-val {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  text-align: right;
}

.score-tip {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
  padding: 6px 0 0;
  margin: 0;
}

.draft-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 16px 8px;
  border-bottom: 1px solid rgba(26, 24, 21, 0.06);
}

.draft-section-label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.section-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.copy-section-btn,
.strengthen-btn {
  flex-shrink: 0;
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  transition: border-color 140ms ease, color 140ms ease, background 140ms ease;
}

.copy-section-btn:hover {
  border-color: var(--ink);
  color: var(--ink);
  background: var(--cream);
}

.strengthen-btn {
  color: var(--blue);
  border-color: color-mix(in srgb, var(--blue) 30%, transparent);
}

.strengthen-btn:hover {
  background: color-mix(in srgb, var(--blue) 8%, transparent);
  border-color: var(--blue);
  color: var(--blue);
}

.strengthen-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.draft-section-body {
  padding: 12px 16px 16px;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.65;
  white-space: pre-wrap;
  outline: none;
  min-height: 48px;
}

.draft-section-body:focus {
  background: rgba(49, 88, 212, 0.03);
}

/* ── Critique / gaps panel ──────────────────────────────────────────────── */

.critique-panel { padding-top: 2px; }

.critique-count {
  min-width: 28px;
  justify-content: center;
}

.critique-list {
  display: grid;
  gap: 1px;
  border: 1px solid var(--divider);
  border-radius: var(--radius);
  background: var(--divider);
  overflow: hidden;
}

.critique-item {
  padding: 14px 16px;
  background: var(--surface);
  color: #4b4740;
  font-size: 14px;
  line-height: 1.5;
}

.critique-item strong {
  display: block;
  margin-bottom: 3px;
  color: var(--ink);
  font-size: 13px;
}

.critique-empty {
  padding: 18px 0;
  border-top: 1px solid var(--divider);
  border-bottom: 1px solid var(--divider);
}

.critique-empty p { color: var(--muted); line-height: 1.55; margin: 0; }

/* ── Export panel ──────────────────────────────────────────────────────── */

.export-panel {
  display: flex;
  justify-content: flex-end;
  padding-top: 2px;
}

.html-export-button {
  min-width: 150px;
  padding: 12px 18px;
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  background: transparent;
  color: var(--ink);
  font-size: 13px;
  font-weight: 500;
  transition: background 160ms ease, color 160ms ease;
}

.html-export-button:hover:not(:disabled) {
  background: var(--ink);
  color: #fff;
}

.html-export-button:disabled {
  cursor: not-allowed;
  opacity: 0.4;
}

/* ── Responsive ─────────────────────────────────────────────────────────── */

@media (max-width: 960px) {
  .hero-main {
    grid-template-columns: 1fr;
  }

  .hero-stack {
    width: 380px;
    min-height: 342px;
    margin-inline: auto;
    margin-top: 12px;
    transform: scale(1.38);
    transform-origin: top center;
    margin-bottom: calc(342px * 0.38);
  }

  .preview-column {
    position: static;
  }
}

@media (max-width: 760px) {
  .topbar {
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
  }

  .nav-links { display: none; }

  .brand { font-size: 14px; }
  .brand-logo { width: 26px; height: 26px; }

  .ghost-button {
    padding: 9px 10px;
    font-size: 13px;
    box-shadow: 2px 2px 0 var(--ink);
  }

  .hero {
    padding: 30px 16px 32px;
  }

  .hero-copy h2 {
    font-size: clamp(28px, 8vw, 38px);
  }

  .hero-copy p { font-size: 16px; }

  .hero-actions {
    gap: 10px;
    margin-top: 24px;
  }

  .primary-button, .sample-button {
    justify-content: center;
  }

  .label-row { gap: 10px 14px; margin-top: 24px; }

  .hero-stack {
    width: 380px;
    min-height: 342px;
    margin-inline: auto;
    transform: scale(0.76);
    transform-origin: top center;
    margin-bottom: calc(342px * (0.76 - 1));
  }

  .hero-metrics { grid-template-columns: 1fr; }
  .hero-metrics div:nth-child(2) { transform: none; }
  .missing-card p { font-size: 18px; }

  .app-shell {
    padding: 32px 16px 52px;
  }

  .section-heading { margin-bottom: 28px; }

  .section-lede { font-size: clamp(24px, 6.5vw, 32px); }

  .section-heading p:not(.section-lede) {
    font-size: clamp(16px, 4.5vw, 20px);
  }

  .builder-panel {
    max-width: 100%;
    padding-right: 0;
  }

  .panel-header { flex-wrap: wrap; }

  .generate-row { grid-template-columns: 1fr; }

  .generate-button { font-size: 15px; }

  .model-select-label { min-width: 0; }

  .export-panel { justify-content: stretch; }

  .html-export-button { width: 100%; }

  .preview-toolbar { flex-wrap: wrap; }

  .draft-section-body { font-size: 14px; }
}

/* ── Footer ─────────────────────────────────────────────────────────────────── */

.site-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  padding: 32px 24px;
  border-top: 1px solid var(--divider);
  color: var(--faint);
  font-size: 13px;
}

.site-footer a {
  color: var(--muted);
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--ink);
}
