/* ==========================================================
   Henry 4 anos — tema quadrinhos / heróis
   ========================================================== */
:root {
  --red: #e62429;
  --red-dark: #a8141a;
  --blue: #1d3fa8;
  --blue-dark: #0f2466;
  --yellow: #ffd400;
  --yellow-dark: #e0a800;
  --green: #2e9e3f;
  --green-dark: #1c6b2a;
  --purple: #6a2c91;
  --purple-dark: #3f1a58;
  --ink: #111;
  --paper: #fff8e7;
  --white: #fff;

  --font-display: 'Bangers', 'Impact', 'Arial Black', sans-serif;
  --font-body: 'Comic Neue', 'Comic Sans MS', 'Trebuchet MS', sans-serif;

  --border: 4px;
  --shadow: 8px 8px 0 var(--ink);
  --shadow-sm: 4px 4px 0 var(--ink);
  --radius: 6px;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.05rem;
  line-height: 1.45;
  color: var(--ink);
  background-color: var(--blue-dark);
  background-image:
    radial-gradient(circle at 20% 10%, rgba(255,255,255,.08) 0 2px, transparent 3px),
    repeating-linear-gradient(135deg, rgba(255,255,255,.03) 0 2px, transparent 2px 14px);
  min-height: 100dvh;
}

.page {
  max-width: 880px;
  margin: 0 auto;
  padding-block: 24px 48px;
  padding-inline: 16px;
  display: grid;
  gap: 28px;
}

@media (min-width: 640px) {
  .page { padding-inline: 24px; padding-block: 40px 72px; gap: 40px; }
}

/* ---------- Painéis ---------- */
.panel {
  position: relative;
  border: var(--border) solid var(--ink);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px 20px;
  overflow: hidden;
  overflow: clip;
  isolation: isolate;
}

@media (min-width: 640px) {
  .panel { padding: 40px 36px; }
}

.tilt-left  { transform: rotate(-1.2deg); }
.tilt-right { transform: rotate(1.2deg); }
@media (max-width: 639px) {
  .tilt-left, .tilt-right { transform: none; }
}

