﻿*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:          #939597;
  --bg-light:    #A4A6A8;
  --text:        #1A1A1A;
  --white:       #FFFFFF;
  --white-body:  #E8E9EA;
  --white-70:    rgba(255, 255, 255, 0.7);
  --white-50:    rgba(255, 255, 255, 0.5);
  --white-25:    rgba(255, 255, 255, 0.25);
  --white-10:    rgba(255, 255, 255, 0.10);
  --dark:        #2A2C2E;
  --font-title:  'Cormorant Garamond', Georgia, serif;
  --font-body:   'DM Sans', sans-serif;
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--white-body);
  font-family: var(--font-body);
  font-weight: 300;
  line-height: 1.7;
  font-size: 16px;
  overflow-x: hidden;
  position: relative;
}

/* TEXTURA DE GRANO FOTOGRÁFICO SUTIL */
body::before {
  content: "";
  position: fixed;
  top: 0; left: 0; width: 100vw; height: 100vh;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.04;
  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.75' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 2.5rem; position: relative; z-index: 1; }

/* ── HEADER ──────────────────────────────────────────────── */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 1.2rem 2.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(147, 149, 151, 0.65);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.logo {
  font-family: var(--font-title);
  font-size: 1.4rem;
  font-weight: 400;
  letter-spacing: 0.04em;
  color: var(--white);
}
.logo span { color: var(--white-50); font-style: italic; }

nav { display: flex; gap: 2.5rem; }
nav a {
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--white-70);
  transition: color 0.3s;
  position: relative;
}
nav a::after {
  content: '';
  position: absolute;
  bottom: -4px; left: 0;
  width: 0; height: 1px;
  background: var(--white);
  transition: width 0.4s cubic-bezier(0.215, 0.61, 0.355, 1);
}
nav a:hover { color: var(--white); }
nav a:hover::after { width: 100%; }

.menu-btn { display: none; flex-direction: column; gap: 5px; cursor: pointer; background: none; border: none; padding: 4px; }
.menu-btn span { display: block; width: 24px; height: 1.5px; background: var(--white); transition: all 0.3s; transform-origin: center; }
.menu-btn.active span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.menu-btn.active span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.menu-btn.active span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* ── HERO ─────────────────────────────────────────────────── */
#hero {
  position: relative;
  height: 100vh;
  min-height: 600px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  /* Transición más natural hacia el gris base */
  background: linear-gradient(180deg, var(--bg-light) 0%, var(--bg) 100%);
}

.hero-content { position: relative; z-index: 1; text-align: center; padding: 0 2rem; transform: translateY(-3rem);}

.hero-content h1 {
  font-family: var(--font-title);
  font-size: clamp(4rem, 10vw, 8.5rem);
  font-weight: 300;
  line-height: 0.95;
  color: var(--white);
  letter-spacing: 0.08em;
  margin-bottom: 1.5rem;
  text-shadow: 0 10px 30px rgba(0,0,0,0.05);
}

.hero-content h2 {
  font-family: var(--font-body);
  font-size: clamp(0.75rem, 1.2vw, 0.9rem);
  font-weight: 400;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--white-body);
}

.scroll-hint {
  position: absolute;
  bottom: 3rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}
.scroll-hint::after {
  content: '';
  display: block;
  width: 8px; height: 8px;
  border-right: 1px solid var(--white-70);
  border-bottom: 1px solid var(--white-70);
  transform: rotate(45deg);
  animation: arrowBounce 2s ease-in-out infinite;
}
@keyframes arrowBounce {
  0%, 100% { transform: rotate(45deg) translateY(0); opacity: 0.2; }
  50%      { transform: rotate(45deg) translateY(6px); opacity: 1; }
}

#sobre-mi, #servicios, #portfolio, #contacto {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

/* ── SOBRE MI ─────────────────────────────────────────────── */
#sobre-mi { padding: 10rem 0; background: var(--bg); }

.sobre-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7rem; align-items: flex-start; }

.sobre-texto h3 {
  font-family: var(--font-title);
  font-size: clamp(3rem, 5.5vw, 4.5rem);
  font-weight: 300;
  font-style: italic;
  line-height: 1.1;
  margin-bottom: 2rem;
  color: var(--white);
  letter-spacing: 0.02em;
}

