/*
 * TEMA Digital - Main Stylesheet
 * Minimal, performance-first CSS
 */

/* ============================================
   CSS Variables (Design Tokens)
   ============================================ */
:root {
  /* Colors - Professional Dark Mode */
  --color-primary: #24708E;
  --color-secondary: #44A495;
  --color-accent: #9FD5D6;
  --color-background: #191919;
  --color-surface: #1F1F1F;
  --color-surface-elevated: #252525;
  --color-white: #FFFFFF;
  --color-text-primary: #FFFFFF;
  --color-text-secondary: #B4B4B4;
  --color-text-muted: #6B6B6B;
  --color-border: #2A2A2A;
  --color-overlay: rgba(0, 0, 0, 0.95);
  
  /* Typography */
  --font-primary: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.5rem;
  --text-3xl: 1.875rem;
  --text-4xl: 2.25rem;
  --text-5xl: 3rem;
  --text-6xl: 3.75rem;
  --leading-tight: 1.25;
  --leading-normal: 1.5;
  --leading-relaxed: 1.75;
  --font-normal: 400;
  --font-medium: 500;
  --font-semibold: 600;
  --font-bold: 700;
  
  /* Spacing */
  --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;
  
  /* Layout */
  --container-max: 1200px;
  --container-padding: var(--space-6);
  --section-padding-y: var(--space-20);
  --section-padding-y-sm: var(--space-12);
  
  /* Border Radius */
  --radius-sm: 0.25rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  
  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  
  /* Transitions */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================
   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;
}

body {
  font-family: var(--font-primary);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  color: var(--color-text-primary);
  background-color: var(--color-background);
}

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

a {
  color: inherit;
  text-decoration: none;
}

/* ============================================
   Layout Utilities
   ============================================ */
.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--container-padding);
}

.section__title {
  font-size: var(--text-4xl);
  font-weight: var(--font-bold);
  text-align: center;
  margin-bottom: var(--space-12);
  color: var(--color-text-primary);
}

/* ============================================
   Buttons
   ============================================ */
.btn {
  display: inline-block;
  padding: var(--space-4) var(--space-8);
  border-radius: var(--radius-md);
  font-weight: var(--font-semibold);
  font-size: var(--text-base);
  text-align: center;
  cursor: pointer;
  transition: all var(--transition-base);
  border: none;
  text-decoration: none;
}

.btn--primary {
  background: var(--color-primary);
  color: var(--color-white);
  box-shadow: 0 0 20px rgba(36, 112, 142, 0.3);
}

.btn--primary:hover {
  background: #1d5a72;
  box-shadow: 0 0 30px rgba(36, 112, 142, 0.5), 0 4px 12px rgba(0, 0, 0, 0.3);
  transform: translateY(-2px);
}

.btn--secondary {
  background: transparent;
  color: var(--color-primary);
  border: 2px solid var(--color-primary);
  padding: calc(var(--space-4) - 2px) calc(var(--space-8) - 2px);
}

.btn--secondary:hover {
  background: var(--color-primary);
  color: var(--color-white);
}

.btn--large {
  padding: var(--space-5) var(--space-12);
  font-size: var(--text-lg);
}

/* ============================================
   Header Section
   ============================================ */
.site-header {
  background: var(--color-background);
  padding: var(--space-6) 0;
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  z-index: 1000;
  backdrop-filter: blur(10px);
  background: rgba(25, 25, 25, 0.95);
}

.site-header .container {
  display: flex;
  justify-content: center;
  align-items: center;
}

.site-logo {
  max-width: 200px;
  height: auto;
  display: block;
}

.site-logo img {
  width: 100%;
  height: auto;
}

/* ============================================
   Hero Section
   ============================================ */
.hero {
  color: var(--color-white);
  padding: var(--space-32) 0;
  min-height: 100vh;
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
  background: var(--color-background);
}

/* Video Background Placeholder with Animation */
.hero__video-placeholder {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(36, 112, 142, 0.2) 0%, rgba(68, 164, 149, 0.15) 100%), var(--color-background);
  z-index: 0;
  animation: pulse 3s ease-in-out infinite;
}

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

/* Video Background */
.hero__video {
  position: absolute;
  top: 50%;
  left: 50%;
  min-width: 100%;
  min-height: 100%;
  width: auto;
  height: auto;
  transform: translate(-50%, -50%);
  z-index: 1;
  object-fit: cover;
  opacity: 0;
  transition: opacity 1s ease-in-out;
}

.hero__video.loaded {
  opacity: 1;
}

.hero__video.loaded ~ .hero__video-placeholder {
  opacity: 0;
  transition: opacity 1s ease-in-out;
}

