/* Theme color variables for easier maintenance */
:root {
  --color-background: #030303;
  --color-background-gradient-end: #0c0c0c;
  --color-text-primary: #ffffff;
  --color-text-secondary: #b3b3b3;
  --color-text-tertiary: #666666;
  --color-accent: #0070ba; /* Changed from #0466c8 to PayPal blue for trust */
  --color-accent-dark: #00498e; /* Darker PayPal blue */
  --color-accent-light: #1a8ddd; /* Lighter PayPal blue */
  --color-surface: rgba(15, 15, 15, 0.65); /* Increased opacity for more solidity */
  --color-surface-hover: rgba(15, 15, 15, 0.75);
  --color-border: rgba(255, 255, 255, 0.15);
  --color-border-hover: rgba(0, 112, 186, 0.9);
  --border-radius-large: 16px; /* Reduced from 24px for more professional look */
  --border-radius-medium: 10px; /* Reduced from 12px */
  --shadow-default: 0 10px 25px rgba(0, 0, 0, 0.25), inset 0 0 1px 1px rgba(255, 255, 255, 0.07);
  --shadow-hover: 0 15px 35px rgba(0, 0, 0, 0.35), inset 0 0 2px 2px rgba(255, 255, 255, 0.1);
  --transition-default: 0.3s ease;

  /* Accessibility variables */
  --focus-outline: 3px solid var(--color-accent);
  --transition-hover: 0.15s ease-in-out;
  
  /* Legal links color */
  --color-legal-links: #5d93c0; /* Changed to a blue tone for trust */
  --color-legal-links-hover: #7eb3e6;
}

/* Light theme variables */
:root[data-theme="light"] {
  --color-background: #f7f9fc; /* More professional light blue tint */
  --color-background-gradient-end: #e8eef7;
  --color-text-primary: #111827;
  --color-text-secondary: #374151;
  --color-text-tertiary: #6b7280;
  --color-surface: rgba(255, 255, 255, 0.85);
  --color-surface-hover: rgba(255, 255, 255, 0.95);
  --color-border: rgba(0, 0, 0, 0.12);
  --color-border-hover: rgba(0, 112, 186, 0.7);
  --shadow-default: 0 10px 25px rgba(0, 0, 0, 0.08), 0 0 1px rgba(0, 0, 0, 0.1);
  --shadow-hover: 0 15px 35px rgba(0, 0, 0, 0.12), 0 0 2px rgba(0, 0, 0, 0.15);
}

/* Remove render-blocking font import and use font-display: swap in the global styles */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Space Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

html {
  scroll-behavior: smooth;
  /* Improve text rendering */
  text-rendering: optimizeSpeed;
}