.sobre-texto p {
  font-size: 1.05rem;
  color: var(--white-body);
  margin-bottom: 1.5rem;
  max-width: 500px;
  line-height: 1.9;
}

.sobre-foto { position: relative; width: 100%; max-width: 350px; margin-left: auto; margin-top: 3.5rem; }

.sobre-foto-inner { width: 100%; overflow: hidden; border-radius: 2px; }

.sobre-foto-inner img {
  width: 100%; height: auto;
  display: block;
  transform: scale(1.08);
  transition: transform 1.8s cubic-bezier(0.215, 0.61, 0.355, 1);
  box-shadow: 0 20px 50px rgba(0,0,0,0.1);
}

.sobre-foto.visible .sobre-foto-inner img { transform: scale(1); }

/* ── SERVICIOS ────────────────────────────────────────────── */
#servicios { padding: 8rem 0; background: var(--bg); }

.servicios-header { margin-bottom: 4rem; text-align: center; }

.servicios-header h2 {
  font-family: var(--font-title);
  font-size: clamp(3rem, 5vw, 4.5rem);
  font-weight: 300;
  font-style: italic;
  color: var(--white);
}

.servicios-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem;
}

.servicio-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255,255,255,0.05);
  padding: 3rem 2.5rem;
  border-radius: 4px;
  transition: transform 0.4s ease, background 0.4s ease, border-color 0.4s ease;
}

.servicio-card:hover {
  background: rgba(255, 255, 255, 0.05);
  transform: translateY(-5px);
  border-color: rgba(255,255,255,0.15);
}

.servicio-card h3 {
  font-family: var(--font-title);
  font-size: 1.8rem;
  font-weight: 400;
  font-style: italic;
  margin-bottom: 1.2rem;
  line-height: 1.2;
  color: var(--white);
}

.servicio-card p { font-size: 0.95rem; color: var(--white-body); line-height: 1.8; }

.servicio-tags { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 2rem; }

.servicio-tag {
  font-size: 0.6rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0.4rem 0.9rem;
  background: rgba(0,0,0,0.04);
  border-radius: 30px;
  color: var(--white-70);
  transition: background 0.3s, color 0.3s;
}

.servicio-card:hover .servicio-tag { background: rgba(255,255,255,0.1); color: var(--white); }

/* ── PORTFOLIO ────────────────────────────────────────────── */
#portfolio { padding: 10rem 0; background: var(--bg); }

.portfolio-header { margin-bottom: 5rem; text-align: center; }

.portfolio-header h2 {
  font-family: var(--font-title);
  font-size: clamp(3rem, 5vw, 4.5rem);
  font-weight: 300;
  font-style: italic;
  color: var(--white);
}

.portfolio-category { margin-bottom: 6rem; }

.category-title {
  font-family: var(--font-title);
  font-size: 1.6rem;
  font-weight: 400;
  font-style: italic;
  color: var(--white-70);
  margin-bottom: 2.5rem;
  display: flex; align-items: center; gap: 1.5rem;
}
.category-title::after { content: ''; flex: 1; height: 1px; background: rgba(255,255,255,0.1); }

.album-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 2rem; }

.album-card {
  position: relative;
  cursor: pointer;
  border-radius: 4px;
  overflow: hidden;
  transition: transform 0.6s cubic-bezier(0.215, 0.61, 0.355, 1), box-shadow 0.6s ease;
}

.album-card:hover {
  transform: translateY(-8px) scale(1.01);
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
  z-index: 2;
}

.album-cover { width: 100%; aspect-ratio: 3/2; overflow: hidden; background: rgba(0,0,0,0.05); }

.album-cover img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.8s ease; }
.album-card:hover .album-cover img { transform: scale(1.06); }

.album-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(20, 22, 24, 0.6) 0%, transparent 60%);
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: 1.8rem;
  opacity: 0.9;
  transition: opacity 0.4s ease, background 0.4s ease;
}

.album-card:hover .album-overlay {
  opacity: 1;
  background: linear-gradient(to top, rgba(20, 22, 24, 0.8) 0%, transparent 70%);
}

.album-name {
  font-family: var(--font-title); font-size: 1.4rem; font-weight: 400; font-style: italic;
  color: var(--white); transform: translateY(5px); transition: transform 0.4s ease;
}
.album-card:hover .album-name { transform: translateY(0); }