/* Dark Overlay */
.hero__overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  z-index: 2;
  pointer-events: none;
}

.hero__content {
  max-width: 800px;
  margin: 0 auto;
  text-align: center;
  position: relative;
  z-index: 3;
}

.hero__headline {
  font-size: var(--text-6xl);
  font-weight: var(--font-bold);
  line-height: var(--leading-tight);
  margin-bottom: var(--space-6);
  position: relative;
  cursor: default;
}

.hero__headline-wrapper {
  display: inline-block;
}

.hero__headline .char {
  display: inline-block;
  position: relative;
  transition: all 0.9s cubic-bezier(0.23, 1, 0.32, 1);
  transform-origin: center bottom;
  opacity: 0.88;
  filter: blur(0.2px);
  transform-style: preserve-3d;
}

/* Complex hover - reveals hidden dimension */
.hero__headline .char:hover {
  color: transparent;
  background: linear-gradient(135deg, var(--color-accent) 0%, var(--color-primary) 50%, var(--color-secondary) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  transform: translateY(-3px) rotateX(15deg) scale(1.08);
  text-shadow: 0 5px 25px rgba(159, 213, 214, 0.6), 0 -2px 15px rgba(36, 112, 142, 0.4);
  opacity: 1;
  filter: blur(0px) brightness(1.2);
  transition: all 0.7s cubic-bezier(0.23, 1, 0.32, 1);
}

/* Quantum wave pattern - appears on headline hover */
.hero__headline:hover .char {
  animation: quantumWave 4.5s ease-in-out infinite;
  animation-delay: calc(var(--char-index) * 0.12s);
}

@keyframes quantumWave {
  0%, 100% {
    opacity: 0.88;
    filter: blur(0.2px) hue-rotate(0deg);
    transform: translateY(0) rotateZ(0deg);
  }
  25% {
    opacity: 0.95;
    filter: blur(0.4px) hue-rotate(5deg);
    transform: translateY(-1px) rotateZ(1deg);
  }
  50% {
    opacity: 1;
    filter: blur(0.1px) hue-rotate(10deg);
    transform: translateY(-2px) rotateZ(-1deg);
  }
  75% {
    opacity: 0.92;
    filter: blur(0.3px) hue-rotate(5deg);
    transform: translateY(-1px) rotateZ(0.5deg);
  }
}

/* Hidden layer - reveals on hover with delay */
.hero__headline .char::before {
  content: attr(data-char);
  position: absolute;
  top: 0;
  left: 0;
  color: var(--color-accent);
  opacity: 0;
  transform: translate(-2px, -2px) scale(0.95);
  filter: blur(1px);
  transition: all 1.2s cubic-bezier(0.23, 1, 0.32, 1);
  pointer-events: none;
  z-index: -1;
}

.hero__headline .char:hover::before {
  opacity: 0.4;
  transform: translate(-4px, -4px) scale(1);
  filter: blur(2px);
}

/* Shadow dimension */
.hero__headline .char::after {
  content: attr(data-char);
  position: absolute;
  top: 0;
  left: 0;
  color: var(--color-primary);
  opacity: 0;
  transform: translate(2px, 2px) scale(0.95);
  filter: blur(1px);
  transition: all 1.2s cubic-bezier(0.23, 1, 0.32, 1);
  pointer-events: none;
  z-index: -1;
}

.hero__headline .char:hover::after {
  opacity: 0.3;
  transform: translate(4px, 4px) scale(1);
  filter: blur(2px);
}

/* Active - reality shift */
.hero__headline .char:active {
  transform: scale(0.92) rotateY(180deg);
  color: var(--color-secondary);
  text-shadow: 0 0 40px rgba(68, 164, 149, 0.8);
  filter: brightness(1.5);
}

.hero__subhead {
  font-size: var(--text-xl);
  line-height: var(--leading-relaxed);
  margin-bottom: var(--space-10);
  opacity: 0.95;
}

.hero__cta {
  display: flex;
  gap: var(--space-4);
  justify-content: center;
  flex-wrap: wrap;
}

.hero__cta .btn--secondary {
  border-color: var(--color-white);
  color: var(--color-white);
}

.hero__cta .btn--secondary:hover {
  background: var(--color-white);
  color: var(--color-primary);
}

/* ============================================
   Trust Bar
   ============================================ */
.trust {
  background: var(--color-surface);
  padding: var(--space-8) 0;
  text-align: center;
  border-bottom: 1px solid var(--color-border);
}

.trust__text {
  font-size: var(--text-lg);
  color: var(--color-text-secondary);
  font-weight: var(--font-medium);
}

/* ============================================
   Services Section
   ============================================ */
.services {
  padding: var(--section-padding-y) 0;
  background: var(--color-background);
}

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

.service-card {
  padding: var(--space-8);
  background: var(--color-surface-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  transition: all var(--transition-base);
}

.service-card:hover {
  box-shadow: 0 10px 30px rgba(68, 164, 149, 0.2);
  transform: translateY(-4px);
  border-color: var(--color-accent);
  background: var(--color-surface);
}

.service-card__icon {
  color: var(--color-accent);
  margin-bottom: var(--space-4);
  filter: drop-shadow(0 0 8px rgba(159, 213, 214, 0.4));
}

.service-card__title {
  font-size: var(--text-xl);
  font-weight: var(--font-semibold);
  margin-bottom: var(--space-3);
  color: var(--color-text-primary);
}

.service-card__desc {
  font-size: var(--text-base);
  line-height: var(--leading-relaxed);
  color: var(--color-text-secondary);
}

/* ============================================
   Process Section
   ============================================ */
.process {
  padding: var(--section-padding-y) 0;
  background: var(--color-surface);
}

.process__steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: var(--space-10);
}

.process-step {
  text-align: center;
  position: relative;
}

.process-step__number {
  font-size: var(--text-5xl);
  font-weight: var(--font-bold);
  color: var(--color-accent);
  margin-bottom: var(--space-4);
  opacity: 0.6;
}

.process-step__title {
  font-size: var(--text-2xl);
  font-weight: var(--font-semibold);
  margin-bottom: var(--space-3);
  color: var(--color-text-primary);
}

.process-step__desc {
  font-size: var(--text-base);
  line-height: var(--leading-relaxed);
  color: var(--color-text-secondary);
}

/* ============================================
   Industries Section
   ============================================ */
.industries {
  padding: var(--section-padding-y) 0;
  background: var(--color-background);
}

.industries__list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  justify-content: center;
  max-width: 900px;
  margin: 0 auto;
}

