:root {
  --bg: #f5f7f4;
  --surface: #ffffff;
  --surface-soft: #eef3ee;
  --ink: #111713;
  --muted: #5f6a62;
  --line: #d8dfd8;
  --accent: #285f46;
  --accent-strong: #174231;
  --accent-soft: #dceadd;
  --warning: #8f5c16;
  --danger: #9c3328;
  --shadow: 0 24px 60px rgba(31, 44, 34, 0.12);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111713;
    --surface: #19221c;
    --surface-soft: #202b24;
    --ink: #f4f8f3;
    --muted: #aeb9b0;
    --line: #334137;
    --accent: #9ed3ad;
    --accent-strong: #cbefd2;
    --accent-soft: #26392b;
    --warning: #f2c16c;
    --danger: #ee9b91;
    --shadow: 0 24px 70px rgba(0, 0, 0, 0.28);
  }
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 20% 8%, rgba(40, 95, 70, 0.12), transparent 28rem),
    linear-gradient(180deg, var(--bg), var(--surface-soft));
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  content: "";
  background-image:
    linear-gradient(rgba(95, 106, 98, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(95, 106, 98, 0.08) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(to bottom, black, transparent 82%);
}

a {
  color: inherit;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  width: min(1240px, calc(100% - 32px));
  min-height: 72px;
  margin: 0 auto;
  padding: 14px 0;
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--ink);
  font-weight: 850;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 10px;
  color: var(--surface);
  background: var(--accent-strong);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
}

.topnav {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 82%, transparent);
}

.topnav a {
  min-height: 36px;
  padding: 9px 13px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 750;
  text-decoration: none;
  white-space: nowrap;
}

.topnav a:hover,
.topnav a:focus-visible {
  color: var(--ink);
  background: var(--accent-soft);
  outline: none;
}

main {
  width: min(1240px, calc(100% - 32px));
  margin: 0 auto;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(310px, 0.65fr);
  gap: 28px;
  align-items: stretch;
  min-height: calc(100dvh - 92px);
  padding: 36px 0 48px;
}

.hero-copy,
.brief-panel,
.lead-form,
.result-panel,
.process,
.pitch {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  box-shadow: var(--shadow);
}

.hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(28px, 6vw, 68px);
}

.kicker {
  margin: 0 0 12px;
  color: var(--accent);
  font-size: 0.77rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  line-height: 1.4;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1,
h2,
h3 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  max-width: 860px;
  font-size: clamp(3rem, 6vw, 6.2rem);
  font-weight: 850;
  line-height: 0.94;
}

h2 {
  font-size: clamp(1.9rem, 3.6vw, 3.4rem);
  font-weight: 820;
  line-height: 1;
}

h3 {
  font-size: 1.08rem;
  line-height: 1.25;
}

.hero-lead {
  max-width: 620px;
  margin: 22px 0 0;
  color: var(--muted);
  font-size: clamp(1.02rem, 1.8vw, 1.2rem);
  line-height: 1.6;
}

.hero-actions,
.form-actions,
.result-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.hero-actions {
  margin-top: 30px;
}

.primary-link,
.secondary-link,
.primary-action,
.ghost-action,
.copy-button {
  min-height: 46px;
  border-radius: 10px;
  font-weight: 850;
  text-decoration: none;
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    background 180ms ease;
}

.primary-link,
.primary-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--accent-strong);
  color: var(--surface);
  background: var(--accent-strong);
}

.primary-link {
  padding: 12px 17px;
}

.primary-action {
  padding: 12px 18px;
}

.secondary-link,
.ghost-action,
.copy-button {
  border: 1px solid var(--line);
  color: var(--ink);
  background: var(--surface);
}

.secondary-link {
  padding: 12px 17px;
}

.ghost-action {
  padding: 10px 14px;
}

.ghost-action.small {
  min-height: 38px;
  padding: 8px 11px;
  font-size: 0.9rem;
}

.copy-button {
  min-height: 34px;
  padding: 7px 10px;
  font-size: 0.84rem;
}

.primary-link:hover,
.primary-action:hover,
.secondary-link:hover,
.ghost-action:hover,
.copy-button:hover,
.primary-link:focus-visible,
.primary-action:focus-visible,
.secondary-link:focus-visible,
.ghost-action:focus-visible,
.copy-button:focus-visible {
  transform: translateY(-1px);
  outline: 3px solid color-mix(in srgb, var(--accent) 28%, transparent);
  outline-offset: 2px;
}

.primary-link:active,
.primary-action:active,
.secondary-link:active,
.ghost-action:active,
.copy-button:active {
  transform: translateY(1px);
}

.brief-panel {
  display: grid;
  align-content: end;
  gap: 14px;
  padding: clamp(22px, 4vw, 34px);
  background:
    linear-gradient(145deg, color-mix(in srgb, var(--accent-soft) 72%, transparent), transparent 62%),
    color-mix(in srgb, var(--surface) 92%, transparent);
}

.brief-panel div {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: color-mix(in srgb, var(--surface) 76%, transparent);
}

