/* ============================================
   Main CSS - Core Styles and Layout
   ============================================ */

/* CSS Custom Properties for Theming */
:root {
  /* Colors - Dark slate, blue, and grey palette with white pops */
  --color-primary: #ffffff;
  --color-background: #0a0e1a;
  --color-background-elevated: #141824;
  --color-accent: #4a9eff;
  --color-accent-secondary: #6b7fd7;
  --color-text: #e8edf4;
  --color-text-light: #9ca9be;
  --color-text-muted: #6b7a94;
  --color-border: #1e2738;
  --color-slate: #2d3748;
  --color-slate-light: #3d4a5f;
  --color-blue: #4a9eff;
  --color-blue-dark: #2563eb;
  --color-grey: #64748b;
  --color-error: #ef4444;
  --color-success: #10b981;
  
  /* Spacing - Consistent rhythm */
  --spacing-unit: 1rem;
  --spacing-xs: calc(var(--spacing-unit) * 0.5);
  --spacing-sm: calc(var(--spacing-unit) * 1);
  --spacing-md: calc(var(--spacing-unit) * 2);
  --spacing-lg: calc(var(--spacing-unit) * 4);
  --spacing-xl: calc(var(--spacing-unit) * 6);
  --spacing-xxl: calc(var(--spacing-unit) * 8);
  
  /* Layout */
  --max-width: 1200px;
  --content-width: 800px;
  
  /* Transitions */
  --transition-speed: 0.3s;
  --transition-easing: cubic-bezier(0.4, 0, 0.2, 1);
  
  /* Font stacks with proper fallbacks for special characters */
  --font-primary: 'Caractères', 'Helvetica Neue', 'Helvetica', 'Arial', sans-serif;
  --font-standard: 'Helvetica Neue', 'Helvetica', 'Arial', sans-serif;
}

/* ============================================
   Reset and Base Styles
   ============================================ */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  position: relative;
  overflow-x: hidden;
  min-height: 100vh;
  font-family: var(--font-standard); /* Use standard fonts by default for special character support */
  color: var(--color-text);
  background: var(--color-background);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Animated gradient background - seamless breathing effect */
body::before {
  content: "";
  position: fixed;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: 
    radial-gradient(ellipse at 20% 30%, #1e3a8a 0%, transparent 50%),
    radial-gradient(ellipse at 80% 70%, #1e40af 0%, transparent 50%),
    radial-gradient(ellipse at 40% 80%, #334155 0%, transparent 50%),
    radial-gradient(ellipse at 60% 20%, #475569 0%, transparent 50%);
  background-size: 200% 200%;
  opacity: 0.5;
  animation: breathe 15s ease-in-out infinite;
  filter: blur(80px) saturate(1.4);
  mix-blend-mode: screen;
  z-index: -1;
  pointer-events: none;
}

@keyframes breathe {
  0%, 100% {
    transform: scale(1) translate(0, 0);
    background-position: 0% 0%, 100% 100%, 0% 100%, 100% 0%;
  }
  33% {
    transform: scale(1.15) translate(5%, -5%);
    background-position: 30% 40%, 70% 60%, 40% 70%, 60% 30%;
  }
  66% {
    transform: scale(0.9) translate(-5%, 5%);
    background-position: 60% 70%, 40% 30%, 70% 40%, 30% 60%;
  }
}

/* Subtle glitch effect on body */
@keyframes glitch {
  0%, 98%, 100% {
    filter: none;
  }
  99% {
    filter: hue-rotate(5deg) saturate(1.2);
  }
}

body {
  animation: glitch 60s ease-in-out infinite;
}

/* ============================================
   Splash Screen
   ============================================ */

.splash-screen {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1000;
  cursor: pointer;
  overflow: hidden;
}

.splash-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  opacity: 0;
  animation: fadeIn 1s ease-out 0.2s forwards;
  z-index: 1;
}

.splash-content {
  position: relative;
  z-index: 2;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  width: 100%;
  gap: var(--spacing-md);
  padding: 0 var(--spacing-md);
}

.splash-text {
  font-weight: 300;
  letter-spacing: 0.15em;
  color: var(--color-primary);
  opacity: 0;
  margin-bottom: var(--spacing-lg);
  margin-top: var(--spacing-xl); /* Add top margin to push text down to brain center */
  line-height: 0.6; /* Very tight line height */
  text-shadow: 2px 3px 8px rgba(0, 0, 0, 0.7), 1px 2px 4px rgba(0, 0, 0, 0.5);
  animation: 
    fadeInUp 1s ease-out 0.5s forwards,
    textBreathe 4s ease-in-out 2s infinite;
  transform: translateX(10%); /* Shift slightly right to center on brain */
}

.splash-text-tiny {
  font-size: 1.5rem;
  display: block;
  line-height: 0.5;
  margin: 0;
}

.splash-text-tiny:first-child {
  margin-bottom: -0.72em; /* Reduced by 10% from -0.8em */
}

.splash-text-large {
  font-size: 4.5rem;
  display: block;
  line-height: 0.6;
  margin: 0;
}

.splash-text-large:not(:last-child) {
  margin-bottom: -0.36em; /* Reduced by 10% from -0.4em */
}

.splash-text-tiny:not(:first-child) {
  margin-bottom: -0.63em; /* Reduced by 10% from -0.7em */
}

.splash-text-large:last-child {
  margin-bottom: 0;
}

@keyframes textBreathe {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.7; transform: scale(1.02); }
}

.splash-hint {
  font-size: 1rem;
  color: #000000;
  opacity: 0;
  animation: fadeIn 1s ease-out 4s forwards;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-weight: 500;
  margin-top: var(--spacing-xl); /* Add significant top margin to push it down */
  padding-top: var(--spacing-lg); /* Additional padding for more separation */
}

@keyframes fadeIn {
  0% { opacity: 0; }
  100% { opacity: 1; }
}

/* Main site initially hidden */
.main-site.hidden {
  display: none;
}

.main-site {
  opacity: 0;
  animation: siteReveal 0.8s ease-out forwards;
}

@keyframes siteReveal {
  0% { opacity: 0; transform: translateY(20px); }
  100% { opacity: 1; transform: translateY(0); }
}

/* Splash screen fade out */
.splash-screen.fade-out {
  opacity: 0;
  transition: opacity 0.8s ease-out;
}

/* Respect user's motion preferences */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  
  body::before {
    animation: none !important;
  }
  
  .splash-screen {
    animation: none !important;
  }
  
  .splash-text {
    animation: fadeInUp 0.01ms ease-out forwards !important;
  }
  
  .splash-hint {
    animation: fadeIn 0.01ms ease-out 0.5s forwards !important;
  }
}

/* ============================================
   Skip Link (Accessibility)
   ============================================ */

.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--color-accent);
  color: var(--color-primary);
  padding: var(--spacing-sm);
  text-decoration: none;
  z-index: 100;
  font-weight: 600;
}

