/* ==========================================================================
   Google Antigravity Design System — Crisp White & Red Antigravity Tokens
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Google+Sans+Code:ital,wght@0,400;0,600;1,400&family=Google+Sans+Flex:wght@300;400;500;600;700;800&family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@24,400,0,0&display=swap');

:root {
  /* Clean White Palette with Google Red Antigravity Accents */
  --theme-bg: #ffffff;
  --theme-surface: #ffffff;
  --theme-surface-container: #f8fafc;
  --theme-surface-elevated: #f1f5f9;
  --theme-surface-on-surface: #0f172a; /* Deep Charcoal Black */
  --theme-surface-on-surface-variant: #0a0a0a; /* Deep Black */
  
  --theme-primary: #ea4335; /* Google Antigravity Red */
  --theme-primary-glow: rgba(234, 67, 53, 0.25);
  --theme-secondary: #e11d48; /* Crimson Red */
  --theme-accent: #1a73e8; /* Google Blue */
  
  --theme-outline: rgba(15, 23, 42, 0.12);
  --theme-outline-hover: rgba(234, 67, 53, 0.4);
  
  /* Shapes & Corners */
  --shape-corner-xs: 4px;
  --shape-corner-sm: 8px;
  --shape-corner-md: 12px;
  --shape-corner-lg: 20px;
  --shape-corner-xl: 32px;
  --shape-corner-rounded: 9999px;

  /* Spacing Tokens */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;
  --space-4xl: 64px;
  --space-6xl: 96px;
  --space-8xl: 128px;

  /* Typography */
  --font-sans: 'Google Sans Flex', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-code: 'Google Sans Code', monospace;
  
  /* Layout Grid */
  --grid-max-width: 1280px;
  --grid-columns: 12;
  --grid-gutter: 24px;
}

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

html {
  scroll-behavior: smooth;
  font-family: var(--font-sans);
  background-color: var(--theme-bg);
  color: var(--theme-surface-on-surface);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  cursor: default;
}

/* 12-Column Grid Layout Utility */
.grid-container {
  width: 100%;
  max-width: var(--grid-max-width);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--space-lg);
  padding-right: var(--space-lg);
}

.grid-row {
  display: grid;
  grid-template-columns: repeat(var(--grid-columns), 1fr);
  gap: var(--grid-gutter);
}

/* Debug Grid Overlay */
.grid-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  display: none;
  opacity: 0.6;
}

.grid-overlay.active {
  display: block;
}

.grid-overlay .grid-row {
  height: 100%;
}

.grid-col-visual {
  background-color: rgba(234, 67, 53, 0.04);
  border-left: 1px dashed rgba(234, 67, 53, 0.2);
  border-right: 1px dashed rgba(234, 67, 53, 0.2);
  height: 100%;
}

/* Custom Interactive Red Antigravity Cursor */
.custom-cursor-wrapper {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 9990;
}

.custom-cursor {
  position: fixed;
  top: 0;
  left: 0;
  transform: translate(-50%, -50%) scale(1);
  padding: 6px 16px;
  background: var(--theme-surface-on-surface);
  color: #ffffff;
  font-family: var(--font-code);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  border-radius: var(--shape-corner-rounded);
  box-shadow: 0 8px 25px rgba(15, 23, 42, 0.2), 0 0 15px var(--theme-primary-glow);
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.15s ease-out;
  pointer-events: none;
  white-space: nowrap;
}

.custom-cursor::before {
  content: '';
  position: absolute;
  left: -8px;
  top: 50%;
  transform: translateY(-50%);
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--theme-primary);
}

.custom-cursor.visible {
  opacity: 1;
}

.custom-cursor.active {
  transform: translate(-50%, -50%) scale(1.15);
  background: var(--theme-primary);
  color: #ffffff;
}

/* Canvas Background Particles */
.morphing-particles-component-section {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.morphing-particles-container canvas {
  width: 100%;
  height: 100%;
  display: block;
}

/* Reactive Header */
.header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  padding: var(--space-md) 0;
  transition: background-color 0.3s ease, backdrop-filter 0.3s ease, border-bottom 0.3s ease;
}

