:root {
  --refer-primary: #ff8a00;
  --refer-secondary: #e52e71;
  --refer-bg: #050505;
  --refer-card: rgba(255, 255, 255, 0.04);
  --refer-border: rgba(255, 255, 255, 0.08);
  --refer-text: #f5f5f5;
  --refer-muted: #9ca3af;
  --refer-gradient: linear-gradient(135deg, #ff8a00, #e52e71);
  --refer-radius: 18px;
  --refer-font: 'Manrope', 'DM Sans', system-ui, -apple-system, sans-serif;
  --refer-header-h: 72px;
  --refer-safe-bottom: env(safe-area-inset-bottom, 0px);
}

*, *::before, *::after { box-sizing: border-box; }

.refer-body {
  margin: 0;
  font-family: var(--refer-font);
  background: var(--refer-bg);
  color: var(--refer-text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.refer-body.refer-nav-open { overflow: hidden; }

.refer-container {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

/* ── Header ── */
.refer-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(5, 5, 5, 0.92);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.refer-header.is-scrolled {
  border-color: var(--refer-border);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
}

@supports (backdrop-filter: blur(12px)) {
  .refer-header {
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
  }
}

.refer-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: var(--refer-header-h);
}

.refer-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  min-width: 0;
  flex-shrink: 0;
}

.refer-brand img {
  border-radius: 10px;
  background: #fff;
  flex-shrink: 0;
}

.refer-brand-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.refer-brand-text strong {
  font-size: 0.95rem;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.refer-brand-text small {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--refer-primary);
  letter-spacing: 0.02em;
}

.refer-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.refer-nav--desktop {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  margin-right: 8px;
}

.refer-nav-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  color: var(--refer-muted);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  transition: color 0.15s ease, background 0.15s ease;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.refer-nav-link:hover,
.refer-nav-link.is-active {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
}

.refer-nav-link.is-active { color: var(--refer-primary); }

.refer-nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--refer-border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.refer-nav-toggle:active { transform: scale(0.96); }

/* Mobile drawer */
.refer-nav-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0, 0, 0, 0.55);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
}

.refer-nav-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}

.refer-nav-drawer {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 201;
  width: min(320px, 100vw);
  height: 100%;
  height: 100dvh;
  background: #0a0a0a;
  border-left: 1px solid var(--refer-border);
  transform: translateX(105%);
  transition: transform 0.26s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  padding-bottom: calc(16px + var(--refer-safe-bottom));
  overflow: hidden;
}

.refer-nav-drawer.is-open { transform: translateX(0); }

.refer-nav-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  border-bottom: 1px solid var(--refer-border);
}

.refer-brand--compact .refer-brand-text strong { font-size: 0.92rem; }

.refer-nav-close {
  width: 40px;
  height: 40px;
  border: 1px solid var(--refer-border);
  border-radius: 10px;
  background: transparent;
  color: #fff;
  cursor: pointer;
}

.refer-nav--drawer {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 14px;
  overflow-y: auto;
  flex: 1;
  -webkit-overflow-scrolling: touch;
}

.refer-nav--drawer .refer-nav-link {
  padding: 14px 14px;
  border-radius: 12px;
  font-size: 0.95rem;
}

.refer-nav--drawer .refer-nav-link i {
  width: 18px;
  color: var(--refer-primary);
}

.refer-nav-drawer-foot {
  padding: 14px 18px;
  border-top: 1px solid var(--refer-border);
  display: grid;
  gap: 10px;
}

.refer-hide-mobile { display: inline-flex; }

/* ── Buttons ── */
.refer-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  border-radius: 999px;
  padding: 10px 18px;
  font: inherit;
  font-weight: 600;
  font-size: 0.92rem;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  white-space: nowrap;
}

.refer-btn:hover { transform: translateY(-1px); }
.refer-btn:active { transform: translateY(0); }

.refer-btn-primary {
  background: var(--refer-gradient);
  color: #fff;
  box-shadow: 0 8px 24px rgba(255, 138, 0, 0.22);
}

.refer-btn-outline,
.refer-btn-ghost {
  background: transparent;
  color: #fff;
  border: 1px solid var(--refer-border);
  box-shadow: none;
}

.refer-btn-block { width: 100%; }
.refer-btn-lg { padding: 14px 22px; font-size: 0.98rem; }

.refer-header .refer-btn { padding: 9px 16px; font-size: 0.88rem; }

.refer-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(255, 138, 0, 0.12);
  color: #ffb347;
  font-size: 0.85rem;
  font-weight: 600;
}

