/* EventPixie site. One deliberate dark theme: the app's purple backdrop is the brand. */

/* ---------- Fonts (self-hosted, latin subset, SIL Open Font License) ---------- */
@font-face {
  font-family: "Fraunces";
  font-style: normal;
  font-weight: 500 700;
  font-display: swap;
  src: url(../fonts/Fraunces-normal-500-700.woff2) format("woff2");
}
@font-face {
  font-family: "Fraunces";
  font-style: italic;
  font-weight: 400 600;
  font-display: swap;
  src: url(../fonts/Fraunces-italic-400-600.woff2) format("woff2");
}
@font-face {
  font-family: "Figtree";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url(../fonts/Figtree-400-700.woff2) format("woff2");
}
/* BRAND FONT SLOT: the owner's EventPixie display font.
 * Drop the file in as assets/fonts/eventpixie-display.woff2. Nothing uses this
 * face yet, so the browser never requests the file until a rule does.
 * Until it arrives the name "EventPixie" as branding is ALWAYS the artwork
 * (wordmark/lockup images), never a substitute web font. */
@font-face {
  font-family: "EventPixie Display";
  font-style: normal;
  font-weight: 400;
  font-display: block;
  src: url(../fonts/eventpixie-display.woff2) format("woff2");
}

/* ---------- Tokens ---------- */
:root {
  color-scheme: dark;
  --bg: #2c2558;            /* mid-tone of BG1, for contrast checks */
  --bg-deep: #1b1636;
  --ink: #ffffff;
  --ink-soft: #e9e4ff;      /* body copy: 11.9:1 on --bg */
  --ink-muted: #c9c1ee;     /* small print: 8.0:1 on --bg */
  --spark: #ffd98a;         /* pixie-dust gold for numerals and sparkles */
  --line: rgba(255, 255, 255, 0.18);
  --panel: rgba(23, 18, 50, 0.42);
  --card: #fbf8ff;
  --card-ink: #1d1640;
  --radius: 22px;
  --gutter: 16px;
  --display: "Fraunces", "Iowan Old Style", Georgia, serif;
  --text: "Figtree", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink-soft);
  font: 400 1.0625rem/1.6 var(--text);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
/* The app's faceted purple (BG1) covers the whole page and scrolls with it.
 * One 1600px file serves every width: it is soft gradients plus thin light lines. */
body {
  background-color: #1f1a2e; /* BG1's bottom edge */
  background-image:
    linear-gradient(180deg, rgba(27, 22, 54, 0) 0%, rgba(27, 22, 54, 0.25) 60%, rgba(20, 16, 40, 0.55) 100%),
    url(../img/bg-1600.jpg);
  background-image:
    linear-gradient(180deg, rgba(27, 22, 54, 0) 0%, rgba(27, 22, 54, 0.25) 60%, rgba(20, 16, 40, 0.55) 100%),
    image-set(url(../img/bg-1600.webp) type("image/webp"), url(../img/bg-1600.jpg) type("image/jpeg"));
  background-size: cover;
  background-position: right top;
  background-repeat: no-repeat;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--ink); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--spark); outline-offset: 3px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: var(--gutter); top: -60px; background: var(--card); color: var(--card-ink); padding: 8px 14px; border-radius: 10px; z-index: 10; }
.skip:focus { top: 12px; }

.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 var(--gutter); }
@media (min-width: 700px) { :root { --gutter: 32px; } }

/* ---------- Header ---------- */
.top { padding: 14px 0; }
.top .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.top__brand img { width: 150px; }
.top__get {
  font-weight: 600; font-size: 0.9375rem; text-decoration: none;
  padding: 8px 16px; border-radius: 999px; border: 1.5px solid rgba(255, 255, 255, 0.45);
  white-space: nowrap;
}
.top__get:hover { background: rgba(255, 255, 255, 0.1); }
@media (min-width: 700px) { .top { padding: 22px 0; } .top__brand img { width: 190px; } }

/* ---------- Buttons (mirror the app: white capsule, outlined capsule) ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 12px;
  min-height: 56px; padding: 8px 26px 8px 8px; border-radius: 999px;
  font: 700 1.0625rem/1.2 var(--text); text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.btn--get { background: var(--card); color: var(--card-ink); box-shadow: 0 10px 30px -10px rgba(8, 4, 30, 0.8); }
.btn--get:hover { transform: translateY(-1px); box-shadow: 0 14px 34px -10px rgba(8, 4, 30, 0.9); }
.btn--get img { width: 40px; height: 40px; border-radius: 10px; }
.btn--get small { display: block; font-weight: 500; font-size: 0.8125rem; color: #5a5180; }
.btn--plain { padding: 8px 24px; background: var(--card); color: var(--card-ink); }
.btn--ghost { padding: 8px 24px; color: var(--ink); border: 1.5px solid rgba(255, 255, 255, 0.45); }
.btn--ghost:hover { background: rgba(255, 255, 255, 0.1); }

/* The phase line under every download button. <html data-phase> decides which shows. */
.phase { margin: 12px 0 0; font-size: 0.875rem; color: var(--ink-muted); }
[data-phase="testflight"] .phase--appstore,
[data-phase="appstore"] .phase--testflight { display: none; }

