/* ─────────────────────────────────────────────────────────────────────
   style.css — RSVP styles. Shares the animated background and crayon
   system with the main martins.fyi landing page.
   ───────────────────────────────────────────────────────────────────── */

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

html, body { min-height: 100%; }

body {
  font-family: 'Bricolage Grotesque', Georgia, serif;
  font-optical-sizing: auto;
  font-size: 15px;
  line-height: 1.74;
  color: #1e1b17;
  background: #08125b;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── Page shell ───────────────────────────────────────────────────────
   #wrap is the positioned root. Background layers sit behind, the card
   sits inside <main> on top. */
#wrap {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

/* ── Animated background ──────────────────────────────────────────────
   Same two independent cycles as the main site: 226s color drift and a
   slower (530s) brightness drift — combined, they never repeat. */
#bg {
  position: absolute; inset: 0; z-index: 0;
  animation:
    bg-colors     226s linear      infinite,
    bg-brightness 530s ease-in-out infinite;
}
@keyframes bg-colors {
  0%    { background-color: #08125b; }
  12.5% { background-color: #1e0549; }
  25%   { background-color: #072612; }
  37.5% { background-color: #041f28; }
  50%   { background-color: #14052f; }
  62.5% { background-color: #300515; }
  75%   { background-color: #270e00; }
  87.5% { background-color: #081245; }
  100%  { background-color: #08125b; }
}
@keyframes bg-brightness {
  0%   { filter: brightness(1.10); }
  14%  { filter: brightness(1.25); }
  28%  { filter: brightness(0.80); }
  42%  { filter: brightness(0.50); }
  55%  { filter: brightness(0.25); }
  66%  { filter: brightness(0.18); }
  76%  { filter: brightness(0.35); }
  88%  { filter: brightness(0.72); }
  100% { filter: brightness(1.10); }
}

/* Warm paper overlay */
#overlay {
  position: absolute; inset: 0; z-index: 2;
  background: rgba(204, 196, 178, 0.12);
}

/* Grain — generated as a canvas tile in bg.js, opacity breathes */
#grain {
  position: absolute; inset: 0; z-index: 3;
  pointer-events: none;
  background-size: 180px 180px;
  animation: grain-breathe 28s ease-in-out infinite alternate;
}
@keyframes grain-breathe {
  from { opacity: 0.14; }
  to   { opacity: 0.38; }
}

/* Crayon drawings canvas */
#crayon {
  position: absolute; top: 0; left: 0;
  z-index: 8; pointer-events: none;
}

main {
  position: relative; z-index: 9;
  padding: 20px; width: 100%;
  display: flex; align-items: center; justify-content: center;
}

/* ── Card ─────────────────────────────────────────────────────────── */

.card {
  background: rgba(205, 200, 188, 0.48);
  border: 4px solid #8a3a00;
  padding: 32px 36px;
  max-width: 420px;
  width: 100%;
  font-weight: 500;
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  box-shadow:
    inset 6px 6px 20px rgba(0, 0, 0, 0.65),
    inset -2px -2px 8px rgba(255, 255, 255, 0.05);
}

.card h1 {
  font-weight: 500;
  font-size: 22px;
  line-height: 1.25;
  letter-spacing: -0.005em;
  margin: 0 0 0.18em;
}

.meta {
  margin: 0 0 0.7em;
  font-size: 14px;
  opacity: 0.78;
}

.description {
  margin: 0 0 1.6em;
}

.card p + p { margin-top: 0.7em; }

.fine {
  opacity: 0.62;
  font-size: 13px;
  margin: 1.5em 0 0;
}

/* ── Form ─────────────────────────────────────────────────────────── */

form label {
  display: block;
  margin-bottom: 14px;
}
form label > span {
  display: block;
  font-size: 14px;
  opacity: 0.78;
  margin-bottom: 4px;
}
form input[type=text],
form input[type=email] {
  width: 100%;
  border: 1px solid rgba(30, 27, 23, 0.32);
  background: rgba(30, 27, 23, 0.20);
  padding: 9px 12px;
  font: inherit;
  font-weight: 500;
  color: #1e1b17;
  outline: none;
  border-radius: 6px;
  transition: background 0.2s ease, border-color 0.2s ease;
}
form input[type=text]:focus,
form input[type=email]:focus {
  background: rgba(30, 27, 23, 0.28);
  border-color: rgba(30, 27, 23, 0.55);
}

/* Override the browser's white/yellow autofill background. The very long
   `transition` on background-color is a known trick: when the browser tries
   to swap our `rgba(30, 27, 23, 0.20)` background for its autofill colour,
   the change animates over 5000 seconds, so visually our original semi-
   transparent fill stays in place — pixel-identical to a manually-typed
   field. We only force the text and caret colors. */
form input[type=text]:-webkit-autofill,
form input[type=email]:-webkit-autofill,
form input[type=text]:-webkit-autofill:hover,
form input[type=email]:-webkit-autofill:hover,
form input[type=text]:-webkit-autofill:focus,
form input[type=email]:-webkit-autofill:focus,
form input[type=text]:-webkit-autofill:active,
form input[type=email]:-webkit-autofill:active {
  -webkit-text-fill-color: #1e1b17 !important;
  caret-color: #1e1b17;
  transition: background-color 5000s ease-in-out 0s !important;
}

/* honeypot — off-screen (not display:none — bots skip those) */
.hp {
  position: absolute;
  left: -9999px;
  top: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

form button {
  margin-top: 8px;
  background: transparent;
  color: #1e1b17;
  border: 1.5px solid rgba(30, 27, 23, 0.35);
  padding: 10px 22px;
  font: inherit;
  font-weight: 500;
  letter-spacing: 0.01em;
  cursor: pointer;
  border-radius: 8px;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
form button:hover {
  background: #8a3a00;
  color: #f4ede0;
  border-color: #8a3a00;
}

/* ── Error block ──────────────────────────────────────────────────── */

.errors {
  background: rgba(138, 58, 0, 0.10);
  border: 1px solid rgba(138, 58, 0, 0.45);
  padding: 10px 14px;
  margin-bottom: 1em;
  font-size: 14px;
}
.errors p { margin: 0; }

/* ── Status text ──────────────────────────────────────────────────── */

.status { font-size: 16px; margin: 0.6em 0 0.4em; }
.status strong { font-weight: 500; }
.status.wait strong      { color: #6f2e00; }
.status.cancelled strong { color: #6f2e00; opacity: 0.7; }

/* ── Links (matches main site hover glow) ─────────────────────────── */

a {
  color: #1e1b17;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  padding: 2px 5px;
  margin: 0 -5px;
  position: relative;
  z-index: 1;
  isolation: isolate;
  transition: color 0.7s ease;
}
a::after {
  content: '';
  position: absolute;
  inset: -7px -16px;
  border-radius: 50%;
  background: rgba(175, 72, 0, 0.72);
  filter: blur(13px);
  opacity: 0;
  transition: opacity 0.75s ease;
  z-index: -1;
  pointer-events: none;
}
a:hover { text-decoration: none; }
a:hover::after { opacity: 1; }
a.cancel { display: inline-block; margin-top: 6px; opacity: 0.85; font-size: 14px; }

/* ── Subtitles (film-style, matches the index page) ───────────────── */

#subtitle {
  position: fixed;
  bottom: 44px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  font-family: 'Bricolage Grotesque', Georgia, serif;
  font-size: 18px;
  font-weight: 500;
  color: #f0d800;
  text-align: center;
  pointer-events: none;
  filter: blur(0.6px);
  text-shadow:
    -1px -1px 0 #1a1006,
     1px -1px 0 #1a1006,
    -1px  1px 0 #1a1006,
     1px  1px 0 #1a1006,
     0   -1px 0 #1a1006,
     0    1px 0 #1a1006,
    -1px  0   0 #1a1006,
     1px  0   0 #1a1006;
  opacity: 0;
  transition: opacity 0.5s ease;
  max-width: 90vw;
  white-space: nowrap;
}
#subtitle.show { opacity: 1; }

@media (max-width: 500px) {
  #subtitle { font-size: 15px; white-space: normal; line-height: 1.3; }
}

/* ── Admin variant — solid bg, no animation ───────────────────────── */

body.admin {
  display: block;
  padding: 40px 20px;
}
body.admin main { display: block; max-width: 820px; margin: 0 auto; padding: 0; }
.admin-card {
  max-width: none;
  padding: 36px 40px;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  background: rgba(205, 200, 188, 0.96);
}
.admin-card h2 {
  margin-top: 1.7em;
  font-weight: 500;
  font-size: 17px;
}
.summary {
  display: flex;
  gap: 28px;
  flex-wrap: wrap;
  margin: 16px 0 6px;
}
.summary > div { font-variant-numeric: tabular-nums; }
.summary strong { display: block; font-size: 26px; font-weight: 500; line-height: 1.1; }
.summary span { font-size: 13px; opacity: 0.7; }
.admin-card table { width: 100%; border-collapse: collapse; margin-top: 8px; font-size: 14px; }
.admin-card th, .admin-card td {
  text-align: left; padding: 6px 10px;
  border-bottom: 1px solid rgba(30, 27, 23, 0.20); vertical-align: top;
}
.admin-card th { font-weight: 500; opacity: 0.7; font-size: 13px; }
.admin-card .empty { opacity: 0.5; font-style: italic; font-size: 14px; }
.export { display: inline-block; margin-top: 8px; font-size: 14px; }

@media (max-width: 500px) {
  .card { padding: 26px 22px; max-width: 360px; }
  .card h1 { font-size: 20px; }
  .admin-card { padding: 26px 22px; }
}
