:root {
  color-scheme: light;
  --ink: #17201d;
  --muted: #5b6862;
  --paper: #fbfbf8;
  --surface: #ffffff;
  --line: #dce3da;
  --teal: #0f766e;
  --teal-soft: #e6f4f0;
  --coral: #df5a34;
  --coral-soft: #fff0e8;
  --indigo: #4856c7;
  --indigo-soft: #eef0ff;
  --warm: #f3efe7;
  --amber: #b9781d;
  --amber-soft: #fff6df;
  --shadow: 0 24px 80px rgba(23, 32, 29, 0.11);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

button,
a {
  font: inherit;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 14px clamp(20px, 5vw, 72px);
  background: rgba(251, 251, 248, 0.92);
  border-bottom: 1px solid rgba(220, 227, 218, 0.9);
  backdrop-filter: blur(18px);
}

.brand,
.nav-actions a {
  color: var(--ink);
  text-decoration: none;
}

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

.brand-mark {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 8px;
  background: var(--ink);
  color: #ffffff;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.nav-actions a,
.copy-all,
.copy-campaign,
.copy-template,
.primary-link,
.secondary-link {
  min-height: 38px;
  border-radius: 8px;
  border: 1px solid var(--line);
  padding: 8px 13px;
  background: #ffffff;
  color: var(--ink);
  cursor: pointer;
  text-decoration: none;
}

.copy-all,
.primary-link {
  background: var(--ink);
  border-color: var(--ink);
  color: #ffffff;
}

.hero-band {
  min-height: min(760px, calc(100vh - 64px));
  display: flex;
  align-items: center;
  padding: clamp(28px, 6vw, 88px) clamp(20px, 5vw, 72px) 42px;
  background:
    linear-gradient(180deg, rgba(230, 244, 240, 0.8), rgba(251, 251, 248, 0) 46%),
    var(--paper);
}

.hero-content {
  width: min(1180px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(300px, 0.9fr) minmax(360px, 1.15fr);
  gap: clamp(28px, 5vw, 64px);
  align-items: center;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--teal);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0;
}

h2,
p {
  overflow-wrap: anywhere;
}

h1 {
  margin: 0;
  max-width: 680px;
  font-size: clamp(2.5rem, 4.75rem, 4.75rem);
  line-height: 0.98;
  letter-spacing: 0;
}

.hero-subtitle {
  margin: 12px 0 0;
  color: var(--teal);
  font-size: 1.8rem;
  font-weight: 800;
  line-height: 1.1;
}

.hero-lede {
  max-width: 600px;
  margin: 22px 0 0;
  color: var(--muted);
  font-size: 1.13rem;
}

.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 28px;
}

.hero-visual {
  margin: 0;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
  background: #ffffff;
}

.hero-visual img {
  display: block;
  width: 100%;
  height: auto;
}

.summary-band,
.score-band,
.campaign-band,
.test-plan {
  padding: clamp(44px, 6vw, 76px) clamp(20px, 5vw, 72px);
}

.summary-grid,
.score-rubric,
.template-grid,
.test-plan {
  width: min(1180px, 100%);
  margin: 0 auto;
}

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

.summary-card,
.template-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 18px 48px rgba(23, 32, 29, 0.06);
}

.summary-card {
  padding: clamp(22px, 3vw, 34px);
}

.tag {
  display: inline-flex;
  margin: 0 0 18px;
  border-radius: 999px;
  padding: 6px 10px;
  color: #ffffff;
  font-size: 0.8rem;
  font-weight: 800;
}

.tag.ctr {
  background: var(--teal);
}

.tag.reply {
  background: var(--coral);
}

.summary-card h2,
.section-heading h2,
.test-plan h2 {
  margin: 0;
  font-size: clamp(1.75rem, 2.5rem, 2.5rem);
  line-height: 1.05;
  letter-spacing: 0;
}

.summary-card p:not(.tag),
.section-heading p:not(.eyebrow) {
  color: var(--muted);
}

dl {
  margin: 22px 0 0;
  display: grid;
  gap: 10px;
}

