/* ============================================
   ZENVYROLABS 2026 — Premium Design System
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Sora:wght@300;400;500;600;700;800&family=Space+Grotesk:wght@400;500;600;700&display=swap');

/* --- Tokens --- */
:root {
  --bg-deep: #040810;
  --bg-primary: #070c18;
  --bg-elevated: #0c1225;
  --bg-surface: #101830;
  --bg-surface-hover: #141e3c;

  --border-subtle: rgba(255, 255, 255, 0.04);
  --border-default: rgba(255, 255, 255, 0.07);
  --border-active: rgba(0, 198, 255, 0.25);

  --text-primary: #f0f2f5;
  --text-secondary: rgba(240, 242, 245, 0.55);
  --text-muted: rgba(240, 242, 245, 0.3);

  --accent-blue: #2d7aff;
  --accent-cyan: #00c6ff;
  --accent-green: #00e68a;
  --accent-teal: #00d4aa;

  --grad-brand: linear-gradient(135deg, #2d7aff 0%, #00c6ff 40%, #00e68a 100%);
  --grad-blue-cyan: linear-gradient(135deg, #2d7aff, #00c6ff);
  --grad-glow: radial-gradient(ellipse at 50% 0%, rgba(0, 198, 255, 0.08) 0%, transparent 55%);
  --grad-glow-green: radial-gradient(ellipse at 50% 100%, rgba(0, 230, 138, 0.05) 0%, transparent 50%);

  --font-display: 'Sora', sans-serif;
  --font-body: 'Space Grotesk', sans-serif;

  --fs-display: clamp(3rem, 6vw, 4.5rem);
  --fs-h1: clamp(2.25rem, 4vw, 3.25rem);
  --fs-h2: clamp(1.75rem, 3vw, 2.5rem);
  --fs-h3: clamp(1.25rem, 2vw, 1.625rem);
  --fs-body: 1.0625rem;
  --fs-body-lg: 1.1875rem;
  --fs-small: 0.9375rem;
  --fs-caption: 0.8125rem;
  --fs-overline: 0.6875rem;

  --lh-display: 1.1;
  --lh-heading: 1.25;
  --lh-body: 1.75;

  --space-section: clamp(100px, 12vw, 160px);
  --space-block: clamp(48px, 6vw, 80px);
  --space-element: 24px;
  --space-tight: 12px;

  --container: 1200px;
  --gutter: clamp(20px, 4vw, 48px);
  --card-blur: blur(25px);
  --radius: 8px;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --dur-fast: 0.2s;
  --dur-med: 0.4s;
  --dur-slow: 0.8s;
  --dur-reveal: 1s;
}

/* --- Scroll Reveal Defaults --- */
.sr {
  transform: translateY(30px);
  transition: opacity 1s var(--ease-out), transform 1s var(--ease-out), visibility 1s;
}

/* Fail-safe: Reveal everything after 4s even if JS fails */
@keyframes progressiveReveal {
  to {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }
}

.sr {
  animation: progressiveReveal 1s ease-out 2.5s forwards;
}

/* Only hide if JS is confirmed working */
html.js-ready .sr {
  opacity: 0;
  visibility: hidden;
  animation: none;
  /* Let JS handle it */
}

html.js-ready .sr.in-view {
  opacity: 1 !important;
  transform: translateY(0) !important;
  visibility: visible !important;
}

Broadway .sr.in-view {
  opacity: 1 !important;
  transform: translateY(0) !important;
}

.text-vanish {
  opacity: 0 !important;
  filter: blur(12px) !important;
  transform: translateY(10px) scale(0.95) !important;
  transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.text-appear {
  opacity: 1 !important;
  filter: blur(0) !important;
  transform: translateY(0) scale(1) !important;
  transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  cursor: none;
  overflow-x: hidden; /* ADDED — prevent horizontal scroll */
}

body {
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: 1.6;
  /* Changed from var(--lh-body) to 1.6 */
  color: var(--text-primary);
  /* Changed from var(--text-secondary) to var(--text-primary) */
  background: var(--bg-deep);
  overflow-x: hidden;
  cursor: none;
}

a,
button,
.stat-card,
.stack-animate-btn,
.radar-node,
.service-card,
.btn {
  cursor: none !important;
}

/* --- SCANNER CROSSHAIR --- */
.scanner-cursor {
  position: fixed;
  top: 0;
  left: 0;
  pointer-events: none;
  z-index: 99999;
  mix-blend-mode: screen;
}

.scanner-dot {
  position: absolute;
  width: 4px;
  height: 4px;
  background: var(--accent-cyan);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 10px var(--accent-cyan);
  transition: width 0.2s, height 0.2s, background 0.2s;
}

.scanner-line-x {
  position: absolute;
  width: 100vw;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0, 198, 255, 0.15) 50%, transparent);
  transform: translate(-50vw, -50%);
}

.scanner-line-y {
  position: absolute;
  height: 100vh;
  width: 1px;
  background: linear-gradient(0deg, transparent, rgba(0, 198, 255, 0.15) 50%, transparent);
  transform: translate(-50%, -50vh);
}

.scanner-cursor.active .scanner-dot {
  width: 8px;
  height: 8px;
  background: #fff;
  box-shadow: 0 0 15px #fff;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-display);
  color: var(--text-primary);
  line-height: var(--lh-heading);
  font-weight: 700;
}

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

img {
  max-width: 100%;
  display: block;
}

ul,
ol {
  list-style: none;
}

button,
input,
textarea {
  font-family: var(--font-body);
  border: none;
  outline: none;
  background: none;
  color: var(--text-primary);
}

/* --- Layout --- */
.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

section {
  position: relative;
  overflow: hidden;
}

.section-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
  opacity: 0.4;
  transition: opacity 0.8s ease;
}

#services-bg,
#why-bg {
  opacity: 0.65;
}

/* --- Section Divider --- */
.section-divider {
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-default) 30%, var(--border-default) 70%, transparent);
}

/* --- Overline Label --- */
.overline {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: var(--fs-overline);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 4px;
  color: var(--accent-cyan);
  margin-bottom: 20px;
}

.overline::before {
  content: '';
  width: 24px;
  height: 1px;
  background: var(--grad-brand);
}

