:root {
  color-scheme: dark;
  --bg: #090b10;
  --panel: rgba(17, 24, 39, 0.78);
  --panel-strong: rgba(20, 29, 44, 0.94);
  --line: rgba(255, 255, 255, 0.11);
  --text: #f8fafc;
  --muted: #a7b0c0;
  --accent: #6ee7b7;
  --accent-2: #60a5fa;
  --danger: #fb7185;
  --warning: #fbbf24;
  --radius: 8px;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.38);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 20% 10%, rgba(96, 165, 250, 0.17), transparent 34%),
    radial-gradient(circle at 82% 16%, rgba(110, 231, 183, 0.14), transparent 30%),
    linear-gradient(135deg, #090b10 0%, #10141f 45%, #111827 100%);
  color: var(--text);
}

body[data-mode="widget"],
body[data-mode="goal-widget"],
body[data-mode="donation-widget"] {
  background: transparent;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.site-page {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
}

.app-shell {
  overflow: visible;
}

.animated-backdrop {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}

.animated-backdrop div {
  position: absolute;
  width: 46vw;
  aspect-ratio: 1;
  border-radius: 999px;
  filter: blur(80px);
  opacity: 0.16;
  animation: drift 14s ease-in-out infinite alternate;
}

.animated-backdrop div:nth-child(1) {
  left: -18vw;
  top: 8vh;
  background: #60a5fa;
}

.animated-backdrop div:nth-child(2) {
  right: -16vw;
  top: 20vh;
  background: #6ee7b7;
  animation-delay: -4s;
}

.animated-backdrop div:nth-child(3) {
  left: 35vw;
  bottom: -28vw;
  background: #fbbf24;
  animation-delay: -7s;
}

.site-nav {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  letter-spacing: 0;
}

.brand-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #071014;
  box-shadow: 0 12px 36px rgba(96, 165, 250, 0.28);
}

.nav-actions,
.head-actions,
.cta-row,
.signal-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: var(--radius);
  padding: 0 16px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #061116;
  font-weight: 800;
  box-shadow: 0 16px 40px rgba(96, 165, 250, 0.22);
  transition: transform 180ms ease, filter 180ms ease, border-color 180ms ease;
}

.button:hover {
  transform: translateY(-1px);
  filter: brightness(1.04);
}

.button.ghost,
.button.subtle {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  box-shadow: none;
}

.button.danger {
  background: rgba(251, 113, 133, 0.14);
  color: #fecdd3;
  border: 1px solid rgba(251, 113, 133, 0.28);
  box-shadow: none;
}

.button.compact {
  min-height: 36px;
  padding: 0 12px;
  font-size: 14px;
}

.hero {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 0.82fr);
  gap: 28px;
  align-items: center;
  min-height: calc(100vh - 88px);
  padding: 30px 0 72px;
}

.hero-copy {
  display: grid;
  gap: 22px;
}

.eyebrow {
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.split-title {
  display: flex;
  flex-wrap: wrap;
  gap: 0 14px;
  margin: 0;
  max-width: 820px;
  font-size: clamp(42px, 7vw, 84px);
  line-height: 0.95;
  letter-spacing: 0;
}

.split-title span {
  display: inline-block;
  animation: wordIn 620ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
  animation-delay: calc(var(--i) * 55ms);
}

.lede {
  max-width: 700px;
  margin: 0;
  color: #cbd5e1;
  font-size: 18px;
  line-height: 1.65;
}

.muted {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.small {
  font-size: 14px;
}

.pill,
.metric-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: #dbeafe;
  padding: 8px 12px;
  font-size: 13px;
}

.metric-pill {
  border-radius: 8px;
  align-items: flex-start;
  flex-direction: column;
  min-width: 128px;
}

.metric-pill strong {
  color: var(--text);
  font-size: 18px;
}

.hero-stage {
  min-width: 0;
}

.spotlight-card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.03)),
    var(--panel);
  box-shadow: var(--shadow);
  padding: 22px;
  backdrop-filter: blur(18px);
}

.spotlight-card::before {
  content: "";
  position: absolute;
  inset: -1px;
  background: linear-gradient(120deg, transparent, rgba(110, 231, 183, 0.22), transparent);
  opacity: 0;
  transform: translateX(-65%);
  transition: opacity 180ms ease;
}

