:root {
  --cream: #fdf2dd;
  --white: #fefbf3;
  --ink: #403c46;
  --purple: #5c3781;
  --purple-deep: #492f62;
  --red: #ff4848;
}

* { box-sizing: border-box; }

html, body { min-width: 320px; min-height: 100%; margin: 0; }

body {
  color: var(--ink);
  font-family: "pacaembu", sans-serif;
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

button, input { font: inherit; }
img, canvas, object { image-rendering: auto; }

.campaign {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  background-color: var(--cream);
}

.campaign::before {
  position: absolute;
  z-index: 0;
  inset: 0;
  pointer-events: none;
  content: "";
  opacity: 0.1;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 160 160' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.35'/%3E%3C/svg%3E");
}

.home-screen { position: relative; z-index: 1; min-height: 100vh; padding: 80px; }

.home-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: calc(100vh - 160px);
  max-width: 720px;
  margin: 0 auto;
}

.home-top { display: flex; flex-direction: column; align-items: center; width: 100%; gap: 32px; }
.number-marquee, .mobile-banner, .mobile-campaign-logo { display: none; }
.campaign-seal { display: block; width: min(395px, 100%); height: auto; }

.brand-card {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  width: min(100%, 542px);
  height: 168px;
  padding: 0 32px;
  gap: 40px;
  overflow: hidden;
  border-radius: 12px;
  background-color: var(--white);
}

.brand-card__logo-wrap { display: flex; flex: 0 0 auto; align-items: center; padding: 32px 0; }
.brand-card__logo { display: block; width: 223px; height: 104px; aspect-ratio: 223 / 104; object-fit: contain; object-position: center; }

.brand-card__portrait { position: relative; flex: 0 0 auto; width: 215px; height: 165.089px; overflow: hidden; }

.brand-card__portrait img {
  position: absolute;
  top: -80.38%;
  left: -27.92%;
  display: block;
  width: 160.3%;
  height: 263.59%;
  max-width: none;
}

.home-intro { display: flex; flex-direction: column; align-items: center; justify-content: center; width: 100%; text-align: center; }
.home-intro__copy { display: flex; flex-direction: column; width: 100%; gap: 16px; }

.home-intro h1, .home-intro p, .home-footer p, .flow-title h2, .flow-title p, .format-flow h2 { margin: 0; }

.home-intro h1 { width: 100%; font-size: 40px; font-weight: 300; line-height: 56px; }
.home-intro h1 strong { font-weight: 700; }
.home-intro p strong, .flow-title h2, .format-flow h2, .format-option strong { font-weight: 700; }

.home-intro p { width: 100%; font-size: 20px; font-weight: 300; line-height: 28px; text-align: center; }
.home-footer p { width: 100%; font-size: 18px; font-weight: 300; line-height: 32px; text-align: center; }

.home-action input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.home-action input:focus-visible + .pill-button { outline: 3px solid var(--red); outline-offset: 4px; }

.pill-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 64px;
  gap: 16px;
  padding: 8px 24px;
  cursor: pointer;
  border: 0;
  border-radius: 999px;
  background: var(--purple);
  color: var(--cream);
  font-size: 20px;
  font-weight: 300;
  line-height: 32px;
  text-align: center;
  box-shadow: 0 0 0 rgba(73, 47, 98, 0);
  transition: background-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.pill-button:hover { background: var(--purple-deep); box-shadow: 0 8px 20px rgba(73, 47, 98, 0.25); transform: translateY(-2px); }
.pill-button:hover .pill-button__icon { background: var(--purple); transform: translateX(2px); }
.pill-button:active { box-shadow: 0 2px 8px rgba(73, 47, 98, 0.22); transform: translateY(1px) scale(0.985); }
.pill-button:focus-visible, .format-option:focus-visible, .flow-control:focus-visible { outline: 3px solid var(--red); outline-offset: 4px; }
.pill-button--upload { padding-left: 8px; }
.pill-button--forward { padding-right: 8px; }

