/* =========================================================
   Festa da Sofia · 8 anos · tema Hello Kitty
   Palete pastel inspirada no poster de referência: céu azul,
   arco-íris, nuvens brancas e contornos castanhos suaves.
   Abordagem mobile first.
   ========================================================= */

:root {
  --sky:        #bfe6f7;
  --sky-deep:   #9ed8f2;
  --sky-pale:   #e9f6fd;
  --pink:       #ffaecd;
  --pink-deep:  #ff7fb2;
  /* Rosa escuro reservado para texto e links, onde o pastel não
     tem contraste suficiente sobre branco. */
  --pink-text:  #c2457f;
  --pink-soft:  #ffe2ee;
  --pink-pale:  #fff4f9;
  --yellow:     #ffe08a;
  --lilac:      #cdc1ee;
  --mint:       #b6e8c6;
  --cream:      #fffaf6;
  --line:       #7d5b63;
  --ink:        #5c4450;
  --ink-soft:   #8a717c;

  --radius: 22px;
  --radius-lg: 30px;
  --shadow: 0 10px 24px -14px rgba(125, 91, 99, .45);
  --shadow-lg: 0 20px 44px -22px rgba(125, 91, 99, .5);
  --hairline: 2px solid var(--pink-soft);

  --font-display: "Baloo 2", "Trebuchet MS", system-ui, sans-serif;
  --font-body: "Quicksand", "Avenir Next", system-ui, -apple-system, sans-serif;

  --gutter: 1.25rem;
  --max: 68rem;
}

*,
*::before,
*::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 1rem;
  line-height: 1.6;
  color: var(--ink);
  background: var(--cream);
  overflow-x: hidden;
}

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 800;
  line-height: 1.1;
  margin: 0;
  letter-spacing: -0.01em;
}

p { margin: 0; }

ul, ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

a { color: var(--pink-text); }

:focus-visible {
  outline: 3px solid var(--pink-text);
  outline-offset: 3px;
  border-radius: 6px;
}

.sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.skip-link {
  position: absolute;
  left: 50%;
  top: 0;
  transform: translate(-50%, -140%);
  z-index: 50;
  padding: .6rem 1.1rem;
  background: var(--cream);
  border: 2px solid var(--line);
  border-radius: 0 0 var(--radius) var(--radius);
  font-weight: 700;
  text-decoration: none;
  transition: transform .2s ease;
}

.skip-link:focus-visible { transform: translate(-50%, 0); }

.center { text-align: center; }

/* ---------- Ícones ---------- */

.icon {
  width: 1.4em;
  height: 1.4em;
  vertical-align: -0.35em;
  flex: none;
}

.icon--bow { color: var(--pink); }
.icon--heart { color: var(--pink); }

.icon--lg {
  width: 2rem;
  height: 2rem;
  vertical-align: middle;
}

/* =========================================================
   Cenário do topo
   ========================================================= */

.hero {
  position: relative;
  background: var(--cream);
}

/* A ilustração é a imagem do pin. O céu à volta acompanha o azul
   da própria imagem, e a base desvanece para o fundo da página. */
.scene {
  display: flex;
  justify-content: center;
  background: linear-gradient(180deg, #5eade3 0%, #8ecaea 58%, #d4eef8 80%, var(--cream) 100%);
}

.scene__art {
  display: block;
  width: min(100%, 40rem);
  height: auto;
  -webkit-mask-image: linear-gradient(to bottom, #000 86%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 86%, transparent 100%);
}

/* ---------- Texto do topo ---------- */

.hero__inner {
  position: relative;
  z-index: 6;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--gutter) 3rem;
  text-align: center;
}

.hero__eyebrow { margin: 1.1rem 0 1rem; }

.hero__eyebrow span {
  display: inline-block;
  padding: .35rem 1.1rem;
  border: 2px solid var(--line);
  border-radius: 999px;
  background: var(--cream);
  box-shadow: var(--shadow);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: .78rem;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.hero__title {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .4rem;
}

.hero__name {
  font-size: clamp(2.4rem, 12.5vw, 5rem);
  color: var(--pink-text);
  text-shadow: 0 3px 0 var(--pink-soft);
}

.hero__age {
  display: inline-flex;
  align-items: baseline;
  gap: .4rem;
  padding: .15rem 1.15rem .3rem;
  border: 2px solid var(--line);
  border-radius: 999px;
  background: var(--pink);
  color: var(--ink);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.05rem, 4.6vw, 1.5rem);
  box-shadow: var(--shadow);
  transform: rotate(-2deg);
}

.hero__age strong { font-size: 1.55em; }

.hero__sub {
  max-width: 34ch;
  margin: 1.1rem auto 0;
  color: var(--ink-soft);
  font-weight: 600;
}

.hero__when {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  margin-top: 1.4rem;
  padding: .55rem 1.2rem;
  border: var(--hairline);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(.95rem, 3.6vw, 1.15rem);
}

/* ---------- Contagem decrescente ---------- */

.countdown { margin-top: 2rem; }

.countdown__title {
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: .75rem;
}

.countdown__list {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: .5rem;
  max-width: 26rem;
  margin: 0 auto;
}

.countdown__cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: .7rem .2rem .55rem;
  border: var(--hairline);
  border-radius: 18px;
  background: #fff;
  box-shadow: var(--shadow);
}

