/* HistropediaJS Concept - Revolutionary Design System */

/* CSS Custom Properties */
:root {
  /* Revolutionary Color Palette */
  --primary-gradient: linear-gradient(135deg, #1d4ed8 0%, #0ea5e9 100%);
  --secondary-gradient: linear-gradient(135deg, #60a5fa 0%, #0ea5e9 100%);
  --accent-gradient: linear-gradient(135deg, #0ea5e9 0%, #67e8f9 100%);
  --primary-gradient-soft: linear-gradient(135deg, #1d4ed8 0%, #2563eb 100%);
  --title-accent-gradient: linear-gradient(135deg, #5eead4 0%, #14b8a6 100%);
  --title-accent-color: #5eead4;
  --dark-gradient: linear-gradient(135deg, #0c0c0c 0%, #1a1a1a 100%);
  
  /* Semantic Colors */
  --color-primary: #1d4ed8;
  --color-secondary: #0ea5e9;
  --color-accent: #38bdf8;
  --primary-rgb: 29, 78, 216;
  --secondary-rgb: 14, 165, 233;
  --accent-rgb: 56, 189, 248;
  --color-success: #10b981;
  --color-warning: #f59e0b;
  --color-error: #ef4444;
  
  /* Neutral Palette */
  --neutral-0: #ffffff;
  --neutral-50: #fafafa;
  --neutral-100: #f5f5f5;
  --neutral-200: #e5e5e5;
  --neutral-300: #d4d4d4;
  --neutral-400: #a3a3a3;
  --neutral-500: #737373;
  --neutral-600: #525252;
  --neutral-700: #404040;
  --neutral-800: #262626;
  --neutral-900: #171717;
  --neutral-950: #0a0a0a;
  
  /* Typography */
  --font-display: 'Playfair Display', serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
  
  /* Spacing Scale */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;
  --space-32: 8rem;
  
  /* Border Radius */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-2xl: 1.5rem;
  --radius-3xl: 2rem;
  --radius-full: 9999px;
  
  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
  --shadow-2xl: 0 25px 50px -12px rgb(0 0 0 / 0.25);
  --shadow-inner: inset 0 2px 4px 0 rgb(0 0 0 / 0.05);
  
  /* Animations */
  --ease-out-cubic: cubic-bezier(0.33, 1, 0.68, 1);
  --ease-in-out-cubic: cubic-bezier(0.65, 0, 0.35, 1);
  --ease-elastic: cubic-bezier(0.68, -0.55, 0.265, 1.55);
  
  /* Z-Index Scale */
  --z-dropdown: 1000;
  --z-sticky: 1020;
  --z-fixed: 1030;
  --z-modal-backdrop: 1040;
  --z-modal: 1050;
  --z-popover: 1060;
  --z-tooltip: 1070;
  --z-toast: 1080;
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-body);
  font-weight: 400;
  line-height: 1.6;
  color: var(--neutral-800);
  background: var(--neutral-0);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* List Styles - Proper indentation for bullets */
ul,
ol {
  padding-left: var(--space-6);
  margin-left: 0;
  margin-bottom: var(--space-4);
  list-style-position: outside;
}

li {
  margin-bottom: var(--space-2);
  padding-left: 0;
  margin-left: 0;
}

/* Nested lists */
ul ul,
ol ol,
ul ol,
ol ul {
  margin-top: var(--space-2);
  margin-bottom: var(--space-2);
}

/* Immersive Navigation */
.nav-immersive {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: var(--z-fixed);
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  transition: all 0.3s var(--ease-out-cubic);
}

.nav-immersive.scrolled {
  background: rgba(255, 255, 255, 0.98);
  box-shadow: var(--shadow-lg);
}

.nav-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: var(--space-4) var(--space-6);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  text-decoration: none;
  color: var(--neutral-900);
}

.nav-logo {
  transform: translateY(4px);
  height: 52px;
  width: auto;
}

.nav-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.25rem;
  background: var(--primary-gradient-soft);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-8);
}

.nav-link {
  position: relative;
  color: var(--neutral-700);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  transition: color 0.3s var(--ease-out-cubic);
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--primary-gradient);
  transition: width 0.3s var(--ease-out-cubic);
}

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

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

.nav-cta {
  padding: var(--space-3) var(--space-6);
  background: var(--primary-gradient-soft);
  color: white;
  text-decoration: none;
  border-radius: var(--radius-full);
  font-weight: 600;
  font-size: 0.9rem;
  transition: all 0.3s var(--ease-out-cubic);
  box-shadow: var(--shadow-md);
}

.nav-cta:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-xl);
}

