/* ══════════════════════════════════════════════
   SIKO-MONT — Industrial Luxe Redesign
   ══════════════════════════════════════════════ */

/* === CSS Variables === */
:root {
  --accent: #E8580C;
  --accent-light: #FF6B1A;
  --surface: #161616;
  --dark: #0B0B0B;
  --cream: #F5F0E8;
  --ease-out-strong: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --transition-drawer: 0.32s;
}

/* === Base === */
* {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: 'Outfit', sans-serif;
  scroll-behavior: smooth;
}

::selection {
  background: var(--accent);
  color: #fff;
}

.material-icons {
  vertical-align: middle;
}

/* === Grain Texture Overlay === */
.grain {
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
}

.grain::after {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0.028;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 180px;
}

/* === Navigation === */
#navbar {
  background: transparent;
}

#navbar.scrolled {
  background: rgba(11, 11, 11, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

/* === Mobile Menu === */
#mobile-menu {
  position: fixed;
  top: 0;
  right: 0;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  background: rgba(11, 11, 11, 0.98);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 100;
  transform: translateX(100%);
  transition: transform var(--transition-drawer) var(--ease-out-expo);
  overflow-y: auto;
  pointer-events: none;
}

#mobile-menu.active {
  transform: translateX(0);
  pointer-events: auto;
}

.menu-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 99;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s var(--ease-out-strong),
    visibility 0.3s var(--ease-out-strong);
}

.menu-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* Mobile menu link stagger */
@keyframes menu-link-in {
  from {
    opacity: 0;
    transform: translateX(16px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

#mobile-menu.active .flex-1 > .mobile-menu-link {
  animation: menu-link-in 300ms var(--ease-out-expo) backwards;
}

#mobile-menu.active .flex-1 > .mobile-menu-link:nth-child(1) { animation-delay: 50ms; }
#mobile-menu.active .flex-1 > .mobile-menu-link:nth-child(2) { animation-delay: 100ms; }
#mobile-menu.active .flex-1 > .mobile-menu-link:nth-child(3) { animation-delay: 150ms; }
#mobile-menu.active .flex-1 > .mobile-menu-link:nth-child(4) { animation-delay: 200ms; }

#mobile-menu-close,
#mobile-menu-button {
  align-items: center;
  justify-content: center;
  transition: transform 160ms var(--ease-out-strong);
}

#mobile-menu-close:active,
#mobile-menu-button:active {
  transform: scale(0.93);
}

/* === Hero === */
.hero {
  background: var(--dark);
}

.hero-bg {
  opacity: 0;
}

.hero-accent-stripe {
  position: absolute;
  top: -10%;
  right: -5%;
  width: 40%;
  height: 120%;
  background: linear-gradient(160deg, var(--accent), var(--accent-light));
  transform: skewX(-8deg);
  opacity: 0;
  z-index: 1;
}

/* Hero animations */
@keyframes hero-bg-fade {
  from { opacity: 0; }
  to { opacity: 0.18; }
}

@keyframes hero-stripe-in {
  from {
    opacity: 0;
    transform: skewX(-8deg) translateX(40px);
  }
  to {
    opacity: 0.06;
    transform: skewX(-8deg) translateX(0);
  }
}

