/* =============================================
   EMANUTREK — Editorial Dark Warm
   ============================================= */

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:        #08080e;
  --bg-2:      #0e0e18;
  --surface:   #131320;
  --surface-2: #1a1a2a;
  --border:    rgba(255, 255, 255, 0.07);
  --gold:      #c8a05a;
  --gold-dim:  rgba(200, 160, 90, 0.15);
  --gold-glow: rgba(200, 160, 90, 0.08);
  --ice:       #8ab4c8;
  --text:      #e8e4dc;
  --text-dim:  #9a968e;
  --text-faint:#4a4840;
  --radius:    3px;
  --ease:      cubic-bezier(0.16, 1, 0.3, 1);
}

html { scroll-behavior: smooth; font-size: 16px; }

body {
  background-color: var(--bg);
  color: var(--text);
  font-family: 'Inter', system-ui, sans-serif;
  font-weight: 400;
  line-height: 1.7;
  overflow-x: hidden;
  cursor: none;
}

img { display: block; width: 100%; height: 100%; object-fit: cover; }
a { text-decoration: none; color: inherit; }
button { background: none; border: none; cursor: none; font: inherit; }

/* --- Custom cursor --- */
.cursor {
  position: fixed;
  width: 10px;
  height: 10px;
  background: var(--gold);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
  transition: width 0.25s var(--ease), height 0.25s var(--ease), opacity 0.25s;
  opacity: 0;
  mix-blend-mode: screen;
}
.cursor.hover {
  width: 40px;
  height: 40px;
  background: rgba(200, 160, 90, 0.2);
  border: 1px solid var(--gold);
}

/* --- Grain overlay --- */
.grain {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
  background-size: 200px 200px;
  opacity: 0.035;
  pointer-events: none;
  z-index: 8000;
  mix-blend-mode: overlay;
}

/* =============================================
   SCROLL REVEAL
   ============================================= */
.reveal {
  opacity: 0;
  transform: translateY(36px);
  transition: opacity 0.85s var(--ease), transform 0.85s var(--ease);
}
/* Defensive: if JS fails or data-split conflict, still show content */
.reveal[data-split] { opacity: 1; transform: none; }

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}
.reveal.delay-1 { transition-delay: 0.1s; }
.reveal.delay-2 { transition-delay: 0.2s; }
.reveal.delay-3 { transition-delay: 0.3s; }

/* =============================================
   TYPOGRAPHY
   ============================================= */
.section-label {
  font-family: 'Inter', sans-serif;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 1rem;
}

.section-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(2.8rem, 6vw, 5rem);
  line-height: 0.95;
  letter-spacing: 0.02em;
  color: var(--text);
  margin-bottom: 1.5rem;
}

.section-sub {
  font-size: 1rem;
  color: var(--text-dim);
  max-width: 48ch;
  margin-top: 0.5rem;
}

.section-header {
  margin-bottom: clamp(3rem, 6vw, 5rem);
}

/* =============================================
   LAYOUT
   ============================================= */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 clamp(1.5rem, 5vw, 4rem);
}

/* =============================================
   NAV
   ============================================= */
#nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem clamp(1.5rem, 5vw, 4rem);
  transition: background 0.5s var(--ease), padding 0.4s var(--ease), backdrop-filter 0.5s;
}

#nav.scrolled {
  background: rgba(8, 8, 14, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  padding-top: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.nav-brand {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.4rem;
  letter-spacing: 0.08em;
  color: var(--text);
  transition: color 0.3s;
}
.nav-brand span { color: var(--gold); }
.nav-brand:hover { color: var(--gold); }

.nav-links {
  display: flex;
  gap: 2.5rem;
}
.nav-links a {
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
  transition: color 0.3s;
  position: relative;
}
.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -3px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--gold);
  transition: width 0.35s var(--ease);
}
.nav-links a:hover { color: var(--text); }
.nav-links a:hover::after { width: 100%; }

/* Hamburger */
.menu-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  width: 28px;
  padding: 4px;
}
.menu-toggle span {
  display: block;
  height: 1.5px;
  background: var(--text);
  transition: transform 0.35s var(--ease), opacity 0.25s;
  transform-origin: center;
}
.menu-toggle.open span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.menu-toggle.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.menu-toggle.open span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* Mobile menu */
.mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 900;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2.5rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s var(--ease);
}
.mobile-menu.open {
  opacity: 1;
  pointer-events: auto;
}
.mobile-menu a {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 3.5rem;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  transition: color 0.3s;
}
.mobile-menu a:hover { color: var(--gold); }

/* =============================================
   HERO
   ============================================= */
#hero {
  position: relative;
  height: 100svh;
  min-height: 600px;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: -10%;
  background-color: var(--bg-2);
  background-size: cover;
  background-position: center top;
  will-change: transform;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(8, 8, 14, 0.98) 0%,
    rgba(8, 8, 14, 0.55) 40%,
    rgba(8, 8, 14, 0.2) 70%,
    rgba(8, 8, 14, 0.35) 100%
  );
}

