/* ============================================================
   El Caral — custom styles (ported from src/index.css)
   Tailwind utilities come from the CDN in index.html.
   This file holds the bits Tailwind can't express + a few
   helpers that replace the old React/motion stateful styling.
   ============================================================ */

/* Base resets & custom scrollbar */
html {
  font-family: "Montserrat", sans-serif;
  background-color: #F5F0E8;
  color: #1A1A18;
  overflow-x: hidden;
  scroll-behavior: smooth;
}

::selection {
  background: #D4622A;
  color: #F5F0E8;
}

::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: #F5F0E8;
}
::-webkit-scrollbar-thumb {
  background: rgba(212, 98, 42, 0.3);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #D4622A;
}

/* Custom visual signatures */
.liquid-glass-light {
  background-color: rgba(245, 240, 232, 0.4);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 0.5px solid rgba(26, 26, 24, 0.08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4), 0 12px 32px rgba(26, 26, 24, 0.03);
}

.liquid-glass-dark {
  background-color: rgba(26, 26, 24, 0.5);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 0.5px solid rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15), 0 16px 48px rgba(0, 0, 0, 0.4);
}

/* SVG noise pattern overlay */
.noise-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  content: "";
  opacity: 0.045;
  pointer-events: none;
  z-index: 100;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

/* Sepia - Peruvian Photography tint treatment */
.photography-tint {
  position: relative;
  overflow: hidden;
}
.photography-tint::after {
  content: "";
  position: absolute;
  inset: 0;
  background-color: #D4A574;
  mix-blend-mode: multiply;
  opacity: 0.45;
  pointer-events: none;
}
.photography-tint:hover::after {
  opacity: 0.25;
  transition: opacity 0.5s cubic-bezier(0.76, 0, 0.24, 1);
}

/* Custom polygon cuts (diagonal separators) */
.clip-diagonal-down {
  clip-path: polygon(0 4vw, 100% 0, 100% 100%, 0 100%);
}
.clip-diagonal-up {
  clip-path: polygon(0 100%, 100% 100%, 100% 4vw, 0 0);
}
.clip-diagonal-both {
  clip-path: polygon(0 4vw, 100% 0, 100% calc(100% - 4vw), 0 100%);
}

/* Sharp focus glow on inputs */
.input-focus-glow:focus {
  outline: none;
  border-color: #D4622A;
  box-shadow: 0 0 0 4px rgba(212, 98, 42, 0.18);
  transition: all 0.3s cubic-bezier(0.76, 0, 0.24, 1);
}

/* Marquee animation (mapped to .animate-marquee via tailwind config too) */
@keyframes marquee {
  0% { transform: translateX(0%); }
  100% { transform: translateX(-50%); }
}
.animate-marquee {
  animation: marquee 25s linear infinite;
}

/* Reveal-up helper */
@keyframes revealUp {
  to { opacity: 1; transform: translateY(0); }
}
.slide-up-char {
  display: inline-block;
  opacity: 0;
  transform: translateY(30px);
  animation: revealUp 0.8s cubic-bezier(0.76, 0, 0.24, 1) forwards;
}

/* ============================================================
   Replacements for React/motion stateful behaviour
   ============================================================ */

/* Liquid page transition (replaces AnimatePresence page variants) */
@keyframes pageIn {
  from { opacity: 0; filter: blur(10px) saturate(50%); transform: translateY(20px); }
  to   { opacity: 1; filter: blur(0) saturate(100%);   transform: translateY(0); }
}
.page-animate-in {
  animation: pageIn 0.7s cubic-bezier(0.76, 0, 0.24, 1);
}

/* Intro loader fade-out */
#intro-loader {
  transition: opacity 0.6s cubic-bezier(0.76, 0, 0.24, 1);
}
#intro-loader.is-hidden {
  opacity: 0;
  pointer-events: none;
}