.industry-tag {
  padding: var(--space-3) var(--space-6);
  background: var(--color-surface-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: var(--text-base);
  font-weight: var(--font-medium);
  color: var(--color-text-primary);
  transition: all var(--transition-base);
}

.industry-tag:hover {
  background: var(--color-primary);
  color: var(--color-white);
  border-color: var(--color-primary);
}

/* ============================================
   Case Studies & Testimonials (Placeholder)
   ============================================ */
.case-studies,
.testimonials {
  padding: var(--section-padding-y) 0;
  background: var(--color-surface);
}

.testimonials {
  background: var(--color-background);
}

.placeholder {
  text-align: center;
  padding: var(--space-16) var(--space-8);
  background: var(--color-surface-elevated);
  border: 2px dashed var(--color-border);
  border-radius: var(--radius-lg);
}

.placeholder__text {
  font-size: var(--text-2xl);
  font-weight: var(--font-semibold);
  color: var(--color-text-muted);
  margin-bottom: var(--space-2);
}

.placeholder__note {
  font-size: var(--text-base);
  color: var(--color-text-secondary);
}

/* ============================================
   FAQ Section
   ============================================ */
.faq {
  padding: var(--section-padding-y) 0;
  background: var(--color-surface);
}

.faq__list {
  max-width: 800px;
  margin: 0 auto;
}

.faq-item {
  margin-bottom: var(--space-8);
  padding-bottom: var(--space-8);
  border-bottom: 1px solid var(--color-border);
}

.faq-item:last-child {
  border-bottom: none;
}

.faq-item__question {
  font-size: var(--text-xl);
  font-weight: var(--font-semibold);
  margin-bottom: var(--space-3);
  color: var(--color-text-primary);
}

.faq-item__answer {
  font-size: var(--text-base);
  line-height: var(--leading-relaxed);
  color: var(--color-text-secondary);
}

/* ============================================
   Final CTA Section
   ============================================ */
.cta-final {
  padding: var(--space-24) 0;
  background: linear-gradient(135deg, rgba(36, 112, 142, 0.2) 0%, rgba(68, 164, 149, 0.15) 100%), var(--color-surface-elevated);
  color: var(--color-white);
  text-align: center;
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
  position: relative;
}

.cta-final::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(circle at center, rgba(68, 164, 149, 0.1) 0%, transparent 70%);
  pointer-events: none;
}

.cta-final__headline {
  font-size: var(--text-5xl);
  font-weight: var(--font-bold);
  margin-bottom: var(--space-4);
  position: relative;
  z-index: 1;
}

.cta-final__subtext {
  font-size: var(--text-xl);
  margin-bottom: var(--space-10);
  opacity: 0.95;
  position: relative;
  z-index: 1;
}