.pill-button__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 48px;
  height: 48px;
  border-radius: 999px;
  background: var(--purple-deep);
  transition: background-color 180ms ease, transform 180ms ease;
}

.pill-button__icon img { display: block; width: 24px; height: 24px; }

.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 64px;
  padding: 16px 24px;
  cursor: pointer;
  border: 1px solid var(--purple);
  border-radius: 999px;
  background: transparent;
  color: var(--purple);
  font-size: 20px;
  font-weight: 300;
  line-height: 32px;
  text-align: center;
  transition: background-color 180ms ease, box-shadow 180ms ease, color 180ms ease, transform 180ms ease;
}

.secondary-button:hover { background: rgba(92, 55, 129, 0.1); box-shadow: 0 6px 16px rgba(73, 47, 98, 0.12); transform: translateY(-2px); }
.secondary-button:active { transform: translateY(1px) scale(0.985); }
.secondary-button:focus-visible { outline: 3px solid var(--red); outline-offset: 4px; }

.download-actions { display: flex; align-items: center; justify-content: center; gap: 16px; }

.home-footer { display: flex; flex-direction: column; align-items: center; justify-content: center; width: 100%; gap: 24px; }

.social-links { display: flex; align-items: center; gap: 16px; height: 24.151px; }
.social-link { display: block; height: 24.151px; overflow: hidden; color: var(--purple); transition: filter 180ms ease, transform 180ms ease; }
.social-link--instagram { width: 22.541px; }
.social-link--x { width: 25.456px; }
.social-link--facebook { width: 12.368px; }
.social-link--tiktok { width: 21.82px; }
.social-link__sprite { display: block; width: 130.184px; height: 24.151px; }
.social-link__sprite img { display: block; width: 130.184px; height: 24.151px; max-width: none; }
.social-link--x .social-link__sprite { transform: translateX(-38.541px); }
.social-link--facebook .social-link__sprite { transform: translateX(-79.997px); }
.social-link--tiktok .social-link__sprite { transform: translateX(-108.364px); }
.social-link:hover { filter: brightness(0.84); transform: translateY(-2px) scale(1.08); }
.social-link:active { transform: translateY(1px) scale(0.96); }
.social-link:focus-visible { outline: 3px solid var(--red); outline-offset: 4px; border-radius: 2px; }

.flow-overlay {
  position: fixed;
  z-index: 5;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  overflow: auto;
  background: rgba(253, 242, 221, 0.8);
  backdrop-filter: blur(28px);
}

.flow-overlay[hidden] { display: none; }

.flow-shell { width: 100%; max-width: 720px; margin: 0 auto; }

.format-flow, .color-flow, .position-flow, .download-flow { display: flex; flex-direction: column; align-items: center; width: 100%; max-width: 720px; gap: 32px; }

.format-flow h2, .flow-title h2 { margin: 0; color: var(--ink); font-weight: 700; text-align: center; }
.format-flow h2, .position-flow .flow-title h2, .download-flow .flow-title h2 { font-size: 32px; line-height: normal; }
.color-flow .flow-title h2 { font-size: 32px; line-height: normal; }

.format-options { display: flex; flex-direction: column; align-items: stretch; width: 100%; gap: 16px; }

.format-option {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  gap: 24px;
  padding: 24px;
  cursor: pointer;
  border: 2px solid var(--white);
  border-radius: 12px;
  background: rgba(254, 251, 243, 0.32);
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.32);
  color: var(--ink);
  text-align: left;
  transition: background-color 180ms ease, border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.format-option__copy {
  display: flex;
  flex: 1 1 0;
  align-items: center;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  min-width: 0;
  gap: 8px;
}

