/* ══════════════════════════════════════════════════════════════
   LANDRIFUL — Party Invite & RSVP Page
   
   ALL colors, fonts, and sizing live in :root below.
   Swap those values to completely re-theme the page.
   ══════════════════════════════════════════════════════════════ */

/* ─── FONTS ────────────────────────────────────────────────── */
/* Download Alte Haas Grotesk (.ttf) and place in assets/fonts/  */
/* https://www.fontsquirrel.com/fonts/alte-haas-grotesk          */
@font-face {
  font-family: 'Alte Haas Grotesk';
  src: url('assets/fonts/AlteHaasGroteskRegular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Alte Haas Grotesk';
  src: url('assets/fonts/AlteHaasGroteskBold.ttf') format('truetype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* ─── THEME TOKENS ─────────────────────────────────────────── */
:root {
  /* Colors */
  --bg-color:        #e8f5e2;
  --surface-color:   #f7fdf4;
  --surface-hover:   #edf8e8;
  --border-color:    #b8d9b0;
  --text-primary:    #1e3a1e;
  --text-secondary:  #3d5c3d;
  --text-muted:      #7a9e7a;
  --accent-color:    #b85c72;
  --accent-hover:    #a04060;
  --accent-glow:     rgba(184, 92, 114, 0.25);
  --going-color:     #3a7d44;
  --maybe-color:     #c9863a;
  --not-going-color: #8a9e8a;
  --success-bg:      rgba(58, 125, 68, 0.08);
  --success-border:  rgba(58, 125, 68, 0.3);

  /* Typography */
  --font-heading:    'IM Fell English', Georgia, serif;
  --font-body:       'IM Fell English', Georgia, serif;
  --font-mono:       monospace;

  /* Ink bleed — simulates letterpress ink spread on headings */
  --ink-shadow:      0px 0px 1.5px rgba(20, 50, 20, 0.45),
                     0px 0px 3px   rgba(20, 50, 20, 0.18);

  /* Sizing */
  --max-width:       600px;
  --radius-sm:       8px;
  --radius-md:       14px;
  --radius-lg:       20px;
  --radius-pill:     100px;

  /* Transitions */
  --transition:      0.2s ease;
}

/* ─── RESET & BASE ──────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ─── FILM OVERLAY CANVAS ────────────────────────────────────── */
#film-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9999;
}

/* ─── WATERMARK ──────────────────────────────────────────────── */
.watermark {
  position: fixed;
  bottom: 18px;
  right: 22px;
  font-family: 'Nunito', system-ui, sans-serif;
  font-weight: 800;
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  color: var(--text-primary);
  opacity: 0.13;
  pointer-events: none;
  user-select: none;
  z-index: 10000;
}

html {
  scroll-behavior: smooth;
}

body {
  background-color: var(--bg-color);
  background-image:
    radial-gradient(ellipse at 10% 20%,  rgba(183, 228, 199, 0.55) 0%, transparent 55%),
    radial-gradient(ellipse at 90% 10%,  rgba(186, 225, 255, 0.50) 0%, transparent 50%),
    radial-gradient(ellipse at 75% 80%,  rgba(255, 243, 160, 0.45) 0%, transparent 50%),
    radial-gradient(ellipse at 20% 85%,  rgba(186, 225, 255, 0.40) 0%, transparent 45%),
    radial-gradient(ellipse at 50% 50%,  rgba(220, 248, 210, 0.30) 0%, transparent 70%);
  background-attachment: fixed;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

/* ─── LAYOUT ────────────────────────────────────────────────── */
.page-wrapper {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 16px 80px;
}

/* ─── CARDS ─────────────────────────────────────────────────── */
.card {
  background: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  margin-top: 20px;
}

.card h2 {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  margin-bottom: 16px;
  color: var(--text-primary);
  text-shadow: var(--ink-shadow);
}

.card p {
  color: var(--text-secondary);
  margin-bottom: 12px;
  line-height: 1.7;
}

.card ul {
  color: var(--text-secondary);
  line-height: 1.7;
  padding-left: 1.4em;
  margin-top: 6px;
  margin-bottom: 0;
}

.card ul li {
  margin-bottom: 4px;
}

.card p:last-child {
  margin-bottom: 0;
}

/* ─── HERO ──────────────────────────────────────────────────── */
#hero {
  text-align: center;
  padding-top: 32px;
}

.flyer-container {
  width: 100%;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--surface-color);
  border: 1px solid var(--border-color);
  margin-bottom: 24px;
}

.flyer-img {
  display: block;
  width: 100%;
  height: auto;
}

.flyer-placeholder {
  display: none; /* shown via JS onerror */
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  height: 100%;
  color: var(--text-muted);
  font-size: 0.9rem;
  text-align: center;
  padding: 24px;
}

.flyer-placeholder span {
  font-size: 3rem;
}

.flyer-placeholder code {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  background: var(--border-color);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
}

.event-title {
  font-family: var(--font-heading);
  font-size: clamp(2rem, 8vw, 3rem);
  font-style: italic;
  font-weight: 400;
  letter-spacing: 0.01em;
  line-height: 1.15;
  margin-bottom: 16px;
  color: var(--text-primary);
  text-shadow: var(--ink-shadow);
}

.event-subheading {
  font-style: italic;
  font-size: 1.15rem;
  color: var(--text-secondary);
  margin-bottom: 18px;
  text-shadow: var(--ink-shadow);
}

.event-meta {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
}

.meta-item {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.meta-link {
  color: var(--text-secondary);
  text-decoration: underline;
  text-decoration-style: dotted;
  text-underline-offset: 3px;
  transition: color var(--transition);
}

.meta-link:hover {
  color: var(--accent-color);
}

.meta-icon {
  font-size: 1rem;
  flex-shrink: 0;
}

/* ─── RSVP FORM ─────────────────────────────────────────────── */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 8px;
}

input[type="text"] {
  width: 100%;
  padding: 13px 16px;
  background: var(--bg-color);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 1rem;
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}

input[type="text"]::placeholder {
  color: var(--text-muted);
}

input[type="text"]:focus {
  border-color: var(--accent-color);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

input[type="text"].invalid {
  border-color: var(--accent-color);
}

.field-error {
  display: block;
  font-size: 0.8rem;
  color: var(--accent-color);
  margin-top: 6px;
  min-height: 1em;
}

/* Status radio options */
.status-options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.status-option {
  cursor: pointer;
}

.status-option input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.status-option span {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 6px;
  background: var(--bg-color);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-align: center;
  transition: border-color var(--transition), color var(--transition), background var(--transition);
  user-select: none;
}

.status-option input[type="radio"]:checked + span {
  border-color: var(--accent-color);
  color: var(--text-primary);
  background: rgba(184, 92, 114, 0.1);
}

.status-option:hover span {
  border-color: var(--text-muted);
  color: var(--text-primary);
}

/* Submit button */
.btn-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 15px 24px;
  background: var(--accent-color);
  color: #fffdf7;
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
  margin-top: 4px;
}

.btn-primary:hover:not(:disabled) {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 20px var(--accent-glow);
}

.btn-primary:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: none;
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-link {
  background: none;
  border: none;
  color: var(--accent-color);
  font-family: var(--font-body);
  font-size: 0.88rem;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.btn-link:hover {
  color: var(--accent-hover);
}

/* Spinner */
.spinner {
  width: 18px;
  height: 18px;
  border: 2.5px solid rgba(255,253,247,0.3);
  border-top-color: #fffdf7;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  flex-shrink: 0;
}

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

/* Success state */
.rsvp-success {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
  padding: 24px 16px;
  background: var(--success-bg);
  border: 1px solid var(--success-border);
  border-radius: var(--radius-md);
  margin-bottom: 4px;
  animation: fadeIn 0.4s ease;
}

.rsvp-success[hidden] {
  display: none;
}

.success-icon {
  font-size: 2.4rem;
}

.rsvp-success p {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

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

/* ─── GUEST LIST ────────────────────────────────────────────── */
.guestlist-locked {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 28px 16px;
  text-align: center;
  color: var(--text-muted);
}

.guestlist-locked .lock-icon {
  font-size: 2rem;
  opacity: 0.7;
}

.guestlist-locked p {
  font-size: 1rem;
  font-style: italic;
  color: var(--text-muted);
  margin: 0;
}

#guestlist-unlocked {
  animation: fadeIn 0.4s ease;
}

.guestlist-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

.guestlist-header h2 {
  margin-bottom: 0;
}

.rsvp-counts {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 500;
}

.status-group {
  margin-bottom: 20px;
}

.status-group:last-of-type {
  margin-bottom: 0;
}

.status-label {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 10px;
}

.status-label.going      { color: var(--going-color); }
.status-label.maybe      { color: var(--maybe-color); }
.status-label.not-going  { color: var(--not-going-color); }

.chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  font-size: 0.88rem;
  font-weight: 500;
  animation: chipIn 0.25s ease;
}

@keyframes chipIn {
  from { opacity: 0; transform: scale(0.88); }
  to   { opacity: 1; transform: scale(1); }
}

.chip.going {
  background: rgba(58, 125, 68, 0.1);
  border: 1px solid rgba(58, 125, 68, 0.3);
  color: var(--going-color);
}

.chip.maybe {
  background: rgba(201, 134, 58, 0.1);
  border: 1px solid rgba(201, 134, 58, 0.3);
  color: var(--maybe-color);
}

.chip.not-going {
  background: rgba(138, 158, 138, 0.1);
  border: 1px solid rgba(138, 158, 138, 0.25);
  color: var(--not-going-color);
}

.chip.is-you::after {
  content: ' (you)';
  opacity: 0.65;
  font-size: 0.8em;
}

/* Loading dots */
.loading-state {
  display: flex;
  justify-content: center;
  padding: 24px 0;
}

.loading-dots {
  display: flex;
  gap: 6px;
  align-items: center;
}

.loading-dots span {
  width: 7px;
  height: 7px;
  background: var(--text-muted);
  border-radius: 50%;
  animation: bounce 1.2s ease infinite;
}

.loading-dots span:nth-child(2) { animation-delay: 0.2s; }
.loading-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes bounce {
  0%, 100% { transform: translateY(0); opacity: 0.4; }
  50%       { transform: translateY(-5px); opacity: 1; }
}

.empty-state {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
  padding: 12px 0;
}

/* ─── RESPONSIVE ─────────────────────────────────────────────── */
@media (max-width: 400px) {
  .status-options {
    grid-template-columns: 1fr;
  }

  .card {
    padding: 22px 18px;
  }
}