.countdown__num {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.5rem, 7vw, 2.1rem);
  line-height: 1;
  color: var(--pink-text);
  font-variant-numeric: tabular-nums;
}

.countdown__label {
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.countdown__done {
  margin-top: .9rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--pink-text);
}

/* ---------- Botões ---------- */

.hero__actions {
  display: flex;
  flex-direction: column;
  gap: .7rem;
  margin-top: 2rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3rem;
  padding: .75rem 1.6rem;
  border: 2px solid var(--line);
  border-radius: 999px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  text-decoration: none;
  box-shadow: var(--shadow);
  transition: transform .15s ease, box-shadow .15s ease;
}

.btn--primary {
  background: var(--pink);
  color: var(--ink);
}

.btn--ghost {
  background: #fff;
  color: var(--ink);
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.btn:active { transform: translateY(1px); }

/* =========================================================
   Secções
   ========================================================= */

.section {
  padding: 3rem var(--gutter);
  max-width: var(--max);
  margin: 0 auto;
}

.section--alt {
  max-width: none;
  background: var(--sky-pale);
}

.section--alt > * {
  max-width: var(--max);
  margin-inline: auto;
}

.section__title {
  font-size: clamp(1.75rem, 8vw, 2.6rem);
  text-align: center;
  color: var(--ink);
}

.section__title::after {
  content: "";
  display: block;
  width: 4.5rem;
  height: .35rem;
  margin: .7rem auto 0;
  border-radius: 999px;
  background: var(--pink);
}

.section__lead {
  max-width: 38ch;
  margin: .9rem auto 2rem;
  text-align: center;
  color: var(--ink-soft);
  font-weight: 600;
}

/* ---------- Cartões ---------- */

.cards {
  display: grid;
  gap: 2.5rem;
}

/* Entrada suave dos blocos ao carregar a página. A animação usa
   fill-mode "both", por isso o estado final é sempre visível. */
.card,
.timeline__item,
.tip,
.rsvp {
  animation: rise .55s ease both;
}

.card:nth-child(2),
.timeline__item:nth-child(2),
.tip:nth-child(2) { animation-delay: .08s; }

.card:nth-child(3),
.timeline__item:nth-child(3),
.tip:nth-child(3) { animation-delay: .16s; }

.timeline__item:nth-child(4) { animation-delay: .24s; }
.timeline__item:nth-child(5) { animation-delay: .32s; }

@keyframes rise {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: none; }
}

.card {
  position: relative;
  padding: 2.4rem 1.4rem 1.4rem;
  border: var(--hairline);
  border-radius: var(--radius-lg);
  background: #fff;
  box-shadow: var(--shadow);
}

.card__badge {
  position: absolute;
  top: -1.4rem;
  left: 1.3rem;
  display: grid;
  place-items: center;
  width: 3.4rem;
  height: 3.4rem;
  border: 2px solid var(--line);
  border-radius: 50%;
  background: var(--pink);
  color: var(--ink);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.45rem;
  box-shadow: var(--shadow);
}

.card__badge--icon { background: var(--sky); }

.card__title {
  font-size: 1.4rem;
  color: var(--pink-text);
  margin-bottom: .4rem;
}

.card__text { color: var(--ink-soft); font-weight: 600; }

.card__text strong { color: var(--ink); }

.card__foot {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem .9rem;
  margin-top: 1rem;
  padding-top: .9rem;
  border-top: 2px dashed var(--pink-soft);
}

.link {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: .95rem;
  color: var(--pink-text);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

.link--static {
  color: var(--ink-soft);
  text-decoration: none;
}

/* ---------- Programa ---------- */

.timeline {
  display: grid;
  gap: .9rem;
}

.timeline__item {
  display: grid;
  grid-template-columns: 4.6rem 1fr;
  align-items: start;
  gap: .9rem;
  padding: 1rem 1.1rem;
  border: var(--hairline);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow);
}

.timeline__time {
  display: grid;
  place-items: center;
  padding: .35rem .2rem;
  border-radius: 999px;
  background: var(--sky);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: .95rem;
  color: var(--ink);
}

.timeline__item:nth-child(even) .timeline__time { background: var(--pink-soft); }