.spotlight-card:hover::before {
  opacity: 1;
  animation: sheen 900ms ease;
}

.spotlight-card > * {
  position: relative;
  z-index: 1;
}

.stage-toolbar,
.section-heading,
.dashboard-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.stage-toolbar {
  margin-bottom: 18px;
  color: var(--muted);
}

.feature-band {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  padding: 0 0 56px;
}

.feature-card h3,
.spotlight-card h1,
.spotlight-card h2,
.spotlight-card h3,
.dashboard-head h1 {
  margin: 0;
  letter-spacing: 0;
}

.feature-card p {
  margin: 12px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.auth-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.auth-shell {
  position: relative;
  z-index: 1;
  width: min(520px, 100%);
}

.auth-brand {
  margin-bottom: 18px;
}

.auth-card h1 {
  margin: 14px 0 10px;
  font-size: 34px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 20px;
}

.field {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.field span {
  color: #dbeafe;
  font-size: 13px;
  font-weight: 800;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(5, 8, 14, 0.68);
  color: var(--text);
  outline: none;
  padding: 12px;
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.field textarea {
  min-height: 104px;
  resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: rgba(110, 231, 183, 0.72);
  box-shadow: 0 0 0 3px rgba(110, 231, 183, 0.12);
}

.field.wide,
.form-grid .wide,
.form-grid .button {
  grid-column: 1 / -1;
}

.color-field {
  grid-template-columns: 1fr;
}

.color-field input[type="color"] {
  height: 44px;
  padding: 4px;
}

.message {
  margin-top: 14px;
  border: 1px solid rgba(110, 231, 183, 0.24);
  border-radius: var(--radius);
  background: rgba(110, 231, 183, 0.08);
  color: #d1fae5;
  padding: 12px;
}

.message.error {
  border-color: rgba(251, 113, 133, 0.28);
  background: rgba(251, 113, 133, 0.1);
  color: #fecdd3;
}

.page-stack {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 18px;
  padding: 10px 0 64px;
}

.dashboard-head {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(110, 231, 183, 0.12), transparent 36%),
    linear-gradient(120deg, rgba(96, 165, 250, 0.12), transparent 45%),
    var(--panel);
  box-shadow: var(--shadow);
  padding: 22px;
}

.dashboard-head h1 {
  margin-top: 8px;
  font-size: 38px;
}

.tab-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.04);
  padding: 8px;
}

.tab-row button,
.segmented button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  padding: 0 12px;
  white-space: nowrap;
}

.tab-row button.active,
.segmented button.active {
  border-color: rgba(110, 231, 183, 0.38);
  background: rgba(110, 231, 183, 0.12);
  color: var(--text);
}

.segmented {
  display: inline-flex;
  gap: 6px;
}

.grid {
  display: grid;
  gap: 16px;
}

.workspace-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.mini-panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.055);
  padding: 14px;
}

.mini-panel span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.mini-panel strong {
  display: block;
  margin-top: 8px;
  overflow: hidden;
  color: var(--text);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.grid.two {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.settings-grid {
  grid-template-columns: minmax(0, 0.95fr) minmax(360px, 0.75fr);
  align-items: start;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.metric-card {
  min-height: 110px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.05);
  padding: 16px;
}

.metric-card span {
  color: var(--muted);
}

.metric-card strong {
  display: block;
  margin-top: 12px;
  font-size: 28px;
  overflow-wrap: anywhere;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 12px 10px;
  text-align: left;
  vertical-align: top;
}

th {
  color: #dbeafe;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.copy-box {
  margin-top: 14px;
  border: 1px dashed rgba(255, 255, 255, 0.2);
  border-radius: var(--radius);
  background: rgba(0, 0, 0, 0.18);
  color: #dbeafe;
  padding: 12px;
  overflow-wrap: anywhere;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 13px;
}

.url-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
}

.url-row .copy-box {
  margin-top: 14px;
}

.control-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.widget-url-list {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.widget-url-item {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.045);
  padding: 10px;
}

.widget-url-item span {
  color: #dbeafe;
  font-size: 13px;
  font-weight: 800;
}

.widget-url-item code {
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-field input[type="file"] {
  min-height: 46px;
  padding: 10px;
}

.preview-card {
  position: sticky;
  top: 18px;
}

.alert-card {
  display: grid;
  gap: 16px;
  justify-items: center;
  align-items: center;
  min-height: 260px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 28px;
  text-align: center;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.34);
}

.alert-card.image-left-text {
  grid-template-columns: auto 1fr;
  justify-items: start;
  text-align: left;
}

.alert-card.text-only .alert-logo {
  display: none;
}

.alert-logo {
  width: 116px;
  height: 116px;
  border-radius: 18px;
  object-fit: cover;
  box-shadow: 0 22px 54px rgba(0, 0, 0, 0.36);
}

.alert-text {
  display: grid;
  gap: 8px;
}

.alert-text strong {
  color: var(--highlight);
  font-size: 1.14em;
}

.fade-pop {
  animation: fadePop 480ms ease both;
}

.slide-up {
  animation: slideUp 520ms ease both;
}

.zoom-burst {
  animation: zoomBurst 620ms cubic-bezier(0.17, 0.84, 0.44, 1) both;
}

.type-rise {
  animation: typeRise 520ms ease both;
}

.pulse-glow {
  animation: pulseGlow 1500ms ease-in-out infinite;
}

.stack-list {
  display: grid;
  gap: 12px;
}

.goal-row,
.goal-widget {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.05);
  padding: 14px;
}

