:root {
  --bg: #f7f8fb;
  --surface: #ffffff;
  --surface-soft: #f1f4f8;

  --text: #111827;
  --muted: #5b6474;

  --line: #e5e7eb;

  --accent: #111827;
  --accent-text: #ffffff;
  --accent-soft: #eef2ff;

  --radius: 20px;

  --shadow: 0 10px 30px rgba(17, 24, 39, 0.08);

  --header-bg: rgba(255, 255, 255, 0.95);
  --footer-bg: #ffffff;
  --callout-bg: #ffffff;
}

html[data-theme="dark"] {
  --bg: #0f1115;
  --surface: #171a21;
  --surface-soft: #1d222b;

  --text: #f4f7fb;
  --muted: #aab2c0;

  --line: #2a303a;

  --accent: #f4f7fb;
  --accent-text: #111827;
  --accent-soft: #232936;

  --shadow: 0 10px 30px rgba(0, 0, 0, 0.28);

  --header-bg: rgba(23, 26, 33, 0.96);
  --footer-bg: #171a21;
  --callout-bg: #1d222b;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  color-scheme: light;
}

html[data-theme="dark"] {
  color-scheme: dark;
}

body {
  margin: 0;

  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;

  color: var(--text);
  background: var(--bg);

  line-height: 1.65;
}

a {
  color: inherit;
}

.container {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
}

.narrow {
  max-width: 820px;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;

  background: var(--header-bg);

  border-bottom: 1px solid var(--line);

  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.nav {
  min-height: 68px;

  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;

  gap: 24px;
}

.nav .brand {
  justify-self: start;
}

.brand {
  font-weight: 800;
  text-decoration: none;
  letter-spacing: -0.02em;
}

.nav nav {
  justify-self: center;

  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.nav > .icon-button {
  justify-self: end;
}

.nav nav a {
  color: var(--muted);

  text-decoration: none;

  font-weight: 600;
  font-size: 0.95rem;
}

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

.hero {
  padding: 86px 0 0;
}

.eyebrow {
  margin: 0 0 12px;

  text-transform: uppercase;
  letter-spacing: 0.08em;

  font-size: 0.82rem;
  font-weight: 800;

  color: var(--muted);
}

h1 {
  margin: 0 0 20px;

  font-size: clamp(2.5rem, 7vw, 4.7rem);

  line-height: 1.02;
  letter-spacing: -0.05em;

  color: var(--text);
}

h2 {
  margin: 48px 0 14px;

  line-height: 1.15;
  letter-spacing: -0.025em;

  color: var(--text);
}

h3 {
  margin: 26px 0 8px;

  line-height: 1.2;

  color: var(--text);
}

p {
  margin: 0 0 18px;
}

.lead {
  max-width: 760px;

  font-size: clamp(1.1rem, 2vw, 1.35rem);

  color: var(--muted);
}

.card {
  background: var(--surface);
  color: var(--text);

  border: 1px solid var(--line);
  border-radius: var(--radius);

  box-shadow: var(--shadow);
}

.referral-card {
  position: relative;

  margin-top: 34px;

  padding: 30px;
}

.referral-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;

  gap: 16px;
}

.referral-card-header .eyebrow {
  margin-bottom: 0;
}

.code-row {
  display: flex;

  gap: 16px;

  align-items: center;
  justify-content: space-between;

  flex-wrap: wrap;

  margin: 16px 0 20px;
}

.code {
  margin: 12px 0 20px;

  font-size: clamp(2.2rem, 7vw, 3.6rem);

  font-weight: 900;

  letter-spacing: 0.09em;

  line-height: 1;

  color: var(--text);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  padding: 14px 20px;

  border: 1px solid var(--accent);
  border-radius: 12px;

  background: var(--accent);
  color: var(--accent-text);

  text-decoration: none;

  font: inherit;
  font-weight: 800;

  cursor: pointer;

  transition:
    opacity 0.15s ease,
    transform 0.15s ease,
    background 0.15s ease;
}

.button:hover {
  opacity: 0.88;
  transform: translateY(-1px);
}

.button.secondary {
  background: var(--accent-soft);
  color: var(--text);

  border-color: var(--line);
}

.actions {
  display: flex;

  gap: 12px;

  flex-wrap: wrap;
  align-items: center;

  margin-top: 20px;
}

.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  border: 1px solid var(--line);
  border-radius: 10px;

  background: var(--surface);
  color: var(--text);

  padding: 10px 14px;

  cursor: pointer;

  font: inherit;
  font-weight: 700;

  transition:
    background 0.15s ease,
    transform 0.15s ease;
}

.icon-button:hover {
  background: var(--surface-soft);
  transform: translateY(-1px);
}

.referral-card .actions .button,
.referral-card .actions .icon-button {
  flex: 1 1 0;

  min-width: 0;
  min-height: 50px;

  padding: 14px 20px;

  font: inherit;
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.2;

  border-radius: 12px;

  text-align: center;
}

.copy-icon-button {
  width: 42px;
  height: 42px;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  flex-shrink: 0;

  padding: 0;

  border: 1px solid var(--line);
  border-radius: 10px;

  background: var(--surface-soft);
  color: var(--text);

  cursor: pointer;

  transition:
    background 0.15s ease,
    transform 0.15s ease,
    border-color 0.15s ease;
}