.format-option.is-selected { border: 6px solid rgba(92, 55, 129, 0.48); background: var(--white); box-shadow: 0 1px 0.5px rgba(0, 0, 0, 0.32); }
.format-option:hover { border-color: rgba(92, 55, 129, 0.58); background: rgba(254, 251, 243, 0.86); box-shadow: 0 8px 20px rgba(73, 47, 98, 0.16); transform: translateY(-4px); }
.format-option.is-selected:hover { background: var(--white); }
.format-option:active { box-shadow: 0 2px 8px rgba(73, 47, 98, 0.16); transform: translateY(1px) scale(0.992); }
.format-option strong { color: var(--purple); }
.format-option__copy > strong { font-size: 24px; font-weight: 700; line-height: normal; }
.format-option__copy > span { font-size: 18px; font-weight: 300; line-height: 22px; }

.format-option__preview { display: block; flex: 0 0 auto; width: 100px; object-fit: cover; border: 0.8px solid var(--purple); border-radius: 6px; }
.format-option__preview--round { height: 100px; border-radius: 999px; }
.format-option__preview--rectangular { height: 125px; border-radius: 4px; }
.format-option__preview--vertical { height: 178px; }

.flow-title { display: flex; flex-direction: column; align-items: center; width: 100%; gap: 24px; text-align: center; }
.flow-title p { margin: 0; color: var(--ink); font-size: 18px; font-weight: 300; line-height: 22px; text-align: center; }

.color-options { display: flex; flex-wrap: wrap; justify-content: center; gap: 16px; }

.color-option {
  padding: 12px 20px;
  cursor: pointer;
  border: 0;
  border-radius: 999px;
  background: var(--white);
  color: var(--ink);
  font-size: 18px;
  font-weight: 300;
  line-height: normal;
  transition: background-color 180ms ease, box-shadow 180ms ease, color 180ms ease, transform 180ms ease;
}

.color-option.is-selected { background: var(--purple); color: var(--white); font-weight: 700; }
.color-option:hover { box-shadow: 0 6px 16px rgba(73, 47, 98, 0.16); transform: translateY(-2px); }
.color-option:active { transform: translateY(1px) scale(0.98); }
.color-option:focus-visible { outline: 3px solid var(--red); outline-offset: 4px; }

.photo-stage-card { display: flex; align-items: center; justify-content: center; padding: 24px; border-radius: 12px; background: var(--white); box-shadow: 0 1px 0.5px rgba(0, 0, 0, 0.32); }
.photo-stage-card--round { border-radius: 999px; }

.photo-stage {
  display: block;
  width: min(480px, calc(100vw - 96px), calc((100svh - 350px) * 0.8));
  height: auto;
  aspect-ratio: 4 / 5;
  border-radius: 6px;
  cursor: grab;
  object-fit: contain;
  touch-action: none;
  transition: box-shadow 180ms ease, transform 180ms ease;
}
.photo-stage:hover { box-shadow: 0 0 0 3px rgba(92, 55, 129, 0.22); }
.photo-stage:active { cursor: grabbing; transform: scale(0.995); }
.photo-stage[data-output-format="round"] { width: min(480px, calc(100vw - 96px), calc(100svh - 350px)); aspect-ratio: 1; border-radius: 999px; }
.photo-stage[data-output-format="vertical"] { width: min(270px, calc(100vw - 96px), calc((100svh - 350px) * 0.5625)); aspect-ratio: 9 / 16; }
.photo-stage--download { cursor: default; }
.photo-stage--download:hover { box-shadow: none; }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

@keyframes enter {
  from { opacity: 0; translate: 0 16px; }
  to { opacity: 1; translate: 0 0; }
}

@keyframes fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes number-marquee {
  to { transform: translateX(-50%); }
}