/* --- Gradient Text --- */
.grad-text {
  background: var(--grad-brand);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ============================================
   SCROLL REVEAL SYSTEM
   ============================================ */
.sr {
  opacity: 0;
  transform: translateY(48px);
  transition: opacity var(--dur-reveal) var(--ease-out), transform var(--dur-reveal) var(--ease-out);
  will-change: opacity, transform;
}

.sr.in-view {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger children */
.sr-children>* {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 0.6s var(--ease-out), transform 0.6s var(--ease-out);
}

.sr-children.in-view>*:nth-child(1) {
  transition-delay: 0.05s;
}

.sr-children.in-view>*:nth-child(2) {
  transition-delay: 0.12s;
}

.sr-children.in-view>*:nth-child(3) {
  transition-delay: 0.19s;
}

.sr-children.in-view>*:nth-child(4) {
  transition-delay: 0.26s;
}

.sr-children.in-view>*:nth-child(5) {
  transition-delay: 0.33s;
}

.sr-children.in-view>*:nth-child(6) {
  transition-delay: 0.40s;
}

.sr-children.in-view>*:nth-child(7) {
  transition-delay: 0.47s;
}

.sr-children.in-view>* {
  opacity: 1;
  transform: translateY(0);
}

.sr-children:not(.in-view)>* {
  opacity: 0;
  transform: translateY(32px);
}

/* Scale reveal variant */
.sr-scale {
  opacity: 0;
  transform: scale(0.92);
  transition: opacity var(--dur-reveal) var(--ease-out), transform var(--dur-reveal) var(--ease-out);
}

.sr-scale.in-view {
  opacity: 1;
  transform: scale(1);
}

/* ============================================
   HEADER
   ============================================ */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 100;
  padding: 22px 0;
  transition: background var(--dur-fast), padding var(--dur-fast), backdrop-filter var(--dur-fast);
}

.site-header.scrolled {
  background: rgba(4, 8, 16, 0.85);
  backdrop-filter: blur(24px) saturate(1.2);
  -webkit-backdrop-filter: blur(24px) saturate(1.2);
  padding: 14px 0;
  border-bottom: 1px solid var(--border-subtle);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header-logo {
  display: flex;
  align-items: center;
  gap: 4px;
  z-index: 101;
}

.header-logo img {
  height: 42px;
  width: auto;
  filter: drop-shadow(0 0 12px rgba(0, 198, 255, 0.2));
}

.header-logo-text {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 2.5px;
  color: var(--text-primary);
  transform: translateY(2px);
}

.header-logo-text .labs {
  font-weight: 400;
  color: var(--text-muted);
  margin-left: 4px;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 32px;
}

.header-nav a {
  font-size: var(--fs-small);
  font-weight: 500;
  color: var(--text-muted);
  transition: color var(--dur-fast);
  position: relative;
  padding-bottom: 2px;
}

.header-nav a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 1.5px;
  background: var(--grad-brand);
  transition: width 0.3s var(--ease-out);
}

.header-nav a:hover {
  color: var(--text-primary);
}

.header-nav a:hover::after {
  width: 100%;
}

.header-cta-btn {
  font-size: var(--fs-caption);
  font-weight: 600;
  padding: 10px 26px;
  border-radius: var(--radius);
  background: var(--grad-blue-cyan);
  color: var(--text-primary);
  cursor: pointer;
  letter-spacing: 0.5px;
  transition: transform var(--dur-fast), box-shadow var(--dur-fast);
}

.header-cta-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 24px rgba(0, 198, 255, 0.25);
}

/* Hamburger */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  z-index: 2001; /* Above mobile-nav and header-nav fallbacks */
}

.hamburger span {
  width: 24px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: transform 0.4s var(--ease-spring), opacity 0.4s var(--ease-spring), width 0.4s var(--ease-spring);
}

.hamburger span:nth-child(2) {
  width: 18px;
  align-self: flex-end;
}

.hamburger:hover span:nth-child(2) {
  width: 24px;
}

.hamburger.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.hamburger.active span:nth-child(2) {
  opacity: 0;
}

.hamburger.active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* Mobile Nav */
/* Mobile Nav Drawer */
.mobile-nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background: rgba(5, 10, 20, 0.98);
  backdrop-filter: blur(10px);
  z-index: 9999;
  transform: translateX(100%);
  transition: transform 0.3s ease;
}

.mobile-nav.active {
  transform: translateX(0);
}

.mobile-nav a {
  text-align: center;
  margin: 16px 0;
  font-size: clamp(20px, 5vw, 28px);
}

/* ADDED — prevent scroll when mobile nav is open */
body.nav-open {
  overflow: hidden;
}

.close-btn {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10000;
  transition: transform 0.3s ease;
}

.close-btn:hover {
  transform: rotate(90deg);
}

.close-btn span {
  position: absolute;
  width: 24px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
}

.close-btn span:nth-child(1) {
  transform: rotate(45deg);
}

.close-btn span:nth-child(2) {
  transform: rotate(-45deg);
}

.mobile-nav-links {
  display: flex;
  flex-direction: column;
  gap: 32px;
  margin-top: 40px;
}

.mobile-nav a {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-secondary);
  transition: color var(--dur-fast), transform var(--dur-fast);
  opacity: 0;
  transform: translateX(20px);
}

.mobile-nav.active a {
  opacity: 1;
  transform: translateX(0);
  transition: opacity 0.4s ease 0.2s, transform 0.4s var(--ease-spring) 0.2s, color var(--dur-fast);
}

/* Staggered link animation */
.mobile-nav.active a:nth-child(2) {
  transition-delay: 0.25s;
}

.mobile-nav.active a:nth-child(3) {
  transition-delay: 0.30s;
}

.mobile-nav.active a:nth-child(4) {
  transition-delay: 0.35s;
}

.mobile-nav.active a:nth-child(5) {
  transition-delay: 0.40s;
}

.mobile-nav.active a:nth-child(6) {
  transition-delay: 0.45s;
}

.mobile-nav a:hover {
  color: var(--text-primary);
  transform: translateX(4px);
}

/* ============================================
   PROJECTS DROPDOWN (SYSTEM NEXUS)
   ============================================ */