/* ---------- Hero ---------- */
.hero { padding: 8px 0 56px; text-align: center; }
.hero__art { position: relative; width: min(78vw, 340px); margin: 0 auto; }
.hero__art img { width: 100%; filter: drop-shadow(0 0 22px rgba(196, 176, 255, 0.35)); }
.hero h1 { margin: 6px auto 0; width: min(70vw, 300px); }
.hero h1 img { width: 100%; }
.hero__line {
  margin: 22px auto 0; max-width: 15ch;
  font: italic 500 clamp(2rem, 8.4vw, 3.5rem)/1.08 var(--display);
  font-variation-settings: "opsz" 96, "SOFT" 100;
  color: var(--ink); letter-spacing: -0.01em;
}
.hero__lede { margin: 18px auto 0; max-width: 34em; color: var(--ink-soft); }
.hero__cta { margin-top: 28px; }

/* Sparkles that twinkle over the logo's own stars. */
.spark { position: absolute; width: 14px; height: 14px; color: var(--spark); opacity: 0; animation: twinkle 4.8s ease-in-out infinite; pointer-events: none; }
.spark svg { width: 100%; height: 100%; display: block; }
.spark--1 { top: 9%;  left: 47%; animation-delay: 0.2s; width: 18px; height: 18px; }
.spark--2 { top: 22%; right: 12%; animation-delay: 1.7s; }
.spark--3 { bottom: 26%; left: 6%;  animation-delay: 3.1s; }
.spark--4 { bottom: 14%; right: 9%; animation-delay: 2.4s; width: 10px; height: 10px; }
@keyframes twinkle {
  0%, 100% { opacity: 0; transform: scale(0.4) rotate(0deg); }
  12% { opacity: 1; transform: scale(1) rotate(20deg); }
  26% { opacity: 0; transform: scale(0.5) rotate(40deg); }
}

@media (min-width: 900px) {
  .hero { padding: 24px 0 96px; text-align: left; }
  .hero .wrap { display: grid; grid-template-columns: 1.05fr 1fr; align-items: center; gap: 56px; }
  .hero__art { width: 100%; max-width: 480px; order: 2; justify-self: end; }
  .hero h1 { margin: 0; width: 300px; }
  .hero__line { margin-left: 0; font-size: 3.75rem; }
  .hero__lede { margin-left: 0; font-size: 1.1875rem; }
  .hero__cta { display: flex; align-items: center; gap: 22px; }
  .hero__cta .phase { margin: 0; max-width: 16em; }
}

/* ---------- Section headings ---------- */
.kicker { margin: 0; font-size: 0.8125rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--spark); }
.h2 { margin: 6px 0 0; font: 600 clamp(1.875rem, 6.6vw, 2.75rem)/1.12 var(--display); font-variation-settings: "opsz" 72, "SOFT" 50; color: var(--ink); letter-spacing: -0.01em; }