.skip-link:focus {
  top: 0;
}

/* ============================================
   Navigation
   ============================================ */

nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: rgba(10, 14, 26, 0.85);
  border-bottom: 1px solid rgba(74, 158, 255, 0.15);
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
  z-index: 50;
  padding: var(--spacing-md) var(--spacing-lg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.nav-menu {
  list-style: none;
  display: flex;
  justify-content: center;
  gap: var(--spacing-md);
  flex-wrap: wrap;
  max-width: var(--max-width);
  margin: 0 auto;
}

.nav-link {
  color: var(--color-text-light);
  text-decoration: none;
  font-size: 0.95rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  transition: color var(--transition-speed) var(--transition-easing),
              transform 0.2s var(--transition-easing);
  position: relative;
  display: inline-block;
}

.nav-link:hover,
.nav-link:focus {
  color: var(--color-primary);
  outline: none;
  transform: translateY(-1px);
}

.nav-link:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 4px;
  border-radius: 2px;
}

.nav-link.active {
  color: var(--color-primary);
}

.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--color-accent), var(--color-accent-secondary));
  box-shadow: 0 0 8px rgba(74, 158, 255, 0.5);
}

/* ============================================
   Main Content and Sections
   ============================================ */

main {
  position: relative;
  z-index: 1;
}

.section {
  min-height: 100vh;
  display: flex;
  opacity: 1;
  transform: translateY(0);
  scroll-margin-top: 80px; /* Account for fixed nav */
  position: relative;
}

/* Section background images */
.section::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  opacity: 0.55;
  z-index: -1;
  pointer-events: none;
}

/* Individual section backgrounds */
#home::before {
  background-image: url('../The bureau of minds.png');
}

#clients::before {
  background-image: url('../The bureau of minds.png');
}

#contact::before {
  background-image: url('../The bureau of minds.png');
}

.section-content {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: var(--spacing-xxl) var(--spacing-md);
  width: 100%;
  text-align: center;
  position: relative;
  z-index: 1;
}

/* ============================================
   Home Section
   ============================================ */

#home {
  align-items: center;
  justify-content: center;
  padding-top: 80px; /* Account for fixed nav */
}