/* meio‑tom (halftone) */
.halftone::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image: radial-gradient(circle, rgba(0,0,0,.22) 1.5px, transparent 2px);
  background-size: 9px 9px;
  opacity: .35;
  pointer-events: none;
  mask-image: linear-gradient(135deg, transparent 30%, #000 100%);
  -webkit-mask-image: linear-gradient(135deg, transparent 30%, #000 100%);
}

.halftone--red    { background: var(--red); }
.halftone--blue   { background: var(--blue); }
.halftone--yellow { background: var(--yellow); }
.halftone--green  { background: var(--green); }
.halftone--purple { background: linear-gradient(160deg, #7b3aa6, var(--purple) 60%, var(--purple-dark)); }

/* raios de fundo estilo "burst" */
.panel--hero::after,
.panel--rsvp::after {
  content: "";
  position: absolute;
  inset: -50%;
  z-index: -2;
  background: repeating-conic-gradient(from 0deg, rgba(255,255,255,.14) 0 6deg, transparent 6deg 14deg);
  pointer-events: none;
}

/* ---------- Tipografia ---------- */
.display, .hero__title, .section__title, .fx, .burst, .ribbon, .btn, .choice__big, .success__title {
  font-family: var(--font-display);
  letter-spacing: .03em;
  text-transform: uppercase;
  font-weight: 400;
}

/* ---------- HERO ---------- */
.panel--hero {
  color: var(--white);
  text-align: center;
  padding-top: 118px;
}
@media (min-width: 640px) { .panel--hero { padding-top: 64px; } }

.burst {
  position: absolute;
  display: grid;
  place-items: center;
  color: var(--ink);
  background: var(--yellow);
  font-size: 1.6rem;
  line-height: 1;
  width: 92px; height: 92px;
  clip-path: polygon(50% 0%, 61% 14%, 79% 6%, 80% 25%, 98% 30%, 87% 45%, 100% 58%, 83% 66%, 88% 85%, 70% 82%, 62% 100%, 50% 87%, 38% 100%, 30% 82%, 12% 85%, 17% 66%, 0% 58%, 13% 45%, 2% 30%, 20% 25%, 21% 6%, 39% 14%);
  transform: rotate(-12deg);
  filter: drop-shadow(3px 3px 0 var(--ink));
}
.burst--hey { top: 14px; left: 14px; }
@media (min-width: 640px) { .burst--hey { top: 22px; left: 26px; width: 120px; height: 120px; font-size: 2.2rem; } }

.hero__call {
  margin: 0 0 6px;
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 5vw, 2.2rem);
  line-height: 1.05;
  text-shadow: 3px 3px 0 var(--ink);
  letter-spacing: .04em;
}
.hero__sub {
  margin: 0 0 22px;
  font-weight: 700;
  font-style: italic;
  opacity: .95;
  text-shadow: 1px 1px 0 var(--ink);
}

.hero__title-wrap {
  position: relative;
  display: inline-block;
  padding: 22px 32px 26px;
  transform: rotate(-2deg);
  filter: drop-shadow(8px 8px 0 var(--ink));
  max-width: 100%;
  --comic-shape: polygon(0 8%, 6% 0, 94% 3%, 100% 12%, 98% 90%, 92% 100%, 8% 97%, 0 88%);
}
/* contorno (preto) e preenchimento (amarelo) recortados com o mesmo polígono */
.hero__title-wrap::before,
.hero__title-wrap::after {
  content: "";
  position: absolute;
  z-index: -1;
  clip-path: var(--comic-shape);
}
.hero__title-wrap::before { inset: 0; background: var(--ink); }
.hero__title-wrap::after  { inset: 5px; background: var(--yellow); }
.hero__title {
  margin: 0;
  color: var(--ink);
  line-height: .9;
  display: grid;
  gap: 2px;
}
.hero__name {
  font-size: clamp(3.4rem, 15vw, 6.5rem);
  color: var(--red);
  -webkit-text-stroke: 2px var(--ink);
  text-shadow: 4px 4px 0 var(--ink);
}
.hero__line { font-size: clamp(1.5rem, 6vw, 2.4rem); }
.hero__age {
  font-size: clamp(3rem, 12vw, 5rem);
  display: inline-flex;
  align-items: baseline;
  justify-content: center;
  gap: 8px;
}
.hero__age small { font-size: .45em; }
.hero__bang { color: var(--red); -webkit-text-stroke: 1.5px var(--ink); }

.lightning {
  position: absolute;
  font-size: 2.4rem;
  filter: drop-shadow(2px 2px 0 var(--ink));
  animation: flicker 2.6s infinite;
}
.lightning--1 { right: 18px; top: 22px; }
.lightning--2 { left: 22px; bottom: 18px; animation-delay: 1.2s; }
@keyframes flicker { 0%, 100% { opacity: 1; } 45% { opacity: .35; } 55% { opacity: 1; } 62% { opacity: .5; } }

/* ---------- Balões ---------- */
.row--bubbles {
  display: grid;
  gap: 24px;
}
@media (min-width: 640px) {
  .row--bubbles { grid-template-columns: 1fr 1fr; gap: 32px; }
}
.row--bubbles .panel { min-height: 190px; display: grid; place-items: center; }

.bubble {
  position: relative;
  background: var(--white);
  border: var(--border) solid var(--ink);
  border-radius: 40px / 32px;
  padding: 18px 22px;
  margin-bottom: 26px; /* espaço para a seta */
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 4.5vw, 1.7rem);
  text-align: center;
  line-height: 1.1;
  letter-spacing: .04em;
  box-shadow: var(--shadow-sm);
  max-width: 340px;
}
/* seta: triângulo preto (contorno) + triângulo branco (preenchimento) por cima */
.bubble::after,
.bubble::before {
  content: "";
  position: absolute;
  width: 0; height: 0;
  border-style: solid;
  border-color: transparent;
}
.bubble::after {
  bottom: -26px;
  border-width: 26px 10px 0 18px;
  border-top-color: var(--ink);
  z-index: 0;
}
.bubble::before {
  bottom: -16px;
  border-width: 17px 6px 0 12px;
  border-top-color: var(--white);
  z-index: 1;
}
.bubble--left::after  { left: 34px; }
.bubble--left::before { left: 40px; }
.bubble--right::after  { right: 34px; transform: scaleX(-1); }
.bubble--right::before { right: 40px; transform: scaleX(-1); }

/* onomatopeias */
.fx {
  position: absolute;
  color: var(--yellow);
  -webkit-text-stroke: 2px var(--ink);
  text-shadow: 4px 4px 0 var(--ink);
  font-size: 2.6rem;
  line-height: 1;
  pointer-events: none;
}
.fx--boom { right: 14px; bottom: 10px; transform: rotate(-8deg); color: var(--red); }
.fx--zap  { left: 14px; bottom: 10px; transform: rotate(6deg); color: var(--blue); }
.fx--pow  {
  position: relative;
  display: inline-block;
  font-size: clamp(3rem, 12vw, 4.5rem);
  transform: rotate(-6deg);
  color: var(--yellow);
  -webkit-text-stroke: 2.5px var(--ink);
  text-shadow: 5px 5px 0 var(--ink);
  margin-bottom: 8px;
}
.fx--small { font-size: 2rem; text-shadow: 3px 3px 0 var(--ink); }

/* ---------- Data ---------- */
.panel--date { color: var(--white); text-align: center; padding-bottom: 96px; }

.ribbon {
  display: inline-block;
  background: var(--yellow);
  color: var(--ink);
  border: var(--border) solid var(--ink);
  padding: 8px 26px;
  font-size: clamp(1.4rem, 5vw, 1.9rem);
  box-shadow: var(--shadow-sm);
  transform: rotate(-1.5deg);
  margin-bottom: 26px;
  position: relative;
}
.ribbon::before, .ribbon::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 18px; height: 18px;
  background: var(--yellow);
  border: var(--border) solid var(--ink);
  transform: translateY(-50%) rotate(45deg);
  z-index: -1;
}
.ribbon::before { left: -14px; }
.ribbon::after  { right: -14px; }

