/* ============================================
   FORTBERG Gateway — Design System
   Dark immersive UI, neon accents, glassmorphism
   ============================================ */

/* === CSS Variables === */
:root {
  /* Base Colors */
  --bg-deep: #06060b;
  --bg-surface: #0d0d16;
  --bg-elevated: #13131f;

  /* Neon Accents */
  --neon-cyan: #00f5d4;
  --neon-purple: #b537f2;
  --neon-blue: #3a86ff;
  --neon-pink: #ff006e;

  /* Text */
  --text-primary: #e8e8f0;
  --text-secondary: #7a7a8e;
  --text-muted: #4a4a5c;

  /* Glass */
  --glass-bg: rgba(16, 16, 28, 0.55);
  --glass-border: rgba(255, 255, 255, 0.06);
  --glass-blur: 24px;

  /* Fonts */
  --font-display: 'Outfit', system-ui, sans-serif;
  --font-body: 'DM Sans', system-ui, sans-serif;

  /* Spacing */
  --gap-cards: clamp(20px, 3vw, 40px);

  /* Transitions */
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  background: var(--bg-deep);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

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

/* === Particle Canvas === */
#particleCanvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

/* === Noise Overlay (texture) === */
.noise-overlay {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 256px 256px;
}

/* === Gateway Container === */
.gateway-container {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: clamp(24px, 5vw, 60px);
  gap: clamp(32px, 5vh, 56px);
}

/* === Header / Brand === */
.gateway-header {
  text-align: center;
  animation: fadeInUp 1s var(--ease-out-expo) both;
}

.brand-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  margin-bottom: 16px;
}

.brand-name {
  margin: 0;
}

.brand-tagline {
  font-family: var(--font-body);
  font-size: clamp(0.85rem, 1.5vw, 1rem);
  color: var(--text-secondary);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-weight: 400;
  animation: fadeInUp 1s var(--ease-out-expo) 0.6s both;
}

.fortberg-wordmark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.3rem 0.85rem;
  border: 1.5px solid rgba(255, 255, 255, 0.76);
  background: linear-gradient(180deg, rgba(238, 240, 244, 0.95), rgba(212, 216, 223, 0.95));
  color: #11151d;
  border-radius: 2px;
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: 0.05em;
  line-height: 1;
  text-transform: uppercase;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.fortberg-wordmark--hero {
  font-size: clamp(1.65rem, 5.2vw, 2.95rem);
  border-width: 2px;
  padding: 0.35rem 0.95rem;
}

.fortberg-wordmark--footer {
  font-size: 0.65rem;
  padding: 0.18rem 0.42rem;
  border-width: 1px;
  box-shadow: none;
}

/* === Portals Grid === */
.portals-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--gap-cards);
  max-width: 900px;
  width: 100%;
  align-items: stretch;
  animation: fadeInUp 1s var(--ease-out-expo) 0.4s both;
}

/* === Portal Card === */
.portal-card {
  display: flex;
  position: relative;
  border-radius: 24px;
  overflow: hidden;
  cursor: pointer;
  transform-style: preserve-3d;
  transition: transform 0.5s var(--ease-out-expo);
  will-change: transform;
  height: 100%;
}

.portal-card:hover {
  transform: translateY(-6px) scale(1.02);
}

.portal-glow {
  position: absolute;
  inset: -2px;
  border-radius: 26px;
  opacity: 0;
  transition: opacity 0.5s ease;
  z-index: 0;
}

.portal-card:hover .portal-glow {
  opacity: 1;
}

.portal-glow-store {
  background: linear-gradient(135deg, var(--neon-cyan), var(--neon-blue));
  filter: blur(12px);
}

.portal-glow-dev {
  background: linear-gradient(135deg, var(--neon-purple), var(--neon-pink));
  filter: blur(12px);
}

.portal-inner {
  position: relative;
  z-index: 1;
  padding: clamp(32px, 4vw, 48px);
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 20px;
  min-height: 320px;
  height: 100%;
  flex: 1 1 auto;
  transition: border-color 0.4s ease, background 0.4s ease;
}

.portal-card:hover .portal-inner {
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(16, 16, 28, 0.7);
}

/* Portal Icon */
.portal-icon-wrap {
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  transition: transform 0.4s var(--ease-spring), box-shadow 0.4s ease;
}

.portal-store .portal-icon-wrap {
  background: rgba(0, 245, 212, 0.08);
  color: var(--neon-cyan);
  box-shadow: 0 0 0 rgba(0, 245, 212, 0);
}

.portal-store:hover .portal-icon-wrap {
  transform: scale(1.1) rotate(-3deg);
  box-shadow: 0 0 24px rgba(0, 245, 212, 0.2);
}

.portal-dev .portal-icon-wrap {
  background: rgba(181, 55, 242, 0.08);
  color: var(--neon-purple);
  box-shadow: 0 0 0 rgba(181, 55, 242, 0);
}

.portal-dev:hover .portal-icon-wrap {
  transform: scale(1.1) rotate(3deg);
  box-shadow: 0 0 24px rgba(181, 55, 242, 0.2);
}

.portal-icon {
  width: 40px;
  height: 40px;
}

/* Portal Text */
.portal-title {
  font-family: var(--font-display);
  font-size: clamp(1.3rem, 2.5vw, 1.7rem);
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.2;
}

.portal-desc {
  font-size: clamp(0.85rem, 1.2vw, 0.95rem);
  color: var(--text-secondary);
  line-height: 1.6;
  max-width: 280px;
}

/* Portal CTA */
.portal-cta {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  transition: gap 0.3s var(--ease-out-expo);
}

.portal-card:hover .portal-cta {
  gap: 16px;
}

.portal-store .portal-cta {
  color: var(--neon-cyan);
}