.nav-mobile-toggle {
  display: none;
  flex-direction: column;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--space-2);
}

.nav-mobile-toggle span {
  width: 24px;
  height: 2px;
  background: var(--neutral-700);
  transition: all 0.3s var(--ease-out-cubic);
}

/* Animate hamburger to X when active */
.nav-mobile-toggle span { transform-origin: center; }
.nav-mobile-toggle.active span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-mobile-toggle.active span:nth-child(2) { opacity: 0; }
.nav-mobile-toggle.active span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* Hero Section - Immersive */
.hero-immersive {
  min-height: 100vh;
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
  padding-top: clamp(calc(var(--space-32) + var(--space-2)), 16vh, 160px);
  background: var(--primary-gradient);
}

.hero-background {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1;
}

.timeline-particles {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: 
    radial-gradient(circle at 20% 80%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 40% 40%, rgba(255, 255, 255, 0.05) 0%, transparent 50%);
  animation: float 20s ease-in-out infinite;
}

.hero-gradient {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(var(--primary-rgb), 0.9) 0%, rgba(var(--secondary-rgb), 0.9) 100%);
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 1500px;
  width: min(100%, 1680px);
  margin: 0 auto;
  padding: 0 clamp(var(--space-6), 4vw, var(--space-20));
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  gap: clamp(var(--space-10), 4vw, var(--space-20));
  align-items: center;
}

.hero-text {
  color: white;
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(3rem, 8vw, 6rem);
  font-weight: 900;
  line-height: 0.9;
  margin-bottom: var(--space-6);
}

.title-line {
  display: block;
  opacity: 0;
  transform: translateY(50px);
  animation: slideInUp 1s var(--ease-out-cubic) forwards;
}

.title-line:nth-child(1) { animation-delay: 0.2s; }
.title-line:nth-child(2) { animation-delay: 0.4s; }
.title-line:nth-child(3) { animation-delay: 0.6s; }

@media (max-width: 410px) {
  .title-line {
    font-size: clamp(1.9rem, calc(0.8rem + 7vw), 3rem);
  }

  .hero-immersive .title-line {
    font-size: inherit;
  }
}

.title-accent {
  background: var(--title-accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: 1.25rem;
  line-height: 1.6;
  margin-bottom: var(--space-8);
  opacity: 0.9;
  max-width: 500px;
  opacity: 0;
  transform: translateY(30px);
  animation: slideInUp 1s var(--ease-out-cubic) 0.8s forwards;
}

/* Shared subtitle style for inner-page heroes */
.hero-page-subtitle {
  margin-top: 0.75rem;
  font-size: 1.125rem;
  opacity: 0.95;
  max-width: 540px;
}

.hero-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 1.25rem;
}

.hero-immersive .hero-actions {
  gap: var(--space-4);
  margin-bottom: var(--space-12);
  opacity: 0;
  transform: translateY(30px);
  animation: slideInUp 1s var(--ease-out-cubic) 1s forwards;
}

.hero-visual {
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  transform: scale(0.8);
  animation: scaleIn 1.2s var(--ease-out-cubic) 0.6s forwards;
  width: 100%;
  max-width: clamp(520px, 40vw, 760px);
  margin: 0 auto 60px auto;
}

.timeline-preview-3d {
  position: relative;
  perspective: 1000px;
  width: 100%;
}

.timeline-screen {
  --hero-screen-aspect: 70%;
  position: relative;
  width: 100%;
  height: auto;
  aspect-ratio: 10 / 7;
  background: var(--neutral-900);
  border-radius: var(--radius-2xl);
  padding: var(--space-4);
  box-shadow: var(--shadow-2xl);
  transform: rotateY(-15deg) rotateX(5deg);
  transition: transform 0.6s var(--ease-out-cubic);
}