dl div {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

dt {
  color: var(--muted);
}

dd {
  margin: 0;
  font-weight: 760;
  text-align: right;
}

.campaign-band {
  background: #ffffff;
}

.score-band {
  background: #17201d;
  color: #ffffff;
}

.score-rubric {
  display: grid;
  grid-template-columns: minmax(260px, 0.62fr) minmax(320px, 1fr);
  gap: clamp(24px, 5vw, 60px);
  align-items: start;
}

.score-rubric .eyebrow {
  color: #7dd3c7;
}

.rubric-copy h2 {
  margin: 0;
  font-size: clamp(1.9rem, 3rem, 3rem);
  line-height: 1.03;
}

.rubric-copy p:not(.eyebrow) {
  color: #c8d2ce;
  font-size: 1.04rem;
}

.rubric-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.rubric-card {
  min-height: 190px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  padding: 18px;
}

.rubric-card h3 {
  margin: 0 0 12px;
  font-size: 1.05rem;
}

.rubric-card p {
  margin: 0;
  color: #c8d2ce;
  font-size: 0.94rem;
}

.campaign-band.alt {
  background: #f7f8f5;
}

.section-heading {
  width: min(1180px, 100%);
  margin: 0 auto 24px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px 28px;
  align-items: end;
}

.section-heading .eyebrow,
.section-heading h2,
.section-heading p {
  grid-column: 1;
}

.copy-campaign {
  grid-row: 1 / span 3;
  grid-column: 2;
  align-self: center;
}

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

.template-card {
  display: flex;
  min-height: 390px;
  flex-direction: column;
  padding: 20px;
}

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

.template-title {
  margin: 0;
  color: var(--teal);
  font-size: 0.82rem;
  font-weight: 860;
  text-transform: uppercase;
}

.copy-template {
  min-width: 72px;
}

.subject-line {
  margin: 0;
  border-radius: 8px;
  background: var(--warm);
  padding: 12px;
  color: var(--muted);
  font-size: 0.95rem;
}

.subject-text {
  color: var(--ink);
  font-weight: 780;
}

.score-panel {
  margin-top: 14px;
  border: 1px solid #e3dfd3;
  border-radius: 8px;
  background: #fffaf0;
  padding: 13px;
}

.score-line {
  display: grid;
  grid-template-columns: 82px 34px 1fr;
  gap: 10px;
  align-items: center;
  margin-bottom: 8px;
  color: #4a574f;
  font-size: 0.84rem;
}

.score-line strong {
  color: var(--ink);
  font-size: 0.96rem;
  text-align: right;
}

.score-bar {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #e2e7df;
}

.score-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--teal);
}

.score-line.confidence .score-bar span {
  background: var(--amber);
}

.score-panel p {
  margin: 9px 0 0;
  color: #59665f;
  font-size: 0.86rem;
  line-height: 1.42;
}

.email-body {
  margin-top: 18px;
  color: #252d29;
}

.email-body p {
  margin: 0 0 14px;
}

.test-plan {
  display: grid;
  grid-template-columns: minmax(220px, 0.55fr) minmax(300px, 1fr);
  gap: clamp(24px, 5vw, 70px);
  align-items: start;
}

.test-plan ol {
  margin: 0;
  padding: 0;
  display: grid;
  gap: 12px;
  counter-reset: steps;
  list-style: none;
}

.test-plan li {
  position: relative;
  min-height: 52px;
  padding: 14px 16px 14px 58px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.test-plan li::before {
  counter-increment: steps;
  content: counter(steps);
  position: absolute;
  top: 12px;
  left: 14px;
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 8px;
  background: var(--ink);
  color: #ffffff;
  font-weight: 800;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 20;
  transform: translateY(18px);
  opacity: 0;
  pointer-events: none;
  border-radius: 8px;
  background: var(--ink);
  color: #ffffff;
  padding: 10px 14px;
  box-shadow: var(--shadow);
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.is-visible {
  transform: translateY(0);
  opacity: 1;
}

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

  .hero-band {
    min-height: auto;
  }

  .hero-content,
  .summary-grid,
  .score-rubric,
  .template-grid,
  .test-plan {
    grid-template-columns: 1fr;
  }

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

  h1 {
    font-size: clamp(2.3rem, 3.2rem, 3.2rem);
  }

  .section-heading {
    grid-template-columns: 1fr;
  }

  .copy-campaign {
    grid-row: auto;
    grid-column: 1;
    justify-self: start;
  }

  .template-card {
    min-height: auto;
  }
}

@media (max-width: 560px) {
  .nav-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .nav-actions a,
  .copy-all,
  .copy-campaign,
  .copy-template,
  .primary-link,
  .secondary-link {
    min-height: 42px;
  }

  .hero-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .hero-actions a,
  .hero-actions button {
    text-align: center;
  }

  dl div {
    align-items: flex-start;
    flex-direction: column;
    gap: 2px;
  }

  dd {
    text-align: left;
  }

  .score-line {
    grid-template-columns: 76px 32px 1fr;
  }
}
