/* Send a Duck — one stylesheet, mobile first. */

@font-face {
  font-family: "Fredoka";
  src: url("/fonts/fredoka-latin-500-normal.woff2") format("woff2");
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: "Fredoka";
  src: url("/fonts/fredoka-latin-600-normal.woff2") format("woff2");
  font-weight: 600 700;
  font-display: swap;
}

:root {
  --yellow: #ffd84d;
  --yellow-deep: #f4c22b;
  --pond: #cdedf5;
  --pond-deep: #a9dcea;
  --cream: #fff9e9;
  --orange: #ff9b63;
  --ink: #242a31;
  --ink-soft: #5b6470;
  --white: #ffffff;
  --error: #c2412d;
  --radius: 22px;
  --border: 3px solid var(--ink);
  --shadow: 0 4px 0 var(--ink);
  --display: "Fredoka", ui-rounded, "SF Pro Rounded", "Arial Rounded MT Bold", system-ui, sans-serif;
  --body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}
body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font: 17px/1.55 var(--body);
  overflow-x: hidden;
}
img {
  max-width: 100%;
  height: auto;
}
a {
  color: inherit;
  text-underline-offset: 3px;
}
h1,
h2,
h3,
legend,
.btn,
.logo {
  font-family: var(--display);
  font-weight: 600;
  letter-spacing: -0.01em;
}
h1,
h2,
h3 {
  line-height: 1.12;
  margin: 0 0 0.4em;
}

.skip {
  position: absolute;
  left: -999px;
}
.skip:focus {
  left: 16px;
  top: 16px;
  background: var(--white);
  padding: 8px 12px;
  border: var(--border);
  border-radius: 12px;
  z-index: 10;
}
:focus-visible {
  outline: 3px solid var(--orange);
  outline-offset: 3px;
}

/* ---------- Header & footer ---------- */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  max-width: 1120px;
  margin: 0 auto;
  padding: 14px 16px;
}
.logo {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 1.3rem;
  text-decoration: none;
}
.logo img {
  width: 36px;
}

.site-footer {
  text-align: center;
  padding: 48px 16px 40px;
  margin-top: 56px;
  background: var(--pond);
  border-top: var(--border);
}
.footer-tag {
  font-family: var(--display);
  font-size: 1.25rem;
  margin: 0 0 12px;
}
.site-footer nav {
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
}
.footer-small {
  color: var(--ink-soft);
  font-size: 0.85rem;
  margin: 16px 0 0;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 48px;
  padding: 10px 22px;
  border: var(--border);
  border-radius: 999px;
  background: var(--white);
  color: var(--ink);
  box-shadow: var(--shadow);
  font-size: 1.05rem;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.08s ease, box-shadow 0.08s ease;
}
.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 5px 0 var(--ink);
}
.btn:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 var(--ink);
}
.btn-primary {
  background: var(--yellow);
}
.btn-big {
  min-height: 58px;
  padding: 14px 30px;
  font-size: 1.25rem;
}
.btn-small {
  min-height: 40px;
  padding: 6px 16px;
  font-size: 0.95rem;
}
.btn:disabled {
  cursor: progress;
  opacity: 0.8;
  transform: none;
}

/* ---------- Hero ---------- */
.hero {
  max-width: 1120px;
  margin: 0 auto;
  padding: 16px 16px 8px;
  display: grid;
  gap: 24px;
  align-items: center;
}
.hero h1 {
  font-size: clamp(2.8rem, 11vw, 4.6rem);
  margin-bottom: 0.25em;
}
.hero-tagline {
  display: block;
  font-size: 0.55em;
  margin-top: 0.15em;
  color: var(--ink);
}
.hero-tagline::after {
  content: "";
  display: block;
  width: 3.4em;
  height: 0.28em;
  margin-top: 0.12em;
  background: var(--yellow);
  border-radius: 999px;
}
.lede {
  font-size: 1.15rem;
  max-width: 32em;
  margin: 0 0 24px;
}
.hero-aside {
  font-family: var(--display);
  font-weight: 500;
  color: var(--ink-soft);
  margin: 18px 0 0;
  transform: rotate(-1.5deg);
  width: fit-content;
}

.hero-pond {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 28px 12px 20px;
  background: var(--pond);
  border: var(--border);
  border-radius: 48% 52% 46% 54% / 56% 58% 42% 44%;
}
.pond-duck {
  width: 17%;
  margin: 0 -1.5%;
  animation: bob 3.2s ease-in-out infinite;
}
.pond-duck-1 { animation-delay: -0.4s; width: 23%; z-index: 1; } /* the seasonal duck leads the parade */
.pond-duck-2 { animation-delay: -1.6s; }
.pond-duck-3 { animation-delay: -0.9s; width: 16%; }
.pond-duck-4 { animation-delay: -2.2s; width: 18%; }
.pond-duck-5 { animation-delay: -1.2s; width: 16%; }
.pond-duck-6 { animation-delay: -2.7s; }

