/* Main CSS for Prepunk Club Landing Page */

/* Font setup */
@font-face {
  font-family: 'Satoshi';
  src: url('../fonts/Satoshi-Variable.woff2') format('woff2'),
       url('../fonts/Satoshi-Variable.woff') format('woff'),
       url('../fonts/Satoshi-Variable.ttf') format('truetype');
  font-weight: 300 900;
  font-display: swap;
  font-style: normal;
}

@font-face {
  font-family: 'Satoshi';
  src: url('../fonts/Satoshi-VariableItalic.woff2') format('woff2'),
       url('../fonts/Satoshi-VariableItalic.woff') format('woff'),
       url('../fonts/Satoshi-VariableItalic.ttf') format('truetype');
  font-weight: 300 900;
  font-display: swap;
  font-style: italic;
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

:root {
  --font-satoshi: 'Satoshi', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  
  /* Dark mode colors (default) */
  --color-background: #000000;
  --color-card-bg: #121212;
  --color-secondary-bg: #1a1a1a;
  --color-border: rgba(255, 255, 255, 0.1);
  --color-text: #ffffff;
  --color-secondary-text: #aaaaaa;
  --color-primary: #69a8f8;
  --color-primary-rgb: 105, 168, 248;
  --color-primary-hover: #86b9fa;
  --color-success-bg: #0c1f0c;
  --color-success-border: #1c3a1e;
  --color-success-text: #25a244;
  --color-warning-bg: #2e200a;
  --color-warning-border: #5a3c0e;
  --color-warning-text: #ffa33d;
  --color-error-bg: #290707;
  --color-error-border: #471111;
  --color-error-text: #ff4d4d;
  --shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 12px 24px rgba(0, 0, 0, 0.4);
  --focus-ring: 0 0 0 3px rgba(105, 168, 248, 0.5);
  --safe-area-inset-top: env(safe-area-inset-top, 0px);
  --safe-area-inset-bottom: env(safe-area-inset-bottom, 0px);
  --safe-area-inset-left: env(safe-area-inset-left, 0px);
  --safe-area-inset-right: env(safe-area-inset-right, 0px);
  --color-focus: #0078d7;
}

/* Light mode support */
[data-theme="light"] {
  --color-background: #ffffff;
  --color-card-bg: #ffffff;
  --color-secondary-bg: #f5f5f7;
  --color-border: rgba(0, 0, 0, 0.1);
  --color-text: #1d1d1f;
  --color-secondary-text: #86868b;
  --color-primary: #0071e3;
  --color-primary-rgb: 0, 113, 227;
  --color-primary-hover: #0077ed;
  --color-success-bg: #f2f7f2;
  --color-success-border: #d5e5d6;
  --color-success-text: #1d643b;
  --color-warning-bg: #fef7e9;
  --color-warning-border: #fadcab;
  --color-warning-text: #974c00;
  --color-error-bg: #fbf4f4;
  --color-error-border: #f0d0d0;
  --color-error-text: #c01e1e;
  --shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.03);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 12px 24px rgba(0, 0, 0, 0.07);
  --focus-ring: 0 0 0 3px rgba(0, 113, 227, 0.5);
  --color-focus: #0078d7;
}

/* Base styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 100%; /* Ensure proper rem scaling */
  -webkit-text-size-adjust: 100%; /* Prevent iOS text size adjustment */
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}

html, body {
  background-color: var(--color-background);
  color: var(--color-text);
  font-family: var(--font-satoshi);
  line-height: 1.5;
  transition: background-color 0.3s ease, color 0.3s ease;
  min-height: 100vh;
  -moz-osx-font-smoothing: grayscale;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  width: 100%;
  height: 100%;
  overflow-x: hidden;
}

/* Accessibility helpers */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

:focus {
  outline: none;
}

/* Focus visibility for accessibility */
*:focus-visible {
  outline: 3px solid var(--color-focus);
  outline-offset: 2px;
}

a:focus, button:focus {
  outline: 3px solid var(--color-focus);
  outline-offset: 2px;
}

/* Layout */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  padding-left: calc(24px + var(--safe-area-inset-left));
  padding-right: calc(24px + var(--safe-area-inset-right));
}

/* Hero container with main logo */
.hero-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 80px 0 40px;
  padding-top: calc(80px + var(--safe-area-inset-top));
  padding-bottom: calc(40px + var(--safe-area-inset-bottom));
  animation: fadeIn 0.8s ease-out;
  contain: layout style paint;
}

