@import url('https://fonts.googleapis.com/css2?family=Archivo+Black&family=Nunito:wght@500;700;800&family=Source+Sans+3:wght@400;600;700&display=swap');

:root {
  --navy: #1f3265;
  --deep-navy: #172446;
  --crimson: #ce122e;
  --flame: #f46a3a;
  --mint: #75c1af;
  --cream: #f6e9c9;
  --white: #ffffff;
  --ink: #12233f;
  --error: #8b1222;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: 'Source Sans 3', sans-serif;
  color: var(--ink);
  background-color: var(--deep-navy);
  /* Flame background (place the provided image at /static/campaign/flames-bg.png). */
  background-image:
    radial-gradient(circle at 18% 12%, rgba(117, 193, 175, 0.22), transparent 38%),
    radial-gradient(circle at 88% 84%, rgba(206, 18, 46, 0.18), transparent 40%),
    linear-gradient(120deg, rgba(23, 36, 70, 0.88), rgba(31, 50, 101, 0.58)),
    url('/static/campaign/flames-bg.png');
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center, center, center, center bottom;
  overflow-x: hidden;
}

body::after {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at 26% 18%, rgba(244, 106, 58, 0.08), transparent 34%),
    radial-gradient(circle at 82% 86%, rgba(117, 193, 175, 0.12), transparent 40%);
  pointer-events: none;
  z-index: -2;
}

.backdrop {
  position: fixed;
  border-radius: 46% 54% 57% 43% / 33% 44% 56% 67%;
  pointer-events: none;
  z-index: -1;
}

.backdrop.one {
  width: 45vw;
  height: 45vw;
  top: -14vw;
  left: -12vw;
  background: rgba(117, 193, 175, 0.24);
}

.backdrop.two {
  width: 50vw;
  height: 50vw;
  bottom: -20vw;
  right: -16vw;
  background: rgba(246, 233, 201, 0.16);
}

.backdrop.three {
  width: 38vw;
  height: 38vw;
  top: 38%;
  right: -18vw;
  background: rgba(206, 18, 46, 0.16);
}

.shell {
  width: min(980px, 93vw);
  margin: 2.2rem auto;
  padding: clamp(1.2rem, 2.5vw, 2.3rem);
  border-radius: 44px 88px 54px 96px;
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.9), rgba(246, 233, 201, 0.84));
  box-shadow: 0 36px 90px rgba(9, 18, 41, 0.42);
  position: relative;
  overflow: hidden;
}

.shell::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(108deg, rgba(31, 50, 101, 0.06), transparent 45%),
  background-size: cover;
  background-position: center;
  opacity: 0.12;
  pointer-events: none;
}

.shell > * {
  position: relative;
  z-index: 1;
}

.brand-row {
  display: flex;
  justify-content: center;
}

.ei-logo {
  max-width: min(360px, 86%);
}

.flames-logo {
  width: min(470px, 87%);
  display: block;
  margin: 0.8rem auto 0.7rem;
}

.hero {
  text-align: center;
}

.kicker {
  margin: 0;
  color: var(--crimson);
  font-family: 'Nunito', sans-serif;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.86rem;
}

h1,
h2 {
  margin: 0;
  font-family: 'Archivo Black', sans-serif;
  letter-spacing: 0.01em;
  color: var(--navy);
}

h1 {
  margin-top: 0.35rem;
  font-size: clamp(1.9rem, 4.8vw, 3.1rem);
  line-height: 1.05;
}

.hero-copy {
  margin: 0.8rem auto 0;
  max-width: 59ch;
  font-size: clamp(1rem, 1.8vw, 1.12rem);
  line-height: 1.45;
}

.promise-list {
  list-style: none;
  padding: 0;
  margin: 1rem auto 0;
  width: min(760px, 100%);
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.6rem;
}

.promise-list li {
  background: rgba(31, 50, 101, 0.08);
  color: var(--deep-navy);
  border-radius: 999px;
  padding: 0.45rem 0.95rem;
  font-weight: 700;
}

.story-strip {
  margin-top: 1.25rem;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.8rem;
}

.story-strip article {
  background: linear-gradient(140deg, rgba(255, 255, 255, 0.8), rgba(117, 193, 175, 0.18));
  border-radius: 36px 24px 40px 22px;
  padding: 0.9rem 1rem;
}

.story-strip h2 {
  font-size: 1rem;
}

.story-strip p {
  margin: 0.35rem 0 0;
  line-height: 1.35;
  font-size: 0.96rem;
}

.studio,
.result {
  margin-top: 1.4rem;
  border-radius: 52px 30px 60px 34px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.86), rgba(255, 255, 255, 0.67));
  padding: clamp(1rem, 2vw, 1.6rem);
  border: 1px solid rgba(31, 50, 101, 0.12);
}

.section-title {
  text-align: center;
  font-size: clamp(1.35rem, 3vw, 2rem);
}

.section-copy {
  text-align: center;
  margin: 0.4rem auto 0;
  max-width: 62ch;
  line-height: 1.4;
}