.timeline-screen:hover {
  transform: rotateY(-10deg) rotateX(2deg) scale(1.05);
}

.screen-content-stack {
  position: relative;
  width: 100%;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--neutral-900);
  transition: transform 1.2s var(--ease-out-cubic), opacity 1.2s var(--ease-out-cubic);
}

.screen-content-stack::before {
  content: '';
  display: block;
  padding-bottom: var(--hero-screen-aspect, 70%);
}

.screen-content {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
  opacity: 0;
  transition: opacity 5s var(--ease-out-cubic);
  pointer-events: none;
}

.screen-content.is-active {
  opacity: 1;
}

.screen-overlay {
  position: absolute;
  bottom: var(--space-6);
  left: var(--space-6);
  right: var(--space-6);
}


.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.6);
  position: relative;
  cursor: pointer;
  transition: all 0.3s var(--ease-out-cubic);
}

.dot.active {
  background: var(--color-accent);
  box-shadow: 0 0 20px rgba(var(--accent-rgb), 0.6);
  transform: scale(1.2);
}

.dot::after {
  content: attr(data-year);
  position: absolute;
  bottom: -25px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.75rem;
  color: white;
  font-weight: 600;
  opacity: 0;
  transition: opacity 0.3s var(--ease-out-cubic);
}

.dot:hover::after {
  opacity: 1;
}

.timeline-glow {
  position: absolute;
  top: -20px;
  left: -20px;
  right: -20px;
  bottom: -20px;
  background: radial-gradient(ellipse at center, rgba(var(--primary-rgb), 0.25) 0%, transparent 70%);
  border-radius: var(--radius-3xl);
  z-index: -1;
  animation: pulse 4s ease-in-out infinite;
}

.hero-scroll-indicator {
  position: absolute;
  bottom: var(--space-8);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  color: rgba(255, 255, 255, 0.8);
  z-index: 2;
}

.scroll-line {
  width: 1px;
  height: 40px;
  background: linear-gradient(to bottom, transparent, rgba(255, 255, 255, 0.8), transparent);
  animation: scrollIndicator 2s ease-in-out infinite;
}

.scroll-text {
  font-size: 0.875rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* Experience Section */
.experience-section {
  padding: var(--space-20) 0;
  background: var(--neutral-50);
}

.experience-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 var(--space-6);
}

.section-header-immersive {
  margin-bottom: var(--space-12);
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 800;
  color: var(--neutral-900);
  margin: 0 0 var(--space-4);
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.subsection-title {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 700;
  color: var(--neutral-900);
  margin: 0 0 var(--space-6);
}

.subsection-tertiary-title {
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 2.4vw, 1.6rem);
  font-weight: 700;
  color: var(--neutral-900);
  margin: var(--space-6) 0 var(--space-3);
  letter-spacing: 0.02em;
}

.container-immersive {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 var(--space-6);
}

.section-subtitle {
  font-size: 1.125rem;
  color: var(--neutral-600);
  margin: 0;
  line-height: 1.6;
}

.experience-section .section-header-immersive {
  text-align: center;
}

.experience-section .section-title {
  margin: 0 auto var(--space-6);
}

.experience-section .section-subtitle {
  margin: 0 auto;
}

.experience-showcase {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: var(--space-8);
}

.experience-item {
  position: relative;
  border-radius: var(--radius-2xl);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.6s var(--ease-out-cubic);
}

.experience-item:hover {
  transform: translateY(-10px) scale(1.02);
}

.experience-visual {
  position: relative;
  aspect-ratio: 16/10;
  overflow: hidden;
}

.experience-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s var(--ease-out-cubic);
}

.experience-item:hover .experience-image {
  transform: scale(1.1);
}

.experience-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(var(--primary-rgb), 0.9) 0%, rgba(var(--secondary-rgb), 0.9) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.4s var(--ease-out-cubic);
}

.experience-item:hover .experience-overlay {
  opacity: 1;
}

.experience-info {
  text-align: center;
  color: white;
  padding: var(--space-6);
}

.experience-info h3 {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: var(--space-4);
}