.date__grid {
  display: grid;
  gap: 14px;
  margin-bottom: 22px;
  position: relative;
  z-index: 1;
}
@media (min-width: 640px) { .date__grid { grid-template-columns: repeat(3, 1fr); gap: 18px; } }

.date__item {
  background: var(--white);
  color: var(--ink);
  border: var(--border) solid var(--ink);
  box-shadow: var(--shadow-sm);
  padding: 16px 12px;
  display: grid;
  gap: 2px;
  transform: rotate(-.6deg);
}
.date__item:nth-child(2) { transform: rotate(.8deg); }
.date__item:nth-child(3) { transform: rotate(-.4deg); }
.date__icon { font-size: 1.8rem; }
.date__item strong { font-family: var(--font-display); font-size: 1.5rem; letter-spacing: .04em; line-height: 1.05; text-transform: uppercase; }
.date__item span:last-child { font-size: .92rem; font-weight: 700; opacity: .8; }

.countdown {
  font-family: var(--font-display);
  font-size: clamp(1.2rem, 4.5vw, 1.6rem);
  letter-spacing: .05em;
  text-shadow: 2px 2px 0 var(--ink);
  margin-bottom: 22px;
  min-height: 1.5em;
  position: relative;
  z-index: 1;
}
.countdown b { color: var(--yellow); font-size: 1.35em; }

.date__actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; position: relative; z-index: 1; }