.header[data-scroll-reactive="true"].scrolled {
  background-color: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--theme-outline);
  box-shadow: 0 4px 20px rgba(15, 23, 42, 0.05);
}

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

.logo-link {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--theme-surface-on-surface);
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: -0.5px;
}

.logo-icon {
  width: 32px;
  height: 32px;
  color: var(--theme-primary);
  transition: transform 0.4s ease;
}

.logo-link:hover .logo-icon {
  transform: rotate(180deg) scale(1.1);
}

.nav-list {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  list-style: none;
}

.nav-link {
  color: var(--theme-surface-on-surface-variant);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  transition: color 0.2s ease;
  padding: 6px 12px;
  border-radius: var(--shape-corner-sm);
}

.nav-link:hover, .nav-link.active {
  color: var(--theme-primary);
  background-color: rgba(234, 67, 53, 0.06);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

/* Button Component Tokens */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 22px;
  border-radius: var(--shape-corner-rounded);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-primary {
  background: var(--theme-primary);
  color: #ffffff;
  border-color: var(--theme-primary);
  box-shadow: 0 4px 15px var(--theme-primary-glow);
}

.btn-primary:hover {
  transform: translateY(-2px);
  background: #d93025;
  box-shadow: 0 6px 25px var(--theme-primary-glow);
}

.btn-secondary {
  background: #ffffff;
  color: var(--theme-surface-on-surface);
  border-color: var(--theme-outline);
}

.btn-secondary:hover {
  background: var(--theme-surface-container);
  border-color: var(--theme-outline-hover);
  transform: translateY(-2px);
}

/* Hero Section */
.hero-section {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-top: 120px;
  padding-bottom: var(--space-6xl);
  z-index: 1;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  border-radius: var(--shape-corner-rounded);
  background: rgba(234, 67, 53, 0.08);
  border: 1px solid rgba(234, 67, 53, 0.25);
  color: var(--theme-primary);
  font-family: var(--font-code);
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: var(--space-md);
}

.hero-title {
  font-size: clamp(2.5rem, 5vw, 4.2rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -1px;
  color: #0f172a;
  margin-bottom: var(--space-md);
}

.text-gradient {
  background: linear-gradient(135deg, #0f172a 20%, var(--theme-primary) 70%, var(--theme-secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  font-size: 1.2rem;
  color: var(--theme-surface-on-surface-variant);
  max-width: 620px;
  margin-bottom: var(--space-xl);
}

.typed-container {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-code);
  color: var(--theme-primary);
  font-weight: 600;
}

.blinking-cursor {
  display: inline-block;
  width: 8px;
  height: 18px;
  background-color: var(--theme-primary);
  margin-left: 4px;
  animation: blink 1s infinite;
}

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

.landing-video-section {
  width: 100%;
  margin-top: var(--space-md);
}

.video-wrapper {
  position: relative;
  border-radius: 0;
  overflow: hidden;
  aspect-ratio: 21 / 9;
  border: none;
  box-shadow: none;
  background: #0f172a;
}

/* Fluid Canvas — Full Coverage */
.video-wrapper canvas {
  display: block;
  width: 100%;
  height: 100%;
}


/* Feature Copy & Media */
.feature-explorer-section {
  padding: var(--space-2xl) 0 var(--space-4xl);
  position: relative;
  z-index: 1;
}

.feature-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-6xl);
}

.feature-item {
  align-items: center;
}

.feature-copy {
  padding: var(--space-xl) 0;
}

.feature-copy h3 {
  font-size: 1.8rem;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: var(--space-md);
  line-height: 1.3;
}

.feature-copy p {
  color: var(--theme-surface-on-surface-variant);
  font-size: 1.05rem;
  margin-bottom: var(--space-lg);
}

.feature-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: var(--space-lg);
}

.tag-pill {
  padding: 6px 14px;
  border-radius: var(--shape-corner-rounded);
  background: #f1f5f9 !important;
  border: 1px solid rgba(15, 23, 42, 0.12) !important;
  color: #0f172a !important;
  font-size: 0.82rem;
  font-family: var(--font-code);
  font-weight: 600;
}