.panel-label {
  display: block;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.brief-panel strong {
  display: block;
  font-size: clamp(1.5rem, 2.8vw, 2.25rem);
  line-height: 1;
}

.brief-panel p,
.section-heading p,
.pitch p,
.process-grid p {
  color: var(--muted);
  line-height: 1.62;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(360px, 1.05fr);
  gap: 22px;
  align-items: start;
  padding: 20px 0 46px;
}

.lead-form,
.result-panel {
  padding: clamp(20px, 3vw, 30px);
}

.lead-form {
  position: sticky;
  top: 92px;
}

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

.section-heading p:last-child {
  max-width: 640px;
  margin: 12px 0 0;
}

.section-heading.narrow {
  max-width: 720px;
}

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

.compact-grid {
  margin-top: 2px;
}

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

.field span {
  color: var(--ink);
  font-size: 0.88rem;
  font-weight: 800;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 13px;
  color: var(--ink);
  background: var(--surface);
  outline: none;
}

input,
select {
  min-height: 50px;
}

textarea {
  resize: vertical;
  min-height: 140px;
  line-height: 1.55;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 15%, transparent);
}

.form-error {
  margin: 4px 0 14px;
  padding: 12px 13px;
  border: 1px solid color-mix(in srgb, var(--danger) 48%, var(--line));
  border-radius: 10px;
  color: var(--danger);
  background: color-mix(in srgb, var(--danger) 10%, var(--surface));
  line-height: 1.45;
}

.result-panel {
  min-height: 620px;
}

.empty-state {
  display: grid;
  place-items: center;
  min-height: 420px;
  padding: 30px;
  border: 1px dashed var(--line);
  border-radius: 12px;
  text-align: center;
  background: color-mix(in srgb, var(--surface-soft) 56%, transparent);
}

.empty-state strong {
  font-size: 1.25rem;
}

.empty-state p {
  max-width: 420px;
  margin: 10px auto 0;
  color: var(--muted);
  line-height: 1.6;
}

.results {
  display: grid;
  gap: 14px;
}

.result-toolbar {
  justify-content: flex-end;
  padding-bottom: 2px;
}

.lead-badge {
  margin-right: auto;
  min-height: 38px;
  padding: 9px 12px;
  border-radius: 999px;
  color: var(--accent-strong);
  background: var(--accent-soft);
  font-size: 0.9rem;
  font-weight: 900;
}

.lead-badge.hot {
  color: var(--surface);
  background: var(--accent-strong);
}

.lead-badge.cold {
  color: var(--warning);
  background: color-mix(in srgb, var(--warning) 12%, var(--surface));
}

.output-card {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
}

.output-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.output-card p,
.output-card pre,
.output-card li {
  color: var(--muted);
  font-size: 0.96rem;
  line-height: 1.62;
}

.output-card p {
  margin: 0;
}

.output-card pre {
  margin: 0;
  white-space: pre-wrap;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

.output-card ol {
  display: grid;
  gap: 9px;
  margin: 0;
  padding-left: 20px;
}

.process {
  margin: 10px 0 26px;
  padding: clamp(24px, 4vw, 38px);
}

.process-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr 1fr;
  gap: 14px;
}

.process-grid article {
  min-height: 160px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background:
    linear-gradient(145deg, color-mix(in srgb, var(--accent-soft) 58%, transparent), transparent),
    var(--surface);
}

.process-grid span {
  display: block;
  margin-bottom: 12px;
  font-size: 1.12rem;
  font-weight: 850;
}

.pitch {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(280px, 0.7fr);
  gap: 24px;
  align-items: end;
  margin-bottom: 60px;
  padding: clamp(24px, 5vw, 46px);
}

.pitch p {
  margin: 0;
  font-size: 1.08rem;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 10;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--surface);
  background: var(--accent-strong);
  box-shadow: var(--shadow);
  font-weight: 850;
}

@media (max-width: 980px) {
  .topbar {
    position: static;
    align-items: flex-start;
    flex-direction: column;
  }

  .topnav {
    width: 100%;
    overflow-x: auto;
  }

  .hero,
  .workspace,
  .pitch {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
    padding-top: 16px;
  }

  .lead-form {
    position: static;
  }

  .process-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  main,
  .topbar {
    width: min(100% - 22px, 1240px);
  }

  h1 {
    font-size: clamp(2.45rem, 14vw, 4.2rem);
  }

  .hero-copy,
  .brief-panel,
  .lead-form,
  .result-panel,
  .process,
  .pitch {
    border-radius: 10px;
  }

  .form-grid {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .hero-actions,
  .form-actions,
  .result-toolbar,
  .output-head {
    align-items: stretch;
    flex-direction: column;
  }

  .lead-badge {
    margin-right: 0;
  }

  .primary-link,
  .secondary-link,
  .primary-action,
  .ghost-action,
  .copy-button {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

@media print {
  .topbar,
  .hero,
  .lead-form,
  .process,
  .pitch,
  .copy-button,
  .result-toolbar,
  .toast {
    display: none !important;
  }

  body {
    background: #ffffff;
  }

  main,
  .workspace {
    display: block;
    width: 100%;
  }

  .result-panel,
  .output-card {
    border: 1px solid #d8dfd8;
    box-shadow: none;
  }
}