.experience-info p {
  font-size: 1.1rem;
  margin-bottom: var(--space-6);
  opacity: 0.9;
}

.experience-btn {
  padding: var(--space-3) var(--space-6);
  background: rgba(255, 255, 255, 0.2);
  color: white;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: var(--radius-full);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s var(--ease-out-cubic);
  backdrop-filter: blur(10px);
}

.experience-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  border-color: rgba(255, 255, 255, 0.5);
  transform: translateY(-2px);
}

/* Revolutionary Features */
.features-revolutionary {
  padding: var(--space-20) 0;
  background: var(--neutral-0);
}

.features-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 var(--space-6);
}

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

.features-title {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 800;
  color: var(--neutral-900);
  margin-bottom: var(--space-6);
}

.features-subtitle {
  font-size: 1.25rem;
  color: var(--neutral-600);
  max-width: 600px;
  margin: 0 auto;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--space-8);
}

/* Ensure a balanced 2 x 2 layout for the four feature cards
   on medium-wide screens where auto-fit would otherwise create 3 + 1 */
@media (min-width: 1012px) and (max-width: 1343px) {
  .features-revolutionary .features-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.feature-card-3d {
  background: var(--neutral-0);
  border-radius: var(--radius-2xl);
  padding: var(--space-8);
  box-shadow: var(--shadow-lg);
  transition: all 0.6s var(--ease-out-cubic);
  position: relative;
  overflow: hidden;
  cursor: pointer;
}

.feature-card-3d::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--primary-gradient);
  transform: scaleX(0);
  transition: transform 0.4s var(--ease-out-cubic);
}

.feature-card-3d:hover::before {
  transform: scaleX(1);
}

.feature-card-3d:hover {
  transform: translateY(-15px) rotateX(5deg);
  box-shadow: var(--shadow-2xl);
}

.feature-icon {
  width: 64px;
  height: 64px;
  background: var(--primary-gradient);
  border-radius: var(--radius-xl);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-6);
  color: white;
  transition: transform 0.4s var(--ease-out-cubic);
}

.feature-card-3d:hover .feature-icon {
  transform: scale(1.1) rotateY(10deg);
}

.feature-icon svg {
  width: 28px;
  height: 28px;
}

.feature-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--neutral-900);
  margin-bottom: var(--space-4);
}

.feature-description {
  color: var(--neutral-600);
  line-height: 1.6;
  margin-bottom: var(--space-6);
}

.feature-stats {
  display: flex;
  gap: var(--space-4);
}

.stat {
  text-align: center;
}

.stat-number {
  display: block;
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--color-primary);
}

.stat-label {
  font-size: 0.875rem;
  color: var(--neutral-500);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.feature-demo,
.customization-preview,
.integration-code {
  margin-top: var(--space-4);
}

.interaction-preview {
  height: 60px;
  background: var(--neutral-100);
  border-radius: var(--radius-lg);
  position: relative;
  overflow: hidden;
}

.touch-point {
  width: 20px;
  height: 20px;
  background: var(--color-accent);
  border-radius: 50%;
  position: absolute;
  top: 50%;
  left: 20px;
  transform: translateY(-50%);
  box-shadow: 0 0 0 rgba(var(--accent-rgb), 0);
  transition:
    background-color 0.8s ease,
    box-shadow 0.8s ease-out;
  animation: touchMove 3.3s ease-in-out infinite;
}

.touch-point.moving-right {
  /* Subtle but visible trail when moving to the right */
  box-shadow:
    -10px 0 6px rgba(var(--accent-rgb), 0.22),
    -22px 0 12px rgba(var(--accent-rgb), 0.1);
}

.touch-point.moving-left {
  /* Subtle but visible trail when moving to the left */
  box-shadow:
    10px 0 6px rgba(var(--accent-rgb), 0.22),
    22px 0 12px rgba(var(--accent-rgb), 0.1);
}

.color-palette {
  display: flex;
  gap: var(--space-2);
}

.color-dot {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid var(--neutral-200);
  transition: transform 0.3s var(--ease-out-cubic);
}

.color-dot:hover {
  transform: scale(1.2);
}

.integration-code {
  background: var(--neutral-900);
  color: var(--neutral-200);
  padding: var(--space-4);
  border-radius: var(--radius-lg);
  font-family: var(--font-mono);
  font-size: 0.875rem;
}

/* Showcase Gallery */
.showcase-gallery {
  padding: var(--space-20) 0;
  background: var(--neutral-50);
}

.showcase-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 var(--space-6);
}

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