@keyframes bob {
  0%, 100% { transform: translateY(0) rotate(-2deg); }
  50% { transform: translateY(-6px) rotate(2deg); }
}

/* ---------- Creator ---------- */
.creator,
.how {
  max-width: 1120px;
  margin: 0 auto;
  padding: 40px 16px 0;
  scroll-margin-top: 8px;
}
.section-title {
  font-size: clamp(2rem, 7vw, 2.8rem);
  text-align: center;
  margin-bottom: 20px;
}
.notice {
  max-width: 640px;
  margin: 0 auto 20px;
  padding: 12px 16px;
  background: var(--pond);
  border: var(--border);
  border-radius: 16px;
  text-align: center;
}
.notice-error {
  background: #ffe3d6;
}

/* One small, single-column card. */
.duck-form {
  max-width: 520px;
  margin: 0 auto;
  padding: 20px 18px 22px;
  background: var(--white);
  border: var(--border);
  border-radius: 28px;
  box-shadow: 0 6px 0 var(--ink);
}
fieldset {
  border: 0;
  margin: 0;
  padding: 0;
  min-width: 0;
}
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* Duck picker: all ducks in one row, always. */
.duck-picker {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 4px;
  margin: 0 -6px;
}
.duck-option {
  cursor: pointer;
}
.duck-option input,
.currency input,
.segmented input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.duck-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 6px 2px 8px;
  border: 2px solid transparent;
  border-radius: 16px;
  transition: background 0.15s ease;
}
.duck-card img {
  width: 100%;
  max-width: 72px;
  height: auto;
}
.duck-name {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(0.7rem, 3.2vw, 0.9rem);
  line-height: 1.1;
  white-space: nowrap;
}
.duck-option:hover .duck-card {
  background: var(--cream);
}
.duck-option input:checked + .duck-card {
  background: var(--yellow);
  border-color: var(--ink);
}
.duck-option input:checked + .duck-card img {
  animation: bob 1.6s ease-in-out infinite;
}
.duck-option input:focus-visible + .duck-card {
  outline: 3px solid var(--orange);
  outline-offset: 2px;
}
.duck-blurb {
  margin: 10px 0 18px;
  font-size: 0.95rem;
  text-align: center;
  color: var(--ink-soft);
}
.duck-blurb strong {
  color: var(--ink);
}

/* Fields */
.field {
  position: relative;
  margin-bottom: 16px;
}
.field > label:not(.check),
.label-row label,
.label {
  display: block;
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.05rem;
  margin-bottom: 4px;
  padding: 0;
}
.label-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}
.link-button {
  font: inherit;
  font-size: 0.9rem;
  color: var(--ink);
  background: none;
  border: 0;
  padding: 0;
  text-decoration: underline;
  text-decoration-color: var(--orange);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
  cursor: pointer;
}
input[type="text"],
input[type="email"],
textarea {
  width: 100%;
  font: inherit;
  font-size: 1.05rem; /* ≥16px so iOS doesn't zoom */
  color: var(--ink);
  background: var(--cream);
  border: 2px solid var(--ink);
  border-radius: 14px;
  padding: 10px 12px;
}
textarea {
  resize: vertical;
  min-height: 84px;
}
input:focus,
textarea:focus {
  outline: none;
  background: var(--white);
  box-shadow: 0 0 0 4px var(--yellow);
}
input:disabled {
  opacity: 0.5;
}
[aria-invalid="true"] {
  border-color: var(--error);
}
.field-error {
  color: var(--error);
  font-weight: 600;
  font-size: 0.9rem;
  margin: 4px 0 0;
}
.hint {
  color: var(--ink-soft);
  font-size: 0.9rem;
  margin: 6px 0 0;
}
.textarea-wrap {
  position: relative;
}
.textarea-wrap textarea {
  display: block;
  padding-bottom: 26px;
}
.counter {
  position: absolute;
  right: 28px; /* clear of the resize handle */
  bottom: 8px;
  font-size: 0.8rem;
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
  pointer-events: none;
}
.counter.over {
  color: var(--error);
  font-weight: 700;
}
.check {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  margin-top: 8px;
  font-size: 0.95rem;
  cursor: pointer;
}
.check input {
  width: 20px;
  height: 20px;
  accent-color: var(--ink);
}

/* Segmented controls: delivery method and currency */
.segmented,
.currency {
  display: flex;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: var(--cream);
  padding: 3px;
}
.segmented label {
  flex: 1;
}
.segmented span,
.currency span {
  display: block;
  text-align: center;
  padding: 7px 10px;
  border-radius: 999px;
  font-weight: 600;
  cursor: pointer;
}
.segmented input:checked + span,
.currency input:checked + span {
  background: var(--ink);
  color: var(--white);
}
.segmented input:focus-visible + span,
.currency input:focus-visible + span {
  outline: 3px solid var(--orange);
}