.feature-media {
  position: relative;
  border-radius: var(--shape-corner-lg);
  overflow: hidden;
  border: 1px solid var(--theme-outline);
  aspect-ratio: 16 / 10;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
  background: #ffffff;
}

.feature-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  will-change: transform;
  transition: transform 0.5s ease;
}

.feature-media:hover img {
  transform: scale(1.05);
}

/* Timeline & Solid Cards (100% Opaque Non-transparent) */
.timeline-section {
  padding: var(--space-6xl) 0;
  position: relative;
  z-index: 1;
  background: #ffffff;
  border-top: 1px solid var(--theme-outline);
  border-bottom: 1px solid var(--theme-outline);
}

.timeline {
  position: relative;
  max-width: 900px;
  margin: 0 auto;
  padding-left: 30px;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(180deg, var(--theme-primary), var(--theme-secondary), transparent);
}

.timeline-item {
  position: relative;
  margin-bottom: var(--space-4xl);
}

.timeline-item:last-child {
  margin-bottom: 0;
}

.timeline-dot {
  position: absolute;
  left: -36px;
  top: 4px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--theme-primary);
  box-shadow: 0 0 10px var(--theme-primary-glow);
  border: 3px solid #ffffff;
}

.timeline-content, .solid-card, .blog-card {
  background-color: #ffffff !important; /* 100% Solid White Opaque */
  background: #ffffff !important;
  border: 1px solid var(--theme-outline) !important;
  border-radius: var(--shape-corner-lg);
  padding: var(--space-xl);
  box-shadow: 0 8px 25px rgba(15, 23, 42, 0.07) !important;
  transition: border-color 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease;
  position: relative;
  z-index: 2;
}

.timeline-content:hover, .solid-card:hover, .blog-card:hover {
  border-color: var(--theme-outline-hover) !important;
  box-shadow: 0 14px 35px rgba(15, 23, 42, 0.12) !important;
}

.timeline-period {
  font-family: var(--font-code);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--theme-primary);
  margin-bottom: var(--space-xs);
}

.timeline-role {
  font-size: 1.4rem;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 4px;
}

.timeline-company {
  font-size: 1rem;
  color: var(--theme-surface-on-surface-variant);
  margin-bottom: var(--space-md);
}

/* Blog & Publications Controls */
.blog-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  margin-bottom: var(--space-2xl);
  position: relative;
  z-index: 2;
}

.search-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  background: #ffffff !important;
  border: 1px solid var(--theme-outline);
  border-radius: var(--shape-corner-rounded);
  box-shadow: 0 4px 15px rgba(15, 23, 42, 0.05);
  width: 100%;
  max-width: 380px;
}

.search-bar input {
  background: transparent;
  border: none;
  outline: none;
  color: var(--theme-surface-on-surface);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  width: 100%;
}

.filter-pills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.filter-btn {
  padding: 8px 18px;
  border-radius: var(--shape-corner-rounded);
  background: #ffffff !important;
  border: 1px solid var(--theme-outline);
  color: var(--theme-surface-on-surface-variant);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
  transition: all 0.2s ease;
}

.filter-btn.active, .filter-btn:hover {
  background: var(--theme-primary) !important;
  color: #ffffff !important;
  border-color: var(--theme-primary) !important;
}

.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: var(--space-xl);
  position: relative;
  z-index: 2;
}

.blog-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-code);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--theme-primary);
  margin-bottom: var(--space-md);
}

.blog-card h3 {
  font-size: 1.3rem;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: var(--space-sm);
  line-height: 1.4;
}

.blog-card p {
  color: var(--theme-surface-on-surface-variant);
  font-size: 0.95rem;
  margin-bottom: var(--space-lg);
}

/* Gallery Grid */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--space-xl);
  position: relative;
  z-index: 2;
}

.gallery-card {
  position: relative;
  border-radius: var(--shape-corner-lg);
  overflow: hidden;
  aspect-ratio: 4 / 3;
  border: 1px solid var(--theme-outline);
  background: #ffffff;
  cursor: pointer;
  box-shadow: 0 8px 25px rgba(15, 23, 42, 0.06);
}

