/* ============================================
   CLOWNS CONSORTEN - DESIGN SYSTEM
   Modern, Professional, Playful
   ============================================ */

/* ---------- CSS VARIABLES / DESIGN TOKENS ---------- */
:root {
  /* Colors - Pure Monochrome Palette */
  --color-black: #000000;
  --color-white: #ffffff;
  --color-dark: #0a0a0a;
  --color-dark-elevated: #141414;
  --color-dark-surface: #1a1a1a;
  --color-gray-800: #333333;
  --color-gray-600: #666666;
  --color-gray-400: #999999;
  --color-gray-200: #cccccc;

  /* Typography */
  --font-display: 'Poppins Regular', 'Poppins', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: 'Inter Regular', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

  /* Fluid Typography Scale */
  --text-hero: clamp(2.5rem, 8vw, 6rem);
  --text-h1: clamp(2rem, 5vw, 5rem);
  --text-h2: clamp(1.75rem, 4vw, 3.5rem);
  --text-h3: clamp(1.25rem, 3vw, 2rem);
  --text-body: clamp(1rem, 1.5vw, 1.25rem);
  --text-body-sm: clamp(0.875rem, 1.25vw, 1.1rem);
  --text-small: clamp(0.75rem, 1vw, 0.875rem);
  --text-xs: clamp(0.625rem, 0.8vw, 0.75rem);

  /* Font Weights */
  --weight-normal: 400;
  --weight-medium: 500;
  --weight-semibold: 600;
  --weight-bold: 700;
  --weight-black: 900;

  /* Line Heights */
  --leading-tight: 1.1;
  --leading-snug: 1.25;
  --leading-normal: 1.5;
  --leading-relaxed: 1.65;

  /* Letter Spacing */
  --tracking-tight: -0.03em;
  --tracking-normal: 0;
  --tracking-wide: 0.05em;
  --tracking-wider: 0.1em;

  /* Spacing Scale (8px base) */
  --space-1: 0.25rem;   /* 4px */
  --space-2: 0.5rem;    /* 8px */
  --space-3: 0.75rem;   /* 12px */
  --space-4: 1rem;      /* 16px */
  --space-5: 1.25rem;   /* 20px */
  --space-6: 1.5rem;    /* 24px */
  --space-8: 2rem;      /* 32px */
  --space-10: 2.5rem;   /* 40px */
  --space-12: 3rem;     /* 48px */
  --space-16: 4rem;     /* 64px */
  --space-20: 5rem;     /* 80px */
  --space-24: 6rem;     /* 96px */
  --space-32: 8rem;     /* 128px */

  /* Fluid Section Spacing */
  --space-section: clamp(2.5rem, 6vw, 5rem);
  --space-section-sm: clamp(1.5rem, 4vw, 3rem);

  /* Transitions */
  --ease-out: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);

  --transition-fast: 150ms var(--ease-out);
  --transition-base: 300ms var(--ease-out);
  --transition-slow: 500ms var(--ease-out);
  --transition-slower: 700ms var(--ease-out);

  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.5);
  --shadow-xl: 0 16px 60px rgba(0, 0, 0, 0.6);
  --shadow-glow: 0 0 30px rgba(255, 255, 255, 0.1);
  --shadow-glow-strong: 0 0 50px rgba(255, 255, 255, 0.15);

  /* Border Radius */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-2xl: 32px;
  --radius-full: 9999px;

  /* Z-Index Scale */
  --z-base: 0;
  --z-dropdown: 100;
  --z-sticky: 200;
  --z-fixed: 300;
  --z-modal-backdrop: 400;
  --z-modal: 500;
  --z-tooltip: 600;
}

/* ---------- FONT FACES ---------- */
@font-face {
  font-family: 'Poppins Regular';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: local('Poppins Regular'), url('../fonts/Poppins-Regular.woff') format('woff');
}

@font-face {
  font-family: 'Inter Regular';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: local('Inter Regular'), url('../fonts/Inter-Regular.woff') format('woff');
}

/* ---------- CSS RESET & BASE STYLES ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  margin: 0;
  padding: 0;
  background-color: var(--color-black);
  color: var(--color-white);
  font-family: var(--font-body);
  font-size: var(--text-body);
  line-height: var(--leading-normal);
  overflow-x: hidden;

  /* Sticky footer layout */
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Main content wrapper - grows to push footer down */
.site-content {
  flex: 1 0 auto;
}

/* ---------- TYPOGRAPHY BASE ---------- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: var(--weight-black);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
  color: var(--color-white);
}

p {
  font-family: var(--font-body);
  line-height: var(--leading-relaxed);
  color: var(--color-white);
}

a {
  color: inherit;
  text-decoration: none;
  transition: var(--transition-fast);
}

a:hover {
  opacity: 0.8;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

button {
  font-family: var(--font-body);
  cursor: pointer;
  border: none;
  background: none;
}

/* ---------- FOCUS STATES (Accessibility) ---------- */
:focus-visible {
  outline: 2px solid var(--color-white);
  outline-offset: 2px;
}