.main-logo {
  margin-bottom: 20px;
  content-visibility: auto;
}

.main-logo img {
  width: 200px;
  height: auto;
  max-width: 90vw;
}

.main-title {
  font-size: 3.5rem;
  font-weight: 300;
  margin-bottom: 16px;
  letter-spacing: 1px;
  content-visibility: auto;
}

.date-range {
  font-size: 1.25rem;
  color: var(--color-secondary-text);
  margin-bottom: 24px;
}

.hero-description {
  max-width: 600px;
  margin: 0 auto 40px;
  font-size: 1.1rem;
  color: var(--color-secondary-text);
}

/* Main content */
main {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
}

/* Buttons */
.btn-container {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  justify-content: center;
  margin-bottom: 40px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 28px;
  border-radius: 6px;
  font-size: 1.1rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s ease;
  cursor: pointer;
  min-height: 44px; /* Minimum touch target size */
  min-width: 140px; /* Minimum width for legibility */
  user-select: none;
  -webkit-tap-highlight-color: transparent; /* Remove tap highlight on mobile */
  touch-action: manipulation; /* Optimization for touch */
  position: relative;
  overflow: hidden;
}

.btn::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: transparent;
  transition: background-color 0.2s;
  pointer-events: none;
  border-radius: inherit;
}

.btn:active::after {
  background-color: rgba(0, 0, 0, 0.1);
}

.btn-primary {
  background-color: var(--color-primary);
  color: #000000;
  border: none;
  content-visibility: auto;
}

