/* ==========================================================================
   Oh, Bitch-uary — shared styles
   ========================================================================== */

:root {
  --ink: #e8e2d0;
  --ink-muted: #9b947f;
  --gold: #c9a86a;
  --night-1: #05070f;
  --night-2: #0c1220;
  --night-3: #1a2130;
  --ground-1: #070b09;
  --ground-2: #101a12;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: Georgia, "Times New Roman", serif;
  color: var(--ink);
  background: var(--night-1);
}

body { overflow: hidden; }

.muted { color: var(--ink-muted); }

/* --------------------------------------------------------------------------
   Night sky / scene
   -------------------------------------------------------------------------- */

.scene, .form-scene {
  position: fixed;
  inset: 0;
  overflow: hidden;
  background: linear-gradient(180deg, var(--night-1) 0%, var(--night-2) 55%, var(--night-3) 100%);
}

.stars {
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(1px 1px at 22px 34px, rgba(255,255,255,.9), transparent 60%),
    radial-gradient(1px 1px at 88px 12px, rgba(255,255,255,.7), transparent 60%),
    radial-gradient(1.5px 1.5px at 140px 70px, rgba(255,255,255,.8), transparent 60%),
    radial-gradient(1px 1px at 180px 130px, rgba(255,255,255,.6), transparent 60%),
    radial-gradient(1px 1px at 50px 150px, rgba(255,255,255,.7), transparent 60%),
    radial-gradient(1.5px 1.5px at 120px 190px, rgba(255,255,255,.55), transparent 60%),
    radial-gradient(1px 1px at 165px 30px, rgba(255,255,255,.6), transparent 60%),
    radial-gradient(1px 1px at 32px 210px, rgba(255,255,255,.5), transparent 60%);
  background-size: 200px 240px;
  background-repeat: repeat;
  animation: twinkle 7s ease-in-out infinite alternate;
}

@keyframes twinkle {
  from { opacity: .6; }
  to   { opacity: 1; }
}

.moon {
  position: absolute;
  top: 8%;
  right: 12%;
  width: 92px;
  height: 92px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #f4efdc, #d8d2bc 70%, #b9b39c);
  box-shadow: 0 0 40px 12px rgba(214, 205, 180, .18),
              0 0 120px 60px rgba(214, 205, 180, .08);
}

.ground {
  position: absolute;
  left: -10%;
  right: -10%;
  bottom: -6%;
  height: 34%;
  background: linear-gradient(180deg, var(--ground-2) 0%, var(--ground-1) 70%);
  border-radius: 50% 50% 0 0 / 28% 28% 0 0;
}

.fog {
  position: absolute;
  left: -20%;
  width: 140%;
  height: 34%;
  bottom: 4%;
  background: radial-gradient(ellipse at center, rgba(170, 180, 190, .14), transparent 70%);
  filter: blur(6px);
  animation: drift 30s linear infinite;
}
.fog2 {
  bottom: 0;
  height: 26%;
  opacity: .6;
  animation: drift 44s linear infinite reverse;
}

@keyframes drift {
  from { transform: translateX(-8%); }
  50%  { transform: translateX(8%); }
  to   { transform: translateX(-8%); }
}

/* --------------------------------------------------------------------------
   Tombstones
   -------------------------------------------------------------------------- */

.tombstones {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 10%;
  height: 34%;
  pointer-events: none;
}