.copy-icon-button:hover {
  background: var(--accent-soft);
  border-color: var(--text);

  transform: translateY(-1px);
}

.section {
  padding: 30px 0 68px;
}

.content-card {
  padding: 30px;

  margin-bottom: 22px;
}

.small {
  font-size: 0.88rem;

  color: var(--muted);
}

.muted {
  color: var(--muted);
}

.steps {
  padding-left: 22px;
}

.steps li {
  margin-bottom: 10px;
}

.callout {
  padding: 20px;

  background: var(--callout-bg);
  color: var(--text);

  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);

  border-radius: 10px;
}

.callout a {
  color: var(--text);
  text-decoration: underline;

  overflow-wrap: anywhere;
}

/* -----------------------------------------
   Thank-you section
----------------------------------------- */

.thank-you-section {
  padding-top: 0;
  padding-bottom: 30px;
}

.thank-you-card {
  padding: 32px;

  background: var(--accent);
  color: var(--accent-text);

  border-radius: var(--radius);

  box-shadow: var(--shadow);
}

.thank-you-card .eyebrow {
  color: inherit;
  opacity: 0.72;
}

.thank-you-card h2 {
  margin: 0 0 14px;

  color: inherit;
}

.thank-you-card p {
  max-width: 680px;
}

.thank-you-card p:last-child {
  margin-bottom: 0;
}

/* -----------------------------------------
   How-to options
----------------------------------------- */

.referral-options {
  display: grid;

  grid-template-columns:
    repeat(2, minmax(0, 1fr));

  gap: 16px;

  margin-bottom: 12px;
}

.referral-option {
  padding: 26px 26px 20px;

  background: var(--surface);
  color: var(--text);

  border: 1px solid var(--line);
  border-radius: var(--radius);

  box-shadow: var(--shadow);
}

.referral-option-number {
  width: 36px;
  height: 36px;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  margin-bottom: 16px;

  border-radius: 50%;

  background: var(--accent);
  color: var(--accent-text);

  font-weight: 900;
}

.referral-option h2,
.referral-option h3 {
  margin-top: 0;
}

.referral-option .steps {
  margin-bottom: 14px;
}

.referral-option .button,
.referral-option .icon-button {
  margin-bottom: 0;
}

/* -----------------------------------------
   FAQ
----------------------------------------- */

.faq-item {
  padding: 20px 0;

  border-top: 1px solid var(--line);
}

.faq-item:first-child {
  border-top: 0;
}

.faq-accordion {
  border-top: 1px solid var(--line);
}

.faq-accordion:first-child {
  border-top: 0;
}

.faq-question {
  width: 100%;

  padding: 18px 0;

  display: flex;
  align-items: center;
  justify-content: space-between;

  gap: 18px;

  border: 0;

  background: transparent;
  color: var(--text);

  text-align: left;

  font: inherit;
  font-weight: 800;

  cursor: pointer;
}

.faq-question::after {
  content: "+";

  font-size: 1.4rem;

  line-height: 1;
}

.faq-question[aria-expanded="true"]::after {
  content: "−";
}

.faq-answer {
  padding-bottom: 18px;

  color: var(--muted);
}

/* -----------------------------------------
   Toast
----------------------------------------- */

.toast {
  position: fixed;

  left: 50%;
  bottom: 24px;

  transform: translate(-50%, 20px);

  opacity: 0;

  pointer-events: none;

  padding: 12px 16px;

  background: var(--text);
  color: var(--bg);

  border: 1px solid var(--line);
  border-radius: 999px;

  font-weight: 800;

  z-index: 100;

  transition:
    opacity 0.2s ease,
    transform 0.2s ease;
}

.toast.show {
  opacity: 1;

  transform: translate(-50%, 0);
}

/* -----------------------------------------
   Footer
----------------------------------------- */

footer {
  margin-top: 40px;

  padding: 36px 0;

  border-top: 1px solid var(--line);

  background: var(--footer-bg);
  color: var(--text);
}

.footer-grid {
  display: grid;

  grid-template-columns: 1fr auto;

  gap: 24px;

  align-items: start;
}

footer a {
  color: var(--muted);
}

footer a:hover {
  color: var(--text);
}

/* -----------------------------------------
   Mobile
----------------------------------------- */

@media (max-width: 700px) {
  .nav {
    grid-template-columns: 1fr;

    align-items: flex-start;

    padding: 18px 0;
  }

  .nav .brand,
  .nav nav,
  .nav > .icon-button {
    justify-self: start;
  }

  .hero {
    padding-top: 48px;
  }

  .content-card,
  .referral-card,
  .thank-you-card,
  .referral-option {
    padding: 22px;
  }

  .actions {
    flex-direction: column;
    align-items: stretch;
  }

  .actions .button,
  .actions .icon-button {
    width: 100%;
  }

  .referral-options {
    grid-template-columns: 1fr;

    gap: 14px;

    margin-bottom: 10px;
  }

  .footer-grid {
    grid-template-columns: 1fr;
  }
}