/* ── Base ─────────────────────────────────────────────────────── */
body {
  font-family: 'Inter', sans-serif;
  font-feature-settings: 'cv02', 'cv03', 'cv04', 'cv11';
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(26, 173, 116, 0.10), transparent),
    radial-gradient(ellipse 60% 40% at 90% 80%, rgba(56, 189, 248, 0.04), transparent),
    linear-gradient(180deg, #020617 0%, #0a0f1e 100%);
  -webkit-font-smoothing: antialiased;
}

.portal-shell {
  min-height: 100vh;
}

/* ── Header ──────────────────────────────────────────────────── */
.portal-header {
  background: rgba(2, 6, 23, 0.90);
  backdrop-filter: blur(16px) saturate(1.4);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
}

.portal-menu-button {
  min-width: 44px;
  min-height: 44px;
  padding: 0.65rem 0.9rem;
  border-radius: 0.9rem;
  border: 1px solid rgba(51, 65, 85, 0.8);
  background: rgba(15, 23, 42, 0.72);
  color: #e2e8f0;
  font-size: 0.95rem;
  font-weight: 600;
  transition: border-color 0.2s ease;
}

.portal-menu-button:hover {
  border-color: rgba(26, 173, 116, 0.5);
}

/* ── Cards ────────────────────────────────────────────────────── */
.portal-card {
  background: rgba(15, 23, 42, 0.78);
  border: 1px solid rgba(51, 65, 85, 0.85);
  box-shadow:
    0 18px 60px rgba(2, 6, 23, 0.32),
    0 0 0 0 rgba(26, 173, 116, 0);
  transition: box-shadow 0.3s ease, border-color 0.3s ease;
}

.portal-card-soft {
  background: rgba(15, 23, 42, 0.48);
  border: 1px solid rgba(51, 65, 85, 0.72);
  transition: border-color 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
}

.portal-card-soft:hover {
  border-color: rgba(51, 65, 85, 1);
  transform: translateY(-1px);
  box-shadow: 0 8px 32px rgba(2, 6, 23, 0.25);
}

/* Featured card — hero / stat / trust modules only */
.portal-card-featured {
  background: rgba(15, 23, 42, 0.82);
  border: 1px solid rgba(26, 173, 116, 0.18);
  box-shadow:
    0 24px 80px rgba(2, 6, 23, 0.38),
    0 0 80px -20px rgba(26, 173, 116, 0.08);
}

/* ── Hero glow — use on hero section wrapper ─────────────────── */
.portal-hero-glow {
  position: relative;
}

.portal-hero-glow::before {
  content: '';
  position: absolute;
  top: -60px;
  left: 50%;
  transform: translateX(-50%);
  width: min(700px, 90vw);
  height: 320px;
  background: radial-gradient(ellipse, rgba(26, 173, 116, 0.12), transparent 70%);
  pointer-events: none;
  z-index: 0;
}