.stone {
  position: absolute;
  bottom: 0;
  background: linear-gradient(180deg, #2b3444, #141a24);
  border-radius: 10px 10px 4px 4px;
}
.stone-1 { left: 6%;  width: 44px; height: 84px; }
.stone-2 { left: 16%; width: 30px; height: 56px; }
.stone-3 { right: 7%; width: 48px; height: 90px; }
.stone-4 { right: 18%; width: 32px; height: 58px; }
.stone-5 { right: 30%; width: 26px; height: 48px; }

.tombstone.main {
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: min(300px, 60vw);
  height: 190px;
  background: linear-gradient(180deg, #3a4456 0%, #232b3a 60%, #161c27 100%);
  border-radius: 90px 90px 10px 10px;
  box-shadow: 0 18px 40px rgba(0,0,0,.55), inset 0 0 0 3px rgba(201,168,106,.10);
  text-align: center;
  padding-top: 22px;
  color: var(--ink);
}
.tombstone.main::after {
  content: "";
  position: absolute;
  inset: 14px;
  border-radius: 70px 70px 8px 8px;
  box-shadow: inset 0 0 0 2px rgba(0,0,0,.25), inset 0 0 18px rgba(0,0,0,.45);
}
.tombstone .rip {
  font-size: 13px;
  letter-spacing: .35em;
  color: var(--gold);
  opacity: .9;
}
.tombstone .tname {
  font-size: clamp(22px, 6vw, 34px);
  font-weight: 700;
  margin: 6px 0 2px;
  letter-spacing: .02em;
}
.tombstone .tdates {
  font-size: 15px;
  color: var(--ink-muted);
  letter-spacing: .12em;
}

/* --------------------------------------------------------------------------
   Scrolling eulogy (credits-style upward crawl)
   -------------------------------------------------------------------------- */

.scroll-viewport {
  position: absolute;
  left: 50%;
  top: 4%;
  transform: translateX(-50%);
  width: min(640px, 92vw);
  height: 56%;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 14%, #000 86%, transparent 100%);
  mask-image: linear-gradient(180deg, transparent 0, #000 14%, #000 86%, transparent 100%);
}

.scroll-content {
  will-change: transform;
  text-align: center;
  transform: translateY(100%);
}

.memorial-title {
  font-size: clamp(20px, 4.5vw, 30px);
  letter-spacing: .06em;
  color: var(--gold);
  margin: 0 0 1.2em;
  text-shadow: 0 0 24px rgba(201,168,106,.35);
}

.scroll-content p {
  font-size: clamp(16px, 3.4vw, 20px);
  line-height: 1.65;
  margin: 0 0 1.2em;
  color: #efe9d8;
  text-shadow: 0 1px 8px rgba(0,0,0,.7);
}

/* --------------------------------------------------------------------------
   Overlay (begin ceremony)
   -------------------------------------------------------------------------- */

.overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at center, rgba(6,8,14,.82), rgba(3,4,8,.94));
  z-index: 40;
  transition: opacity .8s ease;
  text-align: center;
  padding: 20px;
}
.overlay.hidden { opacity: 0; pointer-events: none; }

.overlay-inner { max-width: 460px; }
.overlay h1 { font-size: clamp(24px, 5vw, 34px); margin: 0 0 10px; }
.overlay p { margin: 0 0 26px; }
.candle { font-size: 52px; margin-bottom: 8px; animation: flicker 2.4s ease-in-out infinite; }

@keyframes flicker {
  0%,100% { transform: translateY(0) scale(1); opacity: 1; }
  45%     { transform: translateY(-2px) scale(1.03); opacity: .9; }
  70%     { transform: translateY(1px) scale(.98); opacity: .95; }
}

/* --------------------------------------------------------------------------
   Buttons & controls
   -------------------------------------------------------------------------- */

.cta {
  display: inline-block;
  font-family: inherit;
  font-size: 18px;
  letter-spacing: .03em;
  color: #0c0a05;
  background: linear-gradient(180deg, #e2c78f, #c9a86a);
  border: none;
  border-radius: 8px;
  padding: 14px 30px;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(0,0,0,.4);
  transition: transform .12s ease, box-shadow .12s ease;
}
.cta:hover { transform: translateY(-2px); box-shadow: 0 10px 26px rgba(0,0,0,.5); }
.cta:active { transform: translateY(0); }

.ghost {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: inherit;
  font-size: 14px;
  color: var(--ink);
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 6px;
  padding: 9px 16px;
  cursor: pointer;
  text-decoration: none;
  transition: background .15s ease;
}
.ghost:hover { background: rgba(255,255,255,.12); }

.controls {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 50;
  padding: 10px 14px;
  border-radius: 10px;
  background: rgba(5,7,12,.55);
  backdrop-filter: blur(6px);
  transition: opacity .6s ease;
}
.controls.hidden { opacity: 0; pointer-events: none; }
.controls .visits { font-size: 13px; color: var(--ink-muted); margin-right: 4px; }

/* --------------------------------------------------------------------------
   Form page
   -------------------------------------------------------------------------- */

.form-page { overflow: auto; }

.form-card {
  position: relative;
  z-index: 5;
  max-width: 620px;
  margin: 7vh auto 60px;
  padding: 38px 34px;
  background: rgba(10, 13, 22, .72);
  border: 1px solid rgba(201,168,106,.18);
  border-radius: 14px;
  box-shadow: 0 30px 80px rgba(0,0,0,.55);
  backdrop-filter: blur(8px);
}

.site-title {
  margin: 0;
  font-size: clamp(34px, 8vw, 52px);
  letter-spacing: .02em;
  background: linear-gradient(180deg, #f0e3c0, #c9a86a);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-align: center;
}
.tagline {
  text-align: center;
  margin: 6px 0 30px;
  color: var(--ink-muted);
  font-style: italic;
}

.field { margin-bottom: 20px; }
.field label {
  display: block;
  font-size: 13px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 7px;
}
.row { display: flex; gap: 16px; }
.row .field { flex: 1; }

input[type="text"], input[type="number"], textarea {
  width: 100%;
  font-family: inherit;
  font-size: 16px;
  color: var(--ink);
  background: rgba(0,0,0,.35);
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 8px;
  padding: 12px 14px;
  resize: vertical;
}
input:focus, textarea:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(201,168,106,.18);
}

.fine-print {
  margin: 18px 0 0;
  text-align: center;
  font-size: 12px;
  color: var(--ink-muted);
}

@media (max-width: 520px) {
  .form-card { margin: 4vh 12px 40px; padding: 26px 20px; }
  .row { flex-direction: column; gap: 0; }
}