body {
  background-color: var(--color-background);
  color: var(--color-text-primary);
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: 20px;
  position: relative;
  overflow-x: hidden;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Critical CSS for visible content - optimize for fast rendering */
.background {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(145deg, var(--color-background) 0%, var(--color-background-gradient-end) 100%);
  z-index: -2;
  will-change: transform; /* Optimize for GPU */
}

/* Preload critical fonts to improve performance */
@media screen {
  @font-face {
    font-family: 'Space Grotesk';
    font-style: normal;
    font-weight: 400;
    font-display: swap; /* Ensures text is visible while font loads */
    src: local('Space Grotesk'), url('/fonts/SpaceGrotesk-Regular.woff2') format('woff2');
  }
  
  @font-face {
    font-family: 'Space Grotesk';
    font-style: normal;
    font-weight: 700;
    font-display: swap; /* Ensures text is visible while font loads */
    src: local('Space Grotesk Bold'), url('/fonts/SpaceGrotesk-Bold.woff2') format('woff2');
  }
}

/* Optimize grid animation */
.grid {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: 40px 40px;
  background-image: 
    linear-gradient(to right, rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  z-index: -1;
  will-change: background-position;
  animation: gridFloat 30s ease-in-out infinite alternate;
  contain: strict; /* Improve rendering performance */
}

/* Improve grid performance in dark mode */
:root[data-theme="dark"] .grid,
:root:not([data-theme="light"]) .grid {
  background-image: 
    linear-gradient(to right, rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
}

/* Add grid for light mode with appropriate contrast */
:root[data-theme="light"] .grid {
  background-image: 
    linear-gradient(to right, rgba(0, 0, 0, 0.05) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(0, 0, 0, 0.05) 1px, transparent 1px);
}

@keyframes gridFloat {
  0% { background-position: 0px 0px; }
  100% { background-position: 40px 40px; }
}

.container {
  max-width: 800px;
  text-align: center;
  transform: translateZ(0); /* Hardware acceleration */
}

/* Optimize LCP element - critical for first render */
.content {
  padding: 40px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-large);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  box-shadow: var(--shadow-default);
  transition: transform var(--transition-default), 
              box-shadow var(--transition-default), 
              background-color var(--transition-default);
  position: relative;
  overflow: hidden;
  max-width: 650px;
  margin: 0 auto;
  will-change: transform, opacity; /* Optimize for GPU */
  content-visibility: auto; /* Improve rendering performance */
  backface-visibility: hidden;
}

.content::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(
      circle at 30% 30%,
      rgba(255, 255, 255, 0.03) 0%,
      transparent 70%
  );
  pointer-events: none;
}

.content:hover {
  transform: translateY(-5px);
  background: var(--color-surface-hover);
  box-shadow: var(--shadow-hover);
}

/* Typography */
.title {
  font-size: 72px;
  font-weight: 700;
  letter-spacing: -1px;
  margin-bottom: 20px;
  color: var(--color-text-primary);
  text-transform: uppercase;
  position: relative;
  display: inline-block;
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.2);
}

.title::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, var(--color-accent), var(--color-accent-light), var(--color-accent-dark));
  border-radius: 3px;
}

.tagline {
  font-size: 20px;
  color: var(--color-text-secondary);
  margin-bottom: 15px;
  font-weight: 300;
  letter-spacing: 1px;
  overflow: hidden;
  white-space: nowrap;
  display: block;
}

.coming-soon {
  font-size: 24px;
  font-weight: 500;
  margin-bottom: 40px;
  letter-spacing: 6px;
  text-transform: uppercase;
  color: #e6e6e6;
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.1);
}

:root[data-theme="light"] .coming-soon {
  color: #444444;
  text-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

/* Button styling */
.button-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: center;
  margin-bottom: 20px;
  -webkit-touch-callout: none; /* Prevent callout on iOS Safari */
  width: 100%; /* Ensure container takes full width */
}

.button {
  display: inline-block;
  padding: 15px 30px;
  background: rgba(0, 112, 186, 0.1); /* Updated to match new accent color */
  border: 1px solid rgba(0, 112, 186, 0.3); /* Updated to match new accent color */
  border-radius: var(--border-radius-medium);
  color: var(--color-text-primary);
  text-decoration: none;
  font-size: 16px;
  font-weight: 500;
  transition: all 0.4s cubic-bezier(0.215, 0.61, 0.355, 1);
  box-shadow: 0 0 0 rgba(0, 112, 186, 0); /* Updated to match new accent color */
  width: 100%; /* Changed from min-width to width */
  max-width: 400px; /* Added max-width to keep buttons from getting too wide */
  position: relative;
  overflow: hidden;
  z-index: 1;
  -webkit-touch-callout: none; /* iOS Safari */
  -webkit-tap-highlight-color: transparent; /* Remove tap highlight on mobile */
  backface-visibility: hidden;
}

/* Fix for light mode - ensure icons stay dark */
:root[data-theme="light"] .button i {
  color: #121212; /* Changed from var(--color-accent-dark) to pure black */
}

:root[data-theme="light"] .button:hover i {
  color: #000000; /* Changed from var(--color-accent) to black */
}

.button:focus {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

.button:focus:not(:focus-visible) {
  outline: none;
}

.button::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
  transition: left 0.7s ease;
  z-index: -1;
}