/* ── Gradient text — short hero phrases only ─────────────────── */
.portal-gradient-text {
  background: linear-gradient(135deg, #ffffff 0%, #86efac 50%, #34d399 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Fallback for browsers without background-clip */
@supports not (background-clip: text) {
  .portal-gradient-text {
    color: #ffffff;
  }
}

/* ── Kicker badge ─────────────────────────────────────────────── */
.portal-kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.85rem;
  border-radius: 9999px;
  border: 1px solid rgba(26, 173, 116, 0.30);
  background: rgba(26, 173, 116, 0.08);
  color: #86efac;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* ── Icon box — feature card accents ──────────────────────────── */
.portal-icon-box {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 0.875rem;
  background: linear-gradient(135deg, rgba(26, 173, 116, 0.18), rgba(52, 211, 153, 0.08));
  border: 1px solid rgba(26, 173, 116, 0.22);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #4ade80;
}

.portal-icon-box svg {
  width: 1.25rem;
  height: 1.25rem;
}

/* ── Stats / trust bar ────────────────────────────────────────── */
.portal-stat {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1.15rem;
  border-radius: 1rem;
  border: 1px solid rgba(51, 65, 85, 0.65);
  background: rgba(15, 23, 42, 0.55);
}

.portal-stat-icon {
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 0.5rem;
  background: rgba(26, 173, 116, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #4ade80;
}

.portal-stat-icon svg {
  width: 0.95rem;
  height: 0.95rem;
}

/* ── Inline badge — technology / feature tags ─────────────────── */
.portal-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.7rem;
  border-radius: 0.5rem;
  border: 1px solid rgba(51, 65, 85, 0.7);
  background: rgba(15, 23, 42, 0.6);
  color: #94a3b8;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.portal-badge:hover {
  border-color: rgba(26, 173, 116, 0.4);
  color: #cbd5e1;
}

/* ── Navigation ──────────────────────────────────────────────── */
.portal-nav-link {
  color: #94a3b8;
  transition: color 0.18s ease, border-color 0.18s ease;
  border-bottom: 2px solid transparent;
  padding-bottom: 0.2rem;
  font-weight: 500;
  letter-spacing: -0.01em;
}

.portal-nav-link:hover,
.portal-nav-link[aria-current="page"] {
  color: #f8fafc;
  border-color: #1aad74;
}

.portal-mobile-link {
  display: block;
  width: 100%;
  padding: 0.95rem 1rem;
  border-radius: 1rem;
  border: 1px solid rgba(51, 65, 85, 0.72);
  background: rgba(15, 23, 42, 0.72);
  color: #e2e8f0;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.portal-mobile-link:hover,
.portal-mobile-link[aria-current="page"] {
  border-color: rgba(26, 173, 116, 0.5);
  background: rgba(26, 173, 116, 0.12);
  color: #f8fafc;
}

/* ── Typography helpers ──────────────────────────────────────── */
.portal-page-title {
  border-left: 4px solid #1aad74;
  padding-left: 1rem;
  letter-spacing: -0.02em;
}

h1, h2, h3 {
  letter-spacing: -0.025em;
}

/* ── Subnav ──────────────────────────────────────────────────── */
.portal-subnav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.portal-subnav-link {
  display: inline-flex;
  align-items: center;
  padding: 0.7rem 1rem;
  border-radius: 9999px;
  border: 1px solid rgba(51, 65, 85, 0.85);
  background: rgba(15, 23, 42, 0.72);
  color: #cbd5e1;
  font-size: 0.92rem;
  font-weight: 600;
  transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}

.portal-subnav-link:hover {
  border-color: rgba(26, 173, 116, 0.48);
  background: rgba(26, 173, 116, 0.06);
  color: #f8fafc;
}

/* ── Steps ────────────────────────────────────────────────────── */
.portal-grid {
  display: grid;
  gap: 1.25rem;
}

.portal-step {
  position: relative;
  padding-left: 3.25rem;
}

.portal-step-number {
  position: absolute;
  top: 0;
  left: 0;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 9999px;
  background: linear-gradient(135deg, rgba(26, 173, 116, 0.22), rgba(26, 173, 116, 0.08));
  border: 1px solid rgba(26, 173, 116, 0.18);
  color: #4ade80;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
}

/* ── Code ─────────────────────────────────────────────────────── */
.portal-inline-code,
code {
  background: rgba(30, 41, 59, 0.85);
  border-radius: 0.35rem;
  padding: 0.15rem 0.45rem;
  font-size: 0.88em;
  color: #e2e8f0;
}

/* ── Prose ────────────────────────────────────────────────────── */
.portal-prose p,
.portal-prose li {
  color: #cbd5e1;
  line-height: 1.7;
}

.portal-prose li + li {
  margin-top: 0.55rem;
}

/* ── Callout ──────────────────────────────────────────────────── */
.portal-callout {
  border-left: 4px solid #1aad74;
  background: rgba(15, 23, 42, 0.74);
}

/* ── Table ────────────────────────────────────────────────────── */
.portal-table {
  width: 100%;
  border-collapse: collapse;
}

.portal-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.portal-table th,
.portal-table td {
  text-align: left;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid rgba(51, 65, 85, 0.75);
}

.portal-table th {
  color: #f8fafc;
  font-weight: 700;
  font-size: 0.88rem;
  letter-spacing: 0.02em;
}

/* ── Footer ──────────────────────────────────────────────────── */
.portal-footer-link {
  color: #86efac;
  transition: color 0.18s ease;
}

.portal-footer-link:hover {
  color: #bbf7d0;
}

/* ── Scroll-reveal animation ──────────────────────────────────── */
.fade-in-up {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.fade-in-up.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger delays for sequential reveals */
.fade-in-up.delay-1 { transition-delay: 0.08s; }
.fade-in-up.delay-2 { transition-delay: 0.16s; }
.fade-in-up.delay-3 { transition-delay: 0.24s; }

/* Respect user motion preference */
@media (prefers-reduced-motion: reduce) {
  .fade-in-up {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* Ensure content visible without JS */
.no-js .fade-in-up {
  opacity: 1;
  transform: none;
}

/* ── Scroll anchor offset for fixed header ────────────────────── */
[id] {
  scroll-margin-top: 5.5rem;
}

/* ── Divider ──────────────────────────────────────────────────── */
.portal-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(51, 65, 85, 0.6) 20%, rgba(26, 173, 116, 0.15) 50%, rgba(51, 65, 85, 0.6) 80%, transparent);
  border: none;
}

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 767px) {
  .portal-card,
  .portal-card-soft,
  .portal-card-featured {
    border-radius: 1.5rem;
  }

  .portal-page-title {
    padding-left: 0.8rem;
  }

  .portal-subnav {
    gap: 0.5rem;
  }

  .portal-subnav-link {
    width: 100%;
    justify-content: center;
  }

  .portal-stat {
    padding: 0.6rem 0.85rem;
  }

  .portal-hero-glow::before {
    height: 200px;
    top: -40px;
  }
}
