/* Under the mirror ball - registration site
   Palette from brand/visual-identity-brief.md. Warm near-black room, violet wash,
   Instax off-white, date stamp orange. Display: Unbounded 800. Body: Atkinson Hyperlegible. */

:root {
  --ink: #2F2119;
  --room: #22181f;
  --room-deep: #1a1218;
  --wall: #43304a;
  --wall-light: #5a4263;
  --violet: #7E658A;
  --rose: #AE7982;
  --silver: #E9E4DA;
  --frame: #CED3D1;
  --orange: #E8873A;
  --text: #F5F0E8;
  --muted: #CDC3CA;
  --line: #4a3a4d;
  --field: #2d2129;
  --field-line: #6b5870;
  --error: #FFB4A8;
  --display: 'Unbounded', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --body: 'Atkinson Hyperlegible', system-ui, -apple-system, 'Segoe UI', Helvetica, Arial, sans-serif;
  color-scheme: dark;
}

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

html { background: var(--room); -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--room);
  color: var(--text);
  font-family: var(--body);
  font-size: 1.125rem;
  line-height: 1.5;
  min-height: 100vh;
}

img { max-width: 100%; height: auto; }

.skip {
  position: absolute; left: 16px; top: -100px;
  background: var(--silver); color: var(--ink);
  padding: .6em 1em; border-radius: 6px; z-index: 20;
  font-weight: 700; text-decoration: none;
}
.skip:focus { top: 16px; outline: 3px solid var(--orange); outline-offset: 3px; }

/* Hero */

.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding-block: calc(56px + env(safe-area-inset-top, 0px)) 56px;
  padding-inline: 16px;
  background:
    radial-gradient(90% 70% at 50% 0%, var(--wall-light) 0%, transparent 70%),
    radial-gradient(70% 60% at 85% 100%, #4b2f3f 0%, transparent 70%),
    linear-gradient(180deg, var(--wall) 0%, var(--room) 100%);
}
.hero .ball {
  position: absolute; inset: 0; width: 100%; height: 100%;
  z-index: -1; pointer-events: none;
}
.hero-inner {
  max-width: 1040px; margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(220px, 320px) 1fr;
  gap: 48px;
  align-items: center;
  min-height: min(70vh, 640px);
}
.print {
  margin: 0;
  transform: rotate(-2.5deg);
  filter: drop-shadow(0 22px 34px rgba(0,0,0,.6));
}
.print img { display: block; width: 100%; border-radius: 2px; }

.words { min-width: 0; }
.place {
  font-family: var(--display); font-weight: 800;
  font-size: .95rem; letter-spacing: .08em; text-transform: uppercase;
  color: var(--frame); margin: 0 0 .6em;
}
.title {
  font-family: var(--display); font-weight: 800;
  font-size: clamp(2.1rem, 6vw, 3.8rem); line-height: 1.05;
  margin: 0; color: var(--text);
  text-wrap: balance; overflow-wrap: anywhere;
}
.date {
  font-family: var(--display); font-weight: 800;
  font-size: clamp(1.05rem, 2.4vw, 1.4rem);
  color: var(--orange); margin: .7em 0 0; letter-spacing: .02em;
}

/* Buttons */

.button, .button-secondary, .remove {
  font-family: var(--display); font-weight: 800;
  letter-spacing: .04em; text-transform: uppercase;
  border-radius: 999px; border: 0; cursor: pointer;
  min-height: 48px; text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center;
}
.button {
  margin-top: 1.5em;
  font-size: 1.15rem;
  background: var(--silver); color: var(--ink);
  padding: .85em 1.7em;
}
.button:hover { background: #fff; }
.button[disabled] { opacity: .7; cursor: default; }
.button-secondary {
  font-size: .95rem;
  background: transparent; color: var(--silver);
  border: 2px solid var(--field-line);
  padding: .7em 1.3em;
}
.button-secondary:hover { border-color: var(--silver); }
.remove {
  font-family: var(--body); font-weight: 700; text-transform: none; letter-spacing: 0;
  font-size: 1rem; color: var(--muted); background: transparent;
  padding: .5em .9em; text-decoration: underline; text-underline-offset: .2em;
}
.remove:hover { color: var(--text); }

:focus-visible { outline: 3px solid var(--orange); outline-offset: 4px; }

/* Register */

.register {
  padding-block: 56px 72px;
  padding-inline: 16px;
  background: var(--room-deep);
  border-top: 1px solid var(--line);
}
.register-inner { max-width: 640px; margin: 0 auto; }
.section-title {
  font-family: var(--display); font-weight: 800;
  font-size: clamp(1.6rem, 4vw, 2.2rem); line-height: 1.1;
  margin: 0 0 1em; color: var(--text);
}

.field { margin-block: 0 1.4em; }
.field label, .guests legend {
  display: block; font-weight: 700; margin-bottom: .4em; color: var(--text);
}
.field input[type="text"], .field input[type="email"] {
  display: block; width: 100%;
  font: inherit; font-size: 1.125rem; color: var(--text);
  background: var(--field);
  border: 2px solid var(--field-line); border-radius: 8px;
  padding: .7em .8em; min-height: 52px;
}
.field input:focus { outline: 3px solid var(--orange); outline-offset: 2px; border-color: var(--silver); }
.field input[aria-invalid="true"] { border-color: var(--error); }
.help { margin: .45em 0 0; font-size: 1rem; color: var(--muted); }
.error { margin: .45em 0 0; font-size: 1rem; color: var(--error); font-weight: 700; }
.error:empty { display: none; }

.guests { border: 0; padding: 0; margin: 0 0 1.4em; }
.guests legend { font-family: var(--display); font-weight: 800; font-size: 1.05rem; margin-bottom: .8em; }
.guest-row {
  border: 1px solid var(--line); border-radius: 10px;
  padding: 16px 16px 8px; margin-bottom: 14px;
}
.guest-row .field { margin-bottom: 1em; }
.guest-row .remove { margin: 0 0 6px -6px; }

.check { display: flex; align-items: flex-start; gap: 12px; margin-block: 1.6em 1.4em; }
.check input {
  width: 26px; height: 26px; margin: 2px 0 0; flex: 0 0 auto;
  accent-color: var(--orange);
}
.check label { margin: 0; font-weight: 400; }

.trap { position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }

.actions { margin-top: .4em; }
.actions .button { margin-top: 0; }
#form-error { margin-top: 1em; }

.status { margin: 0 0 1em; color: var(--muted); }
.status:empty { display: none; }

.done p { font-size: 1.2rem; max-width: 40ch; }
.done:focus { outline: none; }
.noscript { color: var(--muted); }

/* Footer */

.foot {
  padding-block: 40px calc(48px + env(safe-area-inset-bottom, 0px));
  padding-inline: 16px;
  background: var(--room);
  border-top: 1px solid var(--line);
}
.foot-inner { max-width: 640px; margin: 0 auto; color: var(--muted); font-size: 1rem; }
.foot p { margin: 0 0 1em; }
.foot a { color: var(--text); }
.ack { max-width: 62ch; }

/* Phone */

@media (max-width: 640px) {
  .hero { padding-block: calc(40px + env(safe-area-inset-top, 0px)) 44px; }
  .hero-inner {
    grid-template-columns: 1fr; gap: 30px;
    justify-items: center; text-align: center; min-height: 0;
  }
  .print { width: min(270px, 74vw); }
  .words { max-width: 560px; }
  .title { font-size: clamp(2.2rem, 10vw, 3rem); }
  .register { padding-block: 44px 56px; }
}

@media (prefers-reduced-motion: reduce) {
  .print { transition: none; }
}
