:root {
  --night: #12171f;
  --dusk: #1e2433;
  --glow: #d9b87a;
  --glow-soft: rgba(217, 184, 122, 0.18);
  --paper: #faf8f4;
  --ink: #17191f;
  --ink-muted: #6a6e78;
  --muted: rgba(255, 255, 255, 0.55);
  --on: rgba(255, 255, 255, 0.92);
  --sky: rgba(89, 107, 148, 0.35);
}

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

html, body {
  min-height: 100%;
  background: var(--night);
  color: var(--on);
  font-family: "Cormorant Garamond", Georgia, serif;
  -webkit-font-smoothing: antialiased;
}

body {
  position: relative;
  overflow-x: hidden;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(ellipse 80% 55% at 70% 20%, var(--sky), transparent 60%),
    radial-gradient(ellipse 50% 40% at 15% 80%, rgba(217, 184, 122, 0.08), transparent 55%),
    var(--night);
}

.grain {
  pointer-events: none;
  position: fixed;
  inset: 0;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  z-index: 1;
}

.top, .hero, .foot { position: relative; z-index: 2; }

.top {
  display: flex;
  align-items: center;
  padding: 28px 36px 0;
}

.logo {
  font-family: "Cinzel", serif;
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--glow);
  text-decoration: none;
  animation: rise 0.55s ease both;
}

.hero {
  flex: 1;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 72px;
  align-items: center;
  min-height: calc(100vh - 140px);
  padding: 48px 36px 64px;
  max-width: 1180px;
  margin: 0 auto;
}

.copy { max-width: 34rem; }

h1 {
  display: flex;
  flex-direction: column;
  gap: 0.08em;
  font-family: "Cinzel", serif;
  font-weight: 700;
  font-size: clamp(2.4rem, 5.2vw, 4.1rem);
  line-height: 1.05;
  letter-spacing: 0.04em;
  margin-bottom: 22px;
}

h1 span {
  animation: rise 0.75s ease both;
}

h1 span:nth-child(1) { animation-delay: 0.04s; }
h1 span:nth-child(2) {
  color: rgba(255, 255, 255, 0.78);
  animation-delay: 0.1s;
}
h1 span:nth-child(3) {
  color: rgba(255, 255, 255, 0.55);
  animation-delay: 0.16s;
}

.lede {
  font-size: clamp(1.25rem, 2.2vw, 1.55rem);
  font-weight: 500;
  font-style: italic;
  line-height: 1.45;
  color: var(--muted);
  margin-bottom: 32px;
  max-width: 28rem;
  animation: rise 0.85s 0.18s ease both;
}

.cta-block {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
  animation: rise 0.9s 0.22s ease both;
}

.cta {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 15px 22px;
  background: #f4f0e8;
  color: #111;
  text-decoration: none;
  border-radius: 980px;
  font-family: "Cinzel", serif;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
  transition: transform 0.22s ease, background 0.22s ease, box-shadow 0.22s ease;
}

.cta:hover {
  transform: translateY(-2px);
  background: #fff;
  box-shadow: 0 22px 48px rgba(0, 0, 0, 0.42);
}

.cta svg { flex-shrink: 0; }

.cta-arrow {
  font-size: 1rem;
  line-height: 1;
  opacity: 0.7;
  transition: transform 0.22s ease, opacity 0.22s ease;
}

.cta:hover .cta-arrow {
  transform: translateX(3px);
  opacity: 1;
}

.live {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: "Cinzel", serif;
  font-size: 0.68rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.48);
}

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #e23b3b;
  box-shadow: 0 0 0 0 rgba(226, 59, 59, 0.55);
  animation: live-pulse 1.8s ease-out infinite;
}

.cta-links {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 22px;
}

.cta-links a {
  font-family: "Cinzel", serif;
  font-size: 0.62rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.38);
  text-decoration: none;
}

.cta-links a:hover { color: var(--glow); }

.stage {
  position: relative;
  height: min(58vh, 480px);
  display: grid;
  place-items: center;
  animation: rise 1s 0.14s ease both;
}

/* Viewfinder frame around the keep */
.frame {
  position: absolute;
  width: min(400px, 82vw);
  aspect-ratio: 1.05;
  pointer-events: none;
  z-index: 1;
}

.corner {
  position: absolute;
  width: 28px;
  height: 28px;
  border-color: var(--glow);
  border-style: solid;
  opacity: 0;
  animation: corner-in 0.7s 0.45s ease forwards, corner-pulse 2.8s 1.2s ease-in-out infinite;
}

.corner.tl {
  top: -10px;
  left: -10px;
  border-width: 2.5px 0 0 2.5px;
}

.corner.tr {
  top: -10px;
  right: -10px;
  border-width: 2.5px 2.5px 0 0;
}

.corner.bl {
  bottom: -10px;
  left: -10px;
  border-width: 0 0 2.5px 2.5px;
}

.corner.br {
  bottom: -10px;
  right: -10px;
  border-width: 0 2.5px 2.5px 0;
}