.hero-content {
  position: relative;
  z-index: 2;
  padding: clamp(3rem, 8vw, 6rem) clamp(1.5rem, 5vw, 4rem);
  padding-bottom: clamp(4rem, 10vw, 7rem);
  max-width: 900px;
}

.hero-label {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 1.2rem;
  opacity: 0;
  animation: fadeUp 0.9s var(--ease) 0.3s forwards;
}

.hero-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(6rem, 17vw, 15rem);
  line-height: 0.88;
  letter-spacing: 0.02em;
  color: var(--text);
  display: flex;
  flex-direction: column;
  margin-bottom: 1.8rem;
}

.hero-line {
  opacity: 0;
  transform: translateY(60px);
  animation: heroLineUp 1.1s var(--ease) forwards;
  display: block;
}
.hero-line.hl2 {
  animation-delay: 0.18s;
  color: var(--gold);
}

.hero-tagline {
  font-size: clamp(1rem, 2vw, 1.2rem);
  font-weight: 300;
  color: rgba(232, 228, 220, 0.7);
  line-height: 1.6;
  margin-bottom: 2.5rem;
  opacity: 0;
  animation: fadeUp 0.9s var(--ease) 0.55s forwards;
}

.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text);
  border: 1px solid rgba(232, 228, 220, 0.25);
  padding: 0.85rem 2rem;
  border-radius: var(--radius);
  transition: border-color 0.35s, color 0.35s, background 0.35s;
  opacity: 0;
  animation: fadeUp 0.9s var(--ease) 0.7s forwards;
}
.hero-cta:hover {
  border-color: var(--gold);
  color: var(--gold);
  background: var(--gold-glow);
}

/* Scroll indicator */
.scroll-indicator {
  position: absolute;
  bottom: 2rem;
  right: clamp(1.5rem, 5vw, 4rem);
  z-index: 2;
  color: rgba(232, 228, 220, 0.35);
  opacity: 0;
  animation: fadeIn 1s var(--ease) 1.2s forwards;
  transition: color 0.3s, opacity 0.5s;
}
.scroll-indicator:hover { color: var(--gold); }
.scroll-indicator svg {
  animation: bounce 2.2s ease-in-out infinite;
}

/* =============================================
   SOBRE MÍ
   ============================================= */
#sobre-mi {
  padding: clamp(5rem, 12vw, 10rem) 0;
  background: var(--bg);
}

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(3rem, 6vw, 6rem);
  align-items: center;
}

.about-image-wrap {
  position: relative;
  aspect-ratio: 3/4;
  max-height: 680px;
}

.about-img-inner {
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-radius: var(--radius);
}

.about-img-inner img {
  transition: transform 0.9s var(--ease);
}
.about-img-inner:hover img { transform: scale(1.04); }

.about-badge {
  position: absolute;
  bottom: -1.5rem;
  right: -1.5rem;
  background: var(--gold);
  color: var(--bg);
  padding: 1rem 1.4rem;
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}
.badge-line {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  line-height: 1.4;
}
.badge-line:first-child { font-size: 0.8rem; }

.about-body {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  color: var(--text-dim);
  font-size: 1.05rem;
  margin-bottom: 2.5rem;
}
.about-body p { color: var(--text-dim); }

.about-stats {
  display: flex;
  gap: 2.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.stat { display: flex; flex-direction: column; gap: 0.25rem; }
.stat-number {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 2rem;
  letter-spacing: 0.04em;
  color: var(--gold);
  line-height: 1;
}
.stat-label {
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-faint);
}

/* =============================================
   TEMAS / MUNDO
   ============================================= */
#mundo {
  padding: clamp(5rem, 12vw, 10rem) 0;
  background: var(--bg-2);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.topics-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.topic-card {
  background: var(--bg-2);
  padding: clamp(2rem, 4vw, 3.5rem);
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  transition: background 0.4s var(--ease);
  cursor: default;
}
.topic-card:hover { background: var(--surface); }

.topic-icon {
  width: 44px;
  height: 44px;
  color: var(--gold);
  transition: transform 0.4s var(--ease);
}
.topic-card:hover .topic-icon { transform: translateY(-4px); }

.topic-card h3 {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.8rem;
  letter-spacing: 0.04em;
  color: var(--text);
}

.topic-card p {
  font-size: 0.95rem;
  color: var(--text-dim);
  line-height: 1.65;
  max-width: 38ch;
}

/* =============================================
   PRODUCTOS
   ============================================= */
#productos {
  padding: clamp(5rem, 12vw, 10rem) 0;
  background: var(--bg);
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}

.product-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: clamp(2rem, 4vw, 3rem);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  overflow: hidden;
  transition: border-color 0.4s var(--ease), box-shadow 0.4s var(--ease), transform 0.4s var(--ease);
}
.product-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--gold-glow), transparent 60%);
  opacity: 0;
  transition: opacity 0.4s;
}
.product-card:hover {
  border-color: rgba(200, 160, 90, 0.3);
  box-shadow: 0 0 40px rgba(200, 160, 90, 0.06);
  transform: translateY(-4px);
}
.product-card:hover::before { opacity: 1; }

