:root {
  --bg: #faf7ff;
  --ink: #2b2150;
  --muted: #62597f;
  --brand: #7c5cf0;
  --brand-ink: #ffffff;
  --pink: #e8479b;
  --teal: #12b5b9;
  --teal-deep: #0b7f86;
  --lavender: #e9e1ff;
  --card: #ffffff;
  --line: #e4dbf7;
  --shadow: 0 8px 24px rgba(124, 92, 240, 0.14);
  --hero-a: #7c5cf0;
  --hero-b: #e8479b;
  --hero-ink: #ffffff;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1c1636;
    --ink: #f3eeff;
    --muted: #bdb3dc;
    --brand: #b29bff;
    --brand-ink: #1c1636;
    --pink: #ff7ab8;
    --teal: #3fd6d8;
    --teal-deep: #7ee8e8;
    --lavender: #2c2352;
    --card: #261e47;
    --line: #3a3068;
    --shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
    --hero-a: #5a3fc4;
    --hero-b: #b83a7e;
  }
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; animation: none !important; }
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 17px/1.65 "Trebuchet MS", "Segoe UI", system-ui, -apple-system, sans-serif;
}
a { color: var(--brand); font-weight: 600; }
.wrap { max-width: 980px; margin: 0 auto; padding: 0 20px; }

header.site { background: var(--card); border-bottom: 1px solid var(--line); }
header.site::after { content: ""; display: block; height: 4px; background: linear-gradient(90deg, var(--teal), var(--brand), var(--pink)); }
header.site .wrap { display: flex; align-items: center; justify-content: space-between; padding-top: 14px; padding-bottom: 14px; gap: 12px; flex-wrap: wrap; }
.logo { font-weight: 800; font-size: 1.35rem; text-decoration: none; color: var(--ink); letter-spacing: -0.02em; }
.logo span { color: var(--pink); }
nav { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 18px; }
nav a { text-decoration: none; color: var(--muted); font-size: 0.97rem; font-weight: 700; }
nav a:hover { color: var(--brand); }
nav a.btn, nav a.btn:hover { color: #ffffff; }

.btn {
  display: inline-block;
  background: #0b8f95;
  color: #ffffff;
  padding: 12px 26px;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 800;
  border: 0;
  cursor: pointer;
  font-size: 1.02rem;
  box-shadow: 0 6px 16px rgba(11, 143, 149, 0.35);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.btn:hover { background: #0a7e84; transform: translateY(-2px); box-shadow: 0 10px 22px rgba(11, 143, 149, 0.4); }
.btn:active { transform: translateY(1px); box-shadow: 0 3px 8px rgba(11, 143, 149, 0.3); }
.btn.secondary { background: var(--card); color: var(--brand); box-shadow: inset 0 0 0 2px var(--brand); }
.btn.secondary:hover { background: var(--lavender); box-shadow: inset 0 0 0 2px var(--brand); }
.btn.small { padding: 7px 18px; font-size: 0.93rem; box-shadow: none; }
.btn[disabled] { opacity: 0.55; cursor: not-allowed; transform: none; }

.hero-band {
  background: linear-gradient(135deg, var(--hero-a), var(--hero-b));
  color: var(--hero-ink);
  position: relative;
  overflow: hidden;
}
.hero-band::before, .hero-band::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  opacity: 0.32;
}
.hero-band::before { width: 280px; height: 280px; background: var(--teal); right: -80px; top: -90px; }
.hero-band::after { width: 190px; height: 190px; background: #d9ccff; right: 130px; bottom: -100px; }
.hero { padding: 64px 0 56px; position: relative; z-index: 1; }
.hero h1 { font-size: clamp(2.2rem, 7vw, 3.6rem); line-height: 1.07; margin: 0 0 16px; letter-spacing: -0.03em; }
.hero p.lead { font-size: 1.2rem; max-width: 620px; margin: 0 0 28px; }
.hero .actions { display: flex; gap: 14px; flex-wrap: wrap; }
.hero .btn.secondary { background: rgba(255, 255, 255, 0.95); color: #5a3fc4; box-shadow: none; }
.pill { display: inline-block; background: rgba(255, 255, 255, 0.22); padding: 5px 14px; border-radius: 999px; font-weight: 700; font-size: 0.9rem; margin-bottom: 16px; }

section { padding: 40px 0; }
section h2 { font-size: 1.8rem; margin: 0 0 20px; letter-spacing: -0.02em; }
.grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 22px;
  box-shadow: var(--shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.card:hover { transform: translateY(-3px); }
.card h3 { margin: 6px 0 8px; font-size: 1.15rem; }
.card p { margin: 0; color: var(--muted); font-size: 0.98rem; }
.icon { display: inline-flex; align-items: center; justify-content: center; width: 48px; height: 48px; border-radius: 14px; background: color-mix(in srgb, var(--teal) 16%, transparent); color: var(--teal-deep); margin-bottom: 6px; }
.grid .card:nth-child(2) .icon { background: color-mix(in srgb, var(--brand) 16%, transparent); color: var(--brand); }
.grid .card:nth-child(3) .icon { background: color-mix(in srgb, var(--pink) 16%, transparent); color: var(--pink); }
.grid .card:nth-child(4) .icon { background: color-mix(in srgb, var(--teal) 16%, transparent); color: var(--teal-deep); }

.notice {
  border: 1px solid var(--line);
  border-left: 5px solid var(--pink);
  background: var(--lavender);
  color: var(--ink);
  padding: 16px 20px;
  border-radius: 16px;
}
.rules { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.rules li { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 14px 18px 14px 56px; position: relative; box-shadow: var(--shadow); }
.rules li::before { content: "\2714"; position: absolute; left: 16px; top: 13px; width: 28px; height: 28px; border-radius: 50%; background: #0b8f95; color: #ffffff; font-weight: 900; text-align: center; line-height: 28px; font-size: 0.95rem; }

footer { border-top: 1px solid var(--line); margin-top: 40px; padding: 24px 0; color: var(--muted); font-size: 0.92rem; background: var(--card); }

.portal-box {
  max-width: 480px;
  margin: 48px auto;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 30px;
  box-shadow: var(--shadow);
}
.portal-box h1 { margin-top: 0; font-size: 1.8rem; letter-spacing: -0.02em; }
.small { font-size: 0.92rem; color: var(--muted); }
#browser-warn { display: none; margin-bottom: 16px; }

/* App pages */
[hidden] { display: none !important; }
.text-input, .field input[type="text"], .field select, .field textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  color: var(--ink);
  font: inherit;
}
.field { margin: 14px 0; }
.field label { display: block; font-weight: 700; margin-bottom: 4px; font-size: 0.95rem; }
.field-row { display: flex; gap: 10px; align-items: flex-start; }
.field-row input, .field-row textarea { flex: 1; }
details.section { margin-bottom: 14px; }
details.section > summary { cursor: pointer; font-weight: 900; font-size: 1.15rem; }
nav .small { margin-right: 4px; }
#invite-list { padding-left: 18px; }
#invite-list li { margin: 8px 0; }
.text-input:focus, .field input:focus, .field select:focus, .field textarea:focus { outline: 3px solid color-mix(in srgb, var(--teal) 45%, transparent); border-color: var(--teal); }