/* ---------- SELECTION ---------- */
::selection {
  background-color: var(--color-white);
  color: var(--color-black);
}

/* ---------- SKIP LINK (Accessibility) ---------- */
.skip-link {
  position: absolute;
  top: -100px;
  left: 50%;
  transform: translateX(-50%);
  z-index: var(--z-tooltip);

  padding: var(--space-3) var(--space-6);
  background-color: var(--color-white);
  color: var(--color-black);
  font-family: var(--font-body);
  font-size: var(--text-body-sm);
  font-weight: var(--weight-medium);
  text-decoration: none;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);

  transition: top 0.3s var(--ease-out);
}

.skip-link:focus {
  top: var(--space-4);
  opacity: 1;
}

/* ---------- SCROLLBAR STYLING ---------- */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--color-dark);
}

::-webkit-scrollbar-thumb {
  background: var(--color-gray-600);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--color-gray-400);
}

/* ---------- UTILITY CLASSES ---------- */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- REDUCED MOTION ---------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---------- KEYFRAME ANIMATIONS ---------- */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

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

@keyframes bounce {
  0%, 20%, 50%, 80%, 100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-10px);
  }
  60% {
    transform: translateY(-5px);
  }
}

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

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

@keyframes shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

/* Scroll-triggered animation classes */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity var(--transition-slow), transform var(--transition-slow);
}

.animate-on-scroll.visible {
  opacity: 1;
  transform: translateY(0);
}

.animate-delay-1 { transition-delay: 100ms; }
.animate-delay-2 { transition-delay: 200ms; }
.animate-delay-3 { transition-delay: 300ms; }
.animate-delay-4 { transition-delay: 400ms; }
.animate-delay-5 { transition-delay: 500ms; }

/* ============================================
   UNIFIED BUTTON COMPONENT SYSTEM
   Base button styles with modifiers
   ============================================ */

/* ---------- BASE BUTTON ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);

  font-family: var(--font-body);
  font-size: var(--text-body-sm);
  font-weight: var(--weight-medium);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  text-decoration: none;
  white-space: nowrap;

  padding: var(--space-3) var(--space-6);
  border-radius: var(--radius-full);

  cursor: pointer;
  transition: var(--transition-base);
}

.btn:hover {
  opacity: 1;
}

/* ---------- OUTLINE BUTTON (default for dark backgrounds) ---------- */
.btn--outline {
  color: var(--color-white);
  background-color: transparent;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.btn--outline:hover {
  color: var(--color-black);
  background-color: var(--color-white);
  border-color: var(--color-white);
}

/* ---------- OUTLINE BUTTON (for light backgrounds) ---------- */
.btn--outline-dark {
  color: var(--color-black);
  background-color: transparent;
  border: 1px solid var(--color-gray-200);
}

.btn--outline-dark:hover {
  color: var(--color-white);
  background-color: var(--color-black);
  border-color: var(--color-black);
}

/* ---------- SOLID BUTTON ---------- */
.btn--solid {
  color: var(--color-black);
  background-color: var(--color-white);
  border: 2px solid var(--color-white);
}

.btn--solid:hover {
  color: var(--color-white);
  background-color: transparent;
  border-color: var(--color-white);
}

/* ---------- BUTTON WITH ARROW ---------- */
.btn--arrow::after {
  content: '\2192';
  transition: var(--transition-base);
}

.btn--arrow:hover::after {
  transform: translateX(4px);
}

/* ---------- BUTTON WITH BACK ARROW ---------- */
.btn--arrow-back::before {
  content: '\2190';
  transition: var(--transition-base);
}

.btn--arrow-back:hover::before {
  transform: translateX(-4px);
}

/* ---------- BUTTON SIZES ---------- */
.btn--sm {
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-xs);
}

.btn--lg {
  padding: var(--space-4) var(--space-10);
  font-size: var(--text-body);
  font-weight: var(--weight-bold);
  border-width: 2px;
}

/* ============================================
   UNIFIED NAVIGATION ARROW COMPONENT
   Glassmorphic circular arrow buttons
   ============================================ */

/* ---------- BASE NAV ARROW ---------- */
.nav-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 20;

  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;

  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-full);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);

  cursor: pointer;
  user-select: none;
  transition: var(--transition-base);
}

.nav-arrow:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.3);
  transform: translateY(-50%) scale(1.05);
}

.nav-arrow:active {
  transform: translateY(-50%) scale(0.95);
}

/* ---------- NAV ARROW POSITIONS ---------- */
.nav-arrow--left {
  left: var(--space-8);
}

.nav-arrow--right {
  right: var(--space-8);
}