/* skyline (silhueta de cidade) */
.city {
  position: absolute;
  left: -10px; right: -10px; bottom: -4px;
  height: 90px;
  background: var(--ink);
  clip-path: polygon(
    0% 100%, 0% 55%, 5% 55%, 5% 30%, 10% 30%, 10% 60%, 14% 60%, 14% 20%, 16% 12%, 18% 20%, 18% 50%,
    24% 50%, 24% 38%, 30% 38%, 30% 65%, 34% 65%, 34% 25%, 40% 25%, 40% 45%, 45% 45%, 45% 8%, 47% 8%,
    47% 45%, 52% 45%, 52% 58%, 58% 58%, 58% 32%, 63% 32%, 63% 50%, 68% 50%, 68% 15%, 70% 5%, 72% 15%,
    72% 42%, 78% 42%, 78% 62%, 83% 62%, 83% 28%, 89% 28%, 89% 48%, 94% 48%, 94% 35%, 100% 35%, 100% 100%
  );
  pointer-events: none;
  z-index: 0;
}
.city::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255,212,0,.9) 1.2px, transparent 1.6px);
  background-size: 14px 18px;
  background-position: 4px 30px;
  opacity: .55;
}

/* ---------- Botões ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  font-size: 1.25rem;
  color: var(--ink);
  background: var(--white);
  border: var(--border) solid var(--ink);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  cursor: pointer;
  transition: transform .08s ease, box-shadow .08s ease;
  -webkit-tap-highlight-color: transparent;
}
.btn:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--ink); }
.btn:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--ink); }
.btn:focus-visible { outline: 4px solid var(--yellow); outline-offset: 2px; }
.btn--blue   { background: var(--blue); color: var(--white); }
.btn--yellow { background: var(--yellow); }
.btn--red    { background: var(--red); color: var(--white); }
.btn--big    { width: 100%; font-size: 1.6rem; padding: 16px 24px; }
.btn[disabled] { opacity: .7; cursor: progress; transform: none; }

.btn-link {
  background: none;
  border: none;
  color: inherit;
  font: inherit;
  font-weight: 700;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
  cursor: pointer;
  padding: 6px 2px;
}
.btn-link:hover { text-decoration-color: var(--yellow); }

/* ---------- RSVP ---------- */
.panel--rsvp { color: var(--white); }

.section__title {
  margin: 0 0 8px;
  padding: 4px 0 6px;
  text-align: center;
  display: grid;
  gap: 4px;
  line-height: 1.12;
  overflow: visible;
  overflow-wrap: anywhere;
}
.section__title-top { font-size: clamp(1.2rem, 4.5vw, 1.6rem); opacity: .9; text-shadow: 2px 2px 0 var(--ink); }
.section__title-main {
  font-size: clamp(2.2rem, 9vw, 3.6rem);
  color: var(--yellow);
  -webkit-text-stroke: 1.5px var(--ink);
  text-shadow: 4px 4px 0 var(--ink);
}
.section__title--small { margin-bottom: 18px; }
.section__title--small .section__title-top { color: var(--ink); text-shadow: none; }
.section__title--small .section__title-main { color: var(--red); font-size: clamp(2.2rem, 9vw, 3.2rem); }
.section__lead { text-align: center; margin: 0 0 26px; font-weight: 700; text-shadow: 1px 1px 0 var(--ink); }

.form {
  background: var(--paper);
  color: var(--ink);
  border: var(--border) solid var(--ink);
  box-shadow: var(--shadow);
  padding: 22px 18px 26px;
  display: grid;
  gap: 20px;
  position: relative;
  z-index: 1;
}
@media (min-width: 640px) { .form { padding: 30px 30px 34px; } }

.field { border: 0; padding: 0; margin: 0; min-width: 0; display: grid; gap: 8px; }
.field__label {
  font-family: var(--font-display);
  font-size: 1.25rem;
  letter-spacing: .05em;
  text-transform: uppercase;
}
.req { color: var(--red); }
.opt { font-family: var(--font-body); font-size: .85rem; text-transform: none; letter-spacing: 0; opacity: .7; font-weight: 700; }

.input {
  width: 100%;
  font: inherit;
  font-size: 1.1rem;
  padding: 12px 14px;
  background: var(--white);
  border: 3px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: 3px 3px 0 var(--ink);
  color: var(--ink);
  transition: box-shadow .08s ease, transform .08s ease;
}
.input:focus { outline: none; box-shadow: 3px 3px 0 var(--blue), 0 0 0 4px rgba(29,63,168,.25); }
.input--area { resize: vertical; min-height: 84px; }
.input.is-invalid { border-color: var(--red); box-shadow: 3px 3px 0 var(--red); }

