/* styles-frontend.css */

/* ==================== VARIABLES ==================== */
:root {
  --bg-primary: #061a14;
  --bg-secondary: #0d2b21;
  --bg-tertiary: #123b2a;
  
  --accent: #e6b800;
  --accent-light: #f5d86b;
  --accent-dark: #a68500;
  
  --text-primary: #e8f5e9;
  --text-secondary: #cce3cf;
  --text-tertiary: #a8c7ac;
  
  --border: #1b3a2d;
  --glass-bg: rgba(14, 48, 37, 0.85);
  --glass-border: rgba(39, 80, 61, 0.6);
  
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.6);
  
  --nav-height: 55px;
}

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

html {
  overflow: hidden;
  height: 100vh;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  overflow: hidden;
  height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.6;
  position: fixed;
  width: 100%;
  text-rendering: optimizeLegibility;
  font-smooth: always;
}

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

/* ==================== INITIAL HIDE (Before JS loads) ==================== */
/* ==================== INITIAL HIDE ==================== */
#navbar-placeholder {
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

.section-divider {
  opacity: 0 !important;
  visibility: hidden !important;
  transition: opacity 0.5s ease, visibility 0.5s ease !important;
}

/* Show when loaded */
body.loaded #navbar-placeholder {
  opacity: 1;
  visibility: visible;
}

body.loaded .section-divider {
  opacity: 1 !important;
  visibility: visible !important;
}


/* ==================== BACKGROUND DECORATIONS ==================== */
.bg-decoration {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.sparkle {
  position: absolute;
  width: 5px;
  height: 5px;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 16px var(--accent);
  animation: sparkle-float 8s ease-in-out infinite;
  will-change: transform, opacity;
  transition: all 1s cubic-bezier(0.4, 0, 0.2, 1);
}

.sparkle-1 { top: 15%; left: 8%; animation-delay: 0s; }
.sparkle-2 { top: 35%; right: 12%; animation-delay: 2s; }
.sparkle-3 { bottom: 25%; left: 15%; animation-delay: 4s; }
.sparkle-4 { top: 55%; right: 20%; animation-delay: 1s; }
.sparkle-5 { top: 75%; left: 35%; animation-delay: 3s; }
.sparkle-6 { bottom: 10%; right: 8%; animation-delay: 5s; }
.sparkle-7 { top: 20%; left: 45%; animation-delay: 1.5s; }
.sparkle-8 { bottom: 40%; right: 35%; animation-delay: 3.5s; }

@keyframes sparkle-float {
  0%, 100% {
    transform: translateY(0) scale(1);
    opacity: 0.5;
  }
  50% {
    transform: translateY(-40px) scale(1.8);
    opacity: 1;
  }
}

.grid-overlay {
  position: absolute;
  inset: 0;
  background-image: 
    linear-gradient(rgba(230, 184, 0, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(230, 184, 0, 0.04) 1px, transparent 1px);
  background-size: 50px 50px;
  opacity: 0.4;
}

/* ==================== NAVIGATION ==================== */
/* Gold Portal Text (Non-button) */
.nav-portal-text {
  padding: 6px 10px;
  border: 1px solid #a68500;   /* border color */
  color: #e6b800;              /* gold text */
  font-weight: 600;
  border-radius: 6px;
  text-decoration: none;       /* ensure no underline */
  transition: 0.2s ease;
}

.nav-portal-text:hover {
  color: #ffd94d;              /* lighter gold */
  border-color: #e6b800;
  text-decoration: none;       /* prevent underline */
}

.mobile-portal-text {
  display: block;
  width: fit-content;
  margin-top: 10px;
  padding: 8px 12px;
  border: 1px solid #a68500;
  color: #e6b800;
  font-weight: 600;
  border-radius: 6px;
  text-decoration: none;
  width: 100%;
  text-align: center;
}

.mobile-portal-text:hover {
  color: #ffd94d;
  border-color: #e6b800;
  text-decoration: none;
}

/* ==================== NAVIGATION CONTINUED ==================== */

#floating-nav {
  position: fixed;
  top: 1rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  width: calc(100% - 2rem);
  max-width: 1200px;
  background: var(--glass-bg);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  box-shadow: var(--shadow-lg);
  transition: all 0.3s ease;
}

#navbar-placeholder {
  position: relative;
  z-index: 9999;
}

.nav-content {
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
  height: var(--nav-height);
  position: relative;
}

.nav-logo {
  display: flex;
  align-items: center;
  text-decoration: none;
  flex-shrink: 0;
  height: 100%;
}

.nav-logo img {
  height: 100%;
  width: auto;
  max-height: 100%;
  object-fit: contain;
  display: block;
  transition: transform 0.4s ease;
}

.desktop-nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex: 1;
  justify-content: center;
  margin-left: 2rem;
  flex-wrap: wrap;
}

.desktop-nav > a,
.desktop-nav > .nav-dropdown {
  flex-shrink: 0;
}

.desktop-nav > a {
  text-decoration: none;
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 0.95rem;
  transition: color 0.3s;
  white-space: nowrap;
}

.desktop-nav > a:hover {
  color: var(--accent-light);
}

.nav-dropdown {
  position: relative;
}

.nav-dropdown-toggle {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-family: inherit;
  font-weight: 500;
  font-size: 0.95rem;
  cursor: pointer;
  padding: 0.5rem 0;
  display: flex;
  align-items: center;
  gap: 0.375rem;
  transition: color 0.3s;
  white-space: nowrap;
}

.nav-dropdown-toggle:hover {
  color: var(--accent-light);
}

.nav-dropdown-toggle i {
  font-size: 0.75rem;
  transition: transform 0.3s;
}