.projects-dropdown {
  position: relative;
  display: inline-block;
}

.dropdown-trigger {
  font-size: var(--fs-small);
  font-weight: 600;
  color: var(--accent-cyan);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 18px;
  border-radius: 100px;
  background: rgba(0, 198, 255, 0.05);
  border: 1px solid rgba(0, 198, 255, 0.15);
  transition: all 0.3s var(--ease-out);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.dropdown-trigger i {
  font-style: normal;
  font-size: 0.8rem;
  transition: transform 0.3s var(--ease-spring);
}

.projects-dropdown:hover .dropdown-trigger {
  background: rgba(0, 198, 255, 0.12);
  border-color: var(--accent-cyan);
  box-shadow: 0 0 20px rgba(0, 198, 255, 0.2);
}

.projects-dropdown:hover .dropdown-trigger i {
  transform: rotate(180deg);
}

.dropdown-content {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  background: rgba(4, 8, 16, 0.92);
  backdrop-filter: blur(25px) saturate(1.5);
  -webkit-backdrop-filter: blur(25px) saturate(1.5);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  padding: 12px;
  min-width: 240px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(15px) scale(0.95);
  transition: all 0.4s var(--ease-spring);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8), 0 0 30px rgba(0, 198, 255, 0.05);
  z-index: 1000;
}

.projects-dropdown:hover .dropdown-content {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.dropdown-content a {
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px !important;
  color: var(--text-secondary) !important;
  font-size: 0.85rem !important;
  font-weight: 600 !important;
  border-radius: 12px;
  transition: all 0.3s var(--ease-out) !important;
  text-transform: uppercase;
  letter-spacing: 1px;
  border-bottom: none !important;
}

.dropdown-content a::after {
  content: '→';
  opacity: 0;
  transform: translateX(-10px);
  transition: all 0.3s var(--ease-out);
  color: var(--accent-cyan);
}

.dropdown-content a:hover {
  background: rgba(0, 198, 255, 0.08) !important;
  color: #fff !important;
  padding-left: 24px !important;
}

.dropdown-content a:hover::after {
  opacity: 1;
  transform: translateX(0);
}

.dropdown-content a.active {
  color: var(--accent-cyan) !important;
  background: rgba(0, 198, 255, 0.05);
}

/* Dropdown Up Modifier */
.projects-dropdown.dropdown-up .dropdown-content {
  top: auto;
  bottom: calc(100% + 12px);
  right: 50%;
  transform: translateX(50%) translateY(-15px) scale(0.95);
}

.projects-dropdown.dropdown-up:hover .dropdown-content {
  transform: translateX(50%) translateY(0) scale(1);
}

/* ============================================
   HERO
   ============================================ */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 140px 0 100px;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--grad-glow);
  pointer-events: none;
}

.hero::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 200px;
  background: linear-gradient(to top, var(--bg-deep), transparent);
  pointer-events: none;
}

#hero-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 2;
}

.hero-brand {
  display: flex;
  justify-content: center;
  margin-bottom: 48px;
  opacity: 0;
  animation: heroFadeUp 1s var(--ease-out) 0.2s forwards;
}

.hero-brand-name {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 6px;
  color: var(--text-primary);
  transform: translateY(2px);
  position: relative;
  display: inline-block;
  cursor: default;
  transition: text-shadow 0.4s var(--ease-out), color 0.4s var(--ease-out);
  animation: microFloat 5s ease-in-out infinite;
}

@keyframes microFloat {

  0%,
  100% {
    transform: translateY(2px) scale(1) rotate(0deg);
  }

  33% {
    transform: translateY(0px) scale(1.005) rotate(0.4deg);
  }

  66% {
    transform: translateY(1px) scale(0.995) rotate(-0.4deg);
  }
}

.hero-brand-name::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--grad-brand);
  transition: width 0.6s var(--ease-spring);
}

.hero-brand-name:hover {
  text-shadow: 0 0 20px rgba(0, 198, 255, 0.4);
}

.hero-brand-name:hover::after {
  width: 100%;
}

.hero-brand-name .labs-text {
  font-weight: 400;
  color: var(--text-muted);
  letter-spacing: 8px;
  margin-left: 8px;
  transition: color 0.4s var(--ease-out);
}

.hero-brand-name:hover .labs-text {
  color: var(--text-primary);
}

.hero h1 {
  font-size: var(--fs-display);
  font-weight: 800;
  line-height: var(--lh-display);
  margin-bottom: 28px;
  max-width: 800px;
  opacity: 0;
  animation: heroFadeUp 1s var(--ease-out) 0.4s forwards;
}

#hero-rotator::after,
#why-rotator::after {
  content: '|';
  margin-left: 4px;
  animation: typingBlink 0.8s infinite;
  color: var(--accent-cyan);
  font-weight: 300;
}

@keyframes typingBlink {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0;
  }
}

#hero-rotator {
  min-height: 3.6em;
}

.hero-subtitle {
  font-size: var(--fs-body-lg);
  color: var(--text-secondary);
  max-width: 560px;
  margin-bottom: 52px;
  line-height: 1.8;
  opacity: 0;
  animation: heroFadeUp 1s var(--ease-out) 0.6s forwards;
}

.hero-actions {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  opacity: 0;
  animation: heroFadeUp 1s var(--ease-out) 0.8s forwards;
}

@keyframes heroFadeUp {
  from {
    opacity: 0;
    transform: translateY(32px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Buttons */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 16px 36px;
  font-size: var(--fs-body);
  font-weight: 600;
  border-radius: var(--radius);
  background: var(--grad-blue-cyan);
  color: var(--text-primary);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: transform var(--dur-fast) var(--ease-spring), box-shadow var(--dur-fast);
}

.btn-primary::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.15), transparent);
  opacity: 0;
  transition: opacity var(--dur-fast);
}

.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 40px rgba(0, 198, 255, 0.35), 0 0 0 1px rgba(0, 198, 255, 0.15);
}

.btn-primary:hover::before {
  opacity: 1;
}

.btn-outline {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 16px 36px;
  font-size: var(--fs-body);
  font-weight: 600;
  border-radius: var(--radius);
  border: 1px solid var(--border-default);
  color: var(--text-primary);
  cursor: pointer;
  transition: border-color var(--dur-fast), background var(--dur-fast), transform var(--dur-fast) var(--ease-spring);
}

