/* ================================================
   UPLINKER — Global Stylesheet
   ================================================ */

/* ---- Variables ---- */
:root {
  --bg-primary:   #080f1a;
  --bg-card:      #0d1b2e;
  --bg-nav:       rgba(8, 15, 26, 0.92);
  --accent:       #4db8ff;
  --accent-mid:   #2979d4;
  --accent-dark:  #1a5ca8;
  --text-primary: #f0f6ff;
  --text-muted:   #7a9bbf;
  --border:       rgba(77, 184, 255, 0.12);
  --border-hover: rgba(77, 184, 255, 0.35);
  --glow-sm:      0 0 20px rgba(77, 184, 255, 0.12);
  --glow-md:      0 0 40px rgba(77, 184, 255, 0.18);
  --transition:   0.25s ease;
  --radius:       12px;
  --radius-sm:    8px;
  --radius-xs:    4px;
}

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
input, textarea, select { font-family: inherit; font-size: inherit; color: inherit; }

/* ---- Base Body ---- */
body {
  background-color: var(--bg-primary);
  background-image:
    linear-gradient(rgba(77, 184, 255, 0.022) 1px, transparent 1px),
    linear-gradient(90deg, rgba(77, 184, 255, 0.022) 1px, transparent 1px);
  background-size: 64px 64px;
  background-attachment: fixed;
  color: var(--text-primary);
  font-family: 'Outfit', sans-serif;
  line-height: 1.7;
  overflow-x: hidden;
}

/* ---- Scanline ---- */
.scanline {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 100px;
  background: linear-gradient(
    to bottom,
    transparent 0%,
    rgba(77, 184, 255, 0.025) 50%,
    transparent 100%
  );
  pointer-events: none;
  z-index: 9998;
  animation: scanline-move 12s linear infinite;
}

@keyframes scanline-move {
  0%   { transform: translateY(-100px); }
  100% { transform: translateY(100vh); }
}

/* ---- Typography ---- */
h1, h2, h3, h4, h5, h6 {
  font-family: 'Rajdhani', sans-serif;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: 0.02em;
  color: var(--text-primary);
}

.section-label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.7rem;
  color: var(--accent);
  letter-spacing: 0.25em;
  text-transform: uppercase;
  display: block;
  margin-bottom: 0.75rem;
}

.text-neon {
  color: var(--accent);
  text-shadow: 0 0 28px rgba(77, 184, 255, 0.45), 0 0 60px rgba(77, 184, 255, 0.2);
}

.text-gradient {
  background: linear-gradient(135deg, var(--accent) 0%, #a5d8ff 45%, var(--text-primary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ---- Nav ---- */
.nav-blur {
  background: var(--bg-nav);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}

.nav-link {
  font-family: 'Rajdhani', sans-serif;
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  transition: color var(--transition);
  position: relative;
  padding-bottom: 2px;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--transition);
}

.nav-link:hover,
.nav-link.active { color: var(--text-primary); }

.nav-link:hover::after,
.nav-link.active::after { transform: scaleX(1); }

/* ---- Cards ---- */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent 0%, var(--accent) 50%, transparent 100%);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.35s ease;
}

.card:hover {
  border-color: var(--border-hover);
  box-shadow: var(--glow-sm), 0 8px 32px rgba(0,0,0,0.3);
  transform: translateY(-3px);
}

.card:hover::before { transform: scaleX(1); }

/* ---- Buttons ---- */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1.6rem;
  background: var(--accent-mid);
  color: #fff;
  font-family: 'Rajdhani', sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  transition: all var(--transition);
  white-space: nowrap;
  cursor: pointer;
}

.btn-primary:hover {
  background: var(--accent);
  color: var(--bg-primary);
  box-shadow: 0 0 24px rgba(77, 184, 255, 0.45);
  transform: translateY(-2px);
}

.btn-outline {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1.6rem;
  background: transparent;
  color: var(--accent);
  font-family: 'Rajdhani', sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-hover);
  transition: all var(--transition);
  white-space: nowrap;
  cursor: pointer;
}

.btn-outline:hover {
  background: rgba(77, 184, 255, 0.08);
  border-color: var(--accent);
  box-shadow: 0 0 16px rgba(77, 184, 255, 0.2);
  transform: translateY(-2px);
}

