/* ==========================================================================
   GATEWAY PAGE SPECIFIC STYLES
   ========================================================================== */

/* Main layout wrapper */
.gateway-wrapper {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 2rem 0;
  z-index: 2;
  overflow: hidden;
}

/* Header & Footer styling */
.gateway-header {
  padding: 1rem 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.gateway-logo {
  font-family: var(--font-sans);
  font-size: 1.1rem;
  font-weight: 900;
  color: var(--text-primary);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.gateway-status {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.4);
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.gateway-status-dot {
  width: 6px;
  height: 6px;
  background-color: var(--accent-availability);
  border-radius: 50%;
  animation: pulse-dot 2s infinite;
}

.gateway-footer {
  padding: 1.5rem 0;
  border-top: 1px solid rgba(255, 255, 255, 0.03);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  color: rgba(255, 255, 255, 0.3);
  font-family: var(--font-mono);
  font-size: 0.75rem;
}

/* Hero Section */
.gateway-hero {
  text-align: center;
  max-width: 800px;
  margin: 3.5rem auto 3rem auto;
}

.gateway-title {
  font-size: clamp(3rem, 7vw, 5.5rem);
  font-weight: 900;
  line-height: 0.9;
  letter-spacing: -0.04em;
  text-transform: uppercase;
  margin-bottom: 1.5rem;
  color: #ffffff;
}

.gateway-title span.outline-text {
  color: transparent;
  -webkit-text-stroke: 1px rgba(255, 255, 255, 0.3);
}

.gateway-subtitle {
  font-size: clamp(1.1rem, 2vw, 1.35rem);
  font-weight: 300;
  color: var(--text-secondary);
  max-width: 650px;
  margin: 0 auto;
  line-height: 1.5;
  letter-spacing: 0.02em;
}

/* Card Selection Area */
.gateway-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: clamp(1.5rem, 4vw, 3rem);
  max-width: 1100px;
  width: 100%;
  margin: 0 auto;
  padding: 0 clamp(1rem, 2.5vw, 2rem);
  perspective: 1000px; /* Enable 3D space for card flips/tilts */
}

/* 1px Border Glow Wrapper */
.card-wrapper {
  position: relative;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 24px;
  padding: 1px;
  transition: background 0.3s ease;
  will-change: background;
}

/* Inner Glassmorphic Card */
.gateway-card {
  position: relative;
  background: rgba(10, 10, 10, 0.75);
  border-radius: 23px;
  padding: 3.5rem 3rem;
  height: 100%;
  min-height: 480px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.5s ease;
  will-change: transform;
}

/* Spotlight overlay inside card */
.gateway-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
    300px circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
    rgba(255, 255, 255, 0.05),
    transparent 70%
  );
  z-index: 1;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.5s ease;
}

.card-wrapper:hover .gateway-card::before {
  opacity: 1;
}

/* Visual Illustration Container inside Cards */
.card-visual {
  height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 2rem;
  position: relative;
  z-index: 2;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  padding-bottom: 2rem;
}

.card-content-block {
  position: relative;
  z-index: 2;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.card-tag {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.35);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  margin-bottom: 0.8rem;
}

.card-title {
  font-size: 2rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 1rem;
  letter-spacing: -0.02em;
}

.card-description {
  font-size: 1.02rem;
  color: var(--text-secondary);
  line-height: 1.6;
  font-weight: 300;
  margin-bottom: 2.5rem;
}

/* ─────────────────────────────────────────────────────────────
   CLIENT VISUAL: browser + AI nodes + tags
───────────────────────────────────────────────────────────── */
.client-visual {
  flex-direction: row;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 1.5rem;
  overflow: visible;
}

/* ── Mini browser ── */
.cv-browser {
  width: 155px;
  flex-shrink: 0;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(20,20,24,0.9);
  overflow: hidden;
  transition: border-color 0.4s ease, box-shadow 0.4s ease;
}
.cv-browser-bar {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px 8px;
  background: rgba(255,255,255,0.04);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.cv-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}