.btn-outline:hover {
  border-color: var(--accent-cyan);
  background: rgba(0, 198, 255, 0.05);
  transform: translateY(-3px);
}

/* Hero scroll indicator */
.hero-scroll-indicator {
  position: absolute;
  bottom: 48px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  opacity: 0;
  animation: heroFadeUp 1s var(--ease-out) 1.2s forwards;
}

.scroll-line {
  width: 1px;
  height: 40px;
  background: var(--border-default);
  position: relative;
  overflow: hidden;
}

.scroll-line::after {
  content: '';
  position: absolute;
  top: -100%;
  width: 1px;
  height: 100%;
  background: var(--grad-brand);
  animation: scrollPulse 2s ease-in-out infinite;
}

@keyframes scrollPulse {
  0% {
    top: -100%;
  }

  100% {
    top: 100%;
  }
}

.scroll-text {
  font-size: var(--fs-overline);
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* ============================================
   ABOUT (Merged About + Who We Are)
   ============================================ */
.about {
  padding: var(--space-section) 0;
  position: relative;
}

.about::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--grad-glow-green);
  pointer-events: none;
}

.about-header {
  margin-bottom: var(--space-block);
  max-width: 700px;
}

.about-header h2 {
  font-size: var(--fs-h1);
  margin-bottom: var(--space-element);
}

.about-header p {
  font-size: var(--fs-body-lg);
  line-height: 1.8;
}

.about-philosophy {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2px;
  margin-bottom: var(--space-block);
  border-radius: var(--radius);
  overflow: hidden;
}

.phil-card {
  background: var(--bg-elevated);
  padding: 44px 32px;
  position: relative;
  cursor: default;
  overflow: hidden;
  transition: background var(--dur-med) var(--ease-out);
}

.phil-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--grad-brand);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.5s var(--ease-out);
}

.phil-card:hover {
  background: var(--bg-surface);
}

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

.phil-card .phil-num {
  font-family: var(--font-display);
  font-size: 3rem;
  font-weight: 800;
  background: var(--grad-brand);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  opacity: 0.1;
  line-height: 1;
  margin-bottom: 20px;
  transition: opacity var(--dur-med);
}

.phil-card:hover .phil-num {
  opacity: 0.8;
  animation: colorCycle 1.6s infinite linear;
  background: none;
  -webkit-text-fill-color: initial;
}

.phil-card h4 {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 14px;
  transition: color var(--dur-fast);
}

.phil-card p {
  font-size: var(--fs-small);
  color: var(--text-muted);
  line-height: 1.7;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.5s var(--ease-out), opacity 0.3s;
  opacity: 0;
}

.phil-card:hover p {
  max-height: 120px;
  opacity: 1;
}

/* Deployment badge */
.deployment-badge {
  display: flex;
  align-items: center;
  gap: var(--space-block);
  padding: 40px 48px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
}

.deployment-badge .badge-text {
  flex: 1;
}

.deployment-badge:hover h3 {
  animation: colorCycle 1.6s infinite linear;
}

.deployment-badge h3 {
  font-size: var(--fs-h3);
  margin-bottom: 10px;
  transition: color 0.3s;
}

.deployment-badge p {
  color: var(--text-secondary);
  font-size: var(--fs-small);
  line-height: 1.7;
}

.badge-stats {
  display: flex;
  gap: 48px;
}

.badge-stat {
  text-align: center;
}

.badge-stat .stat-value {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 800;
  background: var(--grad-brand);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.badge-stat .stat-label {
  font-size: var(--fs-overline);
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ============================================
   SERVICES — "What We Engineer"
   ============================================ */
.services {
  padding: var(--space-section) 0;
  background: var(--bg-primary);
}

.services-header {
  margin-bottom: var(--space-block);
}

.services-header h2 {
  font-size: var(--fs-h1);
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 2px;
  border-radius: var(--radius);
  overflow: hidden;
}

.service-cell {
  background: var(--bg-elevated);
  padding: 56px 28px;
  text-align: center;
  cursor: default;
  position: relative;
  overflow: hidden;
  transition: background var(--dur-med);
}

.service-cell::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--grad-brand);
  transform: scaleX(0);
  transition: transform 0.5s var(--ease-out);
}

.service-cell:hover {
  background: var(--bg-surface);
}

.service-cell:hover::after {
  transform: scaleX(1);
}

.service-cell .svc-num {
  font-family: var(--font-display);
  font-size: var(--fs-overline);
  font-weight: 700;
  letter-spacing: 3px;
  color: var(--accent-cyan);
  margin-bottom: 24px;
  opacity: 0.5;
  transition: opacity var(--dur-fast);
}

.service-cell:hover .svc-num {
  opacity: 0.8;
  animation: colorCycle 1.6s infinite linear;
}

.service-cell h3 {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 16px;
  transition: color var(--dur-fast);
}

.service-cell:hover h3 {
  animation: colorCycle 1.6s infinite linear;
}

.service-cell .svc-detail {
  font-size: var(--fs-small);
  color: var(--text-muted);
  line-height: 1.6;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.5s var(--ease-out), opacity 0.3s var(--ease-out);
}

.service-cell:hover .svc-detail {
  max-height: 160px;
  opacity: 1;
}

/* ============================================
   DEVELOPMENT TIMELINE — Scroll-Fill
   ============================================ */
.dev-timeline {
  padding: var(--space-section) 0;
  overflow: hidden;
}

.dev-timeline-header {
  text-align: center;
  margin-bottom: var(--space-block);
}

.dev-timeline-header h2 {
  font-size: var(--fs-h1);
}

.timeline-container {
  position: relative;
  max-width: 720px;
  margin: 0 auto;
  padding-left: 60px;
}

/* The vertical track */
.timeline-track {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 28px;
  width: 2px;
  background: var(--border-default);
}

/* Filled portion */
.timeline-fill {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 0;
  background: var(--grad-brand);
  border-radius: 2px;
  transition: height 0.05s linear;
}

.timeline-node {
  position: relative;
  padding: 0 0 64px 0;
}