.showcase-title {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 800;
  color: var(--neutral-900);
  margin-bottom: var(--space-6);
}

.showcase-subtitle {
  font-size: 1.25rem;
  color: var(--neutral-600);
  max-width: 600px;
  margin: 0 auto;
}

.showcase-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-8);
}

.showcase-item {
  display: block;
  background: var(--neutral-0);
  border-radius: var(--radius-2xl);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  transition: all 0.6s var(--ease-out-cubic);
  cursor: pointer;
  text-decoration: none;
  color: inherit;
}

.showcase-item:hover {
  transform: translateY(-10px);
  box-shadow: var(--shadow-2xl);
}

.showcase-item.featured {
  grid-row: span 2;
}

.showcase-image {
  position: relative;
  aspect-ratio: 16/10;
  overflow: hidden;
}

.showcase-item.featured .showcase-image {
  aspect-ratio: 16/12;
}

.showcase-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s var(--ease-out-cubic);
}

.showcase-item:hover .showcase-image img {
  transform: scale(1.05);
}

.showcase-badge {
  position: absolute;
  top: var(--space-4);
  right: var(--space-4);
  background: var(--secondary-gradient);
  color: white;
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.showcase-content {
  padding: var(--space-6);
}

.showcase-logo {
  margin-bottom: var(--space-4);
}

.showcase-logo img {
  height: 40px;
  width: auto;
}

.showcase-content h3 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--neutral-900);
  margin-bottom: var(--space-3);
}

.showcase-content p {
  color: var(--neutral-600);
  line-height: 1.6;
  margin-bottom: var(--space-4);
}

.showcase-metrics {
  display: flex;
  gap: var(--space-6);
}

.metric {
  text-align: center;
}

.metric-number {
  display: block;
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--color-primary);
}

.metric-label {
  font-size: 0.75rem;
  color: var(--neutral-500);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Developer Section */
.developer-section {
  padding: var(--space-32) 0;
  background: var(--neutral-900);
  color: white;
}

.developer-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 var(--space-6);
}

.developer-content {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: var(--space-16);
  align-items: center;
}

.developer-text {
  text-align: left;
}

.developer-title {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 800;
  margin-bottom: var(--space-6);
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.developer-subtitle {
  font-size: 1.25rem;
  color: var(--neutral-300);
  margin-bottom: var(--space-8);
  line-height: 1.6;
}

.developer-features {
  margin-bottom: var(--space-10);
}

.dev-feature {
  display: flex;
  gap: var(--space-4);
  margin-bottom: var(--space-6);
  align-items: flex-start;
}

.dev-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
  width: 3rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: white;
  text-align: center;
}

.dev-content {
  flex: 1;
  text-align: left;
}

.dev-content h4 {
  font-weight: 700;
  margin-bottom: var(--space-2);
  color: white;
}

.dev-content p {
  color: var(--neutral-400);
  line-height: 1.6;
}

.developer-actions {
  display: flex;
  gap: var(--space-4);
  flex-wrap: wrap;
}

.developer-code {
  position: relative;
  min-width: 0;
}

.code-window {
  background: var(--neutral-800);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-2xl);
}