.button:hover {
  border-color: var(--color-border-hover);
  transform: translateY(-3px) scale(1.02);
  box-shadow: 
      0 7px 20px rgba(4, 102, 200, 0.2),
      0 0 15px rgba(4, 102, 200, 0.4);
  letter-spacing: 0.5px;
  background: rgba(4, 102, 200, 0.15);
}

.button:hover::before {
  left: 100%;
}

.button i {
  margin-right: 10px;
  font-size: 18px;
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), color 0.3s ease;
}

.button:hover i {
  transform: translateX(3px) scale(1.1);
  color: rgba(255, 255, 255, 0.95);
}

/* Button states - pressed effect */
.button:active {
  transform: scale(0.98) translateY(-2px);
  box-shadow: 0 2px 10px rgba(4, 102, 200, 0.1);
  transition: all 0.1s ease;
}

.footer {
  margin-top: 40px;
  font-size: 14px;
  color: var(--color-text-tertiary);
}

/* Essential animations */
@keyframes fadeIn {
  0% { opacity: 0; }
  100% { opacity: 1; }
}

@keyframes slideUp {
  0% { opacity: 0; transform: translateY(20px); }
  100% { opacity: 1; transform: translateY(0); }
}

@keyframes rotate {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes fadeOut {
  from { opacity: 1; }
  to { opacity: 0; visibility: hidden; }
}

.intro-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: black;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  animation: fadeOut 0.6s forwards;
  animation-delay: 2.2s;
}

.intro-logo-container {
  position: relative;
  width: 150px;
  height: 150px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.intro-logo {
  width: 80%;
  height: 80%;
  position: relative;
  animation: fadeIn 0.6s forwards;
  z-index: 2;
}

.loading-ring {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 3px solid rgba(4, 102, 200, 0.05);
  border-top: 3px solid var(--color-accent);
  border-right: 3px solid transparent;
  animation: rotate 1.2s linear infinite;
  z-index: 1;
}

/* Logo styling with optimized rendering */
.logo-container {
  margin-bottom: 10px;
  position: relative;
  transform: translateZ(0); /* Hardware acceleration */
}

.logo-link {
  display: inline-block;
  cursor: pointer;
  position: relative;
  transition: transform var(--transition-default);
  backface-visibility: hidden;
}

.logo-link:focus {
  outline: 2px solid var(--color-accent);
  outline-offset: 4px;
  border-radius: 50%;
}

.logo-link::after {
  display: none; /* Remove the underline element */
}

.logo-link:hover {
  transform: translateY(-3px);
}

.logo {
  width: 80px;
  height: auto;
  filter: drop-shadow(0 0 8px rgba(4, 102, 200, 0.5));
  transition: filter var(--transition-default), transform var(--transition-default);
  display: block; /* Prevent layout shift */
  aspect-ratio: attr(width) / attr(height); /* Maintain aspect ratio */
}

.logo-link:hover .logo {
  transform: scale(1.05);
  filter: drop-shadow(0 0 12px rgba(4, 102, 200, 0.7)) contrast(1.1) brightness(1.05);
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Theme toggle button */
.theme-toggle {
  position: fixed;
  top: 20px;
  right: 20px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  z-index: 1000;
  box-shadow: var(--shadow-default);
  transition: transform 0.3s ease, background-color 0.3s ease, opacity 0.5s ease;
  opacity: 0;
  -webkit-touch-callout: none; /* iOS Safari */
  -webkit-tap-highlight-color: transparent; /* Remove tap highlight on mobile */
  backface-visibility: hidden;
}

/* Fix for light mode theme toggle icons */
:root[data-theme="light"] .theme-toggle i {
  color: #121212; /* Changed to black */
}

.theme-toggle:hover {
  transform: scale(1.1);
  box-shadow: var(--shadow-hover);
}

.theme-toggle i {
  font-size: 18px;
  color: var(--color-text-primary);
  transition: transform 0.5s ease;
}

.theme-toggle:hover i {
  transform: rotate(30deg);
}

/* Add focus styles for keyboard navigation accessibility */
*:focus-visible {
  outline: var(--focus-outline);
  outline-offset: 3px;
}

/* Global touch interface improvements */
.logo-link, .button, .theme-toggle, [class*="icon"], i {
  user-select: none; /* Standard syntax */
  -webkit-user-select: none; /* Safari */
  -moz-user-select: none; /* Firefox */
  -ms-user-select: none; /* Internet Explorer/Edge */
  -webkit-touch-callout: none; /* iOS Safari */
  -webkit-tap-highlight-color: transparent; /* Remove tap highlight */
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  
  .grid {
    animation: none;
  }
  
  .content:hover {
    transform: none;
  }
  
  .button:hover {
    transform: none;
    letter-spacing: normal;
  }
}

/* Fix for email address in SEO - add if you have email in your HTML */
.email-address {
  unicode-bidi: bidi-override;
  direction: rtl;
}

/* Add aria-hidden handling for screen readers */
[aria-hidden="true"] {
  display: none;
}

/* Micro-interaction styles */
.pulse-on-hover:hover i {
  animation: pulse 1s infinite;
}

@keyframes pulse {
  0% {
    transform: translateX(3px) scale(1.1);
  }
  50% {
    transform: translateX(3px) scale(1.2);
  }
  100% {
    transform: translateX(3px) scale(1.1);
  }
}

/* Add cursor trail effect styles */
.cursor-trail {
  position: fixed;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-accent);
  opacity: 0.6;
  z-index: 9999;
  pointer-events: none;
  mix-blend-mode: screen;
  will-change: transform, opacity;
  transition: transform 0.1s, opacity 0.5s;
}

/* Fix cursor trail for light mode */
:root[data-theme="light"] .cursor-trail {
  background: var(--color-accent-dark);
  opacity: 0.8;
  mix-blend-mode: multiply;
  filter: drop-shadow(0 0 2px rgba(4, 102, 200, 0.5));
}

/* Enhanced accessibility for keyboard users */
.skip-to-content {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--color-accent);
  color: white;
  padding: 8px 16px;
  z-index: 100;
  transition: top 0.3s ease;
  opacity: 0;
}

