:root {
  --bg: #f3f6f9;
  --bg-deep: #e7eef5;
  --ink: #101826;
  --muted: #5b6b7c;
  --line: rgba(16, 24, 38, 0.1);
  --accent: #ff3d6e;
  --accent-ink: #fff7f9;
  --surface: rgba(255, 255, 255, 0.78);
  --shadow: 0 18px 50px rgba(16, 24, 38, 0.12);
  --radius: 1.25rem;
  --font-display: "Syne", "Avenir Next", sans-serif;
  --font-body: "Figtree", "Segoe UI", sans-serif;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--font-body);
  color: var(--ink);
  background:
    radial-gradient(120% 80% at 0% 0%, #dce9f7 0%, transparent 55%),
    radial-gradient(90% 70% at 100% 10%, #ffe0e8 0%, transparent 45%),
    linear-gradient(180deg, var(--bg-deep), var(--bg) 40%, #eef3f8);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; display: block; }
a { color: inherit; }

.brand {
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 0.95;
  margin: 0;
}

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.03em;
  margin: 0 0 0.45rem;
  line-height: 1.1;
}

h1 { font-size: clamp(1.55rem, 6.5vw, 2.35rem); }
h2 { font-size: clamp(1.15rem, 4vw, 1.45rem); }
.lead, .muted { color: var(--muted); }
.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.82rem;
  color: var(--muted);
  word-break: break-all;
}

.btn-primary,
.btn-ghost,
.btn-danger {
  appearance: none;
  border: 0;
  border-radius: 999px;
  padding: 0.95rem 1.35rem;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}
.btn-primary {
  background: linear-gradient(135deg, #ff4d7a, #ff2f5f 55%, #ff7a4d);
  color: var(--accent-ink);
  box-shadow: 0 10px 28px rgba(255, 61, 110, 0.35);
}
.btn-primary:active { transform: scale(0.98); }
.btn-ghost {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.35);
  backdrop-filter: blur(10px);
}
.btn-danger {
  background: transparent;
  color: #c0392b;
  border: 1px solid rgba(192, 57, 43, 0.3);
  padding: 0.55rem 0.9rem;
  font-size: 0.9rem;
}

label {
  display: grid;
  gap: 0.35rem;
  font-size: 0.92rem;
  color: var(--muted);
  font-weight: 600;
}
input, textarea, select {
  width: 100%;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  border-radius: 14px;
  padding: 0.9rem 1rem;
  font: inherit;
}
textarea { resize: vertical; }
.check {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 500;
}
.check input { width: auto; }

.stack { display: grid; gap: 0.9rem; margin-top: 1rem; }
.grid-form { display: grid; gap: 0.85rem; margin-top: 0.8rem; }
@media (min-width: 720px) {
  .grid-form { grid-template-columns: 1fr 1fr; }
  .grid-form .full,
  .grid-form > .btn-primary { grid-column: 1 / -1; }
  .grid-form.compact {
    grid-template-columns: 2fr 1fr auto auto auto;
    align-items: end;
  }
}

.error { color: #c0392b; font-weight: 600; }
.ok { color: #1f8a4c; font-weight: 600; }
.back { color: var(--muted); text-decoration: none; font-weight: 600; }

/* —— Landing —— */
body.landing { min-height: 100svh; }
.landing-stage {
  min-height: 100svh;
  display: grid;
  place-items: end stretch;
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(80% 60% at 20% 20%, rgba(255, 61, 110, 0.28), transparent 60%),
    radial-gradient(70% 50% at 90% 10%, rgba(64, 140, 255, 0.25), transparent 55%),
    linear-gradient(160deg, #101826, #1c2a44 50%, #0b1220);
}
.landing-stage::before {
  content: "";
  position: absolute;
  inset: -10%;
  background:
    radial-gradient(circle at 30% 40%, rgba(255, 255, 255, 0.08) 0 2px, transparent 3px),
    radial-gradient(circle at 70% 60%, rgba(255, 255, 255, 0.06) 0 1px, transparent 2px);
  background-size: 120px 120px, 80px 80px;
  animation: drift 18s linear infinite;
  opacity: 0.5;
}
.landing-main {
  position: relative;
  z-index: 1;
  width: min(100% - 2rem, 34rem);
  margin: 0 auto;
  padding: 2rem 0 calc(2.5rem + var(--safe-bottom));
  color: #fff;
}
.landing-main .brand {
  font-size: clamp(2.6rem, 12vw, 4.2rem);
  margin-bottom: 0.75rem;
}
.landing-main h1 {
  font-size: clamp(1.15rem, 4.2vw, 1.45rem);
  font-weight: 600;
  color: rgba(255, 255, 255, 0.88);
  max-width: 16ch;
}
.landing-main .lead {
  color: rgba(255, 255, 255, 0.68);
  margin: 0.7rem 0 1.4rem;
  max-width: 28ch;
}
.landing-main .btn-ghost { width: fit-content; }

/* —— Client microsite —— */
body.client { background: var(--bg); }

.hero-cover {
  position: relative;
  min-height: 100svh;
  min-height: 100dvh;
  display: grid;
  align-content: end;
  color: #fff;
  overflow: hidden;
  isolation: isolate;
}
.hero-cover--compact {
  min-height: min(78svh, 640px);
}
.hero-cover__media {
  position: absolute;
  inset: 0;
  z-index: -2;
  background: #152033 center/cover no-repeat;
  transform: scale(1.08);
  animation: kenburns 18s ease-in-out alternate infinite;
}
.hero-cover__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.hero-cover__shade {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(180deg, rgba(10, 14, 22, 0.15) 0%, rgba(10, 14, 22, 0.25) 40%, rgba(10, 14, 22, 0.88) 100%),
    radial-gradient(90% 60% at 50% 0%, rgba(255, 61, 110, 0.22), transparent 60%);
}
.hero-cover__content {
  width: min(100% - 1.75rem, 28rem);
  margin: 0 auto;
  padding: 1.5rem 0 calc(1.75rem + var(--safe-bottom));
}
.hero-cover .brand {
  font-size: clamp(2.4rem, 11vw, 3.6rem);
  text-shadow: 0 8px 40px rgba(0, 0, 0, 0.35);
}
.hero-cover .event-title {
  margin-top: 0.85rem;
  font-size: clamp(1.05rem, 4vw, 1.35rem);
  font-weight: 600;
  color: rgba(255, 255, 255, 0.92);
  max-width: 18ch;
}
.hero-cover .event-meta {
  margin: 0.45rem 0 0;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.98rem;
}
.pin-form {
  margin-top: 1.35rem;
  display: grid;
  gap: 0.75rem;
}
.pin-form label { color: rgba(255, 255, 255, 0.78); }
.pin-form input {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.28);
  color: #fff;
  backdrop-filter: blur(12px);
  font-size: 1.2rem;
  letter-spacing: 0.2em;
  text-align: center;
}
.pin-form input::placeholder { color: rgba(255, 255, 255, 0.45); letter-spacing: normal; }
.pin-form .btn-primary { width: 100%; }

.client-content {
  width: min(100% - 1.5rem, 40rem);
  margin: -1.75rem auto 0;
  padding: 0 0 calc(2.5rem + var(--safe-bottom));
  position: relative;
  z-index: 2;
}
.content-panel {
  background: var(--surface);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.65);
  border-radius: calc(var(--radius) + 4px);
  box-shadow: var(--shadow);
  padding: 1.15rem 1.05rem 1.35rem;
}
@media (min-width: 640px) {
  .content-panel { padding: 1.5rem 1.4rem 1.7rem; }
}

.summary-block {
  margin-bottom: 1.25rem;
  padding-bottom: 1.15rem;
  border-bottom: 1px solid var(--line);
}
.summary-block p {
  color: var(--muted);
  margin: 0 0 0.75rem;
  font-size: 0.95rem;
}

.list-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.35rem;
}
.filters {
  display: flex;
  gap: 0.35rem;
  background: rgba(16, 24, 38, 0.05);
  padding: 0.25rem;
  border-radius: 999px;
}
.filters a {
  text-decoration: none;
  color: var(--muted);
  font-weight: 700;
  font-size: 0.88rem;
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
}
.filters a.active {
  background: #fff;
  color: var(--ink);
  box-shadow: 0 4px 14px rgba(16, 24, 38, 0.08);
}
.list-tools .btn-primary {
  padding: 0.7rem 1rem;
  font-size: 0.9rem;
  width: 100%;
}
@media (min-width: 480px) {
  .list-tools .btn-primary { width: auto; }
}

.msg-list {
  display: grid;
  gap: 0.85rem;
  margin-top: 1rem;
}
.msg-item {
  display: grid;
  gap: 0.45rem;
  padding: 0.95rem 0.15rem 1rem;
  border-bottom: 1px solid var(--line);
}
.msg-item:last-child { border-bottom: 0; padding-bottom: 0.2rem; }
.msg-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
}
.msg-item h3 {
  font-size: 1.12rem;
  font-family: var(--font-body);
  font-weight: 700;
  letter-spacing: -0.02em;
}
.fav {
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-weight: 800;
  color: var(--accent);
  background: rgba(255, 61, 110, 0.1);
  border-radius: 999px;
  padding: 0.28rem 0.6rem;
  white-space: nowrap;
}
.link {
  color: var(--accent);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 700;
}
audio.player {
  width: 100%;
  margin: 0.15rem 0;
  height: 42px;
}