.gallery-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.gallery-card:hover img {
  transform: scale(1.06);
}

.gallery-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(15, 23, 42, 0.85) 0%, transparent 60%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: var(--space-lg);
  color: #ffffff;
  opacity: 0.9;
  transition: opacity 0.3s ease;
}

.gallery-category {
  font-family: var(--font-code);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--theme-primary);
  margin-bottom: 4px;
}

.gallery-title {
  font-size: 1.2rem;
  font-weight: 700;
}

/* Download & Contact Section */
.download-section-backdrop {
  background: #ffffff !important; /* 100% Solid White Opaque */
  border-radius: var(--shape-corner-xl);
  padding: var(--space-4xl) var(--space-2xl);
  border: 1px solid var(--theme-outline);
  text-align: center;
  position: relative;
  overflow: hidden;
  box-shadow: 0 12px 35px rgba(15, 23, 42, 0.08);
  z-index: 2;
}

/* Dialog Modals */
.dialog {
  padding: 0;
  border: none;
  background: transparent;
  max-width: 90vw;
  max-height: 90vh;
  margin: auto;
  z-index: 9995;
}

.dialog::backdrop {
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.dialog-content {
  background: #ffffff !important;
  border: 1px solid var(--theme-outline);
  border-radius: var(--shape-corner-xl);
  padding: var(--space-2xl);
  max-width: 760px;
  width: 100%;
  color: var(--theme-surface-on-surface);
  position: relative;
  box-shadow: 0 25px 60px rgba(15, 23, 42, 0.2);
  max-height: 85vh;
  overflow-y: auto;
}

.dialog-close-button {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.06);
  border: 1px solid var(--theme-outline);
  color: var(--theme-surface-on-surface);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.dialog-close-button:hover {
  background: var(--theme-primary);
  color: #ffffff;
}

/* Dat.GUI Custom Theme & Positioning */
.dg.main {
  position: fixed !important;
  top: 90px !important;
  right: 20px !important;
  z-index: 9980 !important;
  font-family: var(--font-code) !important;
  border-radius: var(--shape-corner-md) !important;
  overflow: hidden !important;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.15) !important;
}

/* Section Headers */
.section-header {
  text-align: center;
  margin-bottom: var(--space-4xl);
  position: relative;
  z-index: 2;
}

.section-tag {
  display: inline-block;
  font-family: var(--font-code);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--theme-primary);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  margin-bottom: var(--space-sm);
}

.section-title {
  font-size: 2.8rem;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.15;
  margin-bottom: var(--space-md);
}

.section-description {
  font-size: 1.1rem;
  color: var(--theme-surface-on-surface-variant);
  max-width: 640px;
  margin-left: auto;
  margin-right: auto;
}

/* Left-aligned headers: keep description flush-left, directly under the title */
.section-header[style*="text-align:left"] .section-description,
.section-header[style*="text-align: left"] .section-description {
  margin-left: 0;
  margin-right: 0;
  text-align: left;
}

/* Slider Carousel */
.slider-container {
  position: relative;
  overflow: hidden;
  border-radius: var(--shape-corner-xl);
  border: 1px solid var(--theme-outline);
  background: #ffffff;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
}

.slider-track {
  display: flex;
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.slider-slide {
  min-width: 100%;
  aspect-ratio: 21 / 9;
}

.slider-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.slider-controls {
  position: absolute;
  bottom: 16px;
  right: 16px;
  display: flex;
  gap: 8px;
}

.slider-control-button {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--theme-outline);
  color: #0f172a;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.slider-control-button:hover {
  background: var(--theme-primary);
  color: #ffffff;
}

.slider-control-button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* Responsive Utilities */
@media (max-width: 992px) {
  .grid-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .header-actions {
    display: none;
  }

  .hero-section {
    padding-top: 100px;
  }

  .blog-controls {
    flex-direction: column;
    align-items: stretch;
  }

  .search-bar {
    max-width: 100%;
  }

  .nav-list {
    gap: 8px;
  }

  .nav-link {
    font-size: 0.8rem;
    padding: 4px 8px;
  }
}