/* Compact live preview */
.preview {
  display: flex;
  gap: 12px;
  align-items: center;
  margin: 20px 0 18px;
  padding: 12px 14px;
  background: var(--pond);
  border-radius: 18px;
}
.preview-duck {
  flex: none;
  width: 76px;
  height: 76px;
}
.preview-text {
  min-width: 0;
}
.preview-text p {
  margin: 0;
  overflow-wrap: anywhere;
}
.preview-title {
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.1rem;
  line-height: 1.2;
}
.preview-message {
  margin: 4px 0 !important;
  white-space: pre-line;
}
.preview-from {
  font-size: 0.85rem;
  font-style: italic;
  color: var(--ink-soft);
}

/* Pay */
.btn-pay {
  width: 100%;
}
.btn-pay.is-loading {
  animation: pulse 1s ease-in-out infinite;
}
@keyframes pulse {
  50% { background: var(--yellow-deep); }
}
.pay-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
}
.currency {
  flex: none;
  font-size: 0.85rem;
}
.currency span {
  padding: 4px 10px;
}
.fine-print {
  font-size: 0.8rem;
  line-height: 1.35;
  color: var(--ink-soft);
}
.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* ---------- The duck letter (preview, success, recipient) ---------- */
.duck-letter {
  position: relative;
  background: var(--white);
  border: var(--border);
  border-radius: 28px;
  padding: 0 20px 22px;
  text-align: center;
  overflow: hidden;
  box-shadow: 0 6px 0 var(--ink);
}
.duck-letter::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 150px;
  background: var(--pond);
  border-bottom: var(--border);
  border-radius: 0 0 50% 50% / 0 0 26px 26px;
}
.letter-duck {
  position: relative;
  width: 170px;
  height: 170px;
  margin: 18px auto 4px;
  display: block;
}
.bob {
  animation: bob 2.6s ease-in-out infinite;
}
.letter-title {
  font-size: clamp(1.6rem, 6.5vw, 2.3rem);
  margin: 8px 0 12px;
  overflow-wrap: anywhere;
}
.letter-meet {
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.3rem;
  margin: 0 0 6px;
}
.letter-intro {
  margin: 0 auto 6px;
  max-width: 30em;
}
.letter-message {
  position: relative;
  margin: 20px 0 14px;
  padding: 18px 20px;
  background: var(--cream);
  border: var(--border);
  border-radius: 20px;
  font-family: var(--display);
  font-weight: 500;
  font-size: 1.3rem;
  line-height: 1.35;
  white-space: pre-line;
  overflow-wrap: anywhere;
}
.letter-message::before {
  content: "";
  position: absolute;
  top: -12px;
  left: 50%;
  width: 20px;
  height: 20px;
  margin-left: -10px;
  background: var(--cream);
  border-left: var(--border);
  border-top: var(--border);
  transform: rotate(45deg);
}
.letter-from {
  font-style: italic;
  margin: 0;
  overflow-wrap: anywhere;
}
.duck-number {
  display: inline-block;
  margin: 16px 0 0;
  padding: 3px 12px;
  border: 2px dashed var(--ink-soft);
  border-radius: 999px;
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
  color: var(--ink-soft);
  letter-spacing: 0.04em;
}

/* ---------- Recipient ---------- */
.recipient,
.success {
  max-width: 620px;
  margin: 0 auto;
  padding: 8px 16px 0;
}
.recipient .letter-duck {
  width: 210px;
  height: 210px;
}
.recipient .duck-letter::before {
  height: 180px;
}
.recipient-actions {
  display: grid;
  gap: 14px;
  margin: 28px 0 16px;
}
.recipient-small {
  text-align: center;
  color: var(--ink-soft);
  font-size: 0.9rem;
}

/* ---------- Success ---------- */
.success {
  position: relative;
}
.success-title {
  text-align: center;
  font-size: clamp(2.2rem, 9vw, 3.2rem);
  margin: 10px 0 14px;
}
.email-status {
  text-align: center;
  margin: 0 auto 16px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 2px solid var(--ink);
  background: var(--pond);
  width: fit-content;
  max-width: 100%;
  font-weight: 600;
}
.email-sent {
  background: #d9f3d0;
}
.email-failed {
  background: #ffe3d6;
}
.share-box {
  background: var(--yellow);
  border: var(--border);
  border-radius: var(--radius);
  padding: 18px 16px;
  margin-bottom: 28px;
  box-shadow: var(--shadow);
}
.share-box > label {
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.15rem;
  display: block;
  margin-bottom: 8px;
}
.copy-row {
  display: grid;
  gap: 10px;
}
.copy-row input {
  background: var(--white);
  font-size: 1rem;
}
.share-buttons {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  margin-top: 12px;
}
.btn-whatsapp.btn-primary {
  background: #9be7a8;
}
.share-box .hint {
  color: var(--ink);
  opacity: 0.75;
}
.success-more {
  text-align: center;
  margin-top: 24px;
}