.skip-to-content:focus {
  top: 0;
  opacity: 1;
}

/* Responsive styles */
@media (max-width: 768px) {
  .title {
    font-size: 48px;
  }
  
  .coming-soon {
    font-size: 20px;
    letter-spacing: 4px;
  }
  
  .content {
    padding: 30px;
  }
}

@media (max-width: 480px) {
  .title {
    font-size: 36px;
  }
  
  .coming-soon {
    font-size: 16px;
    letter-spacing: 3px;
  }
  
  .tagline {
    font-size: 16px;
  }
  
  .content {
    padding: 25px;
  }
  
  .button {
    padding: 12px 24px;
    min-width: 180px;
  }
}

/* Fix for mobile Safari 100vh bug */
@supports (-webkit-touch-callout: none) {
  .background, .grid {
    height: -webkit-fill-available;
  }
}

/* Print styles - simplified */
@media print {
  body {
    background: white;
    color: black;
  }
  
  .background, .grid, .intro-overlay, .theme-toggle {
    display: none;
  }
  
  .content {
    box-shadow: none;
    background: white;
    border: 1px solid #ddd;
  }
}

/* for legal links - customs style for matching footer */
.legal-links {
  margin-top: 5px;
  font-size: 12px;
  animation: fadeIn 0.7s ease-out forwards;
  animation-delay: 3.6s;
  opacity: 0;
  color: var(--color-text-tertiary);
}

.legal-link {
  color: var(--color-text-tertiary);
  text-decoration: none;
  transition: color 0.3s ease, text-decoration 0.3s ease;
  margin: 0 5px;
}
    
.legal-link:hover {
  text-decoration: none;
  color: var(--color-text-secondary);
}