.album-count {
  font-size: 0.65rem; letter-spacing: 0.15em; text-transform: uppercase;
  color: rgba(255, 255, 255, 0.6); margin-top: 0.4rem; opacity: 0;
  transform: translateY(10px); transition: opacity 0.4s ease, transform 0.4s ease;
}
.album-card:hover .album-count { opacity: 1; transform: translateY(0); }

/* ── MODAL ALBUM Y LIGHTBOX (Se mantienen igual, sin tocar funcionalidad) ───────────────────────── */
.album-modal { display: none; position: fixed; inset: 0; z-index: 200; background: rgba(20, 22, 24, 0.97); overflow-y: auto; }
.album-modal.open { display: block; }
.modal-header { position: sticky; top: 0; display: flex; align-items: center; justify-content: space-between; padding: 1.4rem 2.5rem; background: rgba(20, 22, 24, 0.95); backdrop-filter: blur(10px); border-bottom: 1px solid rgba(255, 255, 255, 0.08); z-index: 10; }
.modal-title { font-family: var(--font-title); font-size: 1.5rem; font-weight: 300; font-style: italic; color: var(--white); }
.modal-close { background: none; border: none; cursor: pointer; color: var(--white-50); font-size: 1.5rem; line-height: 1; transition: color 0.3s; padding: 0.3rem 0.5rem; }
.modal-close:hover { color: var(--white); }
.modal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 4px; padding: 2rem 2.5rem 4rem; }
.modal-photo { aspect-ratio: 4/3; overflow: hidden; background: rgba(255, 255, 255, 0.04); cursor: zoom-in; }
.modal-photo img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s ease; }
.modal-photo:hover img { transform: scale(1.04); }
.modal-placeholder { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; font-size: 0.6rem; letter-spacing: 0.1em; text-transform: uppercase; color: rgba(255, 255, 255, 0.2); }
.lightbox { display: none; position: fixed; inset: 0; z-index: 300; background: rgba(10, 11, 12, 0.95); align-items: center; justify-content: center; padding: 2rem; }
.lightbox.open { display: flex; }
.lightbox-img { max-width: 88vw; max-height: 88vh; object-fit: contain; box-shadow: 0 32px 80px rgba(0, 0, 0, 0.7); animation: lbIn 0.25s ease; }
@keyframes lbIn { from { opacity: 0; transform: scale(0.96); } to { opacity: 1; transform: scale(1); } }
.lightbox-close { position: fixed; top: 1.5rem; right: 2rem; background: none; border: none; cursor: pointer; color: var(--white-50); font-size: 2rem; line-height: 1; transition: color 0.3s; z-index: 301; }
.lightbox-close:hover { color: var(--white); }
.lightbox-prev, .lightbox-next { position: fixed; top: 50%; transform: translateY(-50%); background: none; border: none; cursor: pointer; color: rgba(255, 255, 255, 0.35); font-size: 2.5rem; line-height: 1; transition: color 0.3s; z-index: 301; padding: 1rem; }
.lightbox-prev { left: 1rem; } .lightbox-next { right: 1rem; }
.lightbox-prev:hover, .lightbox-next:hover { color: var(--white); }

/* ── CONTACTO ─────────────────────────────────────────────── */
#contacto { padding: 8rem 0 10rem; background: var(--bg); }

.contacto-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 5rem; align-items: start; }

.contacto-info h2 {
  font-family: var(--font-title);
  font-size: clamp(3rem, 5vw, 4.5rem);
  font-weight: 300;
  font-style: italic;
  line-height: 1.1;
  margin-bottom: 1.5rem;
  color: var(--white);
}

.contacto-info p { font-size: 1rem; color: var(--white-body); margin-bottom: 3rem; max-width: 400px; line-height: 1.8; }

.social-links { display: flex; flex-direction: column; gap: 1.5rem; }

.social-link {
  display: inline-flex; align-items: center; gap: 1rem; font-size: 0.9rem;
  letter-spacing: 0.08em; color: var(--white-70); transition: color 0.3s;
}
.social-link:hover { color: var(--white); }

.social-icon {
  width: 22px; height: 22px; flex-shrink: 0; fill: none; stroke: var(--white-70);
  stroke-width: 1.2; stroke-linecap: round; stroke-linejoin: round; transition: stroke 0.3s, transform 0.3s;
}
.social-link:hover .social-icon { stroke: var(--white); transform: scale(1.1); }