/* Intro loader SVG draw-in animations (replaces motion on circle/text) */
@keyframes drawCircle {
  from { stroke-dasharray: 0 200; opacity: 0; }
  to   { stroke-dasharray: 188 188; opacity: 1; }
}
@keyframes popDot {
  from { transform: scale(0); }
  to   { transform: scale(1); }
}
@keyframes drawText {
  from { stroke-dasharray: 0 500; stroke-dashoffset: 500; }
  to   { stroke-dasharray: 500 0; stroke-dashoffset: 0; }
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 0.8; transform: translateY(0); }
}
#intro-loader .il-circle { animation: drawCircle 1.2s ease-in-out forwards; }
#intro-loader .il-dot { transform-box: fill-box; transform-origin: center; animation: popDot 0.5s ease 0.8s both; }
#intro-loader .il-text { animation: drawText 1.4s cubic-bezier(0.76,0,0.24,1) forwards; }
#intro-loader .il-signet { animation: fadeUp 0.4s ease 1s both; }
#intro-loader .il-sub { opacity: 0; animation: fadeUp 1s ease 0.4s forwards; }

/* Intro loader logo entrance (replaces the SVG draw-in) */
@keyframes logoIn {
  from { opacity: 0; transform: scale(0.94) translateY(8px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
#intro-loader .il-logo { animation: logoIn 0.9s cubic-bezier(0.76,0,0.24,1) both; }

/* Mobile-menu staggered link entrance */
@keyframes menuLinkIn {
  from { opacity: 0; transform: translateY(15px); }
  to   { opacity: 1; transform: translateY(0); }
}
#mobile-navigation:not(.hidden) .m-link {
  opacity: 0;
  animation: menuLinkIn 0.4s ease forwards;
}

/* Back-to-top entrance */
@keyframes bttIn {
  from { opacity: 0; transform: translateY(20px) scale(0.8); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
#back-to-top:not(.hidden) {
  animation: bttIn 0.4s cubic-bezier(0.76, 0, 0.24, 1);
}

/* Navbar state (replaces isScrolled conditional Tailwind classes) */
#main-navigation {
  background-color: transparent;
  border-bottom: 1px solid transparent;
  color: #fff;
}
#main-navigation.nav-scrolled {
  background-color: rgba(245, 240, 232, 0.75);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border-bottom: 1px solid rgba(26, 26, 24, 0.05);
  color: #1A1A18;
}

/* Desktop nav links color states */
.nav-link {
  color: rgba(255, 255, 255, 0.7);
  transition: color 0.3s;
}
.nav-link:hover { color: #fff; }
#main-navigation.nav-scrolled .nav-link { color: rgba(26, 26, 24, 0.7); }
#main-navigation.nav-scrolled .nav-link:hover { color: #1A1A18; }
.nav-link.active { color: #D4622A; font-weight: 500; }

/* active orange dot under desktop link */
.nav-dot { display: none; }
.nav-link.active .nav-dot { display: block; }

/* mobile toggle color states */
#mobile-toggle { color: #fff; }
#main-navigation.nav-scrolled #mobile-toggle,
body.menu-open #mobile-toggle { color: #1A1A18; }
#mobile-toggle:hover { color: #D4622A; }

/* Dish card hover (replaces motion 3D tilt — simplified to a clean lift) */
.dish-card {
  transition: transform 0.4s cubic-bezier(0.76, 0, 0.24, 1), box-shadow 0.4s;
}
.dish-card:hover {
  transform: translateY(-6px) scale(1.02);
}
.dish-card .dish-overlay {
  transform: translateY(100%);
  opacity: 0;
  transition: all 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}
.dish-card:hover .dish-overlay {
  transform: translateY(0);
  opacity: 1;
}

/* prevent body scroll when mobile menu open */
body.menu-open { overflow: hidden; }

/* ============================================================
   Mobile safety net — no horizontal overflow / offset, and
   guaranteed hero centering below the lg breakpoint.
   ============================================================ */
body { overflow-x: hidden; }
#main-content-flow,
.page-section { max-width: 100%; }

@media (max-width: 1023px) {
  /* Hero branding column: always centered on mobile/tablet */
  section[data-page="inicio"] .hero-branding {
    align-items: center;
    text-align: center;
  }
  section[data-page="inicio"] .hero-branding > * {
    margin-left: auto;
    margin-right: auto;
  }
}