.btn-primary:hover {
  background-color: var(--color-primary-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn-primary:focus-visible {
  box-shadow: var(--focus-ring);
}

.btn-secondary {
  background-color: var(--color-secondary-bg);
  color: var(--color-text);
  border: 1px solid var(--color-border);
}

.btn-secondary:hover {
  background-color: var(--color-card-bg);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn-secondary:focus-visible {
  box-shadow: var(--focus-ring);
}

/* Social links */
.social-links {
  display: flex;
  gap: 20px;
  justify-content: center;
  margin-top: 40px;
  flex-wrap: wrap;
}

.social-link {
  color: var(--color-secondary-text);
  text-decoration: none;
  font-size: 1rem;
  transition: all 0.2s ease;
  padding: 8px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px; /* Increased for better touch target */
  height: 48px; /* Increased for better touch target */
  -webkit-tap-highlight-color: transparent;
  position: relative;
}

.social-link::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: transparent;
  transition: background-color 0.2s;
  pointer-events: none;
  border-radius: inherit;
}

.social-link:active::after {
  background-color: rgba(0, 0, 0, 0.1);
}

.social-link:hover {
  color: var(--color-primary);
  background-color: rgba(var(--color-primary-rgb), 0.2);
  transform: translateY(-2px);
}

.social-link:focus-visible {
  box-shadow: var(--focus-ring);
}

.social-link svg {
  width: 24px;
  height: 24px;
}

/* Social icon specific styling */
.social-marketplace {
  color: var(--color-secondary-text);
}

.social-marketplace:hover {
  color: var(--color-primary);
  background-color: rgba(var(--color-primary-rgb), 0.2);
}

/* Theme toggle */
.theme-toggle {
  position: fixed;
  top: calc(24px + var(--safe-area-inset-top));
  right: calc(24px + var(--safe-area-inset-right));
  background: var(--color-card-bg);
  border: 1px solid var(--color-border);
  border-radius: 50%;
  width: 48px; /* Increased for better touch target */
  height: 48px; /* Increased for better touch target */
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
  z-index: 100;
  -webkit-tap-highlight-color: transparent;
}

.theme-toggle:hover {
  transform: scale(1.05);
  box-shadow: var(--shadow-md);
}

.theme-toggle:focus-visible {
  box-shadow: var(--focus-ring);
}

/* Background pattern */
.background-pattern {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: radial-gradient(var(--color-border) 0.5px, transparent 0.5px);
  background-size: 25px 25px;
  pointer-events: none;
  z-index: -1;
}

/* Responsive styles for different screen sizes */
/* Extra small screens (phones, 576px and down) */
@media (max-width: 576px) {
  html {
    font-size: 87.5%; /* 14px base font size */
  }
  
  .main-title {
    font-size: 2.5rem;
  }
  
  .date-range {
    font-size: 1.1rem;
  }
  
  .hero-description {
    font-size: 1rem;
  }
  
  .main-logo img {
    width: 140px;
  }
  
  .btn-container {
    flex-direction: column;
    width: 100%;
    max-width: 280px;
    margin-left: auto;
    margin-right: auto;
  }
  
  .btn {
    width: 100%;
    padding: 12px 16px;
  }
}

/* Small screens (tablets, 576px to 768px) */
@media (min-width: 577px) and (max-width: 768px) {
  html {
    font-size: 93.75%; /* 15px base font size */
  }
  
  .main-title {
    font-size: 3rem;
  }
  
  .main-logo img {
    width: 160px;
  }
}

/* Medium screens (tablets, 768px to 992px) */
@media (min-width: 769px) and (max-width: 992px) {
  html {
    font-size: 100%; /* 16px base font size */
  }
}

/* Large screens (desktops, 992px and up) */
@media (min-width: 993px) {
  html {
    font-size: 100%; /* 16px base font size */
  }
  
  .container {
    padding: 0 48px;
    padding-left: calc(48px + var(--safe-area-inset-left));
    padding-right: calc(48px + var(--safe-area-inset-right));
  }
  
  .btn {
    padding: 14px 32px;
  }
}

/* Print styles */
@media print {
  .theme-toggle {
    display: none;
  }
  
  html, body {
    background-color: #ffffff;
    color: #000000;
  }
  
  .hero-container {
    padding: 20px 0;
  }
  
  .background-pattern {
    display: none;
  }
}

/* Reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* High contrast preference */
@media (prefers-contrast: high) {
  :root {
    --color-primary: #0055aa;
    --color-primary-hover: #003d7a;
  }
  
  [data-theme="light"] {
    --color-text: #000000;
    --color-secondary-text: #333333;
    --color-border: rgba(0, 0, 0, 0.3);
  }
  
  [data-theme="dark"] {
    --color-text: #ffffff;
    --color-secondary-text: #dddddd;
    --color-border: rgba(255, 255, 255, 0.4);
    --color-focus: #2a9fff;
  }
}

/* Apple-style scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
}

[data-theme="light"] ::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.2);
}

/* Improve tablet responsiveness */
@media (max-width: 768px) {
    .container {
        padding: 1.5rem;
        max-width: 100%;
    }
    
    .main-title {
        font-size: 2.5rem;
    }
    
    .hero-description {
        font-size: 1rem;
        max-width: 90%;
    }
    
    .btn {
        padding: 0.75rem 1.25rem;
        font-size: 0.95rem;
    }
    
    .btn-container {
        flex-direction: column;
        gap: 1rem;
    }
    
    .btn {
        width: 100%;
        max-width: 300px;
    }
    
    .main-logo img {
        width: 150px;
        height: 150px;
    }
}

/* Improve mobile responsiveness */
@media (max-width: 480px) {
    .container {
        padding: 1rem;
    }
    
    .main-title {
        font-size: 2rem;
    }
    
    .date-range {
        font-size: 0.9rem;
    }
    
    .hero-description {
        font-size: 0.95rem;
        max-width: 100%;
        padding: 0 0.5rem;
    }
    
    .social-links {
        gap: 1.25rem;
    }
    
    .main-logo img {
        width: 120px;
        height: 120px;
    }
}

/* Add specific touch optimizations */
@media (hover: none) {
    /* Enhance touch targets for mobile */
    .btn, .social-link, .theme-toggle {
        min-height: 44px;
        min-width: 44px;
    }
    
    .social-link {
        padding: 10px;
    }
    
    /* Remove hover effects on touch devices */
    .btn:hover, .social-link:hover {
        transform: none;
    }
    
    /* Add active touch state instead */
    .btn:active, .social-link:active {
        transform: scale(0.97);
        transition: transform 0.1s;
    }
}

/* Improve focus visibility for accessibility */
.btn:focus-visible, 
.social-link:focus-visible,
.theme-toggle:focus-visible {
    outline: 3px solid var(--color-focus);
    outline-offset: 3px;
}

/* Add smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Add loading animation for better perceived performance */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.loaded main {
    animation: fadeIn 0.5s ease-in-out;
}

/* Make sure buttons have proper spacing on all devices */
.btn-container {
    margin: 2rem auto;
}

/* Loading indicator */
.loading-indicator {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(to right, var(--color-primary), var(--color-secondary));
  z-index: 9999;
  animation: loading-bar 1.5s ease-in-out infinite;
  transform: translateX(-100%);
}

@keyframes loading-bar {
  0% {
    transform: translateX(-100%);
  }
  50% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(100%);
  }
} 