*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg: #000000;
  --surface: #0f0f0f;
  --surface-2: #161616;
  --border: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(255, 255, 255, 0.16);
  --text: #ffffff;
  --text-muted: #888888;
  --text-subtle: #555555;
  --navy: #2a5ca8;
  --navy-hover: #3570c0;
  --navy-gradient: linear-gradient(135deg, #1a4480 0%, #2a5ca8 45%, #4588d4 100%);
  --navy-gradient-hover: linear-gradient(135deg, #2458a0 0%, #3570c0 45%, #5a9ee8 100%);
  --font: 'Inter', system-ui, -apple-system, sans-serif;
  --radius: 12px;
  --radius-lg: 16px;
  --max: 1080px;
}

html {
  min-height: 100%;
  overflow-x: hidden;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  position: relative;
  overflow-x: hidden;
}

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

.layout {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 max(1.5rem, env(safe-area-inset-right)) 0 max(1.5rem, env(safe-area-inset-left));
}

.layout--center {
  justify-content: center;
}

/* Topbar */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.75rem 0 1rem;
}

.topbar--minimal {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  max-width: var(--max);
  margin: 0 auto;
  padding: 1.75rem 1.5rem 0;
}

.topbar__link {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s;
}

.topbar__link:hover {
  color: var(--text);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  color: var(--text);
}

.brand__mark {
  display: block;
  flex-shrink: 0;
}

.brand__name {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.brand--footer .brand__name {
  font-size: 0.7rem;
}

/* Hero */
.hero {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 520px) 1fr;
  grid-template-areas:
    "intro visual"
    "action visual";
  gap: 2rem 2.5rem;
  align-items: center;
  padding: 3rem 0 4rem;
  width: 100%;
  min-height: 0;
}

.hero__intro {
  grid-area: intro;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.hero__action {
  grid-area: action;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1.25rem;
  width: 100%;
  align-self: start;
}

.hero__eyebrow {
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}

.hero__title {
  font-family: 'Montserrat', var(--font);
  font-size: clamp(3rem, 10vw, 5.5rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 0.95;
  margin-bottom: 1.25rem;
}

.hero__title-text {
  display: inline-block;
  background-image: var(--navy-gradient);
  background-size: 100% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: #2a5ca8;
}

@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .hero__title-text {
    color: transparent;
  }
}

.hero__visual {
  grid-area: visual;
  justify-self: end;
  align-self: center;
  width: clamp(220px, 38vw, 480px);
  max-height: min(70vh, 520px);
  height: auto;
  object-fit: contain;
  margin: 0;
}

.hero__desc {
  font-size: 1.05rem;
  line-height: 1.65;
  color: var(--text-muted);
  max-width: 440px;
  margin-bottom: 2rem;
}

.hero__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0;
}

.pill {
  display: inline-flex;
  align-items: center;
  padding: 0.4rem 0.85rem;
  font-size: 0.8rem;
  font-weight: 500;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
}

.pill--ghost {
  background: transparent;
  color: var(--text-muted);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border: none;
  cursor: pointer;
  font-family: var(--font);
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  border-radius: 999px;
  transition: opacity 0.2s, transform 0.2s, background 0.2s;
}

.btn--primary {
  background: var(--navy-gradient);
  color: var(--text);
  padding: 0.9rem 1.75rem;
  min-height: 48px;
}

.btn--primary:hover {
  background: var(--navy-gradient-hover);
  transform: translateY(-1px);
}

.btn--primary:disabled {
  opacity: 0.5;
  cursor: wait;
  transform: none;
}

.btn--full {
  width: 100%;
}

/* Footer */
.footer {
  padding: 2.5rem 0 2rem;
  border-top: 1px solid var(--border);
  margin-top: auto;
}

.footer__inner {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.footer__tagline {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.footer__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.5rem;
  margin-top: 0.5rem;
}

.footer__link {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s;
}

.footer__link:hover {
  color: var(--text);
}

.footer__copy {
  font-size: 0.75rem;
  color: var(--text-subtle);
}

/* Modal */
.modal[hidden] {
  display: none;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
}

.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
}

.modal__dialog {
  position: relative;
  width: 100%;
  max-width: 400px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem 1.75rem 1.75rem;
}

.modal__close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-muted);
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}

.modal__close:hover {
  border-color: var(--border-hover);
  color: var(--text);
}