.sweep {
  position: absolute;
  left: 6%;
  right: 6%;
  height: 2px;
  top: 8%;
  border-radius: 2px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(217, 184, 122, 0.95),
    transparent
  );
  box-shadow: 0 0 16px rgba(217, 184, 122, 0.55);
  opacity: 0;
  animation: sweep 2.4s 0.9s ease-in-out infinite;
}

/* App keep sticker */
.keep-sticker {
  position: relative;
  z-index: 2;
  width: min(340px, 78vw);
  padding: 10px 10px 14px;
  background: var(--paper);
  border-radius: 16px;
  box-shadow:
    0 36px 70px rgba(0, 0, 0, 0.55),
    0 2px 0 rgba(255, 255, 255, 0.4) inset;
  transform: rotate(-2deg);
  --r: -2deg;
}

.keep-photo {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  background: #1a2030;
}

.keep-photo img {
  display: block;
  width: 100%;
  aspect-ratio: 5 / 4;
  max-height: 260px;
  object-fit: cover;
  object-position: center 28%;
}

.keep-index {
  position: absolute;
  top: 12px;
  left: 12px;
  font-family: "Cinzel", serif;
  font-size: 0.62rem;
  letter-spacing: 0.18em;
  color: rgba(255, 255, 255, 0.88);
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.5);
}

.keep-meta {
  padding: 12px 6px 2px;
}

.keep-kind {
  font-family: "Cinzel", serif;
  font-size: 0.56rem;
  letter-spacing: 0.2em;
  color: #b08a4a;
  margin-bottom: 4px;
}

.keep-name {
  font-family: "Cinzel", serif;
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--ink);
  line-height: 1.15;
  margin-bottom: 4px;
}

.keep-detail {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 0.95rem;
  color: var(--ink-muted);
}

.float {
  animation: float 5.5s ease-in-out infinite;
}

.foot {
  display: flex;
  justify-content: flex-end;
  padding: 20px 36px 28px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.foot p {
  font-family: "Cinzel", serif;
  font-size: 0.65rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.38);
}

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

@keyframes float {
  0%, 100% { transform: translateY(0) rotate(var(--r, -2deg)); }
  50% { transform: translateY(-12px) rotate(var(--r, -2deg)); }
}

@keyframes corner-in {
  from { opacity: 0; transform: scale(0.85); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes corner-pulse {
  0%, 100% { opacity: 0.75; filter: drop-shadow(0 0 0 transparent); }
  50% { opacity: 1; filter: drop-shadow(0 0 8px rgba(217, 184, 122, 0.55)); }
}

@keyframes sweep {
  0% { top: 10%; opacity: 0; }
  12% { opacity: 1; }
  88% { opacity: 1; }
  100% { top: 88%; opacity: 0; }
}

@keyframes live-pulse {
  0% { box-shadow: 0 0 0 0 rgba(226, 59, 59, 0.55); }
  70% { box-shadow: 0 0 0 10px rgba(226, 59, 59, 0); }
  100% { box-shadow: 0 0 0 0 rgba(226, 59, 59, 0); }
}

@media (max-width: 860px) {
  .hero {
    grid-template-columns: 1fr;
    min-height: auto;
    padding-top: 28px;
    gap: 48px;
  }

  .stage {
    height: auto;
    min-height: 320px;
    order: -1;
  }

  .frame {
    width: min(340px, 86vw);
    aspect-ratio: 1.1;
  }

  .keep-sticker {
    width: min(300px, 82vw);
  }

  .keep-photo img {
    max-height: 220px;
    aspect-ratio: 5 / 4;
  }

  .top { padding: 22px 22px 0; }
  .hero { padding-left: 22px; padding-right: 22px; }
  .foot { padding: 18px 22px 24px; }
  h1 { font-size: clamp(2rem, 9vw, 2.8rem); }
}

.invite-page .invite {
  position: relative;
  z-index: 2;
  max-width: 440px;
  margin: 0 auto;
  padding: 28px 24px 80px;
}

.invite-kicker {
  font-family: Cinzel, serif;
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  color: var(--glow);
  margin-bottom: 18px;
}

.invite-card h1 {
  display: block;
  font-family: Cinzel, serif;
  font-size: 2rem;
  letter-spacing: 0.04em;
  margin: 8px 0 6px;
}

.invite-thumb {
  width: 100%;
  height: 220px;
  object-fit: cover;
  border-radius: 16px;
  margin-bottom: 8px;
}

.invite-date,
.invite-from,
.invite-state,
.invite-missing {
  font-size: 1.15rem;
  line-height: 1.45;
  color: var(--muted);
  margin-bottom: 8px;
}

.invite-actions {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 22px;
}

.invite-store {
  color: var(--glow);
  text-align: center;
  text-decoration: none;
  font-family: Cinzel, serif;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
}

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

  .corner { opacity: 1; }
  .keep-sticker { transform: rotate(-2deg); }
}
