:root {
  color-scheme: dark;
  --ink: #f7f3ea;
  --muted: #b9b3a7;
  --faint: #8f8a80;
  --panel: rgba(24, 25, 28, .94);
  --line: rgba(255, 255, 255, .11);
  --gold: #ffcf3f;
  --gold-soft: #ffe066;
  --gold-deep: #d99a06;
  --radius: 18px;
}

* { box-sizing: border-box; }

html { min-height: 100%; background: #08090a; }

body {
  min-height: 100svh;
  margin: 0;
  padding: max(28px, env(safe-area-inset-top)) 18px max(28px, env(safe-area-inset-bottom));
  display: grid;
  place-items: center;
  color: var(--ink);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(120% 60% at 50% -10%, rgba(255, 207, 63, .10), transparent 55%),
    linear-gradient(160deg, #141518 0%, #08090a 70%);
  -webkit-font-smoothing: antialiased;
}

.card {
  position: relative;
  z-index: 1;
  width: min(100%, 440px);
  padding: 30px 24px 26px;
  border: 1px solid var(--line);
  border-radius: 30px;
  background: linear-gradient(180deg, rgba(22, 23, 28, .58), rgba(13, 14, 18, .52));
  -webkit-backdrop-filter: blur(14px) saturate(1.25);
  backdrop-filter: blur(14px) saturate(1.25);
  box-shadow: 0 30px 90px rgba(0, 0, 0, .5), inset 0 1px 0 rgba(255, 255, 255, .06);
  text-align: center;
  animation: rise .55s cubic-bezier(.2, .7, .3, 1) both;
}

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

/* ---------- Scene background (Halloween house) ---------- */
.bg-scene {
  position: fixed;
  inset: 0;
  z-index: 0;
  background: url("assets/halloween-house.jpg") center 22% / cover no-repeat;
  pointer-events: none;
}

.bg-scene::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(5, 6, 10, .04) 0%, rgba(5, 6, 10, .16) 55%, rgba(5, 6, 10, .34) 100%);
}

/* ---------- Hero ---------- */
.portrait-ring {
  width: 150px;
  height: 150px;
  margin: 2px auto 18px;
  padding: 3px;
  border-radius: 50%;
  background: conic-gradient(from 210deg, var(--gold-soft), var(--gold-deep), var(--gold), var(--gold-soft));
  box-shadow: 0 14px 36px rgba(0, 0, 0, .4), 0 0 0 8px rgba(255, 207, 63, .08);
}

.portrait {
  display: block;
  width: 100%;
  height: 100%;
  border: 4px solid #141518;
  border-radius: 50%;
  object-fit: cover;
  object-position: 50% 44%;
  background: #24262a;
}

h1 {
  margin: 0;
  text-shadow: 0 2px 18px rgba(0, 0, 0, .65);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.1rem, 10vw, 2.7rem);
  line-height: 1;
  letter-spacing: -.03em;
  font-weight: 600;
}

.tagline {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: .86rem;
  letter-spacing: .22em;
  text-transform: uppercase;
}

.rule {
  width: 44px;
  height: 2px;
  margin: 18px auto 20px;
  border: 0;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

/* ---------- Buttons ---------- */
.btn {
  min-height: 56px;
  width: 100%;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  background: rgba(255, 255, 255, .045);
  font: inherit;
  font-size: 1rem;
  font-weight: 650;
  letter-spacing: .01em;
  text-decoration: none;
  cursor: pointer;
  transition: transform .16s ease, border-color .16s ease, background .16s ease, box-shadow .16s ease;
}

.btn:active { transform: scale(.985); }

.btn .icon { width: 21px; height: 21px; flex: 0 0 auto; fill: currentColor; }

.btn-gold {
  color: #1a130a;
  border-color: transparent;
  background: linear-gradient(135deg, var(--gold-soft), var(--gold));
  box-shadow: 0 10px 26px rgba(255, 207, 63, .28);
}

#install-btn, #vcard-btn {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(135deg, #f0524f, #d61f26);
  box-shadow: 0 10px 26px rgba(230, 40, 50, .30);
}