.children { display: grid; gap: 10px; }
.child-row { display: flex; gap: 8px; align-items: stretch; }
.child-row .input { flex: 1; }
.child-row__remove {
  flex: 0 0 auto;
  width: 48px;
  font-family: var(--font-display);
  font-size: 1.4rem;
  background: var(--white);
  color: var(--red);
  border: 3px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: 3px 3px 0 var(--ink);
  cursor: pointer;
}
.child-row__remove:hover { background: #ffe9e9; }

/* sim / não */
.choice { display: grid; gap: 12px; }
@media (min-width: 520px) { .choice { grid-template-columns: 1fr 1fr; } }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice__opt {
  display: grid;
  gap: 2px;
  text-align: center;
  padding: 14px 12px;
  background: var(--white);
  border: 3px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: 3px 3px 0 var(--ink);
  cursor: pointer;
  user-select: none;
  transition: transform .08s ease, background .08s ease, color .08s ease;
}
.choice__big { font-size: 1.35rem; line-height: 1.05; }
.choice__small { font-size: .9rem; font-weight: 700; opacity: .75; }
.choice__opt:hover { transform: translate(-1px, -1px); }
.choice input:focus-visible + .choice__opt { outline: 4px solid var(--blue); outline-offset: 2px; }
#att-yes:checked + .choice__opt { background: var(--green); color: var(--white); }
#att-yes:checked + .choice__opt .choice__small { opacity: .95; }
#att-no:checked  + .choice__opt { background: var(--red); color: var(--white); }
#att-no:checked  + .choice__opt .choice__small { opacity: .95; }

.form__error {
  margin: 0;
  padding: 10px 14px;
  background: #ffe3e3;
  border: 3px solid var(--red);
  border-radius: var(--radius);
  font-weight: 700;
  color: var(--red-dark);
}

/* sucesso */
.success {
  background: var(--paper);
  color: var(--ink);
  border: var(--border) solid var(--ink);
  box-shadow: var(--shadow);
  padding: 34px 20px;
  text-align: center;
  position: relative;
  z-index: 1;
  animation: pop .45s cubic-bezier(.2, 1.4, .4, 1) both;
}
.success__title { margin: 6px 0 8px; font-size: clamp(2rem, 8vw, 3rem); line-height: 1; }
.success__text { margin: 0 0 14px; font-weight: 700; font-size: 1.15rem; }
@keyframes pop { from { transform: scale(.6) rotate(-4deg); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- Cronograma ---------- */
.panel--schedule { text-align: center; padding-bottom: 56px; }

.schedule-wrap {
  overflow-x: auto;
  background: var(--white);
  border: var(--border) solid var(--ink);
  box-shadow: var(--shadow);
  max-width: 560px;
  margin: 0 auto;
  transform: rotate(.6deg);
  position: relative;
  z-index: 1;
}
.schedule {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}
.schedule th {
  font-family: var(--font-display);
  font-size: 1.25rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  background: var(--red);
  color: var(--white);
  padding: 10px 16px;
  border-bottom: var(--border) solid var(--ink);
}
.schedule td {
  padding: 12px 16px;
  font-weight: 700;
  font-size: 1.1rem;
  border-bottom: 2px dashed rgba(0,0,0,.25);
}
.schedule tr:last-child td { border-bottom: 0; }
.schedule tbody tr:nth-child(even) td { background: var(--paper); }
.schedule td:first-child {
  font-family: var(--font-display);
  font-size: 1.5rem;
  letter-spacing: .04em;
  color: var(--blue);
  white-space: nowrap;
  width: 1%;
  border-right: 3px solid var(--ink);
}
.schedule tbody tr:hover td { background: #fff3b0; }
.fx--schedule { left: auto; right: 14px; bottom: 6px; transform: rotate(-6deg); }

/* ---------- Rodapé ---------- */
.footer {
  text-align: center;
  color: var(--white);
  font-weight: 700;
  text-shadow: 1px 1px 0 var(--ink);
}
.footer p { margin: 8px 0 0; }

/* acessibilidade: menos movimento */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}