.confetti {
  position: absolute;
  inset: 0 0 auto;
  height: 0;
  pointer-events: none;
}
.confetti .c {
  position: absolute;
  top: -10px;
  width: 10px;
  height: 14px;
  border: 2px solid var(--ink);
  border-radius: 3px;
  animation: fall 2.4s ease-in forwards;
  opacity: 0;
}
.c0 { left: 6%; background: var(--yellow); animation-delay: 0.1s !important; }
.c1 { left: 20%; background: var(--orange); animation-delay: 0.5s !important; }
.c2 { left: 34%; background: var(--pond); animation-delay: 0.2s !important; }
.c3 { left: 50%; background: #ff8fb1; animation-delay: 0.7s !important; }
.c4 { left: 64%; background: var(--yellow); animation-delay: 0.3s !important; }
.c5 { left: 78%; background: #7b5ea7; animation-delay: 0.6s !important; }
.c6 { left: 92%; background: var(--orange); animation-delay: 0s !important; }
.confetti .c:nth-child(n + 8) {
  margin-left: 4%;
  animation-duration: 2.9s;
}
@keyframes fall {
  0% { opacity: 1; transform: translateY(0) rotate(0); }
  100% { opacity: 0; transform: translateY(360px) rotate(540deg); }
}

/* ---------- Generic cards & prose ---------- */
.center-card {
  max-width: 560px;
  margin: 24px auto 0;
  padding: 28px 20px;
  text-align: center;
  background: var(--white);
  border: var(--border);
  border-radius: 28px;
  box-shadow: 0 6px 0 var(--ink);
}
.center-card + * {
  margin-top: 24px;
}
.sad-duck {
  width: 140px;
  filter: saturate(0.85);
  transform: rotate(-8deg);
}
.report-form {
  display: grid;
  gap: 4px;
  text-align: left;
  max-width: 360px;
  margin: 16px auto 0;
}
.report-form .btn {
  margin-top: 16px;
}
.prose {
  max-width: 680px;
  margin: 0 auto;
  padding: 16px 16px 0;
}
.prose h1 {
  font-size: 2.6rem;
}
.prose h2 {
  font-size: 1.4rem;
  margin-top: 1.6em;
}
.placeholder {
  background: #fff1b8;
  border-radius: 6px;
  padding: 0 4px;
}

/* ---------- How it works ---------- */
.how-steps {
  list-style: none;
  padding: 0;
  margin: 0 0 32px;
  display: grid;
  gap: 16px;
}
.how-steps li {
  display: grid;
  grid-template-columns: 72px 1fr;
  grid-template-rows: auto auto;
  column-gap: 14px;
  align-items: center;
  padding: 14px 16px;
  background: var(--white);
  border: var(--border);
  border-radius: var(--radius);
}
.how-steps img {
  grid-row: span 2;
  width: 72px;
  height: 72px;
}
.how-steps strong {
  font-family: var(--display);
  font-size: 1.2rem;
  align-self: end;
}
.how-steps span {
  color: var(--ink-soft);
  align-self: start;
}
.faq {
  max-width: 680px;
  margin: 0 auto;
}
.faq details {
  border-bottom: 2px dashed var(--pond-deep);
  padding: 14px 4px;
}
.faq summary {
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.15rem;
  cursor: pointer;
}
.faq p {
  margin: 8px 0 0;
}

/* ---------- Wider screens ---------- */
@media (min-width: 560px) {
  .copy-row {
    grid-template-columns: 1fr auto;
  }
  .recipient-actions {
    grid-template-columns: 1fr 1fr;
  }
  .recipient-actions .btn-big {
    font-size: 1.1rem;
    padding: 14px 18px;
  }
}

@media (min-width: 760px) {
  .how-steps {
    grid-template-columns: repeat(3, 1fr);
  }
  .how-steps li {
    grid-template-columns: 1fr;
    text-align: center;
    justify-items: center;
    padding: 20px;
  }
  .how-steps img {
    grid-row: auto;
    width: 96px;
    height: 96px;
  }
}

@media (min-width: 960px) {
  .hero {
    grid-template-columns: 1.05fr 1fr;
    padding-top: 40px;
    gap: 40px;
  }
  .hero-pond {
    padding: 56px 20px 44px;
  }
}

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

.recipient-report {
  margin-top: 4px;
  font-size: 0.8rem;
}
