:root {
  --ink: #14161a;
  --muted: #5b6270;
  --accent: #3b5bff;
  --accent-ink: #ffffff;
  --line: #e4e7ee;
  --bg: #f7f8fb;
  --panel: #ffffff;
}

* {
  box-sizing: border-box;
}

/* Keep the HTML `hidden` attribute authoritative. Without this, the class
   rules below (for example `.loading { display: flex }`) outrank the browser's
   `[hidden] { display: none }` and the panels would show before JS reveals
   them. */
[hidden] {
  display: none !important;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica,
    Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.5;
}

.page {
  max-width: 720px;
  margin: 0 auto;
  padding: 12vh 24px 64px;
}

.eyebrow {
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 12px;
}

.headline {
  font-size: clamp(2rem, 5vw, 3rem);
  line-height: 1.1;
  font-weight: 700;
  margin: 0 0 16px;
}

.subhead {
  font-size: 1.15rem;
  color: var(--muted);
  margin: 0 0 32px;
  max-width: 36em;
}

.url-form {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

#url-input {
  flex: 1 1 320px;
  min-width: 0;
  padding: 16px 18px;
  font-size: 1.05rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  color: var(--ink);
}

#url-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(59, 91, 255, 0.18);
}

#generate-button {
  padding: 16px 24px;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--accent-ink);
  background: var(--accent);
  border: none;
  border-radius: 10px;
  cursor: pointer;
}

#generate-button:hover {
  filter: brightness(1.05);
}

#generate-button:disabled {
  opacity: 0.6;
  cursor: progress;
}

.form-hint {
  font-size: 0.9rem;
  color: var(--muted);
  margin: 12px 0 0;
}

.loading,
.results,
.error {
  margin-top: 40px;
  padding: 28px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
}

.loading {
  display: flex;
  align-items: center;
  gap: 16px;
}

.loading-stage {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 500;
}

.spinner {
  width: 26px;
  height: 26px;
  flex: none;
  border: 3px solid var(--line);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.error {
  border-color: #f3c2c2;
  background: #fdf3f3;
}

.error-message {
  margin: 0;
  color: #9b2226;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* Honeypot: pushed off-screen rather than display:none, since some bots skip
   hidden inputs but still fill visible-in-DOM ones. People never see it. */
.honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

@media (prefers-reduced-motion: reduce) {
  .spinner {
    animation: none;
  }
}

/* How it works: a compact numbered row under the hero. */
.how-it-works {
  margin-top: 44px;
}

.steps {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.steps li {
  flex: 1 1 180px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.95rem;
}

.step-number {
  flex: none;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 0.85rem;
  font-weight: 600;
}

/* Sample output: a static preview of the 3 campaigns a visitor would get,
   so they know what to expect before pasting their URL. Build step 6 renders
   the live version from the generation result in this same card shape. */
.example {
  margin-top: 56px;
}

.example-heading {
  font-size: 1.4rem;
  font-weight: 700;
  margin: 0 0 6px;
}

.example-sub {
  font-size: 0.95rem;
  color: var(--muted);
  margin: 0 0 24px;
  max-width: 36em;
}

.campaign-cards {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.campaign-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: 0 1px 2px rgba(20, 22, 26, 0.04);
}

.campaign-stage {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent);
}

.campaign-name {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0;
}

/* Trigger and Goal sit side by side on a wide card, stacking when narrow. */
.campaign-meta {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 32px;
}

.campaign-meta > div {
  flex: 1 1 240px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.campaign-meta dt {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--muted);
}

.campaign-meta dd {
  margin: 0;
  font-size: 0.9rem;
}

/* The message sequence: one row per step (timing, channel, sample copy). */
.svg-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.campaign-sequence {
  margin: 0;
  padding: 16px 0 0;
  border-top: 1px solid var(--line);
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.sequence-step {
  position: relative;
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

/* Vertical connector from each step's icon to the next, forming a timeline.
   Anchored to the box edges so it holds at any message height. */
.sequence-step:not(:last-child)::before {
  content: "";
  position: absolute;
  left: 15px;
  top: 32px;
  bottom: -14px;
  width: 2px;
  margin-left: -1px;
  background: var(--line);
}

.sequence-node {
  position: relative;
  z-index: 1;
  flex: none;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
}

.sequence-node svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.node-email {
  background: #eaf0ff;
  color: #2740c4;
}

.node-sms {
  background: #f0ebfd;
  color: #6b3fb8;
}

.sequence-body {
  flex: 1 1 auto;
  min-width: 0;
  padding-top: 4px;
}

.sequence-when {
  display: inline-block;
  margin-right: 8px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}

.sequence-subject {
  display: block;
  margin-top: 2px;
  font-size: 0.9rem;
  font-weight: 600;
}

.sequence-text {
  font-size: 0.9rem;
}

/* Teaser gate: the stand-in shown in place of a withheld sequence, styled to
   sit where the sequence timeline would so the card reads as "more inside". */
.campaign-locked {
  margin: 0;
  padding-top: 14px;
  border-top: 1px dashed var(--line);
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--muted);
}

.campaign-locked-icon {
  font-size: 0.95rem;
  line-height: 1;
}

/* Callout under generated cards: what would sharpen the campaigns. */
.to-sharpen {
  margin-top: 28px;
  padding: 18px 22px;
  background: rgba(59, 91, 255, 0.05);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: 12px;
}

.to-sharpen-heading {
  margin: 0 0 8px;
  font-weight: 600;
  color: var(--ink);
}

.to-sharpen-list {
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
}

.to-sharpen-list li {
  margin: 2px 0;
}

/* Show-then-ask: the email capture under the generated campaigns. This is the
   primary conversion, so it reads as a distinct, accented call to action. */
.show-then-ask {
  margin-top: 32px;
  padding: 24px;
  background: var(--accent);
  color: var(--accent-ink);
  border-radius: 14px;
}

.show-then-ask-heading {
  font-size: 1.3rem;
  font-weight: 700;
  margin: 0 0 6px;
}

.show-then-ask-sub {
  margin: 0 0 18px;
  opacity: 0.9;
}

.email-form {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.email-input {
  flex: 1 1 280px;
  min-width: 0;
  padding: 14px 16px;
  font-size: 1.05rem;
  border: 1px solid transparent;
  border-radius: 10px;
  background: var(--panel);
  color: var(--ink);
}

.email-input:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.5);
}

.email-button {
  padding: 14px 22px;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-ink);
  border: none;
  border-radius: 10px;
  cursor: pointer;
}

.email-button:hover {
  filter: brightness(0.96);
}

.email-button:disabled {
  opacity: 0.6;
  cursor: progress;
}

.email-feedback {
  margin: 14px 0 0;
  font-size: 0.95rem;
  font-weight: 500;
}

/* Errors stay readable on the accent background. */
.email-feedback.is-error {
  color: #ffd7d7;
}

.show-then-ask-note {
  margin: 14px 0 0;
  font-size: 0.85rem;
  opacity: 0.85;
}