.product-soon-badge {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--gold);
  border: 1px solid rgba(200, 160, 90, 0.4);
  padding: 0.3rem 0.7rem;
  border-radius: 100px;
  background: var(--gold-dim);
}

.product-icon {
  width: 40px;
  height: 40px;
  color: var(--text-dim);
  transition: color 0.3s;
}
.product-card:hover .product-icon { color: var(--gold); }

.product-card h3 {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.7rem;
  letter-spacing: 0.04em;
  color: var(--text);
}
.product-card p {
  font-size: 0.9rem;
  color: var(--text-dim);
  line-height: 1.65;
}

/* =============================================
   GALERÍA
   ============================================= */
#galeria {
  padding-top: clamp(5rem, 12vw, 10rem);
  padding-bottom: 0;
  background: var(--bg-2);
  border-top: 1px solid var(--border);
}

#galeria .container { margin-bottom: 3rem; }

.gallery-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  grid-template-rows: 340px 340px;
  gap: 3px;
}

/* Placement — 4 photos */
.gallery-item:nth-child(1) { grid-column: 1;     grid-row: 1 / 3; }
.gallery-item:nth-child(2) { grid-column: 2;     grid-row: 1; }
.gallery-item:nth-child(3) { grid-column: 3;     grid-row: 1; }
.gallery-item:nth-child(4) { grid-column: 2 / 4; grid-row: 2; }

.gallery-item {
  overflow: hidden;
  position: relative;
  background: var(--surface);
}
.gallery-item::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(8, 8, 14, 0.35);
  transition: background 0.5s var(--ease);
}
.gallery-item:hover::after { background: rgba(8, 8, 14, 0.1); }
.gallery-item img {
  transition: transform 0.8s var(--ease);
}
.gallery-item:hover img { transform: scale(1.07); }

/* =============================================
   FOOTER
   ============================================= */
footer {
  background: var(--bg);
  border-top: 1px solid var(--border);
  padding: clamp(3rem, 8vw, 6rem) 0 clamp(2rem, 4vw, 3rem);
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 clamp(1.5rem, 5vw, 4rem);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2.5rem;
  text-align: center;
}

.footer-name {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 3.5rem;
  letter-spacing: 0.1em;
  color: var(--text);
  line-height: 1;
}

.footer-tagline {
  font-size: 0.8rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-top: 0.5rem;
}

.footer-nav {
  display: flex;
  gap: 2rem;
  flex-wrap: wrap;
  justify-content: center;
}
.footer-nav a {
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-faint);
  transition: color 0.3s;
}
.footer-nav a:hover { color: var(--gold); }

.footer-copy {
  font-size: 0.7rem;
  color: var(--text-faint);
  letter-spacing: 0.06em;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  width: 100%;
  text-align: center;
}

/* =============================================
   KEYFRAME ANIMATIONS
   ============================================= */
@keyframes heroLineUp {
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeUp {
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  to { opacity: 1; }
}
@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(8px); }
}

/* =============================================
   RESPONSIVE — TABLET
   ============================================= */
@media (max-width: 900px) {
  body { cursor: auto; }
  .cursor { display: none; }

  .nav-links { display: none; }
  .menu-toggle { display: flex; }

  .about-grid {
    grid-template-columns: 1fr;
  }
  .about-image-wrap {
    max-height: 480px;
    aspect-ratio: 4/3;
  }
  .about-badge {
    right: 1rem;
    bottom: -1rem;
  }

  .topics-grid {
    grid-template-columns: 1fr;
  }

  .products-grid {
    grid-template-columns: 1fr;
  }

  .gallery-grid {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 280px 280px 280px;
  }
  .gallery-item:nth-child(1) { grid-column: 1 / 3; grid-row: 1; }
  .gallery-item:nth-child(2) { grid-column: 1;     grid-row: 2; }
  .gallery-item:nth-child(3) { grid-column: 2;     grid-row: 2; }
  .gallery-item:nth-child(4) { grid-column: 1 / 3; grid-row: 3; }
}

/* =============================================
   RESPONSIVE — MOBILE
   ============================================= */
@media (max-width: 600px) {
  .hero-title {
    font-size: clamp(5rem, 22vw, 7rem);
  }

  .about-stats {
    flex-direction: column;
    gap: 1.5rem;
  }

  .gallery-grid {
    grid-template-columns: 1fr;
    grid-template-rows: repeat(4, 260px);
  }
  .gallery-item:nth-child(1) { grid-column: 1; grid-row: 1; }
  .gallery-item:nth-child(2) { grid-column: 1; grid-row: 2; }
  .gallery-item:nth-child(3) { grid-column: 1; grid-row: 3; }
  .gallery-item:nth-child(4) { grid-column: 1; grid-row: 4; }

  .footer-nav { gap: 1.2rem; }
}
