/* =========================================================
   Bomba's 35th — Message Collection Site
   Palette + base tokens (matches the birthday site)
   ========================================================= */
:root {
  /* Palette */
  --burgundy: #5c1a2b;
  --burgundy-deep: #3d0f1c;
  --cream: #fdf6ec;
  --cream-soft: #f7ead9;
  --blush: #f3c6c6;
  --peach: #f6d3b3;
  --chocolate: #3a241c;
  --gold: #c9a24b;
  --gold-soft: #e3c67e;

  /* Text */
  --ink: #2c1a14;
  --ink-soft: #6b4a3e;
  --ink-on-dark: #fdf6ec;

  /* Surfaces */
  --card-bg: #fffaf3;
  --card-border: rgba(92, 26, 43, 0.12);
  --shadow-sm: 0 4px 14px rgba(61, 15, 28, 0.08);
  --shadow-md: 0 12px 34px rgba(61, 15, 28, 0.14);
  --shadow-lg: 0 24px 60px rgba(61, 15, 28, 0.22);

  /* Layout */
  --radius: 20px;
  --radius-lg: 28px;
  --maxw: 640px;
  --gutter: 1.15rem;

  /* Type */
  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-hand: "Caveat", "Segoe Script", cursive;

  /* Motion */
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* =========================================================
   Reset / base
   ========================================================= */
*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: linear-gradient(180deg, var(--cream) 0%, var(--cream-soft) 100%);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  display: block;
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  line-height: 1.12;
  margin: 0;
}

p {
  margin: 0;
}

button {
  font-family: inherit;
  cursor: pointer;
}

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

.heart {
  display: inline-block;
}

/* =========================================================
   Buttons
   ========================================================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border: none;
  border-radius: 999px;
  padding: 0.95rem 1.6rem;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-decoration: none;
  transition:
    transform 0.2s var(--ease),
    box-shadow 0.2s var(--ease),
    background 0.2s var(--ease);
  min-height: 48px;
  touch-action: manipulation;
}

.btn--primary {
  background: linear-gradient(135deg, var(--burgundy), var(--burgundy-deep));
  color: var(--ink-on-dark);
  box-shadow: var(--shadow-md);
}

.btn--primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}
.btn--primary:active {
  transform: translateY(0) scale(0.98);
}

.btn--primary:disabled {
  opacity: 0.6;
  cursor: default;
  transform: none;
}

.btn--ghost-dark {
  background: transparent;
  color: var(--burgundy);
  border: 2px solid rgba(92, 26, 43, 0.35);
}

.btn--ghost-dark:hover {
  background: rgba(92, 26, 43, 0.06);
  transform: translateY(-2px);
}

.btn--block {
  width: 100%;
}

/* =========================================================
   Hero
   ========================================================= */
.hero {
  position: relative;
  overflow: hidden;
  padding: calc(3rem + env(safe-area-inset-top)) var(--gutter) 3rem;
  background: radial-gradient(
    120% 90% at 50% 0%,
    #7a2438 0%,
    var(--burgundy) 45%,
    var(--burgundy-deep) 100%
  );
  color: var(--ink-on-dark);
  text-align: center;
}

.hero__grain {
  position: absolute;
  inset: 0;
  opacity: 0.16;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E");
}

.hero__inner {
  position: relative;
  max-width: 34rem;
  margin: 0 auto;
  animation: rise 0.9s var(--ease) both;
}

.hero__kicker {
  font-family: var(--font-hand);
  font-size: 1.5rem;
  color: var(--gold-soft);
  margin-bottom: 0.6rem;
}

.hero__title {
  font-size: clamp(1.9rem, 8.5vw, 3rem);
  font-weight: 700;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

.hero__sub {
  margin: 1.1rem auto 1.8rem;
  max-width: 30rem;
  font-size: 1.02rem;
  color: rgba(253, 246, 236, 0.9);
}

.hero__hint {
  margin-top: 1.4rem;
  font-family: var(--font-hand);
  font-size: 1.25rem;
  color: var(--gold-soft);
  opacity: 0.85;
}

.confetti-layer {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.confetti-piece {
  position: absolute;
  top: -12vh;
  width: 10px;
  height: 14px;
  border-radius: 2px;
  opacity: 0.95;
  animation: fall linear forwards;
}

@keyframes fall {
  to {
    transform: translateY(115vh) rotate(720deg);
    opacity: 0.9;
  }
}

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

/* =========================================================
   Sections
   ========================================================= */
.main {
  position: relative;
  z-index: 1;
}

.section {
  position: relative;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 2.6rem var(--gutter);
}

.section__head {
  text-align: center;
  margin-bottom: 1.6rem;
}

.section__kicker {
  font-family: var(--font-hand);
  font-size: 1.35rem;
  color: var(--burgundy);
  margin-bottom: 0.35rem;
}

.section__title {
  font-size: clamp(1.5rem, 6.4vw, 2.15rem);
  font-weight: 700;
  color: var(--chocolate);
  text-wrap: balance;
}

.section__lead {
  margin: 0.8rem auto 0;
  max-width: 30rem;
  color: var(--ink-soft);
  font-size: 0.96rem;
}

/* =========================================================
   Cards
   ========================================================= */
.card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 1.4rem;
  box-shadow: var(--shadow-sm);
}

/* =========================================================
   Form
   ========================================================= */
.form {
  display: grid;
  gap: 1.15rem;
  padding: 1.5rem 1.25rem;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}

.field {
  display: grid;
  gap: 0.4rem;
}

.field__label {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--chocolate);
}