/* ── Hero ── */
.refer-hero {
  padding: clamp(40px, 8vw, 72px) 0 clamp(32px, 6vw, 48px);
  background:
    radial-gradient(circle at 10% 10%, rgba(255, 138, 0, 0.14), transparent 35%),
    radial-gradient(circle at 90% 20%, rgba(229, 46, 113, 0.12), transparent 30%);
}

.refer-hero-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: clamp(24px, 4vw, 36px);
  align-items: center;
}

.refer-hero-copy h1 {
  font-size: clamp(1.85rem, 5.5vw, 3.2rem);
  line-height: 1.12;
  margin: 14px 0;
  letter-spacing: -0.02em;
}

.refer-hero-copy p {
  color: var(--refer-muted);
  max-width: 620px;
  font-size: clamp(0.95rem, 2.5vw, 1.05rem);
}

.refer-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 22px 0;
}

.refer-hero-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.refer-hero-stats div {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px 14px;
  background: var(--refer-card);
  border: 1px solid var(--refer-border);
  border-radius: 14px;
}

.refer-hero-stats strong { font-size: clamp(1.1rem, 3vw, 1.35rem); }
.refer-hero-stats span { color: var(--refer-muted); font-size: 0.82rem; }

.refer-hero-card { position: relative; }

.refer-card-glow {
  position: absolute;
  inset: -16px;
  background: var(--refer-gradient);
  filter: blur(36px);
  opacity: 0.22;
  pointer-events: none;
}

.refer-card-inner {
  position: relative;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--refer-border);
  border-radius: 22px;
  padding: clamp(20px, 4vw, 28px);
}

@supports (backdrop-filter: blur(8px)) {
  .refer-card-inner { backdrop-filter: blur(10px); }
}

.refer-card-top {
  display: flex;
  justify-content: space-between;
  color: var(--refer-muted);
  font-size: 0.9rem;
}

.refer-card-code {
  font-size: clamp(1.5rem, 5vw, 2rem);
  font-weight: 800;
  letter-spacing: 0.08em;
  margin: 14px 0 6px;
  background: var(--refer-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.refer-card-list {
  list-style: none;
  padding: 0;
  margin: 18px 0 0;
  display: grid;
  gap: 10px;
}

.refer-card-list li {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  color: #ddd;
  font-size: 0.92rem;
}

.refer-card-list i { color: #ff8a00; margin-top: 3px; flex-shrink: 0; }

/* ── Sections ── */
.refer-section {
  padding: clamp(48px, 8vw, 72px) 0;
  content-visibility: auto;
  contain-intrinsic-size: auto 400px;
}

.refer-section[id],
#referMain [id] {
  scroll-margin-top: calc(var(--refer-header-h) + 16px);
}

.refer-section-alt { background: rgba(255, 255, 255, 0.02); }

.refer-section-head {
  text-align: center;
  max-width: 680px;
  margin: 0 auto clamp(28px, 5vw, 40px);
}

.refer-section-head h2 {
  font-size: clamp(1.6rem, 4.5vw, 2.4rem);
  margin: 10px 0;
  letter-spacing: -0.02em;
}

.refer-section-head p {
  color: var(--refer-muted);
  font-size: clamp(0.92rem, 2.5vw, 1rem);
}

.refer-section-head a {
  color: var(--refer-primary);
  font-weight: 600;
}

.refer-steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(14px, 3vw, 20px);
}

.refer-step {
  background: var(--refer-card);
  border: 1px solid var(--refer-border);
  border-radius: var(--refer-radius);
  padding: clamp(18px, 3vw, 24px);
}

.refer-step h3 {
  margin: 10px 0 8px;
  font-size: clamp(1rem, 2.5vw, 1.12rem);
}

.refer-step p {
  margin: 0;
  color: var(--refer-muted);
  font-size: 0.92rem;
}

.refer-step-num {
  font-size: clamp(1.6rem, 4vw, 2rem);
  font-weight: 800;
  background: var(--refer-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.refer-services-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: clamp(14px, 3vw, 20px);
}

.refer-service-group {
  background: var(--refer-card);
  border: 1px solid var(--refer-border);
  border-radius: var(--refer-radius);
  padding: clamp(16px, 3vw, 22px);
}

.refer-service-group-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.refer-service-group-head i { color: #ff8a00; }
.refer-service-group-head h3 { margin: 0; font-size: 1rem; }

.refer-service-group ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 6px;
}

.refer-service-group a {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #ddd;
  text-decoration: none;
  font-size: 0.9rem;
  padding: 6px 0;
  touch-action: manipulation;
}

.refer-service-group a:hover { color: #fff; }

.refer-cta-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: clamp(22px, 4vw, 32px);
  border-radius: 22px;
  background: linear-gradient(135deg, rgba(255, 138, 0, 0.12), rgba(229, 46, 113, 0.12));
  border: 1px solid var(--refer-border);
}

.refer-cta-box h2 {
  margin: 0 0 8px;
  font-size: clamp(1.25rem, 3.5vw, 1.75rem);
}

.refer-cta-box p {
  margin: 0;
  color: var(--refer-muted);
  font-size: 0.94rem;
}

/* ── Footer ── */
.refer-footer {
  border-top: 1px solid var(--refer-border);
  padding: clamp(36px, 6vw, 56px) 0 calc(24px + var(--refer-safe-bottom));
  background: rgba(255, 255, 255, 0.015);
  margin-top: 8px;
}

.refer-footer-grid {
  display: grid;
  grid-template-columns: 1.4fr repeat(3, 1fr);
  gap: clamp(24px, 4vw, 36px);
}

.refer-footer-brand { max-width: 320px; }

.refer-footer-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  margin-bottom: 12px;
}

.refer-footer-logo img {
  border-radius: 10px;
  background: #fff;
}

.refer-footer-tagline {
  margin: 0 0 14px;
  color: var(--refer-muted);
  font-size: 0.9rem;
  line-height: 1.55;
}

.refer-footer-main-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--refer-primary);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 600;
}