.timeline-node:last-child {
  padding-bottom: 0;
}

.timeline-dot {
  position: absolute;
  left: -42px;
  top: 4px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid var(--border-default);
  background: var(--bg-deep);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  transition: border-color 0.4s, background 0.4s, box-shadow 0.4s;
}

.timeline-dot-inner {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border-default);
  transition: background 0.4s, box-shadow 0.4s;
}

/* Activated state (JS sets via scroll) */
.timeline-node.active .timeline-dot {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 16px rgba(0, 198, 255, 0.3);
}

.timeline-node.active .timeline-dot-inner {
  background: var(--accent-cyan);
  box-shadow: 0 0 8px rgba(0, 198, 255, 0.5);
}

.tl-content {
  opacity: 0.5;
  transform: translateX(20px);
  transition: opacity 0.5s var(--ease-out), transform 0.5s var(--ease-out);
}

.timeline-node.active .tl-content {
  opacity: 1;
  transform: translateX(0);
}

.tl-step-label {
  font-family: var(--font-display);
  font-size: var(--fs-overline);
  font-weight: 800;
  letter-spacing: 3.5px;
  text-transform: uppercase;
  color: var(--accent-cyan);
  margin-bottom: 8px;
  text-shadow: 0 0 12px rgba(0, 198, 255, 0.4);
}

.tl-content h4 {
  font-size: var(--fs-h3);
  font-weight: 700;
  margin-bottom: 8px;
  color: #ffffff;
}

.tl-content p {
  font-size: var(--fs-small);
  color: var(--text-secondary);
  line-height: 1.7;
  max-width: 480px;
}

/* ============================================
   WHY ZENVYRO
   ============================================ */
.why-section {
  padding: var(--space-section) 0;
  background: var(--bg-primary);
  position: relative;
  overflow: hidden;
}

.why-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(0, 198, 255, 0.05), transparent 60%);
  pointer-events: none;
}

#why-rotator {
  min-height: 2.5em;
  /* Prevent layout jump */
}

.why-header {
  text-align: center;
  margin-bottom: var(--space-block);
}

.why-header h2 {
  font-size: var(--fs-h1);
  margin-bottom: 16px;
}

.why-header p {
  font-size: var(--fs-body-lg);
  color: var(--text-secondary);
  max-width: 560px;
  margin: 0 auto;
}

.why-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.why-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  padding: 48px 36px;
  position: relative;
  overflow: hidden;
  cursor: default;
  transition: transform 0.4s var(--ease-out), border-color 0.3s, box-shadow 0.5s;
}

.why-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--grad-brand);
  opacity: 0;
  transition: opacity 0.5s;
}

.why-card:hover {
  transform: translateY(-8px);
  border-color: var(--border-active);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.4);
}

.why-card:hover::before {
  opacity: 0.03;
}

.why-card .why-idx {
  font-family: var(--font-display);
  font-size: 4rem;
  font-weight: 800;
  line-height: 1;
  background: var(--grad-brand);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  opacity: 0.06;
  position: absolute;
  top: 24px;
  right: 28px;
  transition: opacity 0.3s;
}

.why-card:hover .why-idx {
  opacity: 0.8;
  animation: colorCycle 1.6s infinite linear;
  background: none;
  -webkit-text-fill-color: initial;
}

@keyframes colorCycle {
  0% {
    color: #00c6ff;
  }

  25% {
    color: #00ffcc;
  }

  50% {
    color: #00e5ff;
  }

  75% {
    color: #b2f5ff;
  }

  100% {
    color: #00c6ff;
  }
}

@keyframes colorCycleStroke {
  0% {
    stroke: #00c6ff;
  }

  25% {
    stroke: #00ffcc;
  }

  50% {
    stroke: #00e5ff;
  }

  75% {
    stroke: #b2f5ff;
  }

  100% {
    stroke: #00c6ff;
  }
}

.why-card:hover h4 {
  animation: colorCycle 1.6s infinite linear;
}

.why-card h4 {
  font-size: 1.1875rem;
  font-weight: 600;
  margin-bottom: 14px;
  position: relative;
}

.why-card p {
  font-size: var(--fs-small);
  color: var(--text-muted);
  line-height: 1.75;
  position: relative;
}

/* --- BORDER TRACE EFFECT --- */
.trace-card {
  position: relative;
  overflow: hidden;
}

.trace-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 5;
}

.trace-rect {
  fill: none;
  stroke: var(--accent-cyan);
  stroke-width: 2.5;
  stroke-dasharray: 100, 1500;
  stroke-dashoffset: 0;
  transition: opacity 0.4s;
  opacity: 0;
}

.trace-card:hover .trace-rect {
  opacity: 1;
  animation: traceMove 2s linear infinite, colorCycleStroke 1.6s infinite linear;
}

.trace-card:hover h4,
.trace-card:hover h3,
.trace-card:hover h2 {
  animation: colorCycle 1.6s infinite linear;
}

@keyframes traceMove {
  from {
    stroke-dashoffset: 1600;
  }

  to {
    stroke-dashoffset: 0;
  }
}

/* ============================================
   CASE STUDIES / PORTFOLIO
   ============================================ */
.case-studies {
  padding: var(--space-section) 0;
}

.case-header {
  margin-bottom: 20px;
}

.case-header h2 {
  font-size: var(--fs-h1);
  margin-bottom: 16px;
}

.case-header p {
  font-size: var(--fs-body-lg);
  color: var(--text-secondary);
  max-width: 580px;
}

.case-categories {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: var(--space-block);
}

.case-cat-tag {
  font-size: var(--fs-caption);
  font-weight: 500;
  padding: 7px 18px;
  border-radius: 100px;
  border: 1px solid var(--border-default);
  color: var(--text-muted);
  transition: border-color var(--dur-fast), color var(--dur-fast), background var(--dur-fast);
  cursor: default;
}

.case-cat-tag:hover {
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
  background: rgba(0, 198, 255, 0.05);
}

.case-description {
  max-width: 640px;
  margin-bottom: var(--space-block);
}

.case-description p {
  font-size: var(--fs-body-lg);
  color: var(--text-secondary);
  line-height: 1.9;
  margin-bottom: 20px;
}