.nav-dropdown:hover .nav-dropdown-toggle i {
  transform: rotate(180deg);
}

.nav-dropdown-menu {
  position: absolute;
  top: calc(100% + 0.5rem);
  left: 0;
  min-width: 220px;
  background: rgba(14, 48, 37, 0.98);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 0.75rem;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.3s ease;
  box-shadow: var(--shadow-lg);
  z-index: 1000;
}

.nav-dropdown:hover .nav-dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.nav-dropdown-menu a {
  display: block;
  padding: 0.75rem 1rem;
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: 8px;
  transition: all 0.2s;
  font-size: 0.9rem;
  white-space: nowrap;
}

.nav-dropdown-menu a:hover {
  background: rgba(230, 184, 0, 0.1);
  color: var(--accent-light);
}

.nav-divider {
  height: 1px;
  background: var(--border);
  margin: 0.5rem 0;
}

.mega-menu {
  min-width: 500px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem;
  padding: 1.25rem;
}

.mega-menu-section {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.mega-menu-section h6 {
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.5rem;
  padding: 0 1rem;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-shrink: 0;
  margin-left: auto;
  padding-left: 1rem;
}

.token-badge {
  background: rgba(230, 184, 0, 0.15);
  border: 1px solid var(--accent-dark);
  color: var(--accent);
  padding: 0.5rem 1rem;
  border-radius: 10px;
  font-weight: 700;
  font-size: 0.875rem;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.3s;
  white-space: nowrap;
}

.nav-action-btn {
  color: var(--text-secondary);
  text-decoration: none;
  padding: 0.5rem 0.875rem;
  border-radius: 8px;
  font-weight: 500;
  font-size: 0.875rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.3s;
  white-space: nowrap;
}

.nav-action-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--accent-light);
}

.nav-cta {
  background: var(--accent);
  color: var(--bg-primary) !important;
  padding: 0.625rem 1.75rem;
  border-radius: 12px;
  font-weight: 700;
  font-size: 0.95rem;
  text-decoration: none;
  box-shadow: 0 4px 15px rgba(230, 184, 0, 0.3);
  transition: all 0.3s;
  white-space: nowrap;
  flex-shrink: 0;
}

.nav-cta:hover {
  background: var(--accent-light);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(230, 184, 0, 0.4);
}

.mobile-menu-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  padding: 0.5rem;
  font-size: 1.5rem;
  color: var(--text-primary);
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.3s;
  margin-left: auto;
}

.mobile-menu-toggle:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--accent);
}

.mobile-nav-menu {
  position: absolute;
  top: calc(100% + 0.5rem);
  left: 0;
  right: 0;
  background: rgba(14, 48, 37, 0.98);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: all 0.3s ease;
  box-shadow: var(--shadow-lg);
  z-index: 9998;
}

.mobile-nav-menu.active {
  max-height: 80vh;
  opacity: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.mobile-nav-menu::-webkit-scrollbar {
  width: 6px;
}

.mobile-nav-menu::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 3px;
}

.mobile-nav-menu::-webkit-scrollbar-thumb {
  background: var(--accent);
  border-radius: 3px;
}

.mobile-nav-content {
  padding: 1rem;
}

.mobile-nav-link {
  display: block;
  padding: 1rem;
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: 8px;
  transition: all 0.2s;
  margin-bottom: 0.5rem;
  font-weight: 500;
}

.mobile-nav-link:hover {
  background: rgba(230, 184, 0, 0.1);
  color: var(--accent-light);
}

.mobile-nav-menu .nav-dropdown {
  margin-bottom: 0.5rem;
}

.mobile-nav-menu .nav-dropdown-toggle {
  width: 100%;
  justify-content: space-between;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  border-radius: 8px;
  text-align: left;
}

.mobile-nav-menu .nav-dropdown-menu {
  position: static;
  opacity: 1;
  visibility: visible;
  transform: none;
  margin-top: 0.5rem;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, padding 0.3s ease;
  background: rgba(0, 0, 0, 0.2);
  padding: 0;
}

.mobile-nav-menu .nav-dropdown.active .nav-dropdown-menu {
  max-height: 1000px;
  padding: 0.75rem;
}

.mobile-nav-menu .nav-dropdown-menu:empty {
  display: none !important;
}

.mobile-nav-menu .nav-dropdown.active .nav-dropdown-toggle i {
  transform: rotate(180deg);
}

.mobile-nav-menu .nav-dropdown-menu h6 {
  padding: 0.75rem 1rem 0.5rem;
  margin-top: 0.5rem;
  font-size: 0.75rem;
  color: var(--accent);
}

.mobile-nav-menu .nav-dropdown-menu h6:first-child {
  margin-top: 0;
}

