html { scroll-behavior: smooth; }

/* Laptop: micșorăm scara ușor (redu că text/spacing par mari pe ecrane 15-16") */
@media (min-width: 1024px) {
  html { font-size: 14px; }
}

/* Hero homepage — crossfade lin; 4 slide-uri × 6s; zoom Ken Burns minim */
.hero-bg-img {
  transform: translateZ(0) scale(1.01);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  image-rendering: auto;
  will-change: opacity, transform;
}

.hero-carousel .hero-slide {
  opacity: 0;
  animation:
    heroCrossfade 24s cubic-bezier(0.4, 0, 0.2, 1) infinite,
    heroKenburns 24s ease-in-out infinite alternate;
}

/* Ciclu 24s: ~6s pe slide (fade in / hold / fade out), decalate cu animation-delay: 6s × index */
@keyframes heroCrossfade {
  0% {
    opacity: 0;
  }
  4% {
    opacity: 1;
  }
  22% {
    opacity: 1;
  }
  27% {
    opacity: 0;
  }
  100% {
    opacity: 0;
  }
}

@keyframes heroKenburns {
  from {
    transform: translateZ(0) scale(1.01);
  }
  to {
    transform: translateZ(0) scale(1.03);
  }
}

/* Brand header — logo + SECRETDOORS (font Syne), animație la încărcare */
.brand-logo-img {
  opacity: 0;
  animation: brandLogoReveal 1s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  transform-origin: left center;
}

@keyframes brandLogoReveal {
  0% {
    opacity: 0;
    transform: translateX(-18px) scale(0.94);
    filter: blur(6px);
  }
  100% {
    opacity: 1;
    transform: translateX(0) scale(1);
    filter: blur(0);
  }
}

.brand-wordmark-inner {
  font-family: 'Syne', system-ui, sans-serif;
  font-weight: 700;
  font-size: clamp(1.15rem, 3.2vw, 1.85rem);
  letter-spacing: 0.04em;
  color: #fafafa;
  opacity: 0;
  display: inline-block;
  animation: brandWordReveal 0.95s cubic-bezier(0.22, 1, 0.36, 1) 0.14s forwards;
}

@keyframes brandWordReveal {
  0% {
    opacity: 0;
    transform: translateY(14px);
    letter-spacing: 0.35em;
  }
  100% {
    opacity: 1;
    transform: translateY(0);
    letter-spacing: 0.04em;
  }
}