.case-description p:last-child {
  margin-bottom: 0;
}

.portfolio-cta {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  padding: 20px 44px;
  font-size: var(--fs-body-lg);
  font-weight: 600;
  border-radius: var(--radius);
  background: var(--grad-blue-cyan);
  color: var(--text-primary);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: transform 0.3s var(--ease-spring), box-shadow 0.3s;
}

.portfolio-cta::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.12), transparent);
  opacity: 0;
  transition: opacity var(--dur-fast);
}

.portfolio-cta:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 48px rgba(0, 198, 255, 0.35), 0 0 0 1px rgba(0, 198, 255, 0.15);
}

.portfolio-cta:hover::before {
  opacity: 1;
}

.portfolio-cta .cta-arrow {
  transition: transform 0.3s var(--ease-out);
}

.portfolio-cta:hover .cta-arrow {
  transform: translateX(6px);
}

/* ============================================
   TECH STACK
   ============================================ */
.tech-stack {
  padding: var(--space-section) 0;
  background: var(--bg-primary);
  overflow: hidden;
}

.tech-header {
  text-align: center;
  margin-bottom: var(--space-block);
}

.tech-header h2 {
  font-size: var(--fs-h2);
}

.tech-slider-wrap {
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  overflow: hidden;
}

.tech-slider {
  display: flex;
  gap: 72px;
  animation: techSlide 35s linear infinite;
  width: max-content;
  padding: 16px 0;
}

.tech-slider:hover {
  animation-play-state: paused;
}

@keyframes techSlide {
  0% {
    transform: translateX(0);
  }

  100% {
    transform: translateX(-50%);
  }
}

.tech-pill {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 24px;
  border: 1px solid var(--border-subtle);
  border-radius: 100px;
  background: var(--bg-elevated);
  cursor: default;
  transition: border-color var(--dur-fast), background var(--dur-fast), transform var(--dur-fast);
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}

.tech-pill:hover {
  border-color: var(--border-active);
  background: var(--bg-surface);
  transform: translateY(-3px);
}

.tech-pill img {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}

.tech-pill:hover span {
  animation: colorCycle 1.6s infinite linear;
}

.tech-pill span {
  font-size: var(--fs-small);
  font-weight: 500;
  color: var(--text-secondary);
  transition: color var(--dur-fast);
}

/* ============================================
   CONTACT
   ============================================ */
.contact {
  padding: var(--space-section) 0;
}

.contact-header {
  margin-bottom: var(--space-block);
}

.contact-header h2 {
  font-size: var(--fs-h1);
}

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: var(--space-block);
  align-items: start;
}

.contact-info p {
  margin-bottom: 40px;
  line-height: 1.8;
  font-size: var(--fs-body-lg);
}