.modal__eyebrow {
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.modal__title {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
}

.modal__text {
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.modal__form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.field__label {
  display: block;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 0.45rem;
}

.field__input-wrap {
  display: flex;
  align-items: center;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.2s;
}

.field__input-wrap:focus-within {
  border-color: var(--border-hover);
}

.field__prefix {
  padding-left: 0.85rem;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.field__input {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text);
  font-family: var(--font);
  font-size: 0.95rem;
  padding: 0.75rem 0.85rem 0.75rem 0.25rem;
  outline: none;
}

.field__input--full {
  padding: 0.75rem 0.85rem;
}

.field__input::placeholder {
  color: var(--text-subtle);
}

.modal__summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.9rem;
  color: var(--text-muted);
}

.modal__summary strong {
  color: var(--text);
  font-weight: 600;
}

.modal__error {
  color: #ef4444;
  font-size: 0.85rem;
  text-align: center;
}

/* Success page */
.success {
  width: 100%;
  max-width: 440px;
  margin: 0 auto;
  padding: 2rem 0;
}

.success__card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2.5rem 2rem;
  text-align: center;
}

.success__eyebrow {
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.success__heading {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.75rem;
}

.success__text {
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.success__link {
  margin-bottom: 1rem;
}

.success__back {
  display: inline-block;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s;
}

.success__back:hover {
  color: var(--text);
}

.success__spinner {
  width: 32px;
  height: 32px;
  margin: 0 auto 1.25rem;
  border: 2px solid var(--border);
  border-top-color: var(--text);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.success__spinner[hidden] {
  display: none;
}

.success__card--paid .success__heading {
  color: var(--text);
}

.success__card--error .success__heading {
  color: #ef4444;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 768px) {
  .layout {
    padding-left: max(1rem, env(safe-area-inset-left));
    padding-right: max(1rem, env(safe-area-inset-right));
  }

  .topbar {
    padding: 0.85rem 0 0.35rem;
  }

  .brand__mark {
    width: 28px;
    height: 28px;
  }

  .brand__name {
    font-size: 0.68rem;
  }

  .topbar__link {
    font-size: 0.8rem;
    padding: 0.35rem 0;
  }

  .hero {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr auto auto;
    grid-template-areas:
      "intro"
      "."
      "visual"
      "action";
    gap: 0;
    padding: 0.25rem 0 0;
    text-align: center;
    justify-items: center;
    align-content: stretch;
  }

  .hero__intro {
    align-items: center;
    justify-self: stretch;
    align-self: start;
  }

  .hero__eyebrow {
    font-size: 0.68rem;
    margin-bottom: 0.85rem;
    letter-spacing: 0.1em;
  }

  .hero__title {
    font-size: clamp(2.15rem, 12vw, 3rem);
    line-height: 1;
    margin-bottom: 0.85rem;
  }

  .hero__desc {
    font-size: 0.92rem;
    line-height: 1.6;
    max-width: none;
    margin-bottom: 0;
  }

  .hero__action {
    grid-area: action;
    align-items: center;
    width: 100%;
    max-width: 20rem;
    gap: 0.55rem;
    align-self: end;
    padding-bottom: max(0.75rem, env(safe-area-inset-bottom));
  }

  .hero__meta {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    gap: 0.4rem;
  }

  .pill {
    font-size: 0.75rem;
    padding: 0.35rem 0.85rem;
  }

  .hero .btn--primary {
    width: 100%;
    max-width: 20rem;
    padding: 1rem 1.5rem;
    font-size: 1rem;
    margin-top: 0.25rem;
  }

  .hero__visual {
    grid-area: visual;
    justify-self: center;
    align-self: end;
    width: min(220px, 68vw);
    max-height: 190px;
    margin: 0 auto 0.5rem;
    padding-bottom: 0;
  }

  .footer {
    padding: 1rem 0 max(1rem, env(safe-area-inset-bottom));
  }

  .footer__inner {
    align-items: center;
    text-align: center;
  }

  .footer__tagline {
    font-size: 0.8rem;
  }

  .footer__row {
    justify-content: center;
    gap: 0.75rem 1.25rem;
  }

  .modal {
    align-items: flex-end;
    padding: 0;
  }

  .modal__dialog {
    max-width: none;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    border-bottom: none;
    padding: 1.5rem 1.15rem max(1.5rem, env(safe-area-inset-bottom));
    max-height: 92dvh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .modal__title {
    font-size: 1.2rem;
    padding-right: 2rem;
  }

  .modal__text {
    font-size: 0.85rem;
  }

  .field__input,
  .field__prefix {
    font-size: 16px;
  }

  .success {
    padding: 1rem 0 max(1.5rem, env(safe-area-inset-bottom));
  }

  .success__card {
    padding: 2rem 1.15rem;
  }

  .success__heading {
    font-size: 1.2rem;
  }

  .success__text {
    font-size: 0.85rem;
  }

  .topbar--minimal {
    position: relative;
    padding: 0.85rem 0 0;
  }

  .layout--center {
    justify-content: flex-start;
    padding-top: 0.5rem;
  }

  .layout--center .success {
    margin-top: auto;
    margin-bottom: auto;
    width: 100%;
  }
}