.brand-wordmark-inner .text-accent,
.brand-wordmark-inline .text-accent {
  background: linear-gradient(135deg, #d4b87c 0%, #c7a76a 45%, #a68b4a 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}

/* Același wordmark ca în header, pentru titluri în pagină (fără animația de încărcare cu opacity:0) */
.brand-wordmark-inline {
  font-family: 'Syne', system-ui, sans-serif;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #fafafa;
  display: inline-block;
}

.nav-reveal {
  opacity: 0;
  animation: navReveal 0.7s cubic-bezier(0.22, 1, 0.36, 1) 0.35s forwards;
}

/* Header menu — efect modern: gradient hover, underline fluid, glow subtil */
.nav-reveal a {
  position: relative;
  display: inline-block;
  color: #d4d4d8;
  transition:
    color 260ms ease,
    transform 260ms cubic-bezier(0.22, 1, 0.36, 1),
    text-shadow 260ms ease;
  will-change: transform, color;
}

.nav-reveal a::before {
  content: "";
  position: absolute;
  left: -0.18rem;
  right: -0.18rem;
  bottom: -0.42rem;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(199, 167, 106, 0.05), rgba(199, 167, 106, 0.95), rgba(199, 167, 106, 0.05));
  transform: scaleX(0.08);
  transform-origin: center;
  opacity: 0;
  transition: transform 320ms cubic-bezier(0.22, 1, 0.36, 1), opacity 220ms ease;
}

.nav-reveal a:hover,
.nav-reveal a:focus-visible {
  color: #f4efe2;
  transform: translateY(-1px);
  text-shadow:
    0 0 16px rgba(199, 167, 106, 0.24),
    0 0 6px rgba(199, 167, 106, 0.2);
}

.nav-reveal a:hover::before,
.nav-reveal a:focus-visible::before {
  transform: scaleX(1);
  opacity: 1;
}

.nav-reveal a:focus-visible {
  outline: none;
}

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

.main-site-enter {
  opacity: 0;
  animation: mainSiteReveal 0.85s cubic-bezier(0.22, 1, 0.36, 1) 0.18s forwards;
}

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

.animate-fadein { animation: fadeIn 1.1s ease-out; }
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.cursor-zoom-in {
  cursor: zoom-in;
}

/* Lightbox – animații intrare / ieșire */
.js-lightbox-overlay {
  opacity: 0;
  animation: lbBackdropIn 0.42s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  background: rgba(2, 6, 12, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

@keyframes lbBackdropIn {
  from {
    opacity: 0;
    backdrop-filter: blur(0px);
    -webkit-backdrop-filter: blur(0px);
  }
  to {
    opacity: 1;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
  }
}

.js-lightbox-inner {
  opacity: 0;
  transform: scale(0.88) translateY(1rem);
  filter: blur(4px);
  animation: lbImageIn 0.5s cubic-bezier(0.22, 1, 0.36, 1) 0.06s forwards;
  border-radius: 0.5rem;
  box-shadow:
    0 0 0 1px rgba(199, 167, 106, 0.12),
    0 25px 50px -12px rgba(0, 0, 0, 0.65);
}

@keyframes lbImageIn {
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
    filter: blur(0);
  }
}

.js-lightbox-img {
  display: block;
  max-height: 90vh;
  max-width: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
}

.js-lightbox-close {
  opacity: 0;
  transform: scale(0.85) rotate(-90deg);
  animation: lbBtnIn 0.4s cubic-bezier(0.22, 1, 0.36, 1) 0.2s forwards;
}

@keyframes lbBtnIn {
  to {
    opacity: 1;
    transform: scale(1) rotate(0deg);
  }
}

/* Închidere */
.js-lightbox-overlay.lb-closing {
  animation: lbBackdropOut 0.32s cubic-bezier(0.55, 0, 0.85, 0.4) forwards;
  pointer-events: none;
}

@keyframes lbBackdropOut {
  to {
    opacity: 0;
    backdrop-filter: blur(0);
    -webkit-backdrop-filter: blur(0);
  }
}

.js-lightbox-overlay.lb-closing .js-lightbox-inner {
  animation: lbImageOut 0.32s cubic-bezier(0.55, 0, 0.85, 0.4) forwards;
}

@keyframes lbImageOut {
  from {
    opacity: 1;
    transform: scale(1) translateY(0);
    filter: blur(0);
  }
  to {
    opacity: 0;
    transform: scale(0.9) translateY(0.75rem);
    filter: blur(3px);
  }
}

.js-lightbox-overlay.lb-closing .js-lightbox-close {
  animation: lbBtnOut 0.25s ease forwards;
}

@keyframes lbBtnOut {
  to {
    opacity: 0;
    transform: scale(0.9);
  }
}

@media (prefers-reduced-motion: reduce) {
  .js-lightbox-overlay,
  .js-lightbox-inner,
  .js-lightbox-close {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
  }

  .brand-logo-img,
  .brand-wordmark-inner,
  .nav-reveal,
  .main-site-enter {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
    letter-spacing: 0.04em !important;
  }

  .nav-reveal a,
  .nav-reveal a::before {
    animation: none !important;
    transition: none !important;
    transform: none !important;
    text-shadow: none !important;
  }

  .hero-bg-img {
    animation: none !important;
    transform: none !important;
  }

  .hero-carousel img.hero-slide {
    animation: none !important;
    opacity: 0 !important;
    transform: none !important;
  }

  .hero-carousel img.hero-slide:first-of-type {
    opacity: 1 !important;
  }
}

/* Proiecte recente — carusel imagini (CSS fallback) */
.project-carousel-anim {
  animation-name: projectCarouselFade;
  animation-duration: 15000ms; /* 5 poze x 3 sec */
  animation-timing-function: linear;
  animation-iteration-count: infinite;
  will-change: opacity;
}

@keyframes projectCarouselFade {
  0% {
    opacity: 1;
  }
  19.999% {
    opacity: 1;
  }
  20% {
    opacity: 0;
  }
  100% {
    opacity: 0;
  }
}