.timeline__title {
  font-size: 1.1rem;
  margin-bottom: .15rem;
}

.timeline__body p {
  color: var(--ink-soft);
  font-size: .95rem;
  font-weight: 600;
}

/* ---------- Mapa e dicas ---------- */

.map {
  border: var(--hairline);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
  background: var(--sky-pale);
  aspect-ratio: 4 / 3;
}

.map iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

.tips {
  display: grid;
  gap: .8rem;
  width: 100%;
  margin: 1.5rem auto;
}

.tip {
  padding: 1rem 1.2rem;
  border: 2px dashed var(--pink);
  border-radius: var(--radius);
  background: var(--pink-pale);
  text-align: center;
}

.tip__title {
  font-size: 1.05rem;
  color: var(--pink-text);
  margin-bottom: .2rem;
}

.tip p {
  color: var(--ink-soft);
  font-size: .95rem;
  font-weight: 600;
}

/* ---------- Confirmação de presença ---------- */

.section--rsvp { padding-bottom: 4rem; }

.rsvp {
  position: relative;
  padding: 3.5rem 1.4rem 2.25rem;
  border: var(--hairline);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, var(--pink-pale), #fff 70%);
  box-shadow: var(--shadow-lg);
  text-align: center;
}

.rsvp__bow {
  position: absolute;
  top: -1.75rem;
  left: 50%;
  transform: translateX(-50%);
  width: 6rem;
  height: 3.7rem;
  color: var(--pink);
  filter: drop-shadow(0 8px 10px rgba(125, 91, 99, .2));
}

.rsvp .section__lead { margin-bottom: 1.6rem; }

.rsvp__actions {
  display: flex;
  flex-direction: column;
  gap: .7rem;
}

.rsvp__note {
  margin-top: 1.4rem;
  font-size: .9rem;
  font-weight: 600;
  color: var(--ink-soft);
}

/* ---------- Rodapé ---------- */

.footer {
  position: relative;
  padding-top: 3rem;
  text-align: center;
  background: linear-gradient(180deg, #dff1fb, var(--sky));
}

.footer__clouds {
  position: absolute;
  top: -1px;
  left: 0;
  width: 100%;
  height: clamp(2.6rem, 8vw, 6rem);
  color: var(--cream);
  transform: rotate(180deg);
}

.footer__inner {
  position: relative;
  z-index: 2;
  padding: 1.5rem var(--gutter) 2.5rem;
}

.footer__line {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  line-height: 1.25;
  max-width: 16rem;
  margin-inline: auto;
  text-wrap: balance;
}

.footer__small {
  font-size: .85rem;
  font-weight: 600;
  color: var(--ink-soft);
}

/* =========================================================
   Tablet
   ========================================================= */

@media (min-width: 40rem) {
  :root { --gutter: 2rem; }

  .footer__line {
    font-size: 1.25rem;
    max-width: 40rem;
  }

  .hero__inner { padding-top: .5rem; }

  .hero__actions,
  .rsvp__actions {
    flex-direction: row;
    justify-content: center;
  }

  .countdown__list { gap: .9rem; max-width: 30rem; }

  .cards { grid-template-columns: repeat(2, 1fr); gap: 1.6rem; }

  .tips { grid-template-columns: repeat(3, 1fr); }

  .timeline__item { grid-template-columns: 5.5rem 1fr; padding: 1.2rem 1.4rem; }

  .map { aspect-ratio: 16 / 9; }

  .rsvp { padding: 3.75rem 2.5rem 2.75rem; }
}

/* =========================================================
   Desktop
   ========================================================= */

@media (min-width: 64rem) {
  body { font-size: 1.05rem; }

  .scene__art {
    width: min(100%, 44rem);
    /* No ecrã largo a imagem não ocupa a largura toda: as laterais
       dissolvem-se no céu, em vez de fazerem um retângulo cortado. */
    -webkit-mask-image:
      linear-gradient(to bottom, #000 84%, transparent 100%),
      linear-gradient(to right, transparent 0%, #000 7%, #000 93%, transparent 100%);
    -webkit-mask-composite: source-in;
    mask-image:
      linear-gradient(to bottom, #000 84%, transparent 100%),
      linear-gradient(to right, transparent 0%, #000 7%, #000 93%, transparent 100%);
    mask-composite: intersect;
  }

  .hero__sub { font-size: 1.15rem; }

  .cards { grid-template-columns: repeat(3, 1fr); }

  .section { padding-block: 4.5rem; }

  .timeline {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.2rem;
  }

  .timeline__item:first-child { grid-column: 1 / -1; }
}

/* =========================================================
   Acessibilidade: respeitar quem prefere menos animação
   ========================================================= */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  *,
  *::before,
  *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}