/* ---------- NAV ARROW ICON ---------- */
.nav-arrow svg {
  width: 28px;
  height: 28px;
  color: var(--color-white);
  transition: var(--transition-base);
}

.nav-arrow--left:hover svg {
  transform: translateX(-3px);
}

.nav-arrow--right:hover svg {
  transform: translateX(3px);
}

/* ---------- NAV ARROW SIZES ---------- */
.nav-arrow--sm {
  width: 50px;
  height: 50px;
}

.nav-arrow--sm svg {
  width: 24px;
  height: 24px;
}

.nav-arrow--xs {
  width: 44px;
  height: 44px;
}

.nav-arrow--xs svg {
  width: 20px;
  height: 20px;
}

/* ---------- NAV ARROW INLINE (no absolute positioning) ---------- */
.nav-arrow--inline {
  position: relative;
  top: auto;
  transform: none;
  flex-shrink: 0;
}

.nav-arrow--inline:hover {
  transform: scale(1.05);
}

.nav-arrow--inline:active {
  transform: scale(0.95);
}

/* ---------- RESPONSIVE NAV ARROWS ---------- */
@media (max-width: 1250px) {
  .nav-arrow {
    width: 50px;
    height: 50px;
  }

  .nav-arrow svg {
    width: 24px;
    height: 24px;
  }
}

@media (max-width: 1024px) {
  .nav-arrow {
    width: 48px;
    height: 48px;
  }

  .nav-arrow--left {
    left: var(--space-4);
  }

  .nav-arrow--right {
    right: var(--space-4);
  }
}

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

  .nav-arrow svg {
    width: 20px;
    height: 20px;
  }

  .btn {
    padding: var(--space-2) var(--space-4);
    font-size: var(--text-xs);
  }

  .btn--lg {
    padding: var(--space-3) var(--space-8);
    font-size: var(--text-body-sm);
  }
}

@media (max-width: 400px) {
  .nav-arrow {
    width: 40px;
    height: 40px;
  }
}

/* ============================================
   LOADING & ERROR STATES
   For dynamic content from WordPress API
   ============================================ */

/* Loading state for sections */
.loading {
  position: relative;
  min-height: 200px;
}

.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 40px;
  height: 40px;
  border: 3px solid rgba(255, 255, 255, 0.2);
  border-top-color: var(--color-white);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

/* Error message styling */
.error-message {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-4);
  padding: var(--space-8);
  text-align: center;
  color: var(--color-gray-400);
}

.error-message p {
  color: var(--color-gray-400);
  font-size: var(--text-body-sm);
}

/* Skeleton loading animation */
.skeleton {
  background: linear-gradient(
    90deg,
    var(--color-dark-elevated) 25%,
    var(--color-dark-surface) 50%,
    var(--color-dark-elevated) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-md);
}

/* Content fade-in after load */
.content-loaded {
  animation: fadeIn 0.3s ease-out;
}

/* ============================================
   ACCESSIBILITY
   Focus states and reduced motion
   ============================================ */

/* ---------- FOCUS VISIBLE ---------- */
/* Custom focus outline for keyboard navigation */
:focus-visible {
  outline: 2px solid var(--color-white);
  outline-offset: 2px;
}

/* Remove default outline on focus for mouse users */
:focus:not(:focus-visible) {
  outline: none;
}

/* Button focus states */
.btn:focus-visible,
.nav-arrow:focus-visible,
button:focus-visible {
  outline: 2px solid var(--color-white);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.2);
}

/* Link focus states */
a:focus-visible {
  outline: 2px solid var(--color-white);
  outline-offset: 2px;
}

/* Form element focus states */
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 2px solid var(--color-white);
  outline-offset: 2px;
  border-color: var(--color-white);
}

/* Skip link styles */
.skip-link {
  position: absolute;
  top: -100%;
  left: var(--space-4);
  z-index: var(--z-tooltip);
  padding: var(--space-3) var(--space-6);
  background: var(--color-white);
  color: var(--color-black);
  font-family: var(--font-body);
  font-size: var(--text-body-sm);
  font-weight: var(--weight-medium);
  text-decoration: none;
  border-radius: var(--radius-md);
  transition: top var(--transition-fast);
}

.skip-link:focus {
  top: var(--space-4);
}

/* ---------- REDUCED MOTION ---------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .btn:hover,
  .nav-arrow:hover,
  a:hover {
    transform: none !important;
  }
}

/* ---------- HIGH CONTRAST MODE ---------- */
@media (prefers-contrast: high) {
  :root {
    --color-gray-200: #e5e5e5;
    --color-gray-300: #d4d4d4;
    --color-gray-400: #a3a3a3;
    --color-gray-500: #737373;
    --color-gray-600: #525252;
  }

  .btn,
  .nav-arrow {
    border-width: 2px;
  }

  a:focus-visible,
  button:focus-visible {
    outline-width: 3px;
  }
}