.contact-channels {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.channel {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.channel-label {
  font-size: var(--fs-overline);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 3px;
  color: var(--accent-cyan);
}

.channel-value {
  font-size: var(--fs-body);
  color: var(--text-secondary);
}

.channel-value a {
  transition: color var(--dur-fast);
}

.channel-value a:hover {
  color: var(--text-primary);
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
  background: var(--bg-elevated);
  padding: 40px;
  border-radius: var(--radius);
  border: 1px solid var(--border-subtle);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-group:focus-within label {
  animation: colorCycle 1.6s infinite linear;
}

.form-group label {
  font-size: var(--fs-overline);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--text-muted);
  transition: color var(--dur-fast);
}

.form-group input,
.form-group textarea {
  padding: 14px 18px;
  font-size: var(--fs-body);
  border: 1px solid var(--border-default);
  border-radius: var(--radius);
  background: var(--bg-surface);
  transition: border-color var(--dur-fast), box-shadow var(--dur-fast);
}

.form-group input:focus,
.form-group textarea:focus {
  animation: colorCycleBorder 1.6s infinite linear;
  outline: none;
}

@keyframes colorCycleBorder {
  0% {
    border-color: #00c6ff;
    box-shadow: 0 0 15px rgba(0, 198, 255, 0.2);
  }

  25% {
    border-color: #00ffcc;
    box-shadow: 0 0 15px rgba(0, 255, 204, 0.2);
  }

  50% {
    border-color: #00e5ff;
    box-shadow: 0 0 15px rgba(0, 229, 255, 0.2);
  }

  75% {
    border-color: #b2f5ff;
    box-shadow: 0 0 15px rgba(178, 245, 255, 0.2);
  }

  100% {
    border-color: #00c6ff;
    box-shadow: 0 0 15px rgba(0, 198, 255, 0.2);
  }
}

.form-group textarea {
  min-height: 130px;
  resize: vertical;
}

.form-submit {
  padding: 16px 36px;
  font-size: var(--fs-body);
  font-weight: 600;
  border-radius: var(--radius);
  background: var(--grad-blue-cyan);
  color: var(--text-primary);
  cursor: pointer;
  align-self: center;
  transition: transform var(--dur-fast) var(--ease-spring), box-shadow var(--dur-fast);
}

.form-submit:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 32px rgba(0, 198, 255, 0.3);
}

/* ============================================
   FOOTER
   ============================================ */
.site-footer {
  padding: 48px 0 36px;
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-deep);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.footer-brand img {
  height: 28px;
  width: auto;
  filter: drop-shadow(0 0 6px rgba(0, 198, 255, 0.12));
}

.footer-brand-text {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.875rem;
  letter-spacing: 2px;
  color: var(--text-primary);
  transform: translateY(1px);
}

.footer-copy {
  font-size: var(--fs-caption);
  color: var(--text-muted);
}

.footer-links {
  display: flex;
  gap: 24px;
}

.footer-links a {
  font-size: var(--fs-caption);
  color: var(--text-muted);
  transition: color var(--dur-fast);
}

.footer-links a:hover {
  color: var(--text-primary);
}

/* ============================================
   WHATSAPP
   ============================================ */
.wa-float {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: #25d366;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99;
  cursor: pointer;
  box-shadow: 0 4px 24px rgba(37, 211, 102, 0.4);
  transition: transform 0.3s var(--ease-spring), box-shadow 0.3s;
}

.wa-float:hover {
  transform: scale(1.12) translateY(-2px);
  box-shadow: 0 8px 36px rgba(37, 211, 102, 0.5);
}

.wa-float svg {
  width: 26px;
  height: 26px;
  fill: #fff;
}

/* Pulse ring */
.wa-float::after {
  content: '';
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 2px solid rgba(37, 211, 102, 0.3);
  animation: waPulse 2s ease-out infinite;
}

@keyframes waPulse {
  0% {
    transform: scale(1);
    opacity: 1;
  }

  100% {
    transform: scale(1.4);
    opacity: 0;
  }
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1024px) {
  .about-philosophy {
    grid-template-columns: repeat(2, 1fr);
  }

  .services-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .why-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .contact-grid {
    grid-template-columns: 1fr;
    gap: 48px;
  }

  .deployment-badge {
    flex-direction: column;
    gap: 32px;
  }

  .badge-stats {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 24px 48px;
  }

  .case-item {
    grid-template-columns: 1fr auto;
    gap: 16px;
    padding: 28px 32px;
  }

  .case-item .case-tag {
    display: none;
  }
}

@media (max-width: 768px) {

  .header-nav,
  .header-cta-btn {
    display: none;
  }

  .hamburger {
    display: flex;
  }

  .hero {
    min-height: auto;
    padding: 120px 0 80px;
  }

  .hero-brand img {
    height: 42px;
  }

  .hero-actions {
    flex-direction: column;
  }

  .hero-actions a {
    text-align: center;
    justify-content: center;
  }

  .hero-scroll-indicator {
    display: none;
  }

  .about-philosophy {
    grid-template-columns: 1fr;
  }

  .services-grid {
    grid-template-columns: 1fr;
  }

  .why-grid {
    grid-template-columns: 1fr;
  }

  .timeline-container {
    padding-left: 48px;
  }

  .timeline-dot {
    left: -36px;
    width: 24px;
    height: 24px;
  }

  .timeline-dot-inner {
    width: 6px;
    height: 6px;
  }

  .case-item {
    padding: 24px;
    gap: 12px;
  }

  .case-item:hover {
    padding-left: 32px;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .contact-form {
    padding: 28px;
  }

  .footer-inner {
    flex-direction: column;
    gap: 20px;
    text-align: center;
  }

  .footer-links {
    flex-wrap: wrap;
    justify-content: center;
  }
}

/* --- Card Stack Showcase --- */
.stack-section {
  padding: 120px 0;
  background: radial-gradient(circle at center, rgba(0, 198, 255, 0.05), transparent 70%);
}

.stack-viewport {
  position: relative;
  height: 500px;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 60px;
}

.stack-container {
  position: relative;
  height: 380px;
  width: 100%;
  max-width: 644px;
  overflow: hidden;
}

.stack-card {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: 0;
  width: 324px;
  height: 280px;
  background: rgba(10, 15, 25, 0.8);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px 20px 0 0;
  padding: 15px;
  box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.5);
  transition: all 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
  will-change: transform, opacity;
  display: flex;
  flex-direction: column;
}

.stack-card-img {
  height: 180px;
  width: 100%;
  border-radius: 12px;
  object-fit: contain;
  /* Ensure full picture is visible */
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

/* Global Project Image & Video Scaling FIX */
video {
  max-width: 100%;
  max-height: 70vh;
  object-fit: contain;
  border-radius: 12px;
  display: block;
  margin: 0 auto;
}

.project-hero img,
.story-image img,
.gallery-item img {
  max-height: 70vh !important;
  width: auto !important;
  max-width: 100% !important;
  object-fit: contain !important;
  display: block;
  margin: 0 auto;
}

.story-image {
  background: rgba(0, 0, 0, 0.5);
  display: flex !important;
  align-items: center;
  justify-content: center;
  min-height: 300px;
}

.project-visual img {
  max-height: 60vh;
  width: auto;
  object-fit: contain;
}

.stack-card.pos-0 {
  transform: translateX(-50%) translateY(12px) scale(1);
  z-index: 10;
  opacity: 1;
}

.stack-card.pos-1 {
  transform: translateX(-50%) translateY(-16px) scale(0.95);
  z-index: 5;
  opacity: 0.8;
}

.stack-card.pos-2 {
  transform: translateX(-50%) translateY(-44px) scale(0.9);
  z-index: 2;
  opacity: 0.6;
}

.stack-card.exit {
  transform: translateX(-50%) translateY(340px) scale(1);
  opacity: 0;
  z-index: 11;
}

.stack-card.enter {
  transform: translateX(-50%) translateY(-16px) scale(0.9);
  opacity: 0;
  z-index: 1;
}

/* Card Interior */
.stack-card-content {
  display: flex;
  flex-direction: column;
  gap: 15px;
  height: 100%;
}

.stack-card-img {
  height: 160px;
  width: 100%;
  border-radius: 12px;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.stack-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 10px;
}

.stack-btn-container {
  margin-top: 40px;
  position: relative;
  z-index: 20;
}

.stack-animate-btn {
  padding: 12px 32px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  color: white;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
}

.stack-animate-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--accent-cyan);
  transform: scale(1.05);
}

.stack-animate-btn:active {
  transform: scale(0.95);
}

/* ============================================
   RESPONSIVE DESIGN (MEDIA QUERIES)
   ============================================ */

/* TABLET */
@media (max-width: 1024px) {
  :root {
    --space-section: clamp(80px, 10vw, 120px);
    --space-block: clamp(40px, 5vw, 60px);
  }
  
  .container {
    padding: 0 24px;
  }
}

/* MOBILE */
@media (max-width: 768px) {
  :root {
    --space-section: 60px;
    --space-block: 30px;
  }
  
  .hamburger {
    display: flex;
  }

  .project-hero {
    background-size: cover;
    background-position: center 30% !important;
    padding-top: 120px !important;
  }
  
  .project-hero h1 {
    font-size: clamp(2.5rem, 15vw, 4.5rem) !important;
    line-height: 1.1 !important;
    margin: 20px 0 !important;
  }

  .project-hero .overline {
    margin-bottom: 30px !important;
    display: block;
  }
  
  .header-logo-text {
    font-size: 0.9rem;
    letter-spacing: 1.5px;
  }
  
  .header-cta-btn {
    display: none;
  }
}