/* ---------- How it works: three "prints" ---------- */
.how { padding: 24px 0 64px; }
.how__head { text-align: center; }
.prints { list-style: none; margin: 34px 0 0; padding: 0; display: grid; gap: 26px; counter-reset: step; }
.print {
  background: var(--card); color: var(--card-ink);
  padding: 12px 12px 22px; border-radius: 6px;
  box-shadow: 0 22px 40px -18px rgba(6, 2, 24, 0.85);
  max-width: 340px; width: 100%; margin: 0 auto;
}
.print:nth-child(1) { transform: rotate(-2.2deg); }
.print:nth-child(2) { transform: rotate(1.6deg); }
.print:nth-child(3) { transform: rotate(-1deg); }
.print__shot {
  position: relative; aspect-ratio: 4 / 3; border-radius: 3px; overflow: hidden;
  background: radial-gradient(120% 90% at 70% 10%, #6a5bb0 0%, #3a3070 55%, #241d4c 100%);
  display: grid; place-items: center; color: #fff;
}
.print__shot svg { width: 46%; height: auto; overflow: visible; }
.print__num {
  position: absolute; left: 12px; top: 6px;
  font: italic 600 2.6rem/1 var(--display); color: var(--spark);
}
.print h3 { margin: 16px 6px 0; font: 600 1.375rem/1.2 var(--display); font-variation-settings: "opsz" 36; }
.print p { margin: 6px 6px 0; font-size: 1rem; line-height: 1.5; color: #3d3566; }
.how__note { margin: 40px auto 0; max-width: 32em; text-align: center; color: var(--ink-soft); }

@media (min-width: 900px) {
  .how { padding: 40px 0 104px; }
  .prints { grid-template-columns: repeat(3, 1fr); gap: 32px; margin-top: 48px; }
  .print:nth-child(2) { transform: rotate(1.6deg) translateY(18px); }
}

/* ---------- Hosts ---------- */
.hosts { padding: 0 0 64px; }
.hosts__panel {
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  padding: 26px 22px;
}
.hosts__panel p { margin: 12px 0 0; }
.hosts__link { display: inline-block; margin-top: 16px; font-weight: 600; }
@media (min-width: 900px) {
  .hosts { padding-bottom: 104px; }
  .hosts__panel { display: grid; grid-template-columns: 1fr 1.25fr; gap: 48px; padding: 44px 48px; align-items: start; }
  .hosts__panel p:first-child { margin-top: 0; }
}

/* ---------- Download ---------- */
.get { padding: 0 0 72px; }
.get .wrap { display: grid; gap: 28px; justify-items: center; text-align: center; }
.get__copy p { margin: 12px auto 0; max-width: 30em; }
.get__copy .btn { margin-top: 24px; }
.qr {
  margin: 0; background: var(--card); color: var(--card-ink); border-radius: var(--radius);
  padding: 18px 18px 14px; width: 220px; box-shadow: 0 22px 40px -18px rgba(6, 2, 24, 0.85);
}
.qr img { width: 100%; aspect-ratio: 1; }
.qr figcaption { margin-top: 10px; font-size: 0.875rem; font-weight: 600; }
@media (min-width: 900px) {
  .get { padding-bottom: 112px; }
  .get .wrap { grid-template-columns: auto 1fr; text-align: left; gap: 56px; justify-items: start; align-items: center; max-width: 900px; }
  .get__copy p { margin-left: 0; }
  .qr { width: 240px; }
}

/* ---------- Footer ---------- */
.foot { border-top: 1px solid var(--line); padding: 32px 0 calc(32px + env(safe-area-inset-bottom)); font-size: 0.9375rem; color: var(--ink-muted); }
.foot .wrap { display: grid; gap: 18px; }
.foot__mark { width: 150px; }
.foot nav { display: flex; flex-wrap: wrap; gap: 8px 22px; }
.foot nav a { color: var(--ink-soft); }
.foot p { margin: 0; }
@media (min-width: 900px) {
  .foot .wrap { grid-template-columns: auto 1fr auto; align-items: center; gap: 40px; }
  .foot nav { justify-content: center; }
}

/* ---------- Small pages (/get, /join) ---------- */
.page { padding: 8px 0 64px; }
.sheet {
  max-width: 560px; margin: 0 auto; text-align: center;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  padding: 32px 22px 28px;
}
.sheet__icon { width: 84px; height: 84px; border-radius: 20px; margin: 0 auto 18px; box-shadow: 0 12px 28px -12px rgba(6, 2, 24, 0.9); }
.sheet h1 { margin: 6px 0 0; font: 600 clamp(1.75rem, 7vw, 2.5rem)/1.12 var(--display); font-variation-settings: "opsz" 72, "SOFT" 50; color: var(--ink); overflow-wrap: anywhere; }
.sheet p { margin: 12px auto 0; max-width: 28em; }
.sheet .actions { display: grid; gap: 12px; margin-top: 26px; }
.sheet .fine { margin-top: 18px; font-size: 0.875rem; color: var(--ink-muted); }
.chip { display: inline-block; margin-top: 14px; padding: 4px 12px; border-radius: 999px; border: 1px solid var(--line); font: 600 0.875rem/1.6 ui-monospace, "SF Mono", Menlo, monospace; letter-spacing: 0.08em; color: var(--ink-soft); }
.state[hidden] { display: none; }
.join-qr { display: none; }
@media (min-width: 900px) {
  .page { padding-top: 32px; }
  .sheet { padding: 44px 48px 36px; }
  .sheet .actions { grid-template-columns: 1fr 1fr; }
  .join-qr { display: flex; align-items: center; gap: 16px; margin: 26px auto 0; max-width: 340px; text-align: left; font-size: 0.9375rem; }
  .join-qr img { width: 96px; background: var(--card); border-radius: 12px; padding: 8px; }
}

/* Code entry */
.code-form { margin-top: 22px; display: grid; gap: 12px; }
.code-form label { font-size: 0.8125rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-muted); }
.code-form input {
  width: 100%; min-height: 56px; border-radius: 16px; border: 1.5px solid rgba(255, 255, 255, 0.4);
  background: rgba(10, 6, 30, 0.35); color: var(--ink); text-align: center;
  font: 600 1.5rem/1 ui-monospace, "SF Mono", Menlo, monospace; letter-spacing: 0.2em; text-transform: uppercase;
}
.code-form input::placeholder { color: rgba(255, 255, 255, 0.3); }
.code-form input:focus { outline: none; border-color: var(--spark); }
.code-form button { border: 0; cursor: pointer; }
.err { color: #ffd0d0; font-weight: 600; }

/* Loading dots */
.dots { display: inline-flex; gap: 8px; margin-top: 18px; }
.dots i { width: 9px; height: 9px; border-radius: 50%; background: var(--spark); animation: dot 1.2s ease-in-out infinite; }
.dots i:nth-child(2) { animation-delay: 0.15s; }
.dots i:nth-child(3) { animation-delay: 0.3s; }
@keyframes dot { 0%, 100% { opacity: 0.25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-5px); } }

@media (prefers-reduced-motion: reduce) {
  .spark { animation: none; opacity: 0.85; }
  .dots i { animation: none; opacity: 0.8; }
  .btn, .btn--get:hover { transition: none; transform: none; }
}