/* ---- Badges ---- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  background: rgba(77, 184, 255, 0.07);
  border: 1px solid rgba(77, 184, 255, 0.22);
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-xs);
}

.badge-warn {
  color: #f59e0b;
  background: rgba(245, 158, 11, 0.07);
  border-color: rgba(245, 158, 11, 0.22);
}

.badge-dot {
  width: 6px; height: 6px;
  background: var(--accent);
  border-radius: 50%;
  flex-shrink: 0;
  animation: dot-pulse 1.8s ease-in-out infinite;
}

.badge-dot-warn {
  background: #f59e0b;
  animation: dot-pulse 1.8s ease-in-out infinite;
}

@keyframes dot-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.3; transform: scale(0.7); }
}

/* ---- Tech Tags ---- */
.tag {
  display: inline-block;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.62rem;
  color: var(--text-muted);
  background: rgba(77, 184, 255, 0.05);
  border: 1px solid rgba(77, 184, 255, 0.1);
  padding: 0.2rem 0.5rem;
  border-radius: 3px;
  letter-spacing: 0.05em;
  transition: border-color var(--transition), color var(--transition);
}

.card:hover .tag {
  border-color: rgba(77, 184, 255, 0.22);
  color: var(--accent);
}

/* ---- Service Icon ---- */
.service-icon {
  width: 52px; height: 52px;
  background: rgba(77, 184, 255, 0.07);
  border: 1px solid rgba(77, 184, 255, 0.14);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  flex-shrink: 0;
  transition: all var(--transition);
}

.card:hover .service-icon {
  background: rgba(77, 184, 255, 0.14);
  border-color: rgba(77, 184, 255, 0.35);
  box-shadow: 0 0 16px rgba(77, 184, 255, 0.14);
}

/* ---- Terminal Block ---- */
.terminal {
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(77, 184, 255, 0.14);
  border-radius: var(--radius-sm);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.82rem;
  line-height: 2;
  color: var(--text-muted);
  padding: 1.25rem 1.5rem;
}

.terminal-header {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid rgba(77, 184, 255, 0.1);
}

.terminal-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
}

.terminal-line {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
}

.terminal-line::before {
  content: '›';
  color: var(--accent);
  font-size: 1rem;
  line-height: 1.8;
  flex-shrink: 0;
}

/* ---- Stats Bar ---- */
.stats-bar {
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.stat-item { border-right: 1px solid var(--border); }
.stat-item:last-child { border-right: none; }

/* ---- LED Indicators ---- */
.led { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.led-green  { background: #22c55e; box-shadow: 0 0 6px #22c55e, 0 0 14px rgba(34,197,94,0.4); animation: led-blink 2s ease-in-out infinite; }
.led-blue   { background: var(--accent); box-shadow: 0 0 6px var(--accent), 0 0 14px rgba(77,184,255,0.4); animation: led-blink 2.5s ease-in-out infinite 0.3s; }
.led-orange { background: #f59e0b; box-shadow: 0 0 6px #f59e0b, 0 0 14px rgba(245,158,11,0.4); animation: led-blink 1.6s ease-in-out infinite 0.6s; }
.led-red    { background: #ef4444; box-shadow: 0 0 6px #ef4444; }

@keyframes led-blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.2; }
}

/* ---- Divider ---- */
.divider {
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, rgba(77,184,255,0.25) 50%, transparent 100%);
}

/* ---- Layout ---- */
.section    { padding: 6rem 0; }
.section-sm { padding: 4rem 0; }

.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ---- Scroll Reveal ---- */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.65s cubic-bezier(0.16,1,0.3,1),
              transform 0.65s cubic-bezier(0.16,1,0.3,1);
}

.reveal.visible { opacity: 1; transform: translateY(0); }

.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }
.reveal-delay-5 { transition-delay: 0.5s; }
.reveal-delay-6 { transition-delay: 0.6s; }

/* ---- How it Works steps ---- */
.step-num {
  font-family: 'Rajdhani', sans-serif;
  font-size: 4.5rem;
  font-weight: 700;
  color: rgba(77, 184, 255, 0.08);
  line-height: 1;
  user-select: none;
  transition: color var(--transition);
}

.step-item:hover .step-num { color: rgba(77, 184, 255, 0.22); }

/* ---- Phase timeline (cases) ---- */
.phase-card {
  border-left: 2px solid var(--accent);
  padding-left: 1.5rem;
  position: relative;
}

.phase-card::before {
  content: '';
  position: absolute;
  left: -5px; top: 4px;
  width: 8px; height: 8px;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 12px var(--accent);
}