.code-header {
  background: var(--neutral-700);
  padding: var(--space-4);
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.code-dots {
  display: flex;
  gap: var(--space-2);
}

.code-dots .dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.code-dots .red { background: #ff5f57; }
.code-dots .yellow { background: #ffbd2e; }
.code-dots .green { background: #28ca42; }

.code-title {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  color: var(--neutral-300);
}

.code-content {
  padding: var(--space-6);
  overflow-x: auto;
}

.code-content pre {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  line-height: 1.6;
  color: var(--neutral-200);
  white-space: pre-wrap;
  word-break: break-word;
}

/* Histropedia Sheets Section */
.sheets-section {
  padding: var(--space-20) 0;
  background: var(--neutral-50);
}

.sheets-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 var(--space-6);
}

.sheets-content {
  display: flex;
  flex-direction: column;
  gap: var(--space-16);
}

.sheets-text {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}

.sheets-title {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 800;
  margin-bottom: var(--space-6);
  color: var(--neutral-900);
}

.sheets-subtitle {
  font-size: 1.25rem;
  line-height: 1.7;
  color: var(--neutral-600);
  margin-bottom: var(--space-4);
}

.sheets-description {
  line-height: 1.8;
  color: var(--neutral-600);
  margin-bottom: var(--space-8);
}

.sheets-features {
  margin-bottom: var(--space-10);
}

.sheets-feature {
  display: flex;
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}

.sheets-feature-icon {
  width: 48px;
  height: 48px;
  background: var(--primary-gradient);
  border-radius: var(--radius-xl);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: white;
  transition: transform 0.3s var(--ease-out-cubic);
}

.sheets-feature:hover .sheets-feature-icon {
  transform: scale(1.1) rotate(5deg);
}

.sheets-feature-icon svg {
  width: 24px;
  height: 24px;
}

.sheets-feature-content h4 {
  font-weight: 700;
  margin-bottom: var(--space-2);
  color: var(--neutral-900);
  font-size: 1.1rem;
}

.sheets-feature-content p {
  color: var(--neutral-600);
  line-height: 1.6;
  margin: 0;
}

.sheets-points {
  list-style: none;
  display: grid;
  gap: var(--space-4);
}

.sheets-points li {
  background: var(--neutral-0);
  border: 1px solid rgba(var(--primary-rgb), 0.12);
  border-radius: var(--radius-xl);
  padding: var(--space-5) var(--space-6);
  box-shadow: var(--shadow-md);
  display: grid;
  gap: var(--space-2);
}

.sheets-points strong {
  font-weight: 700;
  color: var(--neutral-900);
}

.sheets-points span {
  color: var(--neutral-600);
  line-height: 1.6;
}

.sheets-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-4);
}

.sheets-actions .btn-primary {
  flex-shrink: 0;
}

.sheets-actions-note {
  font-size: 0.95rem;
  color: var(--neutral-500);
  line-height: 1.6;
  margin: 0;
  font-style: italic;
  flex: 1 1 280px;
  min-width: 280px;
}

.sheets-demo {
  position: relative;
  min-width: 0;
}

.sheets-demo-frame {
  background: var(--neutral-0);
  border-radius: 0;
  border: 1px solid rgba(var(--primary-rgb), 0.15);
  padding: var(--space-6);
  box-shadow: var(--shadow-2xl);
  width: 100%;
  min-width: 0;
  overflow: hidden;
  position: relative;
}

.sheets-demo-frame::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--primary-gradient);
  z-index: 1;
}

.sheets-demo-frame iframe {
  outline: none;
  border: 1px solid rgba(var(--primary-rgb), 0.15);
  border-radius: 0;
  display: block;
  width: 100%;
  height: 80vh;
  min-height: 500px;
}

.sheets-demo-frame iframe:focus {
  outline: none;
}

.sheets-demo-title {
  margin-bottom: var(--space-4);
  font-size: var(--text-xl);
  font-weight: 600;
  color: var(--neutral-900);
}

.sheets-demo-caption {
  margin-top: var(--space-4);
  font-size: var(--text-sm);
  color: var(--neutral-600);
  line-height: 1.6;
}

.sheets-embed-placeholder {
  border-radius: var(--radius-xl);
  border: 2px dashed rgba(var(--primary-rgb), 0.3);
  background: repeating-linear-gradient(135deg, rgba(var(--primary-rgb), 0.05) 0, rgba(var(--primary-rgb), 0.05) 12px, rgba(var(--accent-rgb), 0.05) 12px, rgba(var(--accent-rgb), 0.05) 24px);
  aspect-ratio: 16 / 9;
  display: grid;
  place-items: center;
  text-align: center;
  color: var(--neutral-500);
  padding: var(--space-6);
  overflow-wrap: anywhere;
  word-break: break-word;
}

