/* Layout: a night-sky banner (moon, bats, cobweb, a dangling spider) over one narrow column.
   Single dark Halloween look by design: ink-purple ground, bone text, pumpkin accent, eerie green for focus. */
:root {
  --bg: #0E0A16;
  --surface: #150F22;
  --surface2: #1B1230;
  --fg: #F0EADB;
  --muted: #B5AAC9;
  --line: #34274F;
  --accent: #FF7A18;
  --accent-fg: #1A0B00;
  --glow: rgba(255, 122, 24, .5);
  --focus: #8CF2A6;
  --bad: #FF9188;
  --display: "Creepster", "Chiller", "Impact", fantasy;
  --font: "Instrument Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --pad: max(18px, env(safe-area-inset-left, 0px));
  --padr: max(18px, env(safe-area-inset-right, 0px));
  color-scheme: dark;
}
* { box-sizing: border-box; }
body {
  margin: 0; color: var(--fg); font-family: var(--font); font-size: 18px; line-height: 1.6;
  background: var(--bg);
  padding-left: var(--pad); padding-right: var(--padr);
  padding-block: 0 0;
  overflow-x: hidden;
}

body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(900px 500px at 85% -120px, rgba(120, 60, 200, .22), transparent 70%),
    radial-gradient(700px 400px at 5% 100%, rgba(255, 122, 24, .07), transparent 70%);
}