.refer-footer-col h3 {
  margin: 0 0 14px;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #fff;
}

.refer-footer-col ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.refer-footer-col a {
  color: var(--refer-muted);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.15s ease;
}

.refer-footer-col a:hover { color: #fff; }

.refer-footer-cta p {
  margin: 0 0 14px;
  color: var(--refer-muted);
  font-size: 0.88rem;
  line-height: 1.5;
}

.refer-footer-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: clamp(28px, 5vw, 40px);
  padding-top: 20px;
  border-top: 1px solid var(--refer-border);
}

.refer-footer-bar p {
  margin: 0;
  color: var(--refer-muted);
  font-size: 0.84rem;
}

.refer-footer-social {
  display: flex;
  gap: 8px;
}

.refer-footer-social a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid var(--refer-border);
  color: var(--refer-muted);
  text-decoration: none;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.refer-footer-social a:hover {
  color: #fff;
  border-color: rgba(255, 138, 0, 0.4);
  background: rgba(255, 138, 0, 0.08);
}

/* ── Responsive ── */
@media (max-width: 1024px) {
  .refer-footer-grid {
    grid-template-columns: 1fr 1fr;
  }

  .refer-footer-brand {
    grid-column: 1 / -1;
    max-width: none;
  }

  .refer-footer-cta {
    grid-column: 1 / -1;
  }
}

@media (max-width: 900px) {
  .refer-nav--desktop,
  .refer-hide-mobile { display: none !important; }

  .refer-nav-toggle { display: inline-flex; }

  .refer-hero-grid,
  .refer-steps,
  .refer-services-grid {
    grid-template-columns: 1fr;
  }

  .refer-hero-stats {
    grid-template-columns: repeat(3, 1fr);
  }

  .refer-cta-box {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
  }

  .refer-cta-box .refer-btn {
    width: 100%;
    justify-content: center;
  }

  /* Faster mobile: reduce blur cost */
  .refer-header {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background: rgba(5, 5, 5, 0.97);
  }

  .refer-card-glow { display: none; }
}

@media (max-width: 640px) {
  .refer-container {
    width: min(1180px, calc(100% - 24px));
  }

  .refer-brand-text small { display: none; }

  .refer-hero-stats {
    grid-template-columns: 1fr;
  }

  .refer-hero-actions .refer-btn {
    flex: 1 1 100%;
    justify-content: center;
  }

  .refer-footer-grid {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .refer-footer-bar {
    flex-direction: column;
    text-align: center;
  }

  .refer-footer-social { justify-content: center; }
}

@media (max-width: 480px) {
  :root { --refer-header-h: 64px; }

  .refer-brand-text strong { font-size: 0.88rem; }

  .refer-header .refer-btn { padding: 8px 12px; font-size: 0.84rem; }

  .refer-section { contain-intrinsic-size: auto 320px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