.sheets-embed-label {
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.sheets-embed-note {
  margin-top: var(--space-4);
  font-size: 0.95rem;
  color: var(--neutral-500);
}

/* Button Styles */
.btn-primary,
.btn-secondary,
.btn-primary-large {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-4) var(--space-6);
  border: none;
  border-radius: var(--radius-full);
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.3s var(--ease-out-cubic);
  overflow: hidden;
}

.btn-primary {
  background: var(--primary-gradient-soft);
  color: white;
  box-shadow: var(--shadow-lg);
}

.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-2xl);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.1);
  color: white;
  border: 2px solid rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.3);
  transform: translateY(-2px);
}

.btn-primary-large {
  padding: var(--space-5) var(--space-10);
  font-size: 1.125rem;
  background: var(--primary-gradient-soft);
  color: white;
  box-shadow: var(--shadow-xl);
}

.btn-primary-large:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-2xl);
}

.btn-ripple {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.btn-primary:active .btn-ripple,
.btn-primary-large:active .btn-ripple {
  width: 300px;
  height: 300px;
}

.btn-icon {
  width: 16px;
  height: 16px;
  transition: transform 0.3s var(--ease-out-cubic);
}

.btn-secondary:hover .btn-icon {
  transform: translateX(2px);
}

/* CTA Section */
.cta-section {
  padding: var(--space-20) 0;
  background: var(--dark-gradient);
  color: white;
  position: relative;
  overflow: hidden;
}

.cta-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 var(--space-6);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-16);
  align-items: center;
}

.cta-title {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 800;
  margin-bottom: var(--space-6);
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.cta-subtitle {
  font-size: 1.25rem;
  color: var(--neutral-300);
  margin-bottom: var(--space-8);
  line-height: 1.6;
}

.cta-actions {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
  align-items: flex-start;
}

.cta-info {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.cta-note {
  font-size: 0.875rem;
  color: var(--neutral-400);
}

.cta-stats {
  font-size: 0.875rem;
  color: var(--color-accent);
  font-weight: 600;
}

.floating-timeline {
  position: relative;
  width: 400px;
  height: 200px;
}

.timeline-line-animated {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--accent-gradient);
  transform: translateY(-50%);
  border-radius: 1px;
}

.timeline-events-animated {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  transform: translateY(-50%);
}

.event-animated {
  width: 16px;
  height: 16px;
  background: var(--color-accent);
  border-radius: 50%;
  border: 3px solid var(--neutral-900);
  animation: eventPulse 2s ease-in-out infinite;
  animation-delay: var(--delay);
}

/* Footer */
.footer-immersive {
  background: var(--neutral-950);
  color: var(--neutral-300);
  padding: var(--space-20) 0 var(--space-8);
}

.footer-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 var(--space-6);
}

.footer-content {
  display: grid;
  gap: var(--space-12);
  margin-bottom: var(--space-12);
  grid-template-columns: minmax(220px, 1fr) minmax(0, 2fr);
  align-items: start;
}

.footer-links {
  display: grid;
  gap: var(--space-8);
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.footer-brand {
  grid-column: span 1;
}

.footer-logo {
  height: 40px;
  width: auto;
  margin-bottom: var(--space-4);
}

.footer-tagline {
  font-family: var(--font-display);
  font-style: italic;
  color: var(--neutral-400);
  margin: 0;
}

.footer-section h4 {
  color: white;
  font-weight: 700;
  margin-bottom: var(--space-4);
}

.footer-section a {
  display: block;
  color: var(--neutral-400);
  text-decoration: none;
  margin-bottom: var(--space-2);
  transition: color 0.3s var(--ease-out-cubic);
}

.footer-section a:hover {
  color: var(--color-accent);
}

.footer-bottom {
  border-top: 1px solid var(--neutral-800);
  padding-top: var(--space-8);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer-social {
  display: flex;
  gap: var(--space-4);
}

.footer-social a {
  width: 40px;
  height: 40px;
  background: var(--neutral-800);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--neutral-400);
  transition: all 0.3s var(--ease-out-cubic);
}

.footer-social a:hover {
  background: var(--color-primary);
  color: white;
  transform: translateY(-2px);
}

.footer-social svg {
  width: 18px;
  height: 18px;
}

/* Animations */
@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(50px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.8);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes float {
  0%, 100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-20px);
  }
}