.mobile-nav-actions {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.mobile-cta {
  background: var(--accent);
  color: var(--bg-primary);
  padding: 1rem;
  border-radius: 10px;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
  transition: all 0.3s;
}

.mobile-cta:hover {
  background: var(--accent-light);
}

/* ==================== SCROLL SYSTEM ==================== */
.scroll-wrapper {
  position: fixed;
  inset: 0;
  overflow: hidden;
  z-index: 1;
}

.scroll-content {
  position: relative;
  will-change: transform;
  display: flex;
  flex-direction: column;
  transform: translate3d(0, 0, 0);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.scroll-section {
  position: relative;
  min-height: 70vh;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.8s ease, transform 0.8s ease;
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.scroll-section.section-visible {
  opacity: 1;
  transform: translateY(0);
}

.section-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 4rem 2rem;
  width: 100%;
  position: relative;
}

/* ==================== HERO SECTION ==================== */
.hero-section {
  min-height: 80vh !important;
}

.hero-content {
  text-align: center;
  max-width: 900px;
  margin: 0 auto;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(230, 184, 0, 0.1);
  border: 1px solid var(--accent-dark);
  padding: 0.5rem 1rem;
  border-radius: 50px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 1.5rem;
}

.hero-title {
  font-size: clamp(2.5rem, 7vw, 4.5rem);
  font-weight: 900;
  line-height: 1.1;
  margin-bottom: 1.25rem;
  letter-spacing: -0.03em;
}

.gradient-text {
  background: linear-gradient(135deg, var(--accent-light), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle-ticker {
  margin: 0 auto 2rem;
  min-height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 1rem;
}

.ticker-message {
  font-family: 'JetBrains Mono', 'Courier New', monospace;
  font-size: clamp(0.9rem, 2.5vw, 1.3rem);
  font-weight: 500;
  color: var(--text-secondary);
  background: rgba(230, 184, 0, 0.05);
  border: 1px solid rgba(230, 184, 0, 0.2);
  border-radius: 8px;
  padding: 1rem 1.5rem;
  text-align: center;
  word-wrap: break-word;
  overflow-wrap: break-word;
  hyphens: auto;
  max-width: 100%;
  line-height: 1.5;
  transition: all 0.3s ease;
}

.ticker-message.flickering {
  background: rgba(230, 184, 0, 0.15);
  border-color: var(--accent);
  color: var(--accent-light);
  box-shadow: 0 0 12px rgba(230, 184, 0, 0.3);
}

.hero-ctas {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* ==================== COMMON COMPONENTS ==================== */
.glass-card {
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  box-shadow: var(--shadow-md);
  transition: all 0.4s ease;
}

.glass-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-lg), 0 0 24px rgba(230, 184, 0, 0.15);
  transform: translateY(-4px);
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.875rem 1.75rem;
  border-radius: 14px;
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  transition: all 0.3s;
  cursor: pointer;
  border: none;
  white-space: nowrap;
}

.btn-primary {
  background: var(--accent);
  color: var(--bg-primary);
  box-shadow: 0 4px 15px rgba(230, 184, 0, 0.3);
}

.btn-primary:hover {
  background: var(--accent-light);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(230, 184, 0, 0.4);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
  border: 1px solid var(--glass-border);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--accent);
}

.btn-sm {
  padding: 0.625rem 1.25rem;
  font-size: 0.875rem;
}

.section-divider {
  height: 1px;
  width: 100%;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  box-shadow: 0 0 20px rgba(230, 184, 0, 0.4);
  flex-shrink: 0;
  position: relative;
  margin: 0;
}

.section-divider-end {
  height: 2px;
  box-shadow: 0 0 30px rgba(230, 184, 0, 0.5);
}

.section-header {
  text-align: center;
  margin-bottom: 3rem;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

.section-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(230, 184, 0, 0.1);
  border: 1px solid var(--accent-dark);
  color: var(--accent);
  padding: 0.5rem 1rem;
  border-radius: 50px;
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.section-title {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 900;
  margin-bottom: 1rem;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  line-height: 1.2;
}

.section-subtitle {
  font-size: clamp(1rem, 2vw, 1.125rem);
  color: var(--text-tertiary);
  line-height: 1.7;
}

/* ==================== AGENTS SECTION ==================== */
.agents-section {
  background: var(--bg-secondary);
}

.agents-layout {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 2rem;
  align-items: stretch;
}

.capabilities-stack {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.capability-card {
  padding: 2rem;
  text-align: center;
  min-height: 180px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.capability-icon {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  background: rgba(230, 184, 0, 0.1);
  border: 2px solid var(--accent-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  color: var(--accent);
  margin: 0 auto 1rem;
  transition: all 0.3s;
}

.capability-card:hover .capability-icon {
  transform: scale(1.1);
  box-shadow: 0 8px 24px rgba(230, 184, 0, 0.4);
}

.capability-card h3 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.capability-card p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.5;
}

/* ==================== FLIP CARD ==================== */
.flip-card-container {
  perspective: 1000px;
  height: 100%;
}

.flip-card {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 580px;
  transition: transform 0.8s;
  transform-style: preserve-3d;
}

.flip-card.flipped {
  transform: rotateY(180deg);
}

.flip-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
}

.flip-card-front,
.flip-card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.flip-card-back {
  transform: rotateY(180deg);
}

.code-showcase,
.live-app-showcase {
  padding: 0;
  overflow: hidden;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.code-showcase-header,
.live-app-header,
.demo-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  background: rgba(0, 0, 0, 0.2);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.demo-header {
  justify-content: center;
}

.code-lang {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.code-status {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.875rem;
  color: #4ade80;
}

.code-showcase pre {
  margin: 0;
  /* padding: 1.5rem; */
  overflow-x: auto;
  flex: 1;
}

.code-showcase code {
  font-family: 'JetBrains Mono', 'Courier New', monospace;
  font-size: 0.85rem;
  line-height: 1.6;
  color: var(--text-secondary);
  height: 100%;
}

.code-showcase-footer,
.live-app-footer,
.demo-footer {
  padding: 1.5rem;
  background: rgba(0, 0, 0, 0.2);
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: center;
  flex-shrink: 0;
}

.flip-trigger {
  cursor: pointer;
}

.live-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.3);
  color: #4ade80;
  padding: 0.5rem 1rem;
  border-radius: 50px;
  font-size: 0.875rem;
  font-weight: 600;
}

.live-badge i {
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.btn-close-flip {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-border);
  color: var(--text-primary);
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s;
}

.btn-close-flip:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--accent);
  color: var(--accent);
}

.iframe-wrapper {
  position: relative;
  width: 100%;
  flex: 1;
  background: rgba(0, 0, 0, 0.3);
  min-height: 400px;
}

.iframe-wrapper.flip-card-iframe {
  min-height: 400px;
}

.iframe-wrapper.demo-iframe {
  height: 700px;
  min-height: 700px;
}

.iframe-wrapper iframe {
  width: 100%;
  height: 100%;
  border: none;
}

.iframe-loader {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(6, 26, 20, 0.95);
  transition: opacity 0.3s;
  z-index: 10;
}

.loader-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 1rem;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.iframe-loader p {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

/* ==================== CLOUD SECTION ==================== */
.cloud-section {
  background: var(--bg-tertiary);
}

.cloud-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}

.cloud-config-card,
.deployment-card {
  padding: 2.5rem;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.config-header,
.deployment-header {
  text-align: center;
  margin-bottom: 2rem;
}

.cloud-card-icon {
  width: 72px;
  height: 72px;
  border-radius: 16px;
  background: rgba(230, 184, 0, 0.1);
  border: 2px solid var(--accent-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: var(--accent);
  margin: 0 auto 1rem;
  transition: all 0.3s;
}

.glass-card:hover .cloud-card-icon {
  transform: scale(1.1);
  box-shadow: 0 8px 24px rgba(230, 184, 0, 0.4);
}

.config-header h3,
.deployment-header h3 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
}

.config-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin-bottom: 2rem;
}

.config-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 12px;
  border: 1px solid var(--border);
  transition: all 0.3s;
}

.config-item:hover {
  background: rgba(230, 184, 0, 0.05);
  border-color: var(--accent);
}

.config-icon-wrapper {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: rgba(230, 184, 0, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.config-icon-wrapper i {
  font-size: 1.25rem;
  color: var(--accent);
}

.config-details {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 0;
  flex: 1;
}

.config-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
}

.config-value {
  font-size: 0.8rem;
  color: var(--text-tertiary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.region-section {
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.region-section h4 {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  justify-content: center;
}

.region-section h4 i {
  color: var(--accent);
}

.region-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}

.region-tag {
  padding: 0.75rem 1rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  transition: all 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  white-space: nowrap;
}

.region-tag i {
  color: var(--accent);
  font-size: 1rem;
  flex-shrink: 0;
}

.region-tag:hover {
  background: rgba(230, 184, 0, 0.1);
  border-color: var(--accent);
  color: var(--accent);
}

.deployment-timeline {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 2rem;
  align-items: center;
}

.timeline-step {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  border-radius: 12px;
  transition: all 0.3s;
}

.timeline-step:hover {
  background: rgba(230, 184, 0, 0.05);
  border-color: var(--accent);
}

.step-num {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--bg-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.25rem;
  flex-shrink: 0;
}

.step-content {
  flex: 1;
  min-width: 0;
}

.step-content h4 {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.step-content p {
  font-size: 0.9rem;
  color: var(--text-tertiary);
  margin: 0;
}

.timeline-connector {
  width: 4px;
  border-radius: 3px;
  height: 20px;
  background: var(--accent);
  margin-left: 23px;
}

.deploy-time {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.625rem;
  padding: 0.875rem 1.5rem;
  background: rgba(230, 184, 0, 0.1);
  border: 1px solid var(--accent-dark);
  border-radius: 50px;
  color: var(--text-secondary);
  margin-top: auto;
  flex-wrap: wrap;
}

.deploy-time i {
  color: var(--accent);
  flex-shrink: 0;
}

.deploy-time strong {
  color: var(--accent);
}

/* ==================== STREAMLIT SECTION ==================== */
.streamlit-section {
  background: var(--bg-secondary);
}

.streamlit-demo {
  padding: 0;
  overflow: hidden;
  margin-bottom: 3rem;
}

.use-cases {
  text-align: center;
}

.use-cases h3 {
  font-size: 1.75rem;
  font-weight: 800;
  margin-bottom: 2rem;
  color: var(--text-primary);
}

.use-cases-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
}

.use-case {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  padding: 1.5rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  border-radius: 16px;
  transition: all 0.3s;
  min-height: 140px;
  justify-content: center;
}

.use-case:hover {
  background: rgba(230, 184, 0, 0.05);
  border-color: var(--accent);
  transform: translateY(-4px);
}

.use-case i {
  font-size: 2rem;
  color: var(--accent);
  flex-shrink: 0;
}

.use-case span {
  font-size: 0.95rem;
  color: var(--text-secondary);
  font-weight: 500;
  text-align: center;
  line-height: 1.4;
}

/* ==================== EXAMPLES SECTION ==================== */
.examples-section {
  background: var(--bg-tertiary);
}

.examples-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 2rem;
}

.example-card {
  padding: 2.5rem;
  text-align: center;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.example-icon {
  width: 80px;
  height: 80px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.25rem;
  margin: 0 auto 1.5rem;
  border: 2px solid;
  transition: all 0.3s;
  flex-shrink: 0;
}

.tender-icon {
  background: rgba(59, 130, 246, 0.1);
  color: #60a5fa;
  border-color: rgba(59, 130, 246, 0.3);
}

.caller-icon {
  background: rgba(34, 197, 94, 0.1);
  color: #4ade80;
  border-color: rgba(34, 197, 94, 0.3);
}

.example-card:hover .example-icon {
  transform: scale(1.1);
  box-shadow: 0 8px 24px rgba(230, 184, 0, 0.4);
}

.example-card h3 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

.example-tags {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.tag {
  background: rgba(230, 184, 0, 0.1);
  border: 1px solid var(--accent-dark);
  color: var(--accent);
  padding: 0.375rem 0.75rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}

.example-card p {
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 1.5rem;
  flex: 1;
}

/* ==================== SCROLL INDICATOR ==================== */
#scroll-indicator {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent-light));
  z-index: 999;
  transition: width 0.1s linear;
  box-shadow: 0 0 16px rgba(230, 184, 0, 0.6);
  will-change: width;
}

/* ==================== UTILITIES ==================== */
.hidden {
  display: none !important;
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 1200px) {
  .desktop-nav {
    gap: 1rem;
    margin-left: 1rem;
  }
  
  .nav-cta {
    padding: 0.625rem 1.25rem;
    font-size: 0.875rem;
  }
  
  .agents-layout,
  .cloud-layout {
    grid-template-columns: 1fr !important;
  }
}

@media (max-width: 1024px) {
  :root {
    --nav-height: 55px;
  }
  
  .desktop-nav,
  .nav-actions {
    display: none !important;
  }
  
  .mobile-menu-toggle {
    display: block;
  }
  
  .agents-layout,
  .cloud-layout,
  .examples-grid {
    grid-template-columns: 1fr !important;
    gap: 2rem;
  }
  
  .flip-card {
    min-height: 500px;
  }
  
  .use-cases-grid {
    grid-template-columns: 1fr !important;
  }
  
  .mega-menu {
    grid-template-columns: 1fr !important;
    min-width: auto;
  }
  
  .iframe-wrapper.demo-iframe {
    height: 650px;
    min-height: 650px;
  }
  
  .config-grid,
  .region-grid {
    grid-template-columns: 1fr !important;
  }
}

@media (max-width: 768px) {
  .section-inner {
    padding: 3rem 1.5rem;
  }
  
  #floating-nav {
    width: calc(100% - 1rem);
    border-radius: 16px;
  }
  
  .nav-content {
    padding: 0 1rem;
  }
  
  .nav-logo img {
    max-height: 60px;
  }
  
  .hero-section {
    min-height: 70vh !important;
  }
  
  .hero-title {
    font-size: clamp(2rem, 8vw, 3rem);
  }
  
  .section-title {
    font-size: clamp(1.75rem, 6vw, 2.5rem);
  }
  
  .capability-card {
    min-height: auto;
    padding: 1.5rem;
  }
  
  .flip-card {
    min-height: 450px;
  }
  
  .ticker-message {
    font-size: clamp(0.8rem, 3vw, 1rem);
    padding: 0.875rem 1.25rem;
  }
  
  .iframe-wrapper.demo-iframe {
    height: 600px;
    min-height: 600px;
  }
  
  .config-item {
    padding: 1rem;
  }
  
  .deployment-timeline {
    gap: 1rem;
  }
  
  .timeline-step {
    padding: 1rem;
  }
  
  .region-tag {
    padding: 0.75rem;
    font-size: 0.875rem;
  }
  
  .use-case {
    padding: 1.5rem;
    min-height: 140px;
  }
  
  .example-card {
    padding: 2rem 1.5rem;
  }
  
  .btn {
    padding: 0.875rem 1.25rem;
  }
}

@media (max-width: 480px) {
  .section-inner {
    padding: 2.5rem 1rem;
  }
  
  #floating-nav {
    width: calc(100% - 1rem);
  }
  
  .nav-logo img {
    max-height: 60px;
  }
  
  .hero-title {
    font-size: clamp(1.75rem, 7vw, 2.5rem);
  }
  
  .section-title {
    font-size: clamp(1.5rem, 5vw, 2rem);
  }
  
  .flip-card {
    min-height: 400px;
  }
  
  .ticker-message {
    font-size: clamp(0.75rem, 2.5vw, 0.9rem);
    padding: 0.75rem 1rem;
  }
  
  .use-case {
    padding: 1.25rem;
    min-height: 120px;
  }
  
  .use-case i {
    font-size: 1.75rem;
  }
  
  .iframe-wrapper.demo-iframe {
    height: 500px;
    min-height: 500px;
  }
  
  .config-icon-wrapper {
    width: 36px;
    height: 36px;
  }
  
  .config-icon-wrapper i {
    font-size: 1.125rem;
  }
  
  .timeline-step {
    padding: 0.875rem;
    flex-direction: column;
    text-align: center;
  }
  
  .step-num {
    width: 40px;
    height: 40px;
    font-size: 1.125rem;
    margin-bottom: 0.75rem;
  }
  
  .timeline-connector {
    width: 3px;
    height: 15px;
    margin-left: auto;
    margin-right: auto;
  }
  
  .example-icon {
    width: 64px;
    height: 64px;
    font-size: 2rem;
  }
  
  .btn {
    padding: 0.75rem 1.25rem;
    font-size: 0.875rem;
  }
  
  .hero-ctas {
    flex-direction: column;
    width: 100%;
  }
  
  .hero-ctas .btn {
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 360px) {
  .section-inner {
    padding: 2rem 0.875rem;
  }
  
  .nav-logo img {
    max-height: 60px;
  }
  
  .hero-title {
    font-size: 1.5rem;
  }
  
  .section-title {
    font-size: 1.35rem;
  }
  
  .ticker-message {
    font-size: 0.7rem;
    padding: 0.625rem 0.875rem;
  }
  
  .use-case {
    padding: 1rem;
  }
  
  .iframe-wrapper.demo-iframe {
    height: 450px;
    min-height: 450px;
  }
}

@media (max-width: 768px) and (orientation: landscape) {
  .hero-section {
    min-height: 100vh !important;
  }
  
  .section-inner {
    padding: 2rem 1.5rem;
  }
}

/* ==================== ACCESSIBILITY ==================== */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  
  .scroll-section {
    opacity: 1 !important;
    transform: none !important;
  }
}

@media (hover: none) and (pointer: coarse) {
  .btn,
  a,
  button {
    min-height: 44px;
    min-width: 44px;
  }
  
  input,
  select,
  textarea {
    font-size: 16px !important;
  }
}

@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  img {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
  }
}

@media print {
  #floating-nav,
  #scroll-indicator,
  .bg-decoration,
  .btn,
  .flip-trigger {
    display: none !important;
  }
  
  .scroll-section {
    opacity: 1 !important;
    transform: none !important;
    page-break-inside: avoid;
  }
  
  .scroll-wrapper {
    position: static;
    overflow: visible;
  }
  
  .scroll-content {
    position: static;
    transform: none !important;
  }
}














/* ==================== MOBILE OPTIMIZATIONS ==================== */

/* Force proper scrolling on mobile */
@media (max-width: 768px) {
  html.mobile-scroll,
  body.mobile-device {
    overflow: auto !important;
    overflow-x: hidden !important;
    height: auto !important;
    position: static !important;
    width: 100% !important;
  }
  
  body.mobile-device .scroll-wrapper {
    position: static !important;
    overflow: visible !important;
    overflow-x: hidden !important;
    height: auto !important;
    inset: auto !important;
    width: 100%;
  }
  
  body.mobile-device .scroll-content {
    position: static !important;
    transform: none !important;
    will-change: auto !important;
    width: 100%;
    overflow-x: hidden !important;
  }
  
  body.mobile-device .scroll-section {
    position: static !important;
    min-height: auto !important;
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
    width: 100%;
    overflow-x: hidden !important;
  }
  
  /* Hide scroll indicator on mobile */
  body.mobile-device #scroll-indicator {
    display: none !important;
  }
  
  /* Keep background decorations fixed on mobile */
  body.mobile-device .bg-decoration {
    position: fixed !important;
    inset: 0 !important;
    z-index: 0 !important;
  }
  
  body.mobile-device .bg-decoration .sparkle {
    position: fixed !important;
  }

  /* Prevent horizontal overflow */
  .section-inner {
    padding: 2rem 1rem;
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
    box-sizing: border-box;
  }
  
  /* Force all content to stay within viewport */
  * {
    max-width: 100%;
    box-sizing: border-box;
  }
  
  /* Section header improvements */
  .section-header {
    margin-bottom: 2rem;
    text-align: center;
    position: relative;
    z-index: 1;
  }
  
  /* Section badge - default styling */
  .section-badge {
    display: inline-flex !important;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(230, 184, 0, 0.1);
    border: 1px solid var(--accent-dark);
    border-radius: 50px;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--accent);
    margin-bottom: 1rem;
    position: relative;
    z-index: 1;
    width: fit-content;
    margin-left: auto;
    margin-right: auto;
  }
  
  /* ONLY first badge in hero section gets extra top spacing */
  .section-badge.hero-first-badge,
  .hero-badge.hero-first-badge {
    margin-top: 4rem;
  }
  
  .section-badge i {
    font-size: 1rem;
    color: var(--accent);
  }
  
  /* Hero section mobile improvements */
  .hero-content {
    padding: 0 0.5rem;
    width: 100%;
  }
  
  .hero-ctas {
    flex-direction: column;
    width: 100%;
    gap: 0.75rem;
  }
  
  .hero-ctas .btn {
    width: 100%;
    justify-content: center;
  }
  
  /* Ticker improvements - ensure visibility */
  .hero-subtitle-ticker {
    width: 100%;
    max-width: 100%;
    padding: 0 0.5rem;
    box-sizing: border-box;
  }
  
  .ticker-message {
    font-size: 0.875rem !important;
    padding: 0.875rem 1rem !important;
    line-height: 1.4;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
  }
  
  /* Glass card improvements - prevent overflow */
  .glass-card {
    width: 100%;
    max-width: 100vw;
    box-sizing: border-box;
    overflow: hidden;
    margin-left: 0;
    margin-right: 0;
    padding: 1.5rem 1rem !important;
  }
  
  /* Exception: Keep padding for app-type cards with class structure */
  .glass-card[style*="padding: 3rem"] {
    padding: 2rem 1.5rem !important;
  }
  
  /* Remove padding only from cards with ONLY images or iframes (no text content) */
  .glass-card:has(> img:only-child),
  .glass-card:has(> .iframe-wrapper:only-child),
  .glass-card[style*="padding: 0"] {
    padding: 0 !important;
  }
  
  .glass-card h3,
  .glass-card h4 {
    margin-bottom: 0.75rem;
    word-wrap: break-word;
  }
  
  .glass-card p {
    margin-bottom: 0.75rem;
    word-wrap: break-word;
  }
  
  .glass-card ul {
    margin-bottom: 1rem;
  }
   
  /* Ensure buttons wrap to new line in cards */
  .glass-card > div:has(.btn) {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
  }
  
  .capability-card {
    min-height: auto;
    padding: 1.5rem !important;
  }
  
  .example-card {
    padding: 1.5rem !important;
  }
  
  /* ==================== TABLE IMPROVEMENTS - FIXED ALIGNMENT ==================== */
  
  /* Container for table */
  .glass-card:has(table) {
    padding: 0 !important;
    overflow: visible;
    max-width: calc(100vw);
    border-radius: 20px;
  }
  
  /* Scrollable wrapper */
  .glass-card > div[style*="overflow-x: auto"] {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    width: 100%;
    max-width: 100vw;
    padding: 0;
    position: relative;
  }
  
  /* Table base styling */
  table {
    width: 100% !important;
    min-width: 750px; /* Force horizontal scroll for better readability */
    border-collapse: collapse;
    table-layout: fixed; /* Fixed layout for consistent column widths */
    display: table;
  }
  
  /* Ensure proper table structure */
  table thead,
  table tbody {
    display: table-row-group;
  }
  
  table tr {
    display: table-row;
  }
  
  table th,
  table td {
    display: table-cell;
    vertical-align: middle;
  }
  
  /* Header cells */
  table th {
    padding: 1rem !important;
    font-size: 0.875rem !important;
    font-weight: 700 !important;
    text-align: left !important;
    background: var(--accent) !important;
    color: var(--bg-primary) !important;
    white-space: nowrap;
    border-right: 1px solid rgba(0, 0, 0, 0.1);
  }
  
  table th:last-child {
    border-right: none;
  }
  
  /* Body cells */
  table td {
    padding: 1rem !important;
    font-size: 0.875rem !important;
    text-align: left !important;
    border-bottom: 1px solid var(--border) !important;
    border-right: 1px solid var(--border);
    color: var(--text-secondary) !important;
  }
  
  table td:last-child {
    border-right: none;
  }
  
  /* Remove border from last row */
  table tbody tr:last-child td {
    border-bottom: none !important;
  }
  
  /* Specific column widths for compute table */
  table th:nth-child(1),
  table td:nth-child(1) {
    width: 20%;
    min-width: 100px;
  }
  
  table th:nth-child(2),
  table td:nth-child(2) {
    width: 12%;
    min-width: 70px;
  }
  
  table th:nth-child(3),
  table td:nth-child(3) {
    width: 15%;
    min-width: 90px;
  }
  
  table th:nth-child(4),
  table td:nth-child(4) {
    width: 18%;
    min-width: 110px;
  }
  
  table th:nth-child(5),
  table td:nth-child(5) {
    width: 35%;
    min-width: 180px;
    white-space: normal;
  }
  
  /* Add subtle scroll shadow indicator */
  .glass-card > div[style*="overflow-x: auto"]::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 30px;
    background: linear-gradient(to left, rgba(10, 10, 15, 0.3), transparent);
    pointer-events: none;
    opacity: 0.5;
  }
  
  /* Better touch targets */
  .btn {
    min-height: 48px;
    padding: 0.875rem 1.5rem;
    font-size: 1rem;
    width: 100%;
    box-sizing: border-box;
  }
  
  /* Improve text readability */
  .section-title {
    font-size: 1.75rem !important;
    line-height: 1.2;
    word-wrap: break-word;
    margin-bottom: 1rem;
  }
  
  .section-subtitle {
    font-size: 1rem !important;
    line-height: 1.6;
    word-wrap: break-word;
  }
  
  .hero-title {
    font-size: 2rem !important;
    line-height: 1.1;
    word-wrap: break-word;
  }
  
  /* Force all multi-column grids to single column */
  div[style*="grid-template-columns: repeat(2"],
  div[style*="grid-template-columns: repeat(3"],
  div[style*="grid-template-columns: repeat(4"],
  div[style*="grid-template-columns: repeat(5"],
  div[style*="grid-template-columns: repeat(6"],
  div[style*="display: grid; grid-template-columns: 1fr 1fr"],
  .agents-layout,
  .cloud-layout,
  .examples-grid,
  .use-cases-grid,
  .config-grid,
  .region-grid {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 1.5rem !important;
  }
  
  /* Specific override for 2-column grids in HTML */
  section div[style*="display: grid; grid-template-columns: 1fr 1fr"] {
    grid-template-columns: 1fr !important;
  }
  
  /* Timeline improvements */
  .timeline-step {
    flex-direction: column;
    text-align: center;
    padding: 1.25rem;
  }
  
  .step-num {
    margin-bottom: 1rem;
  }
  
  .timeline-connector {
    width: 3px;
    height: 20px;
    margin: 0.5rem auto;
  }
  
  /* Config items stack better */
  .config-item {
    flex-direction: column;
    text-align: center;
    padding: 1.25rem;
  }
  
  .config-icon-wrapper {
    margin-bottom: 0.75rem;
  }
  
  /* Region tags */
  .region-tag {
    padding: 0.875rem;
    font-size: 0.9rem;
  }
  
  /* Use case cards */
  .use-case {
    padding: 1.5rem;
    min-height: auto;
  }
  
  .use-case i {
    font-size: 2rem;
  }
  
  /* ==================== FLIP CARD FIX FOR MOBILE ==================== */
  
  /* Container */
  .flip-card-container {
    height: auto !important;
    min-height: 500px;
    width: 100%;
    max-width: 100vw;
    padding: 0 !important;
    overflow: visible !important;
    box-sizing: border-box;
    perspective: none !important; /* Disable 3D on mobile */
  }
  
  /* Flip card - use simple opacity transition instead of 3D flip */
  .flip-card {
    min-height: 500px;
    width: 100%;
    max-width: 100%;
    position: relative;
    transform-style: flat !important; /* Disable 3D */
    transform: none !important; /* No rotation on mobile */
  }
  
  .flip-card-inner {
    position: relative;
    width: 100%;
    min-height: 500px;
    transform-style: flat !important;
  }
  
  /* Front and back cards - stack them with opacity transitions */
  .flip-card-front,
  .flip-card-back {
    position: absolute !important;
    top: 0;
    left: 0;
    width: 100%;
    min-height: 500px;
    backface-visibility: visible !important;
    transform: none !important; /* No rotation */
    transition: opacity 0.4s ease, visibility 0.4s ease !important;
  }
  
  /* Default state - show front, hide back */
  .flip-card:not(.flipped) .flip-card-front {
    opacity: 1 !important;
    visibility: visible !important;
    z-index: 2 !important;
    position: relative !important;
  }
  
  .flip-card:not(.flipped) .flip-card-back {
    opacity: 0 !important;
    visibility: hidden !important;
    z-index: 1 !important;
    position: absolute !important;
    pointer-events: none !important;
  }
  
  /* Flipped state - hide front, show back */
  .flip-card.flipped .flip-card-front {
    opacity: 0 !important;
    visibility: hidden !important;
    z-index: 1 !important;
    position: absolute !important;
    pointer-events: none !important;
  }
  
  .flip-card.flipped .flip-card-back {
    opacity: 1 !important;
    visibility: visible !important;
    z-index: 2 !important;
    position: relative !important;
    pointer-events: auto !important;
  }
  
  /* Ensure showcases are visible */
  .code-showcase,
  .live-app-showcase {
    padding: 0 !important;
    display: flex !important;
    flex-direction: column;
    min-height: 500px;
    width: 100%;
    background: var(--glass-bg);
    border-radius: 20px;
    overflow: hidden;
  }
  
  .code-showcase pre {
    flex: 1;
    margin: 0;
    font-size: 0.75rem !important;
    overflow-x: auto;
    width: 100%;
  }
  
  .code-showcase code {
    font-size: 0.75rem !important;
    line-height: 1.4;
    word-break: break-all;
  }
  
  /* Ensure iframe wrapper is visible when flipped */
  .flip-card.flipped .flip-card-back .iframe-wrapper {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    height: 380px !important;
    min-height: 380px !important;
  }
  
  /* Headers and footers */
  .code-showcase-header,
  .code-showcase-footer,
  .live-app-header,
  .live-app-footer,
  .demo-header,
  .demo-footer {
    padding: 0.875rem 1rem !important;
    flex-shrink: 0;
    background: rgba(0, 0, 0, 0.2);
  }
  
  /* Remove padding from iframe containers */
  .glass-card:has(.iframe-wrapper),
  .streamlit-demo,
  .code-showcase,
  .live-app-showcase {
    padding: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }
  
  /* Iframe wrappers */
  .iframe-wrapper {
    width: 100% !important;
    max-width: 100% !important;
    padding: 0 !important;
    border-radius: 0 !important;
    position: relative;
    background: rgba(0, 0, 0, 0.3);
  }
  
  .iframe-wrapper iframe {
    width: 100% !important;
    height: 100% !important;
    border: none !important;
    display: block !important;
  }
  
  .iframe-wrapper.demo-iframe {
    height: 500px;
    min-height: 500px;
  }
  
  .iframe-wrapper.flip-card-iframe {
    min-height: 380px !important;
    height: 380px !important;
  }
  
  /* Ensure images fill their containers properly */
  .glass-card img {
    width: 100%;
    max-width: 100%;
    height: auto;
    display: block;
  }
  
  /* Demo iframe wrapper */
  .streamlit-demo {
    padding: 0 !important;
  }
  
  .demo-iframe {
    border-radius: 0;
  }
}