/* Formulario refactorizado con fondo suave */
.contacto-form {
  background: rgba(0, 0, 0, 0.04);
  padding: 3rem;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  display: flex; flex-direction: column; gap: 2.2rem;
  box-shadow: 0 10px 30px rgba(0,0,0,0.03);
}

.form-group { display: flex; flex-direction: column; gap: 0.8rem; }

.form-group label { font-size: 0.65rem; letter-spacing: 0.25em; text-transform: uppercase; color: rgba(255, 255, 255, 0.95); }

.form-group input, .form-group textarea {
  background: transparent; border: none; border-bottom: 1px solid rgba(255,255,255,0.15);
  color: var(--white); font-family: var(--font-body); font-size: 1.05rem; font-weight: 300;
  padding: 0.5rem 0; outline: none; width: 100%; transition: border-color 0.4s ease, background 0.4s ease;
  border-radius: 0;
}
.form-group input::placeholder, .form-group textarea::placeholder { color: rgba(255, 255, 255, 0.95); font-weight: 300; }
.form-group input:focus, .form-group textarea:focus { border-bottom-color: var(--white); background: rgba(255,255,255,0.02); }
.form-group textarea { resize: none; height: 100px; line-height: 1.6; }

.btn-submit {
  align-self: flex-start; background: var(--white); color: var(--text);
  font-family: var(--font-body); font-size: 0.75rem; font-weight: 500;
  letter-spacing: 0.2em; text-transform: uppercase; padding: 1.2rem 3rem;
  cursor: pointer; border: none; border-radius: 3px;
  transition: transform 0.3s ease, box-shadow 0.3s ease; margin-top: 1rem;
}
.btn-submit:hover { transform: translateY(-3px); box-shadow: 0 10px 20px rgba(0,0,0,0.15); }

/* ── FOOTER ───────────────────────────────────────────────── */
footer { background: rgba(0,0,0,0.05); padding: 3rem 2.5rem; display: flex; align-items: center; justify-content: space-between; border-top: 1px solid rgba(255,255,255,0.05); }
.footer-logo { font-family: var(--font-title); font-size: 1.1rem; font-weight: 400; color: var(--white-50); letter-spacing: 0.05em; }
.footer-copy { font-size: 0.7rem; letter-spacing: 0.15em; color: rgba(255, 255, 255, 0.4); text-transform: uppercase;}

/* ── ANIMACIONES FADE-UP MEJORADAS ────────────────────────── */
.fade-up {
  opacity: 0;
  transform: translateY(50px);
  filter: blur(5px);
  transition: opacity 1.2s cubic-bezier(0.215, 0.61, 0.355, 1),
              transform 1.2s cubic-bezier(0.215, 0.61, 0.355, 1),
              filter 1.2s cubic-bezier(0.215, 0.61, 0.355, 1);
}

.fade-up.visible { opacity: 1; transform: translateY(0); filter: blur(0); }

/* ── RESPONSIVE ───────────────────────────────────────────── */
@media (max-width: 900px) {
  .sobre-grid, .contacto-grid { grid-template-columns: 1fr; gap: 4rem; }
  .sobre-foto { max-width: 400px; order: -1; margin: 0 auto; }
  .servicios-grid { grid-template-columns: 1fr; gap: 1.5rem; }
  .contacto-form { padding: 2rem; }
  footer { flex-direction: column; gap: 1.5rem; text-align: center; }
}

@media (max-width: 600px) {
  header { padding: 1.2rem 1.5rem; }
  nav {
    display: none;
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 1.5rem;
    background: rgba(26, 26, 26, 0.95);
    border-radius: 1rem;
    padding: 1rem 1.25rem;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
    min-width: 14rem;
    max-width: calc(100vw - 3rem);
    z-index: 101;
  }
  nav.open {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }
  nav.open a {
    font-size: 1rem;
    color: var(--white);
    width: 100%;
  }
  nav.open a:hover::after { width: 100%; }
  .menu-btn { display: flex; z-index: 102; }
  .container { padding: 0 1.5rem; }
  #sobre-mi, #servicios, #portfolio, #contacto { padding: 6rem 0; }
  .album-grid { grid-template-columns: 1fr; gap: 1.5rem; }
  .contacto-grid { gap: 3rem; }
  .lightbox-prev, .lightbox-next { display: none; }
}