.empty-state {
  text-align: center;
  padding: 1.5rem 0.5rem;
  color: var(--muted);
}

/* —— Admin —— */
body.admin { min-height: 100svh; }
.admin-shell {
  width: min(100% - 1.5rem, 52rem);
  margin: 0 auto;
  padding: 1.4rem 0 calc(2.5rem + var(--safe-bottom));
}
.admin-shell.narrow { width: min(100% - 1.5rem, 26rem); padding-top: 18vh; }
.admin-shell .brand {
  font-size: clamp(1.8rem, 7vw, 2.4rem);
  background: linear-gradient(120deg, var(--ink), #ff3d6e);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.admin-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.8rem;
  flex-wrap: wrap;
  margin-bottom: 0.8rem;
}
.admin-top .btn-ghost {
  color: var(--ink);
  background: #fff;
  border-color: var(--line);
}
.panel {
  margin-top: 1rem;
  padding: 1.15rem 1.05rem;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: var(--radius);
  box-shadow: 0 10px 30px rgba(16, 24, 38, 0.06);
}
.cover-preview {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-radius: 14px;
  margin-bottom: 0.75rem;
  background: #d7e0ea;
}
.event-list {
  list-style: none;
  padding: 0;
  margin: 0.8rem 0 0;
  display: grid;
  gap: 0.65rem;
}
.event-list a {
  display: grid;
  gap: 0.2rem;
  text-decoration: none;
  color: inherit;
  padding: 0.95rem 1rem;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.65);
  border: 1px solid var(--line);
}
.event-list strong { font-family: var(--font-display); font-size: 1.1rem; }
.event-list span { color: var(--muted); font-size: 0.9rem; }
.msg-admin-list { display: grid; gap: 1rem; margin-top: 0.8rem; }
.msg-admin {
  padding: 0.9rem;
  border-radius: 14px;
  background: rgba(16, 24, 38, 0.03);
  display: grid;
  gap: 0.7rem;
}

/* —— Motion —— */
.reveal { animation: rise 0.75s cubic-bezier(0.22, 1, 0.36, 1) both; }
.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.18s; }
.delay-3 { animation-delay: 0.28s; }
.msg-item.reveal { animation-delay: calc(var(--d, 0) * 0.05s); }

@keyframes rise {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: none; }
}
@keyframes kenburns {
  from { transform: scale(1.05) translate3d(0, 0, 0); }
  to { transform: scale(1.14) translate3d(-1.5%, -1%, 0); }
}
@keyframes drift {
  from { transform: translate3d(0, 0, 0); }
  to { transform: translate3d(-40px, 30px, 0); }
}

@media (prefers-reduced-motion: reduce) {
  .reveal,
  .hero-cover__media,
  .landing-stage::before { animation: none !important; }
}

/* Desktop polish: keep phone-first composition, slightly wider hero text */
@media (min-width: 900px) {
  .hero-cover__content,
  .landing-main { width: min(100% - 3rem, 34rem); }
  .client-content { margin-top: -2.5rem; }
}