/* Extra small devices */
@media (max-width: 480px) {
  .section-inner {
    padding: 1.5rem 0.75rem;
  }
  
  .hero-title {
    font-size: 1.75rem !important;
  }
  
  .section-title {
    font-size: 1.5rem !important;
  }
  
  .glass-card {
    margin-right: -3rem !important;
    /* padding: 1.25rem 0.875rem !important; */
  }
  
  .glass-card[style*="padding: 3rem"] {
    padding: 1.5rem 1rem !important;
  }
  
  .btn {
    padding: 0.875rem 1.25rem;
    font-size: 0.9375rem;
  }
  
  .ticker-message {
    font-size: 0.8125rem !important;
    padding: 0.75rem 0.875rem !important;
  }
  
  .code-showcase pre {
    font-size: 0.7rem !important;
  }
  
  .code-showcase code {
    font-size: 0.7rem !important;
  }
  
  .flip-card-container,
  .flip-card,
  .flip-card-inner,
  .flip-card-front,
  .flip-card-back,
  .code-showcase,
  .live-app-showcase {
    min-height: 450px;
  }
  
  .flip-card-iframe {
    min-height: 350px !important;
    height: 350px !important;
  }
  
  .iframe-wrapper.demo-iframe {
    height: 400px;
    min-height: 400px;
  }
  
  #floating-nav {
    border-radius: 12px;
  }
  
  /* Slightly smaller table padding on tiny screens */
  table th {
    padding: 0.875rem !important;
    font-size: 0.8125rem !important;
  }
  
  table td {
    padding: 0.875rem !important;
    font-size: 0.8125rem !important;
  }
}

/* Landscape mobile optimization */
@media (max-width: 768px) and (orientation: landscape) {
  .hero-section {
    min-height: auto !important;
    padding: 2rem 0;
  }
  
  .section-inner {
    padding: 2rem 1.5rem;
  }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
  /* Larger touch targets */
  .btn,
  a,
  button,
  .nav-dropdown-toggle,
  .mobile-menu-toggle {
    min-height: 48px;
    min-width: 48px;
  }
  
  /* Prevent zoom on input focus */
  input,
  select,
  textarea {
    font-size: 16px !important;
  }
  
  /* Disable hover effects on touch devices */
  .glass-card:hover,
  .capability-card:hover,
  .example-card:hover,
  .use-case:hover {
    transform: none !important;
  }
}

/* Scroll to top button - mobile only */
#scroll-to-top {
  display: none;
  position: fixed;
  bottom: 2rem;
  right: 1rem;
  z-index: 9998;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--bg-primary);
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  transition: all 0.3s ease;
  font-size: 1.5rem;
  align-items: center;
  justify-content: center;
}

#scroll-to-top:active {
  transform: scale(0.95);
}

@media (max-width: 768px) {
  body.mobile-device #scroll-to-top.visible {
    display: flex;
  }
}