#home .section-content {
  text-align: center;
}

.agency-name {
  margin-bottom: var(--spacing-md);
  opacity: 0;
  animation: fadeInUp 0.8s var(--transition-easing) 0.2s forwards;
}

.tagline {
  color: var(--color-text-light);
  font-size: 1.125rem;
  font-weight: 300;
  letter-spacing: 0.02em;
  opacity: 0;
  animation: fadeInUp 0.8s var(--transition-easing) 0.4s forwards;
  margin-bottom: var(--spacing-md);
}

/* Fade in animation */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ============================================
   Clients Section
   ============================================ */

#clients .section-content {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: calc(100vh - 80px);
}

#clients h2 {
  margin-bottom: var(--spacing-lg);
}

.about-intro {
  margin-bottom: var(--spacing-xl);
}

.about-text {
  font-size: 1.125rem;
  line-height: 1.8;
  color: var(--color-text);
  max-width: 600px;
  margin: 0 auto var(--spacing-md);
  opacity: 0.95;
}

.about-text:last-child {
  margin-bottom: 0;
}

/* ============================================
   Contact Section
   ============================================ */

#contact .section-content {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: calc(100vh - 80px);
}

#contact h2 {
  margin-bottom: var(--spacing-lg);
}


.form-group {
  margin-bottom: var(--spacing-md);
}

.form-group label {
  display: block;
  margin-bottom: var(--spacing-xs);
  font-size: 0.875rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--color-text);
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: var(--spacing-sm);
  border: 1px solid var(--color-border);
  background-color: var(--color-background-elevated);
  color: var(--color-text);
  font-family: var(--font-standard); /* Use standard font for form inputs */
  font-size: 1rem;
  transition: border-color var(--transition-speed) var(--transition-easing),
              box-shadow 0.2s var(--transition-easing);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(74, 158, 255, 0.15);
}

.form-group input:focus-visible,
.form-group textarea:focus-visible,
.form-group select:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

.form-group textarea {
  resize: vertical;
  min-height: 120px;
}

.error-message {
  display: block;
  color: var(--color-error);
  font-size: 0.875rem;
  margin-top: var(--spacing-xs);
  min-height: 1.2em;
  opacity: 0;
  transform: translateY(-5px);
  transition: opacity 0.2s var(--transition-easing),
              transform 0.2s var(--transition-easing);
}

.error-message:not(:empty) {
  opacity: 1;
  transform: translateY(0);
}

.submit-button {
  background: linear-gradient(135deg, var(--color-accent), var(--color-accent-secondary));
  color: var(--color-primary);
  border: none;
  padding: var(--spacing-sm) var(--spacing-lg);
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform 0.2s var(--transition-easing),
              box-shadow 0.2s var(--transition-easing);
  box-shadow: 0 4px 12px rgba(74, 158, 255, 0.3);
}

.submit-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(74, 158, 255, 0.4);
}

.submit-button:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(74, 158, 255, 0.3);
}

.submit-button:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 4px;
  border-radius: 2px;
}

.form-feedback {
  margin-top: var(--spacing-md);
  padding: var(--spacing-sm);
  font-size: 0.875rem;
  display: none;
  opacity: 0;
  transform: translateY(-10px);
  transition: opacity 0.3s var(--transition-easing),
              transform 0.3s var(--transition-easing);
}

.form-feedback.success {
  display: block;
  color: var(--color-success);
  border-left: 3px solid var(--color-success);
  padding-left: var(--spacing-sm);
  opacity: 1;
  transform: translateY(0);
}

.form-feedback.error {
  display: block;
  color: var(--color-error);
  border-left: 3px solid var(--color-error);
  padding-left: var(--spacing-sm);
  opacity: 1;
  transform: translateY(0);
}

/* ============================================
   Font Fallbacks for Special Characters
   ============================================ */

/* Use custom font for decorative elements that don't contain special characters */
.custom-font,
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-primary);
}

/* Use standard fonts for elements containing symbols that may not render in custom fonts */
.standard-font,
.email-address,
.quotation,
.special-chars,
.team-title,
.team-name {
  font-family: var(--font-standard) !important;
}

/* Specific styling for email addresses */
.email-address {
  font-weight: 400;
  letter-spacing: 0.01em;
}

/* Quotation marks and similar punctuation */
.quotation {
  font-style: italic;
}

/* Any other special characters that need standard fonts */
.special-chars {
  font-weight: inherit;
}
/* ============================================
   Clients Section - Centered 3-Logo Carousel
   ============================================ */