/* ============================================
   RESPONSIVE — ENHANCED MOBILE (ADDED)
   ============================================ */

/* TABLET+ TOUCH FIXES */
@media (max-width: 768px) {
  /* ADDED — restore native cursor on touch devices */
  html, body, a, button,
  .stat-card, .stack-animate-btn,
  .radar-node, .service-card, .btn {
    cursor: auto !important;
  }

  /* ADDED — hide custom scanner cursor */
  .scanner-cursor {
    display: none !important;
  }

  /* ADDED — scale hero typography for mobile */
  .hero h1 {
    font-size: clamp(2rem, 8vw, 3.5rem);
    max-width: 100%;
  }

  .hero-subtitle {
    font-size: var(--fs-body);
    max-width: 100%;
  }

  #hero-rotator {
    min-height: 4.5em;
  }

  /* ADDED — disable hover-only content on touch (phil-cards) */
  .phil-card p {
    max-height: none;
    opacity: 1;
  }

  /* ADDED — disable hover-only content on touch (service cells) */
  .service-cell .svc-detail {
    max-height: none;
    opacity: 1;
  }

  /* ADDED — reduce deployment badge padding */
  .deployment-badge {
    padding: 28px 24px;
  }

  /* ADDED — fix WhatsApp float positioning */
  .wa-float {
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
  }

  .wa-float svg {
    width: 22px;
    height: 22px;
  }

  /* ADDED — scale card stack for mobile */
  .stack-viewport {
    height: auto;
    min-height: 400px;
  }

  .stack-container {
    height: 320px;
    max-width: 100%;
    overflow: hidden;
  }

  .stack-card {
    width: 90vw;
    max-width: 340px;
    height: 240px;
  }

  .stack-card-img {
    height: 140px;
  }

  /* ADDED — ensure buttons are touch-friendly (44px min) */
  .btn-primary, .btn-outline {
    padding: 14px 28px;
    min-height: 44px;
  }

  .header-cta-btn {
    min-height: 44px;
  }

  /* ADDED — touch-friendly dropdown links */
  .dropdown-content a {
    min-height: 44px;
  }

  /* ADDED — ensure mobile nav links are touch-friendly */
  .mobile-nav a {
    min-height: 44px;
    display: flex;
    align-items: center;
  }

  /* ADDED — prevent hero brand overflow */
  .hero-brand-name {
    font-size: 1.2rem;
    letter-spacing: 4px;
  }

  .hero-brand-name .labs-text {
    letter-spacing: 4px;
    margin-left: 4px;
  }

  /* ADDED — scale section headers */
  .about-header h2,
  .services-header h2,
  .dev-timeline-header h2,
  .why-header h2,
  .case-header h2,
  .contact-header h2 {
    font-size: clamp(1.5rem, 5vw, 2.25rem);
  }

  /* ADDED — overline spacing on mobile */
  .overline {
    letter-spacing: 2px;
    font-size: 0.625rem;
  }

  /* ADDED — prevent 3D bg clipping */
  .section-bg {
    overflow: hidden;
  }

  /* ADDED — scale tech slider gap */
  .tech-slider {
    gap: 36px;
  }

  /* ADDED — prevent dropdown overflow on mobile */
  .projects-dropdown.dropdown-up .dropdown-content {
    right: 50%;
    transform: translateX(50%) translateY(-15px) scale(0.95);
    min-width: 200px;
  }
}

/* SMALL PHONES */
@media (max-width: 480px) {
  /* ADDED — further reduce spacing */
  :root {
    --space-section: 48px;
    --space-block: 24px;
    --space-element: 16px;
    --gutter: 16px;
  }

  /* ADDED — further scale typography */
  .hero h1 {
    font-size: clamp(1.75rem, 7vw, 2.5rem);
  }

  .hero-subtitle {
    font-size: var(--fs-small);
  }

  #hero-rotator {
    min-height: 5.5em;
  }

  /* ADDED — performance: reduce 3D bg opacity on small screens */
  .section-bg {
    opacity: 0.25;
  }

  #services-bg, #why-bg {
    opacity: 0.4;
  }

  /* ADDED — smaller card stack */
  .stack-card {
    width: 85vw;
    max-width: 300px;
    height: 220px;
  }

  .stack-card-img {
    height: 120px;
  }

  .stack-container {
    height: 280px;
  }

  /* ADDED — reduce tech slider gap */
  .tech-slider {
    gap: 24px;
  }

  .tech-pill {
    padding: 8px 16px;
    gap: 8px;
  }

  .tech-pill img {
    width: 18px;
    height: 18px;
  }

  /* ADDED — further reduce badge stats gap */
  .badge-stats {
    gap: 16px 32px;
  }

  .badge-stat .stat-value {
    font-size: 1.5rem;
  }

  /* ADDED — scale why-card padding */
  .why-card {
    padding: 32px 24px;
  }

  /* ADDED — scale phil-card padding */
  .phil-card {
    padding: 32px 20px;
  }

  /* ADDED — reduce service-cell padding */
  .service-cell {
    padding: 36px 20px;
  }

  /* ADDED — scale buttons for small screens */
  .btn-primary, .btn-outline {
    padding: 12px 24px;
    font-size: var(--fs-small);
  }

  /* ADDED — stack button for mobile */
  .stack-animate-btn {
    padding: 10px 24px;
    font-size: var(--fs-small);
  }

  /* ADDED — scale contact form */
  .contact-form {
    padding: 20px;
  }

  /* ADDED — portfolio CTA scaling */
  .portfolio-cta {
    padding: 14px 28px;
    font-size: var(--fs-body);
  }

  /* ADDED — hero section height fix */
  .hero {
    padding: 100px 0 60px;
  }

  /* ADDED — timeline padding fix */
  .timeline-container {
    padding-left: 40px;
  }

  .timeline-track {
    left: 20px;
  }

  .timeline-dot {
    left: -30px;
    width: 20px;
    height: 20px;
  }

  .timeline-dot-inner {
    width: 5px;
    height: 5px;
  }

  .timeline-node {
    padding-bottom: 40px;
  }

  .tl-content h4 {
    font-size: 1rem;
  }

  .tl-content p {
    font-size: var(--fs-caption);
  }
}