.cta-final .btn--primary {
  background: var(--color-primary);
  color: var(--color-white);
  position: relative;
  z-index: 1;
}

.cta-final .btn--primary:hover {
  background: var(--color-secondary);
  transform: translateY(-2px);
  box-shadow: 0 0 35px rgba(68, 164, 149, 0.6);
}

/* ============================================
   Footer
   ============================================ */
.footer {
  background: var(--color-surface-elevated);
  color: var(--color-white);
  padding: var(--space-16) 0 var(--space-8);
  border-top: 1px solid var(--color-border);
}

.footer__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-10);
  margin-bottom: var(--space-10);
}

.footer__brand strong {
  font-size: var(--text-2xl);
  font-weight: var(--font-bold);
}

.footer__logo {
  max-width: 200px;
  height: auto;
  display: block;
  margin-bottom: var(--space-3);
}

.footer__tagline {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin-top: var(--space-2);
}

.footer__links h4,
.footer__contact h4 {
  font-size: var(--text-lg);
  font-weight: var(--font-semibold);
  margin-bottom: var(--space-4);
}

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

.footer__links a {
  color: var(--color-text-muted);
  transition: color var(--transition-base);
}

.footer__links a:hover {
  color: var(--color-white);
}

.footer__contact p {
  margin-bottom: var(--space-2);
  color: var(--color-text-muted);
}

.footer__contact-item {
  display: flex;
  align-items: flex-start;
  margin-bottom: var(--space-3);
  line-height: var(--leading-relaxed);
}

.footer__contact-item svg {
  flex-shrink: 0;
  margin-top: 2px;
  color: var(--color-accent);
}

.footer__contact a {
  color: var(--color-accent);
  transition: color var(--transition-base);
}

.footer__contact a:hover {
  color: var(--color-white);
}

.footer__bottom {
  text-align: center;
  padding-top: var(--space-8);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--color-text-muted);
  font-size: var(--text-sm);
}

/* ============================================
   Animation Classes
   ============================================ */
.fade-in {
  opacity: 0;
  animation: fadeIn var(--transition-slow) forwards;
}

.fade-in.delay-1 {
  animation-delay: 200ms;
}

.fade-in.delay-2 {
  animation-delay: 400ms;
}

.reveal {
  opacity: 0;
  transform: translateY(20px);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
  transition: opacity var(--transition-slow), transform var(--transition-slow);
}

@keyframes fadeIn {
  to {
    opacity: 1;
  }
}

/* ============================================
   Responsive Design
   ============================================ */
@media (max-width: 768px) {
  :root {
    --section-padding-y: var(--section-padding-y-sm);
  }
  
  .site-header {
    padding: var(--space-4) 0;
  }
  
  .site-logo {
    max-width: 150px;
  }
  
  .hero {
    padding: var(--space-20) 0;
    min-height: auto;
  }
  
  .hero__video {
    /* Optimize video for mobile */
    min-width: 100%;
    width: 100%;
    height: 100%;
  }
  
  .hero__overlay {
    /* Darker overlay on mobile for better text readability */
    background: rgba(0, 0, 0, 0.7);
  }
  
  .hero__headline {
    font-size: var(--text-4xl);
  }
  
  /* Disable complex animations on mobile for performance */
  .hero__headline .char:hover::before {
    display: none;
  }
  
  .hero__headline:hover .char {
    animation: none;
  }
  
  /* Simpler mobile interaction */
  .hero__headline .char:active {
    transform: scale(0.95);
  }
  
  .hero__subhead {
    font-size: var(--text-lg);
  }
  
  .hero__cta {
    flex-direction: column;
  }
  
  .section__title {
    font-size: var(--text-3xl);
  }
  
  .services__grid {
    grid-template-columns: 1fr;
  }
  
  .process__steps {
    grid-template-columns: 1fr;
  }
  
  .cta-final__headline {
    font-size: var(--text-3xl);
  }
  
  .footer__grid {
    grid-template-columns: 1fr;
    text-align: center;
  }
  
  .footer__logo {
    max-width: 150px;
    margin-left: auto;
    margin-right: auto;
  }
  
  .footer__links nav {
    align-items: center;
  }
}

/* ============================================
   Accessibility & Motion Preferences
   ============================================ */
@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;
  }
}

/* Focus styles for keyboard navigation */
a:focus-visible,
button:focus-visible,
.btn:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

/* Print styles */
@media print {
  .hero,
  .cta-final,
  .footer {
    background: none !important;
    color: black !important;
  }
  
  .btn {
    border: 1px solid black;
  }
}