.btn-ghost { background: transparent; }

.actions { display: grid; gap: 10px; }

.btn-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.btn:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }

.btn[disabled] { opacity: .6; cursor: default; }

/* ---------- Stay in the loop panel ---------- */
.panel {
  margin-top: 16px;
  padding: 20px 16px 16px;
  border: 1px solid rgba(255, 207, 63, .28);
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(255, 207, 63, .09), rgba(255, 207, 63, .03));
}

.panel h2 {
  margin: 0 0 6px;
  text-shadow: 0 2px 14px rgba(0, 0, 0, .6);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.3rem;
  font-weight: 600;
}

.panel > p { margin: 0 0 14px; color: var(--muted); font-size: .9rem; line-height: 1.45; }

.field { display: block; text-align: left; margin-bottom: 10px; }

.field span {
  display: block;
  margin: 0 2px 6px;
  color: var(--muted);
  font-size: .76rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.field input {
  width: 100%;
  min-height: 52px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--ink);
  background: rgba(8, 9, 10, .6);
  font: inherit;
  font-size: 1rem;
}

.field input::placeholder { color: #6d6860; }

.field input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(255, 207, 63, .22); }

.fine { margin: 10px 2px 0; color: var(--faint); font-size: .74rem; line-height: 1.5; }

.form-status, .status {
  min-height: 1.3em;
  margin: 10px 2px 0;
  font-size: .84rem;
  line-height: 1.45;
}

.form-status.ok, .status.ok { color: #9fe0b4; }
.form-status.err, .status.err { color: #f2a9a9; }
.status.info { color: var(--muted); }

.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 16px 0;
  color: var(--faint);
  font-size: .76rem;
  letter-spacing: .18em;
  text-transform: uppercase;
}

.divider::before, .divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.panel .stack { display: grid; gap: 9px; }

.guide {
  display: none;
  margin: 10px 0 0;
  padding: 11px 12px;
  border-radius: 12px;
  color: var(--ink);
  background: rgba(255, 255, 255, .06);
  font-size: .82rem;
  line-height: 1.5;
  text-align: left;
}

.guide.visible { display: block; }

/* ---------- Socials ---------- */
.eyebrow {
  margin: 26px 0 12px;
  color: var(--muted);
  font-size: .76rem;
  font-weight: 750;
  letter-spacing: .2em;
  text-transform: uppercase;
}

.socials { display: grid; grid-template-columns: repeat(auto-fit, minmax(52px, 1fr)); gap: 8px; }

.social {
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 15px;
  color: #d7d3cb;
  background: rgba(255, 255, 255, .045);
  transition: transform .16s ease, border-color .16s ease, color .16s ease, background .16s ease;
}

.social .icon { width: 22px; height: 22px; fill: currentColor; }

a.social { text-decoration: none; }
a.social:active { transform: scale(.94); }

span.social { position: relative; opacity: .45; cursor: default; }
span.social::after {
  content: "";
  position: absolute;
  right: 6px;
  bottom: 6px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 0 2px #222326;
}

.note { margin: 12px 0 0; color: var(--faint); font-size: .76rem; }

.voter-panel { margin-top: 26px; }

footer { margin: 22px 0 0; color: #5f5a52; font-size: .72rem; letter-spacing: .08em; }

@media (hover: hover) {
  .btn:hover { transform: translateY(-2px); border-color: rgba(255, 207, 63, .55); }
  .btn-gold:hover { background: linear-gradient(135deg, #ffec99, #ffd83d); }
  a.social:hover { transform: translateY(-2px); border-color: rgba(255, 207, 63, .6); color: #fff; background: rgba(255, 207, 63, .12); }
}

@media (max-width: 370px) {
  .card { padding-inline: 16px; border-radius: 26px; }
  .socials { gap: 6px; }
  .social { border-radius: 12px; }
  .btn-row { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