.home-top > *, .home-footer { animation: enter 460ms cubic-bezier(0.22, 0.8, 0.32, 1) both; }
.home-top > .brand-card { animation-name: fade; }
.home-intro { animation-delay: 80ms; }
.home-action { animation-delay: 160ms; }
.home-footer { animation-delay: 240ms; }
.flow-overlay:not([hidden]) .format-flow > *,
.flow-overlay:not([hidden]) .color-flow > *,
.flow-overlay:not([hidden]) .position-flow > *,
.flow-overlay:not([hidden]) .download-flow > * { animation: enter 360ms cubic-bezier(0.22, 0.8, 0.32, 1) both; }
.flow-overlay:not([hidden]) .format-flow > :nth-child(2),
.flow-overlay:not([hidden]) .color-flow > :nth-child(2),
.flow-overlay:not([hidden]) .position-flow > :nth-child(2),
.flow-overlay:not([hidden]) .download-flow > :nth-child(2) { animation-delay: 70ms; }
.flow-overlay:not([hidden]) .format-flow > :nth-child(3),
.flow-overlay:not([hidden]) .color-flow > :nth-child(3),
.flow-overlay:not([hidden]) .position-flow > :nth-child(3),
.flow-overlay:not([hidden]) .download-flow > :nth-child(3) { animation-delay: 140ms; }

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

@media (max-width: 1336px) {
  .home-screen { padding: 40px; }
  .home-container { min-height: calc(100vh - 80px); }
  .home-top { gap: 24px; }
  .home-intro h1 { font-size: 32px; }
}

@media (max-width: 800px) {
  .campaign { overflow: visible; }
  .home-screen { min-height: auto; padding: 24px; }
  .home-container { justify-content: flex-start; min-height: 0; gap: 48px; }
  .home-top { gap: 32px; }
  .campaign-seal, .brand-card { display: none !important; }
  .number-marquee { display: block; width: 100%; overflow: hidden; }
  .number-marquee__track { display: flex; width: max-content; animation: number-marquee 28s linear infinite; will-change: transform; }
  .number-marquee__group { display: flex; flex: 0 0 auto; gap: 12px; padding-right: 12px; }
  .number-marquee img { display: block; width: clamp(52px, 18vw, 70px); height: auto; }
  .mobile-banner { display: block; width: min(100%, 317px); max-width: 100%; height: auto; object-fit: contain; }
  .mobile-campaign-logo { display: block; width: min(223px, 100%); height: auto; }
  .home-intro h1 { font-size: clamp(30px, 7vw, 32px); line-height: 1.12; }
  .home-intro p, .pill-button, .secondary-button { font-size: clamp(18px, 4.5vw, 20px); line-height: 1.4; }
  .home-footer p { line-height: 1.28; }
  .flow-overlay { align-items: flex-start; padding: 32px 20px 48px; }
  .flow-shell, .format-flow, .color-flow, .position-flow, .download-flow { max-width: 520px; }
  .format-option { padding: 24px; }
  .download-actions { flex-direction: column; width: 100%; }
}

@media (max-width: 440px) {
  .home-screen { padding: 20px; }
  .home-container { min-height: 0; }
  .home-top { gap: 32px; }
  .home-intro { gap: 24px; }
  .flow-overlay { padding: 32px 16px; }
  .format-flow, .color-flow, .position-flow, .download-flow { gap: 32px; }
  .format-flow h2, .position-flow .flow-title h2, .download-flow .flow-title h2 { font-size: 28px; line-height: 34px; }
  .color-flow .flow-title h2 { font-size: 32px; line-height: 38px; }
  .format-option__copy > span, .flow-title p { font-size: 18px; line-height: 22px; }
  .color-option { padding: 12px 18px; font-size: 18px; }
  .photo-stage { width: min(480px, calc(100vw - 80px), calc((100svh - 320px) * 0.8)); }
  .photo-stage[data-output-format="round"] { width: min(480px, calc(100vw - 80px), calc(100svh - 320px)); }
  .photo-stage[data-output-format="vertical"] { width: min(270px, calc(100vw - 80px), calc((100svh - 320px) * 0.5625)); }
}