.clients-carousel-container {
  margin-top: var(--spacing-xl);
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
  overflow: hidden;
  position: relative;
}

.clients-carousel {
  width: 100%;
  overflow: hidden;
}

.clients-track {
  display: flex;
  animation: carousel-slide 20s linear infinite;
  width: calc(200px * 13 + var(--spacing-lg) * 13); /* All items + gaps */
}

.client-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--spacing-lg);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  aspect-ratio: 1;
  transition: all 0.3s var(--transition-easing);
  cursor: pointer;
  width: 200px;
  height: 200px;
  margin-right: var(--spacing-lg);
  flex-shrink: 0;
}

.client-item:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(74, 158, 255, 0.4);
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(74, 158, 255, 0.15);
}

.client-logo {
  width: 100px;
  height: 80px;
  object-fit: contain;
  object-position: center;
  filter: brightness(0.8) contrast(1.1);
  transition: filter 0.3s var(--transition-easing);
}

.client-item:hover .client-logo {
  filter: brightness(1) contrast(1.2);
}

@keyframes carousel-slide {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(calc(-200px * 10 - var(--spacing-lg) * 10));
  }
}

/* Pause animation on hover */
.clients-carousel-container:hover .clients-track {
  animation-play-state: paused;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .clients-carousel-container {
    max-width: 600px;
  }
  
  .clients-track {
    width: calc(150px * 13 + var(--spacing-md) * 13);
  }
  
  .client-item {
    width: 150px;
    height: 150px;
    margin-right: var(--spacing-md);
    padding: var(--spacing-md);
  }
  
  .client-logo {
    width: 80px;
    height: 60px;
  }
  
  @keyframes carousel-slide {
    0% {
      transform: translateX(0);
    }
    100% {
      transform: translateX(calc(-150px * 10 - var(--spacing-md) * 10));
    }
  }
}
  }
  
  .client-name {
    font-size: 0.9rem;
  }
  
  .clients-carousel {
    width: calc(250px * 20);
  }
  
  @keyframes carousel-scroll {
    0% {
      transform: translateX(0);
    }
    100% {
      transform: translateX(calc(-250px * 10 - var(--spacing-md) * 10));
    }
  }
}
/* ============================================
   Contact Form Styling
   ============================================ */

.contact-form {
  max-width: 440px; /* 45% smaller than typical 800px form width */
  margin: 0 auto;
  padding: var(--spacing-lg);
  background: rgba(20, 24, 36, 0.3);
  border: 1px solid var(--color-border);
  border-radius: 8px;
}

#general-inquiry .section-content {
  max-width: 600px; /* Constrain the entire section content */
  margin: 0 auto;
}

/* Responsive adjustments for contact form */
@media (max-width: 768px) {
  .contact-form {
    max-width: 100%;
    margin: 0 var(--spacing-sm);
    padding: var(--spacing-md);
  }
}
/* Enhanced Form Success State */
.form-success-container {
    text-align: center;
    padding: 3rem 2rem;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border-radius: 12px;
    border: 2px solid #0ea5e9;
    box-shadow: 0 8px 32px rgba(14, 165, 233, 0.1);
    margin-top: 2rem;
    transition: all 0.4s ease-out;
}

.success-icon {
    font-size: 4rem;
    color: #0ea5e9;
    margin-bottom: 1rem;
    display: block;
    animation: successPulse 0.6s ease-out;
}

@keyframes successPulse {
    0% { transform: scale(0.5); opacity: 0; }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

.success-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--color-primary);
    margin-bottom: 1rem;
    font-family: var(--font-primary);
}

.success-message {
    font-size: 1.1rem;
    color: var(--color-text);
    line-height: 1.6;
    margin-bottom: 2rem;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.send-another-btn {
    background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
    color: white;
    border: none;
    padding: 0.75rem 2rem;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.3);
}

.send-another-btn:hover {
    background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(14, 165, 233, 0.4);
}

.send-another-btn:active {
    transform: translateY(0);
}

/* Enhanced form loading states */
.contact-form.loading {
    opacity: 0.7;
    pointer-events: none;
}

.submit-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Improved error message animations */
.form-feedback.error {
    animation: errorShake 0.5s ease-out;
}

@keyframes errorShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* Mobile responsiveness for success state */
@media (max-width: 768px) {
    .form-success-container {
        padding: 2rem 1rem;
        margin-top: 1rem;
    }
    
    .success-icon {
        font-size: 3rem;
    }
    
    .success-title {
        font-size: 1.25rem;
    }
    
    .success-message {
        font-size: 1rem;
    }
}