/* ---- Metric Cards ---- */
.metric-card {
  background: rgba(77, 184, 255, 0.04);
  border: 1px solid rgba(77, 184, 255, 0.12);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-align: center;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.metric-card:hover {
  border-color: rgba(77, 184, 255, 0.25);
  box-shadow: var(--glow-sm);
}

.metric-value {
  font-family: 'Rajdhani', sans-serif;
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 0.4rem;
}

.metric-label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.62rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

/* ---- Form Inputs ---- */
.form-label {
  display: block;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}

.form-input {
  width: 100%;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  color: var(--text-primary);
  font-size: 0.9rem;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.form-input:focus {
  border-color: rgba(77,184,255,0.4);
  box-shadow: 0 0 0 3px rgba(77,184,255,0.08);
}

.form-input::placeholder { color: var(--text-muted); opacity: 0.55; }

/* ---- Footer ---- */
.footer {
  background: var(--bg-card);
  border-top: 1px solid var(--border);
}

/* ---- Differential block columns ---- */
.diff-col {
  background: rgba(77,184,255,0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  transition: border-color var(--transition);
}

.diff-col:hover { border-color: rgba(77,184,255,0.25); }

.diff-col-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.9rem;
  color: var(--text-muted);
  padding: 0.4rem 0;
  border-bottom: 1px solid rgba(77,184,255,0.06);
}

.diff-col-item:last-child { border-bottom: none; }

.diff-col-item svg { color: var(--accent); flex-shrink: 0; }

/* ---- Topology SVG animation ---- */
.topo-path-anim {
  stroke-dasharray: 6 10;
  animation: march 1.5s linear infinite;
}

@keyframes march {
  to { stroke-dashoffset: -16; }
}

@keyframes ticker {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* ---- Tech Ticker ---- */
.tech-ticker {
  overflow: hidden;
  border-top: 1px solid rgba(77,184,255,0.08);
  border-bottom: 1px solid rgba(77,184,255,0.08);
  background: rgba(13,27,46,0.35);
  padding: 0.7rem 0;
  user-select: none;
}
.tech-ticker-track {
  display: flex;
  gap: 2rem;
  width: max-content;
  animation: ticker 28s linear infinite;
}
.tech-ticker-track:hover { animation-play-state: paused; }
.tech-ticker-item {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--text-muted);
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.tech-ticker-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.5;
  flex-shrink: 0;
}

/* ================================================
   FLUID TYPOGRAPHY — clamp()
   ================================================ */
.h-hero {
  font-family: 'Rajdhani', sans-serif;
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: 0.02em;
  color: var(--text-primary);
  font-size: clamp(2.1rem, 6.5vw, 4.5rem);
}

.h-page {
  font-family: 'Rajdhani', sans-serif;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: 0.02em;
  color: var(--text-primary);
  font-size: clamp(1.875rem, 5.5vw, 3.75rem);
}

.h-section {
  font-family: 'Rajdhani', sans-serif;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: 0.02em;
  color: var(--text-primary);
  font-size: clamp(1.6rem, 4vw, 3rem);
}

/* ================================================
   HAMBURGER BUTTON — animated ↔ X
   ================================================ */
.hamburger-btn {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  padding: 10px 8px;
  min-width: 44px;
  min-height: 44px;
  cursor: pointer;
  background: none;
  border: none;
  color: var(--text-muted);
  transition: color var(--transition);
}

.hamburger-btn:hover { color: var(--text-primary); }

.hamburger-line {
  display: block;
  width: 22px;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
  transition:
    transform 0.35s cubic-bezier(0.23, 1, 0.32, 1),
    opacity   0.25s ease,
    width     0.25s ease;
  transform-origin: center;
}

.hamburger-btn.open .hamburger-line:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger-btn.open .hamburger-line:nth-child(2) { opacity: 0; transform: scaleX(0); }
.hamburger-btn.open .hamburger-line:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ================================================
   MOBILE FULLSCREEN OVERLAY
   ================================================ */
.mobile-overlay {
  position: fixed;
  inset: 0;
  z-index: 45;
  background-color: rgba(8, 15, 26, 0.97);
  background-image:
    linear-gradient(rgba(77, 184, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(77, 184, 255, 0.03) 1px, transparent 1px);
  background-size: 64px 64px;
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.mobile-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.mobile-overlay-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  padding: 2rem 1.5rem;
  text-align: center;
  width: 100%;
  max-width: 360px;
}

.mobile-overlay-nav {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  gap: 0;
  margin-bottom: 2rem;
}

.mobile-nav-link {
  font-family: 'Rajdhani', sans-serif;
  font-size: clamp(1.75rem, 6vw, 2.5rem);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  text-decoration: none;
  padding: 0.65rem 1rem;
  min-height: 44px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  transition:
    opacity  0.35s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.35s cubic-bezier(0.16, 1, 0.3, 1),
    color    0.2s ease,
    background 0.2s ease;
  opacity: 0;
  transform: translateY(18px);
}

.mobile-overlay.open .mobile-nav-link { opacity: 1; transform: translateY(0); }
.mobile-overlay.open .mobile-nav-link:nth-child(1) { transition-delay: 0.06s; }
.mobile-overlay.open .mobile-nav-link:nth-child(2) { transition-delay: 0.11s; }
.mobile-overlay.open .mobile-nav-link:nth-child(3) { transition-delay: 0.16s; }
.mobile-overlay.open .mobile-nav-link:nth-child(4) { transition-delay: 0.21s; }

.mobile-nav-link:hover,
.mobile-nav-link.active {
  color: var(--accent);
  background: rgba(77, 184, 255, 0.06);
}

.mobile-cta {
  width: 100%;
  justify-content: center;
  font-size: 1rem;
  padding: 0.9rem 2rem;
  min-height: 52px;
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.35s ease 0.26s, transform 0.35s ease 0.26s, background 0.25s, box-shadow 0.25s;
}

.mobile-overlay.open .mobile-cta { opacity: 1; transform: translateY(0); }

.mobile-overlay-tag {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.58rem;
  letter-spacing: 0.22em;
  color: rgba(77, 184, 255, 0.28);
  text-transform: uppercase;
  margin-top: 2.5rem;
  opacity: 0;
  transition: opacity 0.3s ease 0.35s;
}

.mobile-overlay.open .mobile-overlay-tag { opacity: 1; }

/* ================================================
   BUTTON GROUP — full-width on mobile
   ================================================ */
.btn-group {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

/* ================================================
   TOUCH TARGETS
   ================================================ */
.btn-primary,
.btn-outline {
  min-height: 44px;
}

/* ================================================
   RESPONSIVE
   ================================================ */

/* --- Mobile: 375–767px --- */
@media (max-width: 767px) {
  .section { padding: 3.5rem 0; }
  .container { padding: 0 1.125rem; }

  /* Stats bar: 2×2 grid with correct borders */
  .stat-item { border-right: none; border-bottom: 1px solid var(--border); }
  .stat-item:last-child { border-bottom: none; }
  .stat-item:nth-child(2n+1) { border-right: 1px solid var(--border); }
  .stat-item:nth-child(-n+2) { border-bottom: 1px solid var(--border); }
  .stat-item:nth-child(2)    { border-bottom: 1px solid var(--border); }
  .stat-item:last-child      { border-right: none; border-bottom: none; }
  .stat-item:nth-last-child(2) { border-bottom: none; }

  /* Buttons full-width in .btn-group */
  .btn-group { flex-direction: column; }
  .btn-group .btn-primary,
  .btn-group .btn-outline {
    width: 100%;
    justify-content: center;
  }

  /* Diff block stack */
  .diff-col { padding: 1.5rem; }

  /* Canvas height on mobile */
  #hero-canvas { height: 280px; }
  #box-canvas  { height: 260px; }

  /* Prevent horizontal overflow */
  section, .card { overflow-x: hidden; }

  /* Reduce section labels */
  .section-label { font-size: 0.62rem; letter-spacing: 0.2em; }
}

/* --- Tablet: 768–1023px --- */
@media (min-width: 768px) and (max-width: 1023px) {
  #hero-canvas, #box-canvas { height: 300px; }
  .section { padding: 4.5rem 0; }
}

/* --- Desktop: 1024px+ --- */
@media (min-width: 1024px) {
  #hero-canvas { height: 440px; }
  #box-canvas  { height: 420px; }
}

/* --- Wide: 1441px+ --- */
@media (min-width: 1441px) {
  .container { max-width: 1400px; }
}

/* Prevent any horizontal overflow globally */
html, body {
  max-width: 100%;
  overflow-x: hidden;
}