body::after {
  content: ""; position: fixed; left: -20%; bottom: 0; width: 140%; height: 42vh; z-index: -1; pointer-events: none;
  background:
    radial-gradient(40% 60% at 20% 85%, rgba(170, 150, 220, .11), transparent 70%),
    radial-gradient(35% 55% at 55% 95%, rgba(170, 150, 220, .09), transparent 70%),
    radial-gradient(40% 60% at 85% 85%, rgba(255, 150, 80, .06), transparent 70%);
  animation: fogdrift 55s ease-in-out infinite alternate;
}
.embers { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.embers i {
  position: absolute; bottom: -12px; border-radius: 50%; background: #FFB066; opacity: 0;
  box-shadow: 0 0 8px 2px rgba(255, 122, 24, .55);
  animation: ember linear infinite; will-change: transform, opacity;
}

/* ---------- Banner ---------- */
.deco {
  position: relative; height: clamp(116px, 24vw, 156px);
  margin-left: calc(-1 * var(--pad)); margin-right: calc(-1 * var(--padr));
  overflow: hidden; pointer-events: none;
  -webkit-mask-image: linear-gradient(#000 66%, transparent);
  mask-image: linear-gradient(#000 66%, transparent);
  background: linear-gradient(#1A1030, #120B20);
}
.stars, .stars::after {
  position: absolute; inset: 0; content: "";
  background:
    radial-gradient(1.2px 1.2px at 9% 34%, #fff9 50%, transparent 52%),
    radial-gradient(1.4px 1.4px at 33% 22%, #fffb 50%, transparent 52%),
    radial-gradient(1.2px 1.2px at 58% 28%, #fff9 50%, transparent 52%),
    radial-gradient(1.2px 1.2px at 80% 18%, #fff9 50%, transparent 52%),
    radial-gradient(1px 1px at 91% 45%, #fff8 50%, transparent 52%);
  animation: twinkle 3.6s ease-in-out infinite alternate;
}
.stars::after {
  background:
    radial-gradient(1px 1px at 19% 62%, #fff8 50%, transparent 52%),
    radial-gradient(1px 1px at 47% 70%, #fff7 50%, transparent 52%),
    radial-gradient(1px 1px at 71% 58%, #fff8 50%, transparent 52%),
    radial-gradient(1.2px 1.2px at 24% 14%, #fff9 50%, transparent 52%),
    radial-gradient(1px 1px at 65% 12%, #fff8 50%, transparent 52%);
  animation-duration: 5.3s; animation-delay: -2s;
}
.s2 { transform: scale(-1, 1); animation-duration: 4.4s; animation-delay: -1.3s; }
.moon {
  --d: clamp(52px, 11vw, 92px);
  position: absolute; top: 24%; right: 7%; width: var(--d); aspect-ratio: 1; border-radius: 50%;
  background-color: #F2D68E;
  /* Craters on a texture twice as wide as the moon that scrolls sideways, so the moon turns like a ball */
  background-image:
    radial-gradient(circle at 12% 60%, rgba(120, 80, 20, .30) 0 4.5%, transparent 5.5%),
    radial-gradient(circle at 24% 28%, rgba(120, 80, 20, .24) 0 3.5%, transparent 4.5%),
    radial-gradient(circle at 36% 74%, rgba(120, 80, 20, .28) 0 5.5%, transparent 6.5%),
    radial-gradient(circle at 50% 40%, rgba(120, 80, 20, .22) 0 6.5%, transparent 7.5%),
    radial-gradient(circle at 63% 68%, rgba(120, 80, 20, .30) 0 4%, transparent 5%),
    radial-gradient(circle at 76% 26%, rgba(120, 80, 20, .26) 0 4.5%, transparent 5.5%),
    radial-gradient(circle at 88% 56%, rgba(120, 80, 20, .28) 0 3.5%, transparent 4.5%),
    radial-gradient(ellipse at 30% 50%, rgba(160, 110, 40, .20) 0 14%, transparent 16%),
    radial-gradient(ellipse at 70% 45%, rgba(160, 110, 40, .18) 0 12%, transparent 14%);
  background-size: calc(var(--d) * 2) 100%;
  background-repeat: repeat-x;
  /* Round shading on top of the spinning surface sells the 3D ball; the outer shadows are the glow */
  box-shadow:
    inset -12px -8px 20px rgba(90, 50, 10, .55),
    inset 7px 5px 16px rgba(255, 250, 225, .45),
    0 0 30px 6px rgba(255, 205, 130, .35),
    0 0 110px 36px rgba(255, 122, 24, .16);
  animation:
    moonx 80s ease-in-out infinite alternate,
    moonbob 9s ease-in-out infinite alternate,
    moonspin 28s linear infinite,
    moonglow 4.5s ease-in-out infinite alternate;
}
/* Slowly turning sun-ray halo and a counter-rotating dreamy color ring around the moon */
.moon::before, .moon::after {
  content: ""; position: absolute; inset: -60%; border-radius: 50%; z-index: -1; pointer-events: none;
}
.moon::before {
  background: repeating-conic-gradient(from 0deg, rgba(255, 214, 150, .55) 0 5deg, transparent 5deg 18deg);
  -webkit-mask: radial-gradient(closest-side, transparent 40%, #000 46%, rgba(0, 0, 0, .35) 70%, transparent 100%);
          mask: radial-gradient(closest-side, transparent 40%, #000 46%, rgba(0, 0, 0, .35) 70%, transparent 100%);
  animation: halospin 40s linear infinite, halopulse 4.5s ease-in-out infinite alternate;
}
.moon::after {
  background: conic-gradient(from 0deg, rgba(255, 160, 60, .5), rgba(190, 140, 255, .45), rgba(140, 242, 166, .4), rgba(255, 205, 130, .5), rgba(255, 160, 60, .5));
  -webkit-mask: radial-gradient(closest-side, transparent 44%, #000 50%, rgba(0, 0, 0, .5) 62%, transparent 82%);
          mask: radial-gradient(closest-side, transparent 44%, #000 50%, rgba(0, 0, 0, .5) 62%, transparent 82%);
  filter: blur(6px);
  animation: halospin 30s linear infinite reverse, halopulse 4.5s ease-in-out infinite alternate-reverse;
}
.cloud { position: absolute; left: 0; height: auto; opacity: .88; filter: drop-shadow(0 -2px 6px rgba(255, 205, 130, .12)); }
.c1 { top: 6%;  width: clamp(120px, 26vw, 230px); animation: drift 75s linear infinite -20s; }
.c2 { top: 38%; width: clamp(90px, 20vw, 170px);  opacity: .7; animation: drift 105s linear infinite -70s; }
.c3 { top: 16%; width: clamp(70px, 15vw, 130px);  opacity: .55; animation: drift 140s linear infinite -105s; }
.web { position: absolute; top: 0; left: 0; width: clamp(78px, 17vw, 128px); color: rgba(240, 234, 219, .38); }
.spider { position: absolute; top: 0; left: 26%; height: 100%; width: auto; color: #08050E; filter: drop-shadow(0 0 1px rgba(240, 234, 219, .55)); animation: dangle 6.5s ease-in-out infinite; }
.bat { position: absolute; width: 30px; color: #07040C; filter: drop-shadow(0 0 1px rgba(240, 234, 219, .45)); }
.bat1 { top: 22%; animation: fly1 17s linear infinite, flap .45s ease-in-out infinite alternate; }
.bat2 { top: 50%; width: 22px; animation: fly2 23s linear infinite -9s, flap .38s ease-in-out infinite alternate; }

@keyframes twinkle { from { opacity: .45; } to { opacity: 1; } }
@keyframes drift { from { translate: 105vw 0; } to { translate: -40vw 0; } }
@keyframes moonx { from { translate: 0 0; } to { translate: -52vw 0; } }
@keyframes moonbob { from { transform: translateY(-5px); } to { transform: translateY(9px); } }
@keyframes moonspin { from { background-position-x: 0; } to { background-position-x: calc(var(--d) * -2); } }
@keyframes moonglow {
  from { box-shadow: inset -12px -8px 20px rgba(90, 50, 10, .55), inset 7px 5px 16px rgba(255, 250, 225, .45), 0 0 22px 4px rgba(255, 205, 130, .25), 0 0 80px 24px rgba(255, 122, 24, .10); }
  to   { box-shadow: inset -12px -8px 20px rgba(90, 50, 10, .55), inset 7px 5px 16px rgba(255, 250, 225, .45), 0 0 46px 14px rgba(255, 220, 150, .55), 0 0 150px 54px rgba(255, 122, 24, .26); }
}
@keyframes halospin { to { transform: rotate(360deg); } }
@keyframes halopulse { from { opacity: .45; scale: .94; } to { opacity: 1; scale: 1.06; } }
@keyframes fogdrift { from { transform: translateX(-7%); } to { transform: translateX(7%); } }
@keyframes ember {
  0% { transform: translate(0, 0); opacity: 0; }
  12% { opacity: .85; }
  80% { opacity: .5; }
  100% { transform: translate(var(--dx), -108vh); opacity: 0; }
}
@keyframes dangle { 0%, 100% { transform: translateY(-40px); } 50% { transform: translateY(-18px); } }
@keyframes fly1 { from { translate: -12vw 0; } 50% { translate: 48vw 16px; } to { translate: 112vw -8px; } }
@keyframes fly2 { from { translate: -12vw 0; } 50% { translate: 52vw -12px; } to { translate: 112vw 10px; } }
@keyframes flap { from { scale: 1 1; } to { scale: 1 .55; } }
@keyframes flicker {
  0%, 17%, 23%, 61%, 66%, 100% { opacity: 1; text-shadow: 0 0 12px var(--glow), 0 0 34px rgba(255, 122, 24, .28); }
  19%, 63% { opacity: .72; text-shadow: 0 0 4px var(--glow); }
  21% { opacity: .9; }
}

/* ---------- Content ---------- */
main { position: relative; max-width: 620px; margin: 0 auto; display: grid; gap: 18px; padding-top: 6px; }
h1 { font-family: var(--display); font-weight: 400; font-size: min(3.85rem, calc((100vw - var(--pad) - var(--padr)) / 10.2)); line-height: 1.05; letter-spacing: .02em; margin: 0; white-space: nowrap; }
.glow { color: var(--accent); text-shadow: 0 0 12px var(--glow), 0 0 34px rgba(255, 122, 24, .28); animation: flicker 7s infinite; display: inline-block; }
h2 { font-family: var(--display); font-weight: 400; font-size: 2rem; line-height: 1.1; letter-spacing: .03em; margin: 0; }
h2::after { content: ""; display: block; width: 46px; height: 3px; margin-top: 8px; border-radius: 2px; background: var(--accent); box-shadow: 0 0 10px var(--accent); }
h3 { font-family: var(--display); font-weight: 400; font-size: 1.6rem; letter-spacing: .03em; margin: 0; }
p { margin: 0; }
.eyebrow { color: var(--focus); font-size: .85rem; letter-spacing: .18em; text-transform: uppercase; font-weight: 600; }
.lede { font-size: 1.2rem; }
.dates { color: var(--muted); border-left: 3px solid var(--accent); padding-left: 14px; }
.dates strong { color: var(--fg); font-weight: 600; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 3px; }

section { display: grid; gap: 14px; padding-top: 30px; margin-top: 10px; border-top: 1px dashed var(--line); }

.prices { margin: 0; display: grid; }
.prices div { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.prices dt { color: var(--muted); }
.prices dd { margin: 0; font-weight: 700; font-size: 1.15rem; color: var(--accent); font-variant-numeric: tabular-nums; }

form { display: grid; gap: 20px; margin-top: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: clamp(18px, 4.5vw, 30px); box-shadow: 0 24px 50px -26px #000, 0 0 0 1px rgba(255, 122, 24, .06); }
form[hidden], .result[hidden], .estimate[hidden] { display: none !important; }
.row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 16px; }
.field { display: grid; gap: 6px; min-width: 0; align-content: start; }
.field label { font-weight: 600; font-size: 1rem; }
.opt { font-weight: 400; color: var(--muted); font-size: .9rem; }
.hint { font-size: .88rem; color: var(--muted); }
input, textarea {
  font: inherit; color: var(--fg); background: var(--bg); width: 100%;
  border: 1.5px solid #43325F; border-radius: 8px; padding: 12px 13px; min-width: 0;
}
input::placeholder, textarea::placeholder { color: #7C6F95; }
input[aria-invalid="true"] { border-color: var(--bad); }
textarea { min-height: 92px; resize: vertical; }
.err { color: var(--bad); font-size: .9rem; }
.err:empty { display: none; }
.form-error { color: var(--bad); font-weight: 600; }
.form-error:empty { display: none; }
.trap { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

.estimate { background: var(--surface2); border: 1.5px solid rgba(255, 122, 24, .5); border-radius: 10px; padding: 16px 18px; display: grid; gap: 8px; box-shadow: 0 0 24px -8px rgba(255, 122, 24, .35); }
.est-title { font-size: .8rem; letter-spacing: .14em; text-transform: uppercase; color: var(--focus); font-weight: 700; }
.est-row { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; align-items: baseline; font-variant-numeric: tabular-nums; }
.est-row span:last-child { font-weight: 600; text-align: right; }
.est-row.total { border-top: 1px solid var(--line); padding-top: 10px; margin-top: 4px; font-size: 1.25rem; }
.est-row.total span:last-child { color: var(--accent); font-weight: 700; text-shadow: 0 0 14px rgba(255, 122, 24, .35); }
.est-note { font-size: .95rem; color: var(--muted); }
.est-note.warn { color: var(--fg); }
.est-note.fine { font-size: .8rem; margin-top: 6px; overflow-wrap: anywhere; }

.btn {
  font: inherit; font-weight: 700; cursor: pointer; display: inline-block;
  background: var(--accent); color: var(--accent-fg); border: 2px solid var(--accent);
  padding: 14px 26px; border-radius: 8px; box-shadow: 0 0 22px -4px var(--glow);
}
.btn:hover { filter: brightness(1.1); }
.btn:disabled { opacity: .6; cursor: progress; }
.btn.ghost { background: transparent; color: var(--fg); border-color: var(--fg); box-shadow: none; }

.result { display: grid; gap: 14px; background: var(--surface); border: 2px solid var(--accent); padding: 24px; border-radius: 12px; box-shadow: 0 0 34px -10px var(--glow); }

/* Sound toggle, fixed to the bottom-right and clear of phone safe areas */
.sound {
  position: fixed; z-index: 5; display: inline-flex; align-items: center; gap: 8px;
  right: calc(14px + env(safe-area-inset-right, 0px)); bottom: calc(14px + env(safe-area-inset-bottom, 0px));
  font: inherit; font-size: .92rem; font-weight: 600; color: var(--fg); cursor: pointer;
  background: rgba(21, 15, 34, .92); border: 1.5px solid #5A4380; border-radius: 999px; padding: 10px 16px 10px 12px;
  box-shadow: 0 8px 24px -8px #000;
}
.sound:hover { border-color: var(--accent); }
.sound[aria-pressed="true"] { border-color: var(--accent); box-shadow: 0 0 22px -4px var(--glow), 0 8px 24px -8px #000; }
.sound .waves { display: none; }
.sound[aria-pressed="true"] .waves { display: inline; }
.sound[aria-pressed="true"] .mute { display: none; }
.sound svg { flex: none; }
.sound:not(.seen)[aria-pressed="false"] { animation: ping 2.6s ease-out infinite; }
@keyframes ping {
  0% { box-shadow: 0 0 0 0 rgba(255, 122, 24, .55), 0 8px 24px -8px #000; }
  70%, 100% { box-shadow: 0 0 0 14px rgba(255, 122, 24, 0), 0 8px 24px -8px #000; }
}
@media (max-width: 560px) {
  /* Icon-only on phones so it never covers the form buttons; the text stays for screen readers */
  .sound { padding: 12px; gap: 0; }
  #sound-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}

footer { position: relative; max-width: 620px; margin: 48px auto 0; padding-block: 24px 36px; border-top: 1px dashed var(--line); color: var(--muted); font-size: .88rem; }


/* ---------- Phones (Android / iPhone, including Facebook's in-app browser) ---------- */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; }
body { padding-bottom: calc(76px + env(safe-area-inset-bottom, 0px)); }   /* keeps the music button from covering the last lines */
input, textarea { -webkit-appearance: none; appearance: none; border-radius: 8px; }
input[type="date"], input[type="time"], input[type="number"], input[type="tel"], input[type="text"] { min-height: 50px; }
/* iPhone Safari draws empty date and time boxes squashed and centred; make them match the text boxes */
input[type="date"], input[type="time"] { display: block; line-height: 1.3; text-align: left; }
input[type="date"]::-webkit-date-and-time-value, input[type="time"]::-webkit-date-and-time-value { text-align: left; min-height: 1.4em; }
.btn, .sound, input, textarea { touch-action: manipulation; }
.btn { min-height: 50px; }

@media (max-width: 700px) {
  /* Moon: sit lower so the halo is not cut off by the top of the banner, and use a lighter glow for phone GPUs */
  .moon {
    top: 34%;
    animation: moonx 80s ease-in-out infinite alternate, moonbob 9s ease-in-out infinite alternate, moonspin 28s linear infinite, moonglowm 4.5s ease-in-out infinite alternate;
    box-shadow: inset -9px -6px 14px rgba(90, 50, 10, .55), inset 5px 4px 12px rgba(255, 250, 225, .45), 0 0 18px 4px rgba(255, 205, 130, .35), 0 0 50px 14px rgba(255, 122, 24, .16);
  }
  .moon::before, .moon::after { inset: -52%; }
  .moon::after { filter: none; }
  .cloud { filter: none; }
}
@keyframes moonglowm {
  from { box-shadow: inset -9px -6px 14px rgba(90, 50, 10, .55), inset 5px 4px 12px rgba(255, 250, 225, .45), 0 0 14px 3px rgba(255, 205, 130, .25), 0 0 40px 10px rgba(255, 122, 24, .10); }
  to   { box-shadow: inset -9px -6px 14px rgba(90, 50, 10, .55), inset 5px 4px 12px rgba(255, 250, 225, .45), 0 0 30px 9px rgba(255, 220, 150, .55), 0 0 70px 22px rgba(255, 122, 24, .24); }
}
@media (max-width: 560px) {
  .btn { display: block; width: 100%; text-align: center; padding: 15px 20px; font-size: 1.05rem; }  /* big, easy-to-hit buttons */
  .row { grid-template-columns: 1fr 1fr; }                      /* date + time side by side, people below */
  .row .field:nth-child(3) { grid-column: 1 / -1; }
  form { gap: 18px; }
  h2 { font-size: 1.8rem; }
  .prices div { gap: 4px 16px; }
}
@media (max-width: 380px) {
  input::placeholder, textarea::placeholder { font-size: .9em; }
  .row { grid-template-columns: 1fr; }                          /* tiny phones: one column */
  .result { padding: 18px; }
}
/* Phones turned sideways: keep the banner short so the content is not pushed off screen */
@media (max-height: 480px) and (orientation: landscape) { .deco { height: 96px; } }

@media (max-width: 480px) { body { font-size: 17px; } }
@media (prefers-reduced-motion: reduce) {
  .spider, .glow, .bat, .moon, .moon::before, .moon::after, .cloud, .stars, .stars::after, body::after, .sound { animation: none !important; }
  .embers { display: none; }
  .spider { transform: translateY(-26px); }
  .bat1 { translate: 58vw 6px; }
  .bat2 { translate: 24vw 0; }
  .moon { translate: -6vw 0; }
  .c1 { translate: 18vw 0; } .c2 { translate: 58vw 0; } .c3 { translate: 80vw 0; }
}