@keyframes hero-reveal-up {
  from {
    opacity: 0;
    transform: translateY(2rem);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes scroll-bounce {
  0%, 100% { transform: translateY(0); opacity: 1; }
  50% { transform: translateY(6px); opacity: 0.3; }
}

@media (prefers-reduced-motion: no-preference) {
  .hero-bg {
    animation: hero-bg-fade 1.4s var(--ease-out-expo) forwards;
  }

  .hero-accent-stripe {
    animation: hero-stripe-in 1.6s var(--ease-out-expo) 0.2s forwards;
  }

  .hero-reveal {
    opacity: 0;
    animation: hero-reveal-up 0.9s var(--ease-out-expo) forwards;
    animation-delay: 0.3s;
  }

  .hero-reveal--d1 { animation-delay: 0.45s; }
  .hero-reveal--d2 { animation-delay: 0.6s; }
  .hero-reveal--d3 { animation-delay: 0.75s; }

  .scroll-dot {
    animation: scroll-bounce 2s ease-in-out infinite;
    animation-delay: 2s;
  }
}

/* === Service Cards === */
.card-number {
  position: absolute;
  top: -8px;
  right: 4px;
  font-family: 'Big Shoulders Display', sans-serif;
  font-size: 5.5rem;
  font-weight: 900;
  line-height: 1;
  color: rgba(255, 255, 255, 0.025);
  user-select: none;
  pointer-events: none;
  transition: color 0.5s var(--ease-out-strong);
}

.service-card:hover .card-number {
  color: rgba(232, 88, 12, 0.06);
}

.card-accent-line {
  position: absolute;
  top: 0;
  left: 0;
  height: 3px;
  width: 32px;
  background: var(--accent);
  transition: width 0.5s var(--ease-out-expo);
  z-index: 10;
  border-radius: 0 0 2px 0;
}

.service-card:hover .card-accent-line {
  width: 100%;
}

@media (hover: hover) and (pointer: fine) {
  .service-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 24px 48px -12px rgba(232, 88, 12, 0.08);
  }
}

/* === Equipment Cards === */
.equipment-card {
  border: 1px solid rgba(255, 255, 255, 0.04);
  transition: border-color 0.4s var(--ease-out-strong);
}

.equipment-card:hover {
  border-color: rgba(232, 88, 12, 0.2);
}

/* === Stat Blocks === */
.stat-block {
  transition: transform 0.4s var(--ease-out-strong),
    border-color 0.4s var(--ease-out-strong);
}

@media (hover: hover) and (pointer: fine) {
  .stat-block:hover {
    transform: translateY(-4px);
    border-color: rgba(232, 88, 12, 0.15);
  }
}

/* === Scroll Reveal === */
.reveal {
  transition:
    opacity 0.7s var(--ease-out-expo),
    transform 0.7s var(--ease-out-expo);
}

@media (prefers-reduced-motion: no-preference) {
  html.js .reveal:not(.is-visible) {
    opacity: 0;
    transform: translateY(1.5rem);
  }

  /* Service card stagger */
  #sluzby .grid > .reveal:nth-child(1) { transition-delay: 0ms; }
  #sluzby .grid > .reveal:nth-child(2) { transition-delay: 60ms; }
  #sluzby .grid > .reveal:nth-child(3) { transition-delay: 120ms; }
  #sluzby .grid > .reveal:nth-child(4) { transition-delay: 180ms; }
  #sluzby .grid > .reveal:nth-child(5) { transition-delay: 240ms; }
  #sluzby .grid > .reveal:nth-child(6) { transition-delay: 300ms; }
  #sluzby .grid > .reveal:nth-child(7) { transition-delay: 360ms; }
  #sluzby .grid > .reveal:nth-child(8) { transition-delay: 420ms; }

  /* Equipment card stagger */
  #pujcovna .grid > .reveal:nth-child(1) { transition-delay: 0ms; }
  #pujcovna .grid > .reveal:nth-child(2) { transition-delay: 80ms; }
  #pujcovna .grid > .reveal:nth-child(3) { transition-delay: 160ms; }

  /* About section stagger */
  html.js #onas .grid > .reveal:nth-child(2) { transition-delay: 120ms; }

  /* Contact section stagger */
  html.js #kontakt .bg-surface > .reveal:nth-child(2) { transition-delay: 100ms; }

  /* Footer stagger */
  html.js footer .grid > .reveal:nth-child(2) { transition-delay: 60ms; }
  html.js footer .grid > .reveal:nth-child(3) { transition-delay: 120ms; }
}

/* === CTA Press Effect === */
@media (prefers-reduced-motion: no-preference) {
  .cta-press {
    transition:
      transform 160ms var(--ease-out-strong),
      background-color 0.3s,
      box-shadow 0.3s;
  }

  .cta-press:active {
    transform: scale(0.96);
  }
}

/* === Focus Styles === */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* === Image Optimization === */
img {
  content-visibility: auto;
}

/* === Reduced Motion === */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }

  #mobile-menu {
    transition-duration: 0.15s !important;
    transition-timing-function: ease !important;
  }

  .menu-overlay {
    transition-duration: 0.15s !important;
  }

  #mobile-menu.active .flex-1 > .mobile-menu-link {
    animation: none !important;
  }

  .hero-bg {
    opacity: 0.18 !important;
  }

  .hero-accent-stripe {
    opacity: 0.06 !important;
    transform: skewX(-8deg) !important;
  }

  .hero-reveal {
    opacity: 1 !important;
    transform: none !important;
  }

  .scroll-dot {
    animation: none !important;
  }

  .reveal {
    opacity: 1 !important;
    transform: none !important;
    transition-delay: 0ms !important;
  }
}
