/* Beyond Apps tips — light theme built on the brand: electric blue glass pills,
   the four-point sparkle, diagonal light rays, letter-spaced mono labels. */
:root {
  --accent: #2f6bff;
  --accent-deep: color-mix(in oklab, var(--accent), #0b1f8f 45%);
  --accent-light: color-mix(in oklab, var(--accent), #fff 55%);
  --accent-soft: color-mix(in oklab, var(--accent) 9%, transparent);
  --accent-ring: color-mix(in oklab, var(--accent) 28%, transparent);
  --glass: linear-gradient(160deg, color-mix(in oklab, var(--accent), #fff 30%) 0%, var(--accent) 45%, var(--accent-deep) 100%);

  --bg: #f4f7ff;
  --surface: #ffffff;
  --surface-2: #f2f5fd;
  --surface-3: #e6ecfa;
  --border: color-mix(in oklab, var(--accent) 12%, transparent);
  --text: #0a1030;
  --muted: #56608a;
  --faint: #929bbf;
  --danger: #e5484d;
  --shadow: 0 1px 2px rgba(10, 16, 48, 0.04), 0 12px 32px -12px rgba(31, 79, 224, 0.18), 0 40px 80px -40px rgba(31, 79, 224, 0.35);

  --font: "Manrope", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --display: "Bricolage Grotesque", var(--font);
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Consolas, monospace;
  --radius: 28px;
  --radius-sm: 16px;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #050816;
  --surface: #0c1128;
  --surface-2: #131a3a;
  --surface-3: #1c2550;
  --border: rgba(140, 170, 255, 0.12);
  --text: #eef2ff;
  --muted: #a3afd8;
  --faint: #6873a3;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 30px 80px -30px rgba(47, 107, 255, 0.45);
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body { font-family: var(--font); background: var(--bg); color: var(--text); -webkit-font-smoothing: antialiased; min-height: 100vh; overflow-x: hidden; }
html.embedded, html.embedded body { background: transparent; min-height: 0; overflow: hidden; } /* the iframe is sized to fit */
button, input, textarea { font: inherit; color: inherit; }
svg use { fill: currentColor; }

/* ---------- Light rays (from the brand banner) ---------- */
.rays { position: fixed; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; }
.rays::before {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(60% 50% at 78% 18%, color-mix(in oklab, var(--accent) 16%, transparent), transparent 70%),
    radial-gradient(40% 40% at 10% 90%, color-mix(in oklab, var(--accent) 10%, transparent), transparent 70%);
}
.rays i {
  position: absolute; left: -30%; width: 160%; height: 56px; border-radius: 999px;
  background: linear-gradient(90deg, transparent 0%, color-mix(in oklab, var(--accent) 34%, transparent) 45%, color-mix(in oklab, var(--accent) 10%, transparent) 70%, transparent 100%);
  transform: rotate(-24deg); filter: blur(12px); opacity: 0.75;
  animation: sweep 14s ease-in-out infinite alternate;
}
.rays i:nth-child(1) { top: 2%; }
.rays i:nth-child(2) { top: 16%; height: 28px; animation-delay: -3s; opacity: 0.5; }
.rays i:nth-child(3) { top: 30%; height: 80px; animation-delay: -6s; opacity: 0.45; }
.rays i:nth-child(4) { top: 48%; height: 36px; animation-delay: -9s; opacity: 0.35; }
.rays i:nth-child(5) { top: 64%; height: 64px; animation-delay: -12s; opacity: 0.25; }
@keyframes sweep { to { transform: rotate(-24deg) translateX(8%); } }
html.embedded .rays { display: none; }

/* ---------- Layout ---------- */
.shell {
  position: relative; z-index: 1;
  display: grid; column-gap: 40px; row-gap: 32px; align-items: start;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  grid-template-areas: "hero form" "wall form";
  grid-template-rows: auto 1fr;
  max-width: 1040px; margin: 0 auto; padding: 72px 16px 56px;
  opacity: 0; transform: translateY(10px);
  transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.shell[aria-busy="false"] { opacity: 1; transform: none; }
.hero { grid-area: hero; }
.wall { grid-area: wall; }
.support { grid-area: form; }
@media (min-width: 861px) { html:not(.layout-card) .support { position: sticky; top: 24px; } }
html.layout-card .shell { grid-template-columns: minmax(0, 1fr); grid-template-areas: "form"; grid-template-rows: auto; max-width: 460px; padding: 10px; gap: 0; }
html.layout-card .hero,
html.layout-card .wall,
html:not(.layout-card) .support-head { display: none; }
html.layout-card .form-title { display: none; }
@media (max-width: 860px) {
  .shell { grid-template-columns: minmax(0, 1fr); grid-template-areas: "hero" "form" "wall"; grid-template-rows: auto; row-gap: 28px; padding-top: 40px; }
}

.card {
  position: relative; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 30px;
}
@media (max-width: 420px) { .card { padding: 22px 18px; } }

/* ---------- Brand bits ---------- */
.logo {
  flex: none; display: grid; place-items: center; overflow: hidden;
  background: radial-gradient(circle at 50% 45%, #13205a, #050816 70%); color: #fff; font-family: var(--display); font-weight: 800;
}
.logo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.logo-lg {
  width: 96px; height: 96px; border-radius: 26px; font-size: 34px;
  box-shadow: 0 0 0 1px rgba(47, 107, 255, 0.25), 0 18px 50px -12px rgba(47, 107, 255, 0.65), 0 0 90px -10px color-mix(in oklab, var(--accent) 45%, transparent);
  animation: float 6s ease-in-out infinite;
}
.logo-sm { width: 48px; height: 48px; border-radius: 14px; font-size: 18px; box-shadow: 0 8px 22px -8px rgba(47, 107, 255, 0.7); }
@keyframes float { 50% { transform: translateY(-6px); } }

.eyebrow {
  display: inline-flex; align-items: center; gap: 8px; margin: 28px 0 10px;
  font-family: var(--mono); font-size: 12px; font-weight: 600; letter-spacing: 0.22em; text-transform: uppercase; color: var(--accent);
}
.eyebrow svg { width: 13px; height: 13px; fill: currentColor; }
.eyebrow-sm { margin: 0 0 3px; font-size: 10.5px; letter-spacing: 0.2em; }

/* ---------- Hero ---------- */
.hero { padding-top: 8px; }
.hero-title { font-family: var(--display); font-size: clamp(44px, 6vw, 64px); line-height: 0.98; letter-spacing: -0.035em; font-weight: 800; margin: 0; }
.hero-tagline {
  margin: 12px 0 0; font-family: var(--display); font-size: 24px; font-weight: 600; letter-spacing: -0.015em;
  background: linear-gradient(90deg, var(--accent-deep), var(--accent) 60%, color-mix(in oklab, var(--accent), #22d3ee 40%));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-bio { margin: 14px 0 0; max-width: 440px; color: var(--muted); font-size: 16px; line-height: 1.65; }

.chips { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 22px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px; border-radius: 999px;
  background: color-mix(in oklab, var(--surface) 75%, transparent); border: 1px solid var(--border);
  backdrop-filter: blur(8px); font-size: 13px; font-weight: 600; color: var(--muted);
}
.chip strong { color: var(--text); font-weight: 800; }
.chip-link { font-family: var(--mono); font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent); text-decoration: none; transition: 0.2s; }
.chip-link:hover { background: var(--accent-soft); border-color: var(--accent-ring); }
.links { display: contents; }
.links a {
  display: grid; place-items: center; width: 34px; height: 34px; border-radius: 999px; color: var(--muted);
  background: color-mix(in oklab, var(--surface) 75%, transparent); border: 1px solid var(--border); transition: 0.2s;
}
.links a:hover { color: var(--accent); border-color: var(--accent-ring); }
.links svg { width: 15px; height: 15px; fill: currentColor; }

/* ---------- Supporters wall ---------- */
.wall { padding: 22px; }
.wall-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.wall-head h2 { font-family: var(--display); font-size: 19px; font-weight: 700; letter-spacing: -0.01em; margin: 0; }
.wall-spark { width: 18px; height: 18px; fill: var(--accent); opacity: 0.5; animation: twinkle 3s ease-in-out infinite; }
@keyframes twinkle { 50% { transform: rotate(45deg) scale(0.7); opacity: 0.25; } }

.supporters { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; max-height: 420px; overflow: auto; scrollbar-width: thin; }
.supporter {
  display: grid; grid-template-columns: 38px 1fr; gap: 12px; padding: 12px; border-radius: var(--radius-sm);
  background: var(--surface-2); animation: rise 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
.dot {
  width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 14px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35);
}
.supporter-line { font-size: 14px; line-height: 1.45; }
.supporter-line strong { font-weight: 800; }
.supporter-amount { font-family: var(--display); font-weight: 700; color: var(--accent); }
.supporter-meta { color: var(--faint); font-size: 12px; margin-top: 1px; }
.supporter-message {
  margin-top: 8px; padding: 10px 12px; border-radius: 4px 14px 14px 14px; background: var(--surface);
  border: 1px solid var(--border); font-size: 14px; line-height: 1.5; overflow-wrap: anywhere;
}
.badge {
  display: inline-flex; align-items: center; gap: 4px; margin-left: 6px; padding: 2px 8px; border-radius: 999px; vertical-align: 1px;
  font-family: var(--mono); font-size: 9.5px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: #fff;
  background: var(--glass); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4);
}
.empty { display: grid; place-items: center; gap: 10px; text-align: center; padding: 36px 16px; border-radius: var(--radius-sm); background: var(--surface-2); color: var(--muted); font-size: 14px; }
.empty svg { width: 28px; height: 28px; fill: var(--accent); animation: twinkle 2.4s ease-in-out infinite; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } }

/* ---------- Form card ---------- */
.support { overflow: hidden; }
.card-glow {
  position: absolute; inset: -40% -30% auto auto; width: 340px; height: 340px; pointer-events: none;
  background: radial-gradient(circle, color-mix(in oklab, var(--accent) 16%, transparent), transparent 65%);
}
.tip-form, .thanks { position: relative; }

.support-head { display: flex; align-items: center; gap: 14px; margin-bottom: 22px; }
.support-name { margin: 0; font-family: var(--display); font-size: 23px; font-weight: 800; letter-spacing: -0.02em; }
.facepile { margin-left: auto; display: flex; padding-left: 8px; }
.facepile .dot { width: 30px; height: 30px; border-radius: 50%; margin-left: -9px; font-size: 11px; box-shadow: 0 0 0 2.5px var(--surface); }
.facepile .more { background: var(--surface-3); color: var(--muted); }

.form-title h2 { margin: 0; font-family: var(--display); font-size: 30px; font-weight: 800; letter-spacing: -0.03em; }
.form-title p { margin: 6px 0 22px; color: var(--muted); font-size: 15px; }

/* One-time / Monthly */
.segmented {
  position: relative; display: grid; grid-template-columns: 1fr 1fr; padding: 4px; margin-bottom: 14px;
  border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border);
}
.segmented label { position: relative; z-index: 1; cursor: pointer; text-align: center; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented span { display: block; padding: 10px 0; font-size: 14px; font-weight: 700; color: var(--muted); transition: color 0.25s; }
.segmented input:checked + span { color: #fff; }
.segmented input:focus-visible + span { outline: 2px solid var(--accent-ring); outline-offset: 2px; border-radius: 999px; }
.segmented-thumb {
  position: absolute; top: 4px; bottom: 4px; left: 4px; width: calc(50% - 4px); border-radius: 999px;
  background: var(--glass); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45), 0 6px 18px -6px var(--accent);
  transition: transform 0.35s cubic-bezier(0.3, 1.3, 0.5, 1);
}
.monthly .segmented-thumb { transform: translateX(100%); }

/* Amount */
.amount {
  display: flex; align-items: baseline; gap: 6px; padding: 16px 20px; cursor: text; border-radius: 22px;
  background: var(--surface-2); border: 1.5px solid transparent; transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}
.amount:focus-within { border-color: var(--accent); box-shadow: 0 0 0 5px var(--accent-ring); background: var(--surface); }
.amount-currency { font-family: var(--display); font-size: 30px; font-weight: 700; color: var(--faint); }
.amount input {
  flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; padding: 0;
  font-family: var(--display); font-size: 52px; line-height: 1.05; font-weight: 800; letter-spacing: -0.04em; font-variant-numeric: tabular-nums;
}
.amount input::placeholder { color: color-mix(in oklab, var(--faint) 55%, transparent); }
.amount-per { font-family: var(--mono); font-size: 12px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); white-space: nowrap; opacity: 0; transform: translateX(-6px); transition: 0.25s; }
.monthly .amount-per { opacity: 1; transform: none; }
.amount.shake { animation: shake 0.4s; border-color: var(--danger); }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }

/* Glass pill presets (the logo's capsules) */
.presets { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 12px 0 16px; }
.preset {
  position: relative; overflow: hidden; height: 46px; border-radius: 999px; cursor: pointer;
  border: 1.5px solid var(--border); background: var(--surface); font-family: var(--display); font-weight: 700; font-size: 16px;
  font-variant-numeric: tabular-nums; transition: transform 0.2s cubic-bezier(0.3, 1.4, 0.5, 1), border-color 0.2s, box-shadow 0.2s;
}
.preset::after {
  content: ""; position: absolute; left: 22%; right: 22%; top: 7px; height: 3px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.85); opacity: 0; transition: opacity 0.2s;
}
.preset:hover { transform: translateY(-2px); border-color: var(--accent-ring); }
.preset[aria-pressed="true"] {
  color: #fff; border-color: transparent; background: var(--glass);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5), inset 0 -3px 8px rgba(11, 31, 143, 0.35), 0 8px 22px -8px var(--accent), 0 0 0 3px color-mix(in oklab, var(--accent) 18%, transparent);
}
.preset[aria-pressed="true"]::after { opacity: 0.8; }

/* Inputs */
.field { margin-bottom: 10px; position: relative; }
.field input, .field textarea {
  width: 100%; border: 1.5px solid transparent; outline: 0; background: var(--surface-2); resize: none;
  border-radius: var(--radius-sm); padding: 14px 16px; font-size: 15px; transition: 0.2s;
}
.field input:focus, .field textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 5px var(--accent-ring); background: var(--surface); }
.field ::placeholder { color: var(--faint); }
.field-message textarea { padding-bottom: 30px; min-height: 104px; }
.counter { position: absolute; right: 14px; bottom: 10px; font-family: var(--mono); font-size: 11px; color: var(--faint); }

/* CTA — a big glass capsule */
.cta {
  position: relative; overflow: hidden; display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; height: 60px; margin-top: 8px; border: 0; border-radius: 999px; cursor: pointer;
  color: #fff; font-family: var(--display); font-weight: 700; font-size: 18px; letter-spacing: -0.01em;
  background: var(--glass);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5), inset 0 -4px 10px rgba(11, 31, 143, 0.35), 0 14px 34px -12px var(--accent), 0 0 0 1px color-mix(in oklab, var(--accent-deep) 40%, transparent);
  transition: transform 0.2s cubic-bezier(0.3, 1.4, 0.5, 1), box-shadow 0.25s;
}
.cta::before { /* glass highlight streak */
  content: ""; position: absolute; left: 10%; right: 38%; top: 8px; height: 4px; border-radius: 999px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.15));
}
.cta-shine {
  position: absolute; inset: 0; transform: translateX(-120%);
  background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, 0.4) 50%, transparent 70%);
}
.cta:hover { transform: translateY(-2px); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5), inset 0 -4px 10px rgba(11, 31, 143, 0.35), 0 20px 42px -14px var(--accent), 0 0 0 1px color-mix(in oklab, var(--accent-deep) 40%, transparent); }
.cta:hover .cta-shine { transform: translateX(120%); transition: transform 0.9s ease; }
.cta:hover .cta-spark { transform: rotate(90deg) scale(1.15); }
.cta:active { transform: translateY(1px) scale(0.99); }
.cta:focus-visible { outline: 0; box-shadow: 0 0 0 5px var(--accent-ring); }
.cta-spark { width: 18px; height: 18px; fill: #fff; transition: transform 0.4s cubic-bezier(0.3, 1.4, 0.5, 1); }
.cta-label { font-variant-numeric: tabular-nums; }
.cta-spinner { display: none; width: 22px; height: 22px; border-radius: 50%; border: 2.5px solid rgba(255, 255, 255, 0.35); border-top-color: #fff; animation: spin 0.7s linear infinite; }
.cta.loading { pointer-events: none; }
.cta.loading .cta-label, .cta.loading .cta-spark { display: none; }
.cta.loading .cta-spinner { display: block; }
@keyframes spin { to { transform: rotate(360deg); } }

.error { margin: 12px 0 0; color: var(--danger); font-size: 14px; font-weight: 600; text-align: center; }
.error:empty { display: none; }
.fallback { text-align: center; margin: 10px 0 0; }
.fallback a { color: var(--accent); font-weight: 700; }
.secure { display: flex; justify-content: center; align-items: center; gap: 6px; margin: 16px 0 0; color: var(--faint); font-size: 13px; }
.secure svg { width: 13px; height: 13px; fill: currentColor; }
.secure strong { color: var(--muted); }

/* ---------- Thanks ---------- */
.thanks { text-align: center; padding: 30px 6px 10px; animation: rise 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
.thanks-badge {
  width: 96px; height: 96px; margin: 0 auto 22px; border-radius: 30px; display: grid; place-items: center;
  background: radial-gradient(circle at 50% 45%, #1a2c7a, #050816 75%);
  box-shadow: 0 0 0 1px rgba(47, 107, 255, 0.35), 0 20px 50px -14px var(--accent), 0 0 80px -10px color-mix(in oklab, var(--accent) 60%, transparent);
  animation: pop 0.8s cubic-bezier(0.3, 1.6, 0.5, 1) both;
}
.thanks-badge svg { width: 44px; height: 44px; fill: #fff; filter: drop-shadow(0 0 12px rgba(140, 180, 255, 0.9)); animation: glint 3s ease-in-out infinite 0.8s; }
@keyframes glint { 50% { transform: scale(1.12); filter: drop-shadow(0 0 20px rgba(160, 195, 255, 1)); } }
.thanks h2 { font-family: var(--display); font-size: 36px; font-weight: 800; letter-spacing: -0.03em; margin: 0 0 10px; }
.thanks p { color: var(--muted); line-height: 1.6; margin: 0 auto 24px; max-width: 330px; }
.ghost { border: 1.5px solid var(--border); background: var(--surface-2); border-radius: 999px; padding: 12px 24px; font-weight: 700; cursor: pointer; transition: 0.2s; }
.ghost:hover { border-color: var(--accent); color: var(--accent); }
@keyframes pop { from { transform: scale(0.3) rotate(-20deg); opacity: 0; } }

.confetti { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 10; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
