/* ============ ESTILO B · dibujo a línea, papel crema ============ */
:root {
  --paper: #f8f2ec;
  --ink: #1b1a19;
  --ink-soft: #4a4744;
  --line: 1.7;
  --outside: #8e8a86;
  --w: 460px;
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: "Patrick Hand", "Comic Sans MS", cursive;
  /* fondo exterior: gris con textura de ladrillo, como el mockup */
  background-color: var(--outside);
  background-image:
    linear-gradient(rgba(255,255,255,.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,0,0,.05) 1px, transparent 1px),
    radial-gradient(circle at 30% 20%, #a8a4a0, #6f6b68 80%);
  background-size: 64px 24px, 64px 48px, cover;
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}

.card {
  position: relative;
  width: min(100%, var(--w));
  margin: 0 auto;
  background: var(--paper);
  overflow: hidden;
  box-shadow: 0 30px 80px rgba(0,0,0,.35);
}
@media (min-width: 560px) {
  .card { margin: 48px auto; }
}

section, footer { position: relative; padding: 0 24px; text-align: center; }

/* ---------- Dibujos ---------- */
svg.draw, .icon {
  fill: none;
  stroke: var(--ink);
  stroke-width: var(--line);
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: url(#wobble);
  overflow: visible;
}
svg .soft { stroke-width: 1; }
svg .ink { fill: var(--ink); }

.wave {
  display: block;
  width: calc(100% + 48px);
  margin: 0 -24px;
  height: 96px;
  fill: none;
  stroke: var(--ink);
  stroke-width: 1.3;
  stroke-linecap: round;
  overflow: visible;
}

/* ---------- Tipografía ---------- */
.big-title, .hand-title, .names, h3 {
  font-family: "Gochi Hand", "Patrick Hand", cursive;
  font-weight: 400;
  margin: 0;
  letter-spacing: .04em;
}
.big-title {
  font-size: clamp(2.6rem, 12vw, 3.6rem);
  line-height: 1.02;
}
.big-title span { display: block; }
.hand-title {
  font-size: 1.6rem;
  line-height: 1.1;
  text-align: left;
  display: inline-block;
}
.hand-title .indent { padding-left: 1.6em; }
.hand-title.small { display: block; text-align: center; font-size: 1.5rem; }
.names { font-size: 1.55rem; margin-top: 14px; }
.names span { font-size: .85em; padding: 0 .15em; }
.tiny { font-size: .98rem; margin: 2px 0 0; color: var(--ink-soft); }
.letter-text { font-size: 1.12rem; line-height: 1.38; }
.letter-text p { margin: 0 0 12px; }

/* ---------- 1. Portada ---------- */
.hero { padding-top: 0; }
.hands {
  display: block;
  width: calc(100% + 48px);
  margin: 0 -24px 6px;
  height: auto;
}
.hero .wave { margin-top: 18px; }
.loose-heart {
  position: absolute;
  width: 20px; height: 18px;
  fill: none; stroke: var(--ink); stroke-width: 1.4;
}
.lh-1 { left: 18%; bottom: 8px; transform: rotate(-14deg); }
.lh-2 { right: 14%; bottom: 66px; transform: rotate(12deg); }

/* ---------- 2. Mensaje ---------- */
.letter { padding-top: 34px; }
.letter .letter-text { margin-top: 16px; }
.couple { display: block; width: min(86%, 320px); margin: 18px auto 0; height: auto; }

/* ---------- 3. Cuenta atrás ---------- */
.countdown-sec .wave { margin-bottom: 8px; }
.countdown {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin: 10px 0 30px;
}
.countdown div {
  width: 70px;
  padding: 8px 0 6px;
  border: 1.6px solid var(--ink);
  border-radius: 46% 54% 48% 52% / 55% 45% 55% 45%;
  display: flex; flex-direction: column; align-items: center;
}
.countdown b {
  font-family: "Gochi Hand", cursive;
  font-weight: 400;
  font-size: 1.9rem;
  line-height: 1;
}
.countdown span { font-size: .9rem; color: var(--ink-soft); }

/* ---------- 4. El día ---------- */
.day { padding-top: 26px; }
.timeline {
  position: relative;
  max-width: 400px;
  margin: 0 auto;
  aspect-ratio: 360 / 400;
}
.route {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  fill: none; stroke: var(--ink); stroke-width: 1.3; stroke-linecap: round;
  overflow: visible;
}
.route path { vector-effect: non-scaling-stroke; }
.route-heart {
  position: absolute; left: 8%; top: 88.5%;
  width: 18px; height: 16px;
  fill: none; stroke: var(--ink); stroke-width: 1.4;
  transform: rotate(-18deg);
}
.stop {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 8px;
  text-align: left;
}
.stop h3 { font-size: 1.32rem; line-height: 1; }
.stop p { margin: 2px 0 0; font-size: .86rem; color: var(--ink-soft); }
.stop .icon { width: 58px; height: auto; flex: none; }
.stop-1 { right: 0; top: 0; }
.stop-2 { left: 0; top: 23%; }
.stop-3 { right: 0; top: 46%; }
.stop-4 { left: 4%; top: 66%; }
.stop-4 .icon { order: 2; }

/* ---------- 5. Ubicación ---------- */
.location { padding-top: 10px; }
.table { display: block; width: min(92%, 340px); margin: 14px auto 6px; height: auto; }

.btn {
  display: inline-block;
  font-family: "Patrick Hand", cursive;
  font-size: 1.1rem;
  color: var(--ink);
  text-decoration: none;
  padding: 8px 26px 7px;
  border: 1.6px solid var(--ink);
  border-radius: 255px 15px 225px 15px / 15px 225px 15px 255px;
  background: transparent;
  cursor: pointer;
  transition: transform .2s, background-color .2s, color .2s;
}
.btn:hover { transform: rotate(-1.5deg) scale(1.03); }
.btn-ink { background: var(--ink); color: var(--paper); }
.btn:focus-visible, .outfit:focus-visible { outline: 2px dashed var(--ink); outline-offset: 4px; }

/* ---------- 6. Dress code ---------- */
.palette {
  list-style: none;
  display: flex;
  justify-content: center;
  gap: 14px;
  padding: 0;
  margin: 18px 0 10px;
}
.palette li svg {
  width: 44px; height: 40px;
  fill: var(--c);
  stroke: var(--c);
  stroke-width: .6;
  transition: transform .25s;
}
.palette li:nth-child(odd) svg { transform: rotate(-6deg); }
.palette li:nth-child(even) svg { transform: rotate(5deg); }
.palette li:hover svg { transform: scale(1.15) rotate(0); }

.outfits {
  display: flex;
  justify-content: center;
  gap: 34px;
  margin: 8px 0 26px;
}
.outfit {
  display: flex; flex-direction: column; align-items: center;
  color: var(--ink);
  text-decoration: none;
}
.outfit svg { width: 92px; height: auto; }
.outfit span {
  margin-top: 10px;
  font-size: .92rem;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ---------- 7. Confirmar ---------- */
.rsvp .big-title { margin-top: 4px; }
.rsvp .letter-text { margin: 10px 0 18px; font-size: 1.02rem; }
.rsvp-form {
  display: flex; flex-direction: column; gap: 12px;
  max-width: 340px; margin: 0 auto;
  text-align: left;
}
.choice { border: 0; padding: 0; margin: 0; display: flex; gap: 10px; }
.choice label { flex: 1; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice span {
  display: block;
  text-align: center;
  padding: 7px 4px;
  font-size: 1.05rem;
  border: 1.6px solid var(--ink);
  border-radius: 15px 225px 15px 255px / 255px 15px 225px 15px;
  cursor: pointer;
  transition: background-color .2s, color .2s;
}
.choice input:checked + span { background: var(--ink); color: var(--paper); }
.choice input:focus-visible + span { outline: 2px dashed var(--ink); outline-offset: 3px; }
.field input, .field textarea {
  width: 100%;
  font: inherit;
  font-size: 1.05rem;
  color: var(--ink);
  background: transparent;
  border: 0;
  border-bottom: 1.5px solid var(--ink);
  padding: 6px 2px;
  resize: vertical;
}
.field textarea {
  border: 1.5px solid var(--ink);
  border-radius: 6px 14px 8px 12px;
  padding: 8px;
}
.field input:focus, .field textarea:focus { outline: none; background: rgba(0,0,0,.035); }
::placeholder { color: #8a857f; }
.rsvp-form .btn { align-self: center; margin-top: 4px; }
.form-status { min-height: 1.4em; margin: 0; text-align: center; font-size: 1.05rem; }

/* ---------- 8. Cierre ---------- */
.end { padding: 34px 24px 48px; }
.end-hearts {
  width: 120px; height: 40px;
  fill: none; stroke: var(--ink); stroke-width: 1.3;
}
.end .big-title { font-size: clamp(2.2rem, 10vw, 3rem); margin-top: 6px; }

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

/* ---------- Animaciones ---------- */
.js .reveal { opacity: 0; transform: translateY(14px); transition: opacity .8s ease, transform .8s ease; }
.js .reveal.is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
}