.field__req {
  color: var(--burgundy);
}

.field__input {
  width: 100%;
  font-family: inherit;
  font-size: 1rem;
  color: var(--ink);
  background: #fffdf9;
  border: 1.5px solid rgba(92, 26, 43, 0.18);
  border-radius: 14px;
  padding: 0.85rem 0.95rem;
  transition:
    border-color 0.2s var(--ease),
    box-shadow 0.2s var(--ease);
  -webkit-appearance: none;
  appearance: none;
}

.field__input::placeholder {
  color: rgba(107, 74, 62, 0.55);
}

.field__input:focus {
  outline: none;
  border-color: var(--burgundy);
  box-shadow: 0 0 0 4px rgba(92, 26, 43, 0.12);
}

.field__input--area {
  resize: vertical;
  min-height: 8rem;
  line-height: 1.55;
}

.field__input.is-invalid {
  border-color: #b3261e;
  box-shadow: 0 0 0 4px rgba(179, 38, 30, 0.1);
}

.field__hint {
  font-size: 0.82rem;
  color: var(--ink-soft);
}

.field__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.field__error {
  font-size: 0.82rem;
  color: #b3261e;
  min-height: 1.1em;
}

.field__count {
  font-size: 0.78rem;
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.form__note {
  text-align: center;
  font-size: 0.82rem;
  color: var(--ink-soft);
}

/* Honeypot — hidden from humans */
.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* =========================================================
   Success card
   ========================================================= */
.success {
  text-align: center;
  padding: 2rem 1.4rem;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  animation: rise 0.5s var(--ease) both;
}

.success[hidden] {
  display: none;
}

.success__emoji {
  font-size: 2.6rem;
  display: block;
  margin-bottom: 0.5rem;
}

.success__title {
  font-size: 1.5rem;
  color: var(--burgundy);
  margin-bottom: 0.5rem;
}

.success__text {
  color: var(--ink-soft);
  margin-bottom: 1.4rem;
}

/* =========================================================
   Loader overlay
   ========================================================= */
.loader {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: grid;
  place-items: center;
  padding: var(--gutter);
  background: rgba(30, 8, 15, 0.55);
  backdrop-filter: blur(3px);
}

.loader[hidden] {
  display: none;
}

.loader__box {
  display: grid;
  justify-items: center;
  gap: 1rem;
  padding: 1.8rem 2rem;
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  animation: rise 0.3s var(--ease) both;
}

.loader__spinner {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 4px solid rgba(92, 26, 43, 0.15);
  border-top-color: var(--burgundy);
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.loader__text {
  font-family: var(--font-hand);
  font-size: 1.3rem;
  color: var(--chocolate);
}

/* =========================================================
   Result popup
   ========================================================= */
.modal {
  position: fixed;
  inset: 0;
  z-index: 310;
  display: grid;
  place-items: center;
  padding: var(--gutter);
}

.modal[hidden] {
  display: none;
}

.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(30, 8, 15, 0.6);
  backdrop-filter: blur(3px);
}

.modal__box {
  position: relative;
  max-width: 26rem;
  width: 100%;
  text-align: center;
  padding: 2rem 1.5rem;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  animation: rise 0.4s var(--ease) both;
}

.modal__emoji {
  font-size: 2.8rem;
  display: block;
  margin-bottom: 0.6rem;
}

.modal__title {
  font-size: 1.5rem;
  color: var(--burgundy);
  margin-bottom: 0.5rem;
}

.modal__text {
  color: var(--ink-soft);
  margin-bottom: 1.4rem;
  overflow-wrap: anywhere;
}

.modal--error .modal__title {
  color: #b3261e;
}

/* =========================================================
   Footer
   ========================================================= */
.footer {
  text-align: center;
  padding: 1.6rem var(--gutter) calc(1.6rem + env(safe-area-inset-bottom));
  background: var(--burgundy-deep);
  color: rgba(253, 246, 236, 0.7);
  font-size: 0.82rem;
}

/* =========================================================
   Floating hearts
   ========================================================= */
.floaters {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.floater {
  position: absolute;
  bottom: -3rem;
  left: var(--x);
  font-size: var(--s);
  color: rgba(92, 26, 43, 0.16);
  animation: floatUp 14s linear infinite;
  animation-delay: var(--d);
}

@keyframes floatUp {
  0% {
    transform: translateY(0) rotate(0deg);
    opacity: 0;
  }
  10% {
    opacity: 1;
  }
  90% {
    opacity: 1;
  }
  100% {
    transform: translateY(-108vh) rotate(40deg);
    opacity: 0;
  }
}

/* =========================================================
   Responsive
   ========================================================= */
@media (min-width: 560px) {
  .form {
    padding: 2rem 1.8rem;
  }
}

@media (min-width: 820px) {
  :root {
    --maxw: 700px;
  }
  .section {
    padding: 3.4rem var(--gutter);
  }
}

/* =========================================================
   Reduced motion
   ========================================================= */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .floater {
    display: none;
  }
}