.portal-dev .portal-cta {
  color: var(--neon-purple);
}

.cta-arrow, .portal-lock {
  width: 20px;
  height: 20px;
  transition: transform 0.3s var(--ease-spring);
}

.portal-card:hover .cta-arrow {
  transform: translateX(4px);
}

.portal-card:hover .portal-lock {
  transform: scale(1.15);
}

/* Portal micro-particles (decorative) */
.portal-particles {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.5s ease;
}

.portal-card:hover .portal-particles {
  opacity: 1;
}

/* === SEO Content Block === */
.gateway-seo {
  position: relative;
  width: min(1020px, 100%);
  padding: clamp(22px, 3.6vw, 40px) clamp(20px, 4vw, 52px);
  border-radius: 28px;
  text-align: center;
  background:
    radial-gradient(120% 120% at 50% -26%, rgba(0, 245, 212, 0.18), rgba(0, 245, 212, 0) 58%),
    radial-gradient(110% 110% at 100% 120%, rgba(181, 55, 242, 0.12), rgba(181, 55, 242, 0) 56%),
    linear-gradient(180deg, rgba(9, 12, 24, 0.84), rgba(6, 10, 20, 0.8));
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 28px 54px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
  line-height: 1.75;
  animation: fadeInUp 1s var(--ease-out-expo) 0.55s both;
  overflow: hidden;
}

.gateway-seo::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(95deg, rgba(0, 245, 212, 0.18), rgba(58, 134, 255, 0.12), rgba(181, 55, 242, 0.16));
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
  -webkit-mask-composite: xor;
  padding: 1px;
  opacity: 0.55;
}

.gateway-seo-kicker {
  margin: 0;
  font-size: clamp(0.7rem, 1.15vw, 0.78rem);
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: rgba(232, 232, 240, 0.7);
}

.gateway-seo h2 {
  margin-top: 10px;
  margin-bottom: 12px;
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3.4vw, 2.5rem);
  line-height: 1.12;
  letter-spacing: -0.02em;
  background: linear-gradient(90deg, #ffffff, #ccfef7 54%, #b4d9ff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.gateway-seo-lead {
  margin: 0 auto 16px;
  max-width: 760px;
  font-size: clamp(0.98rem, 1.9vw, 1.2rem);
  color: rgba(232, 232, 240, 0.9);
}

.gateway-seo-copy {
  margin: 0 auto;
  max-width: 860px;
}

.gateway-seo-copy p {
  margin: 0 auto 8px;
}

.gateway-seo strong {
  color: var(--text-primary);
  font-weight: 700;
}

.gateway-seo-copy a {
  color: #b9fff4;
  border-bottom: 1px solid rgba(0, 245, 212, 0.35);
}

.gateway-seo-links {
  margin-top: 18px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.gateway-seo-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(9, 14, 28, 0.55);
  color: rgba(232, 232, 240, 0.95);
  font-weight: 500;
  transition: border-color 0.2s ease, color 0.2s ease, transform 0.2s ease, background 0.2s ease;
}

.gateway-seo a:hover {
  color: #dffffa;
  border-color: rgba(0, 245, 212, 0.65);
  background: rgba(0, 245, 212, 0.12);
  transform: translateY(-2px);
}

/* === Footer === */
.gateway-footer {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.8rem;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  animation: fadeInUp 1s var(--ease-out-expo) 0.8s both;
}

.footer-dot {
  opacity: 0.4;
}

/* === Animations === */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* === Responsive === */
@media (max-width: 700px) {
  .portals-grid {
    grid-template-columns: 1fr;
    max-width: 420px;
  }

  .gateway-seo {
    border-radius: 22px;
    line-height: 1.65;
  }

  .portal-inner {
    min-height: 240px;
    height: auto;
  }

  .brand-logo { margin-bottom: 12px; }
}

@media (max-width: 380px) {
  .portal-inner {
    padding: 24px;
  }
  
  .fortberg-wordmark--hero { font-size: 1.45rem; }
}

/* === Hover glow on card border (subtle neon line) === */
.portal-store .portal-inner::before {
  content: '';
  position: absolute;
  top: -1px;
  left: 20%;
  right: 20%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--neon-cyan), transparent);
  opacity: 0;
  transition: opacity 0.5s ease;
}

.portal-store:hover .portal-inner::before {
  opacity: 0.6;
}

/* Store bottom "chin" to balance visual height with Dev card */
.portal-store .portal-inner::after {
  content: '';
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: -11px;
  height: 20px;
  border-radius: 0 0 18px 18px;
  background: linear-gradient(180deg, rgba(0, 245, 212, 0) 0%, rgba(0, 245, 212, 0.58) 78%, rgba(58, 134, 255, 0.62) 100%);
  filter: blur(8px);
  opacity: 0.72;
  pointer-events: none;
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.portal-store:hover .portal-inner::after {
  opacity: 0.9;
  transform: translateY(1px);
}

.portal-dev .portal-inner::after {
  content: '';
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: -11px;
  height: 20px;
  border-radius: 0 0 18px 18px;
  background: linear-gradient(180deg, rgba(181, 55, 242, 0) 0%, rgba(181, 55, 242, 0.58) 78%, rgba(255, 0, 110, 0.62) 100%);
  filter: blur(8px);
  opacity: 0.72;
  pointer-events: none;
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.portal-dev:hover .portal-inner::after {
  opacity: 0.9;
  transform: translateY(1px);
}

.portal-dev .portal-inner::before {
  content: '';
  position: absolute;
  top: -1px;
  left: 20%;
  right: 20%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--neon-purple), transparent);
  opacity: 0;
  transition: opacity 0.5s ease;
}

.portal-dev:hover .portal-inner::before {
  opacity: 0.6;
}