.cv-red    { background: #ff5f57; }
.cv-yellow { background: #febc2e; }
.cv-green  { background: #28c840; }
.cv-url-bar {
  flex: 1;
  font-size: 0.55rem;
  color: rgba(255,255,255,0.3);
  font-family: var(--font-mono);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-left: 4px;
  transition: color 0.4s ease;
}
.cv-browser-body {
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.cv-code-line {
  font-size: 0.5rem;
  font-family: var(--font-mono);
  line-height: 1.4;
  white-space: nowrap;
  opacity: 0;
  transform: translateX(-6px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}
.cv-kw      { color: #7aa2f7; }
.cv-attr    { color: #e0af68; }
.cv-str     { color: #9ece6a; }
.cv-txt     { color: rgba(255,255,255,0.75); }
.cv-comment { color: #565f89; }

/* stagger the lines */
.cv-line-1 { transition-delay: 0s; }
.cv-line-2 { transition-delay: 0.08s; }
.cv-line-3 { transition-delay: 0.16s; }
.cv-line-4 { transition-delay: 0.24s; }

.card-wrapper:hover .cv-code-line {
  opacity: 1;
  transform: translateX(0);
}
.card-wrapper:hover .cv-browser {
  border-color: rgba(122, 162, 247, 0.4);
  box-shadow: 0 0 18px rgba(122, 162, 247, 0.15);
}
.card-wrapper:hover .cv-url-bar {
  color: rgba(255,255,255,0.6);
}

/* ── Floating tech tags ── */
.cv-tags {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-self: center;
}
.cv-tag {
  font-size: 0.52rem;
  font-family: var(--font-mono);
  font-weight: 700;
  letter-spacing: 0.1em;
  padding: 4px 8px;
  border-radius: 4px;
  border: 1px solid rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.3);
  background: rgba(255,255,255,0.03);
  transition: all 0.4s ease;
}
.card-wrapper:hover .cv-tag-web  {
  background: rgba(122, 162, 247, 0.15);
  border-color: #7aa2f7;
  color: #7aa2f7;
  box-shadow: 0 0 10px rgba(122,162,247,0.2);
}
.card-wrapper:hover .cv-tag-ai   {
  background: rgba(187, 154, 247, 0.15);
  border-color: #bb9af7;
  color: #bb9af7;
  box-shadow: 0 0 10px rgba(187,154,247,0.2);
  transition-delay: 0.08s;
}
.card-wrapper:hover .cv-tag-auto {
  background: rgba(115, 218, 202, 0.15);
  border-color: #73daca;
  color: #73daca;
  box-shadow: 0 0 10px rgba(115,218,202,0.2);
  transition-delay: 0.16s;
}

/* ── AI node SVG ── */
.cv-nodes {
  width: 90px;
  height: 90px;
  flex-shrink: 0;
  align-self: center;
}
.cv-edge {
  stroke: rgba(255,255,255,0.08);
  stroke-width: 1;
  stroke-dasharray: 4 4;
  transition: stroke 0.4s ease;
}
.cv-node {
  fill: rgba(255,255,255,0.1);
  transition: fill 0.4s ease, filter 0.4s ease;
}
/* pulsing animation on nodes */
.cv-n2 {
  animation: cv-pulse 2.2s ease-in-out infinite;
}
@keyframes cv-pulse {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 1; }
}

.card-wrapper:hover .cv-edge {
  stroke: rgba(187, 154, 247, 0.35);
  animation: cv-edge-flow 1.5s linear infinite;
  stroke-dashoffset: 0;
}
@keyframes cv-edge-flow {
  to { stroke-dashoffset: -16; }
}
.card-wrapper:hover .cv-n1 { fill: #7aa2f7; filter: drop-shadow(0 0 4px #7aa2f7); transition-delay: 0s; }
.card-wrapper:hover .cv-n2 { fill: #bb9af7; filter: drop-shadow(0 0 8px #bb9af7); animation: none; transition-delay: 0.05s; }
.card-wrapper:hover .cv-n3 { fill: #73daca; filter: drop-shadow(0 0 4px #73daca); transition-delay: 0.1s; }
.card-wrapper:hover .cv-n4 { fill: #9ece6a; filter: drop-shadow(0 0 4px #9ece6a); transition-delay: 0.15s; }
.card-wrapper:hover .cv-n5 { fill: #e0af68; filter: drop-shadow(0 0 4px #e0af68); transition-delay: 0.2s; }

/* ── Glow backdrop on card hover ── */
.card-wrapper:hover .client-visual {
  position: relative;
}
.card-wrapper:hover .client-visual::after {
  content: '';
  position: absolute;
  inset: -20px;
  background: radial-gradient(ellipse at 60% 50%, rgba(122,162,247,0.06) 0%, transparent 70%);
  pointer-events: none;
  z-index: -1;
}


/* Graphic styles - Engineering wave SVG */
.wave-svg {
  width: 200px;
  height: 80px;
  overflow: visible;
}

.wave-path {
  fill: none;
  stroke: rgba(255, 255, 255, 0.25);
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 400;
  stroke-dashoffset: 400;
  transition: stroke-dashoffset 2s ease, stroke 0.4s ease;
}

.grid-path {
  fill: none;
  stroke: rgba(255, 255, 255, 0.04);
  stroke-width: 0.8;
  stroke-dasharray: 4, 4;
}

.wave-dots circle {
  fill: rgba(255, 255, 255, 0.2);
  transition: fill 0.4s ease, transform 0.4s ease;
}

.card-wrapper:hover .wave-path {
  stroke: rgba(255, 255, 255, 0.8);
  stroke-dashoffset: 0;
}

.card-wrapper:hover .wave-dots circle {
  fill: rgba(255, 255, 255, 0.9);
  transform: scale(1.2);
}

/* Buttons */
.magnetic-btn-container {
  display: inline-block;
  position: relative;
  z-index: 3;
}

.magnetic-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
  padding: 1.1rem 2.2rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  border-radius: 100px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.02);
  color: #ffffff;
  transition: border-color 0.3s, background-color 0.3s, color 0.3s, transform 0.1s ease-out;
  cursor: pointer;
  width: 100%;
  justify-content: center;
}

.magnetic-btn svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
  transition: transform 0.3s ease;
}

.magnetic-btn:hover {
  background-color: #ffffff;
  color: #000000;
  border-color: #ffffff;
}

.magnetic-btn:hover svg {
  transform: translateX(4px);
}

/* Special styling for Coming Soon button */
.magnetic-btn.btn-disabled {
  border: 1px dashed rgba(255, 255, 255, 0.1);
  background: transparent;
  color: rgba(255, 255, 255, 0.3);
  cursor: not-allowed;
  font-weight: 600;
}

.magnetic-btn.btn-disabled:hover {
  background: transparent;
  color: rgba(255, 255, 255, 0.4);
  border-color: rgba(255, 255, 255, 0.2);
}

.magnetic-btn.btn-disabled svg {
  fill: rgba(255, 255, 255, 0.3);
  transform: none !important;
}

/* Background canvas for 3D Solar System */
#gateway-bg-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

@media (max-width: 768px) {
  .gateway-wrapper .container {
    padding: 0 0.75rem;
  }

  .gateway-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
    padding: 0;
  }
  
  .gateway-card {
    min-height: auto;
    padding: 2.5rem 1.25rem;
  }
  
  .gateway-hero {
    margin-top: 2rem;
    margin-bottom: 2rem;
  }
  
  .gateway-title {
    margin-bottom: 1rem;
  }
}

@media (max-width: 480px) {
  .client-visual {
    gap: 0.5rem;
    justify-content: center;
  }
  
  .cv-browser {
    width: 110px;
  }
  
  .cv-nodes {
    width: 65px;
    height: 65px;
  }
  
  .cv-tags {
    gap: 4px;
  }
  
  .cv-tag {
    font-size: 0.45rem;
    padding: 2px 4px;
  }
}

@keyframes pulse-dot {
  0% {
    transform: scale(0.9);
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7);
  }
  70% {
    transform: scale(1);
    box-shadow: 0 0 0 6px rgba(34, 197, 94, 0);
  }
  100% {
    transform: scale(0.9);
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0);
  }
}