.picker-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.8rem;
  margin-top: 1rem;
}

.picker-row.compact {
  margin-top: 0.75rem;
}

.pill {
  border: none;
  border-radius: 999px;
  background: linear-gradient(130deg, var(--navy), #314987);
  color: var(--white);
  font-weight: 700;
  font-family: 'Nunito', sans-serif;
  font-size: 0.95rem;
  padding: 0.78rem 1.22rem;
  cursor: pointer;
  min-width: 165px;
  text-decoration: none;
  text-align: center;
  box-shadow: 0 10px 24px rgba(24, 36, 76, 0.24);
}

.pill:hover {
  transform: translateY(-1px);
}

.pill.secondary {
  background: linear-gradient(130deg, #3c548f, #516ba4);
}

.control-pill {
  display: inline-flex;
  justify-content: center;
  align-items: center;
}

.preview-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.camera-actions {
  margin-top: 0.75rem;
}

.preview-wrap {
  width: min(600px, 100%);
  margin: 1.05rem auto 0;
}

.preview-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  min-height: 360px;
  border-radius: 42px 26px 46px 24px;
  background: rgba(23, 36, 70, 0.08);
  border: 1px solid rgba(31, 50, 101, 0.16);
  overflow: hidden;
}

.preview-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  text-align: center;
  color: rgba(23, 36, 70, 0.55);
  font-family: 'Nunito', sans-serif;
  font-weight: 800;
  letter-spacing: 0.02em;
}

#photo-preview {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

#result-image {
  width: 100%;
  border-radius: 42px 26px 46px 24px;
  display: block;
  background: rgba(23, 36, 70, 0.1);
  border: 1px solid rgba(31, 50, 101, 0.14);
}

.action-row {
  display: flex;
  justify-content: center;
  margin-top: 0.95rem;
}

.cta {
  border: none;
  border-radius: 999px;
  background: linear-gradient(120deg, var(--crimson), var(--flame));
  color: var(--white);
  font-weight: 800;
  font-family: 'Nunito', sans-serif;
  letter-spacing: 0.01em;
  font-size: 1rem;
  text-decoration: none;
  min-width: 270px;
  padding: 0.85rem 1.6rem;
  text-align: center;
  cursor: pointer;
  box-shadow: 0 14px 26px rgba(188, 45, 36, 0.28);
}

#generate-btn:disabled {
  opacity: 0.52;
  cursor: not-allowed;
}

.progress-panel {
  text-align: center;
  padding: 2rem 1rem 1.2rem;
}

.progress-panel h3 {
  margin: 0.8rem 0 0.2rem;
  color: var(--navy);
  font-family: 'Archivo Black', sans-serif;
  font-size: 1.2rem;
}

.progress-panel p {
  margin: 0;
  color: var(--deep-navy);
}

.spinner {
  width: 56px;
  height: 56px;
  margin: 0 auto;
  border-radius: 50%;
  border: 5px solid rgba(31, 50, 101, 0.2);
  border-top-color: var(--crimson);
  animation: spin 0.85s linear infinite;
}

.share-row {
  margin-top: 0.95rem;
  display: grid;
  gap: 0.7rem;
  grid-template-columns: 1fr auto;
}

#share-link {
  border: none;
  width: 100%;
  border-radius: 999px;
  background: rgba(117, 193, 175, 0.2);
  padding: 0.72rem 1rem;
  color: var(--deep-navy);
  font-weight: 700;
}

.status,
.error {
  margin: 0.7rem 0 0;
  text-align: center;
  min-height: 1.3rem;
  font-size: 0.96rem;
}

.error {
  color: var(--error);
  font-weight: 700;
}

.page-footer {
  margin-top: 1.4rem;
  text-align: center;
  font-size: 0.95rem;
  color: var(--deep-navy);
}

.page-footer a {
  color: var(--crimson);
  font-weight: 700;
}

.micro {
  margin-top: 0.35rem;
  opacity: 0.88;
  font-size: 0.88rem;
}

.hidden {
  display: none !important;
}

.studio.complete {
  opacity: 0.8;
}

.result-live .studio {
  display: none;
}

.result-live #how-it-works {
  display: none;
}

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

@media (max-width: 860px) {
  .story-strip {
    grid-template-columns: 1fr;
  }

  .story-strip article {
    border-radius: 28px 18px 34px 20px;
  }
}

@media (max-width: 680px) {
  body {
    /* Keep the flames visible on tall screens by biasing to the bottom. */
    background-position: center, center, center, 50% 92%;
  }

  .shell {
    margin: 1.15rem auto;
    border-radius: 28px 40px 34px 46px;
    padding: 1rem;
  }

  .studio,
  .result {
    border-radius: 30px 20px 34px 22px;
    padding: 0.95rem;
  }

  .promise-list li {
    width: 100%;
    text-align: center;
  }

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

  .preview-frame {
    min-height: 290px;
  }

  .pill,
  .cta {
    width: 100%;
    min-width: 0;
  }
}