@keyframes pulse {
  0%, 100% {
    opacity: 0.6;
    transform: scale(1);
  }
  50% {
    opacity: 1;
    transform: scale(1.05);
  }
}

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

@keyframes touchMove {
  0%, 100% {
    left: 20px;
  }
  50% {
    left: calc(100% - 40px);
  }
}

@keyframes eventPulse {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(var(--accent-rgb), 0.7);
  }
  50% {
    transform: scale(1.1);
    box-shadow: 0 0 0 10px rgba(var(--accent-rgb), 0);
  }
}

/* Responsive Design */
@media (max-width: 1024px) {
  .hero-immersive {
    padding-bottom: 8rem;
  }

  .hero-content,
  .developer-content,
  .cta-container {
    grid-template-columns: 1fr;
    gap: var(--space-12);
    text-align: center;
  }

  .developer-content {
    text-align: left;
  }

  .developer-features {
    max-width: 520px;
    margin-left: auto;
    margin-right: auto;
  }

  .developer-title,
  .developer-subtitle {
    text-align: center;
  }
  
  .developer-actions {
    justify-content: center;
  }
  
  .sheets-content {
    gap: var(--space-12);
  }
  
  /* Keep hero items centered on smaller screens */
  .hero-content {
    justify-items: center;
  }
  .hero-immersive .hero-actions {
    justify-content: center;
  }
  .hero-visual {
    justify-self: center;
  }
  .timeline-preview-3d,
  .timeline-screen {
    margin-left: auto;
    margin-right: auto;
  }
  
  .cta-visual .floating-timeline.animate-active {
    margin-left: auto;
    margin-right: auto;
  }
  
  .showcase-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .cta-actions {
    align-items: center;
  }
  
  .footer-content {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-8);
  }
}

@media (max-width: 1200px) {
  .timeline-screen {
    max-width: 96%;
  }
}

@media (max-width: 768px) {
  .nav-logo {
    height: 44px;
  }

  .nav-links {
    display: none;
  }
  
  .nav-mobile-toggle {
    display: flex;
  }

  /* Show mobile menu when toggled */
  .nav-links.active {
    display: flex;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: var(--space-4);
    background: rgba(255, 255, 255, 0.98);
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    box-shadow: var(--shadow-lg);
    padding: var(--space-4) var(--space-6);
  }

  .nav-links.active .nav-link,
  .nav-links.active .nav-cta {
    padding: var(--space-3) var(--space-6);
  }
  
  .experience-showcase {
    grid-template-columns: 1fr;
  }
  
  .features-grid {
    grid-template-columns: 1fr;
  }
  
  .sheets-text {
    text-align: left;
  }
  
  .sheets-features {
    margin-bottom: var(--space-8);
  }
  
  .sheets-actions-note {
    white-space: normal;
  }
  
  .sheets-demo-frame iframe {
    height: 85vh;
    min-height: 400px;
  }

  .sheets-demo-title {
    font-size: var(--text-lg);
    margin-bottom: var(--space-3);
  }

  .sheets-demo-caption {
    margin-top: var(--space-3);
    font-size: var(--text-xs);
  }
  
  .footer-content {
    grid-template-columns: 1fr;
    text-align: center;
  }
  
  .footer-links {
    grid-template-columns: 1fr;
  }
  
  .footer-bottom {
    flex-direction: column;
    gap: var(--space-4);
    text-align: center;
  }

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

@media (max-width: 520px) {
  .hero-actions {
    flex-direction: column;
    align-items: center;
  }
}

@media (max-width: 480px) {
  :root {
    --space-6: 1rem;
    --space-8: 1.5rem;
    --space-12: 2rem;
    --space-16: 2.5rem;
    --space-20: 3rem;
    --space-24: 3.5rem;
    --space-32: 4rem;
  }

  .nav-logo {
    height: 35px;
  }

  .floating-timeline {
    width: 280px;
    height: 150px;
  }
}
