:root {
  --bg: #0a0a0a;
  --bg-soft: #161616;
  --panel: #0f0f10;
  --panel-alt: #ffffff;
  --text: #f4f4f5;
  --text-dark: #111827;
  --muted: #c7c9d1;
  --line: rgba(255, 255, 255, 0.12);
  --line-soft: rgba(17, 24, 39, 0.12);
  --orange: #ff9901;
  --orange-deep: #f47f18;
  --blue: #0541dc;
  --blue-deep: #032ea2;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Open Sans", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(5, 65, 220, 0.2), transparent 32%),
    radial-gradient(circle at top right, rgba(255, 153, 1, 0.16), transparent 30%),
    linear-gradient(180deg, #060606 0%, #111111 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 24px 24px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.5), transparent 85%);
}

.container {
  width: min(1120px, calc(100% - 32px));
  margin: 32px auto 56px;
}

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

.card {
  border: 1px solid var(--line);
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.01));
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
}

.hero {
  overflow: hidden;
  margin-bottom: 24px;
}

.hero-media {
  position: relative;
  min-height: 280px;
}

.hero-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.8) 8%, rgba(0, 0, 0, 0.15) 65%, rgba(0, 0, 0, 0.7) 100%);
}

.hero-media img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 280px;
  object-fit: cover;
}

.hero-copy {
  position: relative;
  margin-top: -210px;
  z-index: 1;
  padding: 0 32px 32px;
  max-width: 720px;
}

.eyebrow {
  display: inline-block;
  margin-bottom: 12px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 153, 1, 0.16);
  color: var(--orange);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.hero h1 {
  margin-bottom: 8px;
  font-size: clamp(2.2rem, 5vw, 3.8rem);
  line-height: 0.95;
  font-weight: 800;
  text-transform: uppercase;
}

.hero-meta {
  margin-bottom: 8px;
  color: #ffffff;
  font-weight: 700;
}

.hero-tagline {
  margin-bottom: 14px;
  color: var(--orange);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.hero-description {
  max-width: 62ch;
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.65;
}

.form-card,
#output {
  padding: 28px;
}

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

.section-intro {
  margin-bottom: 20px;
}

.section-intro h2 {
  margin-bottom: 8px;
  font-size: 1.45rem;
  color: #ffffff;
}

.section-intro p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.55;
}

label {
  display: block;
  margin: 16px 0 8px;
  color: #ffffff;
  font-size: 0.95rem;
  font-weight: 700;
}

input {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  padding: 14px 16px;
  font: inherit;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.05);
  transition: border-color 120ms ease, transform 120ms ease, background 120ms ease;
}

input:focus {
  outline: none;
  border-color: rgba(255, 153, 1, 0.8);
  background: rgba(255, 255, 255, 0.08);
  transform: translateY(-1px);
}

input[readonly] {
  color: var(--text-dark);
  background: #ffffff;
  border-color: var(--line-soft);
}

button,
.download-btn {
  border: 0;
  border-radius: 999px;
  padding: 14px 22px;
  font: inherit;
  font-weight: 800;
  letter-spacing: 0.01em;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 120ms ease, box-shadow 120ms ease, background 120ms ease;
}

button {
  margin-top: 22px;
  color: #ffffff;
  background: linear-gradient(135deg, var(--orange) 0%, var(--orange-deep) 100%);
  box-shadow: 0 12px 24px rgba(244, 127, 24, 0.3);
}

button:hover,
.download-btn:hover {
  transform: translateY(-1px);
}

.link-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
}

.link-row button {
  margin-top: 0;
  background: linear-gradient(135deg, var(--blue) 0%, var(--blue-deep) 100%);
  box-shadow: 0 12px 24px rgba(5, 65, 220, 0.28);
}

.preview-shell {
  margin-top: 8px;
  border: 1px solid var(--line);
  border-radius: 22px;
  overflow: hidden;
  background: #ffffff;
}

#emailPreviewFrame {
  width: 100%;
  min-height: 680px;
  border: 0;
  background: #ffffff;
}

#emailPreviewError {
  margin-top: 8px;
  padding: 12px;
  white-space: pre-wrap;
  color: #7f1d1d;
  background: #fff1f2;
  border: 1px solid #fecdd3;
  border-radius: 16px;
}

.download-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 20px;
}

.download-btn {
  color: #ffffff;
  background: linear-gradient(135deg, var(--orange) 0%, var(--orange-deep) 100%);
  box-shadow: 0 12px 24px rgba(244, 127, 24, 0.24);
  gap: 10px;
}

.secondary {
  background: linear-gradient(135deg, var(--blue) 0%, var(--blue-deep) 100%);
  box-shadow: 0 12px 24px rgba(5, 65, 220, 0.24);
}

.platform-icon {
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 18px;
}

.platform-icon svg {
  width: 100%;
  height: 100%;
  display: block;
  fill: currentColor;
}

.hidden {
  display: none;
}

@media (max-width: 720px) {
  .container {
    width: min(100% - 20px, 1120px);
    margin-top: 18px;
  }

  .hero-copy {
    margin-top: -120px;
    padding: 0 20px 24px;
  }

  .hero h1 {
    font-size: 2rem;
  }

  .form-card,
  #output {
    padding: 20px;
  }

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

  .link-row button,
  .download-actions .download-btn,
  .form-card button {
    width: 100%;
  }

  #emailPreviewFrame {
    min-height: 520px;
  }
}