.goal-row span {
  display: block;
  color: var(--muted);
  font-size: 14px;
  margin-top: 4px;
}

.progress {
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
}

.progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}

.donation-widget {
  display: grid;
  width: min(420px, 100%);
  gap: 10px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 12px;
  padding: 18px;
  box-shadow: var(--shadow);
}

.donation-widget.single-feature .donation-item:first-of-type {
  border: 1px solid color-mix(in srgb, var(--accent), transparent 55%);
  background: color-mix(in srgb, var(--accent), transparent 88%);
  padding: 18px;
}

.donation-widget.compact-list .donation-item {
  grid-template-columns: 1fr auto;
  padding: 9px 10px;
}

.donation-widget > strong {
  color: var(--accent);
}

.donation-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  padding: 12px;
}

.donation-item small {
  grid-column: 1 / -1;
  color: currentColor;
  opacity: 0.72;
}

.widget-stage {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
  background: transparent;
}

.empty-state {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.05);
  color: var(--muted);
  padding: 24px;
  text-align: center;
}

.loading-line {
  width: 100%;
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.loading-line::after {
  content: "";
  display: block;
  width: 38%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  animation: loading 1.1s ease-in-out infinite;
}

.reveal {
  animation: reveal 760ms ease both;
}

.delay-1 {
  animation-delay: 150ms;
}

@keyframes drift {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(5vw, -4vh, 0) scale(1.08); }
}

@keyframes wordIn {
  from { opacity: 0; transform: translateY(18px) rotateX(30deg); }
  to { opacity: 1; transform: translateY(0) rotateX(0); }
}

@keyframes reveal {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes sheen {
  from { transform: translateX(-75%); }
  to { transform: translateX(75%); }
}

@keyframes fadePop {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes zoomBurst {
  0% { opacity: 0; transform: scale(0.82); }
  70% { opacity: 1; transform: scale(1.04); }
  100% { opacity: 1; transform: scale(1); }
}

@keyframes typeRise {
  from { opacity: 0; transform: translateY(10px); filter: blur(4px); }
  to { opacity: 1; transform: translateY(0); filter: blur(0); }
}

@keyframes pulseGlow {
  0%, 100% { text-shadow: 0 0 0 rgba(110, 231, 183, 0); }
  50% { text-shadow: 0 0 28px rgba(110, 231, 183, 0.52); }
}

@keyframes loading {
  from { transform: translateX(-120%); }
  to { transform: translateX(280%); }
}

@media (max-width: 920px) {
  .hero,
  .grid.two,
  .settings-grid,
  .feature-band {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
    padding-top: 34px;
  }

  .preview-card {
    position: static;
  }
}

@media (max-width: 640px) {
  .shell {
    width: min(100% - 20px, 1180px);
  }

  .site-nav,
  .dashboard-head,
  .section-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .nav-actions {
    width: 100%;
  }

  .button.compact,
  .nav-actions .button {
    flex: 1;
  }

  .split-title {
    font-size: 42px;
  }

  .form-grid,
  .stats-grid,
  .workspace-strip,
  .url-row,
  .widget-url-item {
    grid-template-columns: 1fr;
  }

  .alert-card.image-left-text {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }
}
