/* ============================================================
   Roberta Peña de Silvestri — Portfolio
   Diseño editorial / minimalista
   ============================================================ */

:root {
  --bg: #f7f5f1;          /* hueso cálido */
  --ink: #1a1a18;         /* casi negro */
  --muted: #8a857c;       /* gris cálido */
  --line: #e2ddd4;        /* línea sutil */
  --accent: #1a1a18;
  --white: #ffffff;

  --serif: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --sans: "Inter", system-ui, -apple-system, sans-serif;

  --maxw: 1280px;
  --gut: clamp(1.25rem, 4vw, 4rem);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 400;
  line-height: 1.6;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
ul { list-style: none; margin: 0; padding: 0; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

/* ---------- Header / Nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem var(--gut);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.4s var(--ease);
}
.site-header.is-scrolled { border-bottom-color: var(--line); }

.brand {
  font-family: var(--serif);
  font-size: clamp(1.05rem, 2vw, 1.35rem);
  font-weight: 500;
  letter-spacing: 0.01em;
  line-height: 1.1;
  display: flex;
  flex-direction: column;
}
.brand__sub {
  font-family: var(--sans);
  font-size: 0.62rem;
  font-weight: 400;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 0.2rem;
}

.nav__menu {
  display: flex;
  gap: clamp(1.25rem, 3vw, 2.75rem);
}
.nav__menu a {
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink);
  position: relative;
  padding-bottom: 3px;
}
.nav__menu a::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 0; height: 1px;
  background: var(--ink);
  transition: width 0.35s var(--ease);
}
.nav__menu a:hover::after { width: 100%; }

.nav__toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  padding: 6px;
}
.nav__toggle span {
  width: 26px; height: 1.5px;
  background: var(--ink);
  transition: transform 0.35s var(--ease), opacity 0.2s;
}

/* ---------- Hero ---------- */
.hero {
  min-height: 84vh;
  display: flex;
  align-items: center;
  padding: 4rem var(--gut) 3rem;
}
.hero__inner { max-width: var(--maxw); margin: 0 auto; width: 100%; }
.hero__eyebrow {
  font-size: 0.72rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 1.4rem;
}
.hero__title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(3rem, 11vw, 9rem);
  line-height: 0.95;
  letter-spacing: -0.01em;
  margin: 0;
}
.hero__title em { font-style: italic; color: var(--muted); }
.hero__lead {
  font-size: clamp(1rem, 1.6vw, 1.2rem);
  color: var(--muted);
  max-width: 32ch;
  margin: 1.6rem 0 2.4rem;
}
.hero__cta {
  display: inline-block;
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  border: 1px solid var(--ink);
  padding: 0.85rem 1.8rem;
  border-radius: 100px;
  transition: background 0.35s var(--ease), color 0.35s var(--ease);
}
.hero__cta:hover { background: var(--ink); color: var(--bg); }

/* ---------- Section scaffolding ---------- */
.section {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(3.5rem, 9vw, 8rem) var(--gut);
}
.section__head {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: clamp(2rem, 5vw, 3.5rem);
  padding-bottom: 1.1rem;
  border-bottom: 1px solid var(--line);
}
.section__num {
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  color: var(--muted);
}
.section__title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  margin: 0;
  letter-spacing: -0.01em;
}

/* ---------- Galería (masonry) ---------- */
.gallery {
  columns: 3;
  column-gap: clamp(0.8rem, 1.8vw, 1.4rem);
}
@media (max-width: 900px) { .gallery { columns: 2; } }
@media (max-width: 540px) { .gallery { columns: 1; } }

.gallery__item {
  break-inside: avoid;
  margin-bottom: clamp(0.8rem, 1.8vw, 1.4rem);
  position: relative;
  overflow: hidden;
  background: #ece8e0;
  cursor: pointer;
}
.gallery__item img {
  width: 100%;
  transition: transform 0.7s var(--ease), filter 0.5s var(--ease);
}
.gallery__item:hover img { transform: scale(1.04); }
.gallery__cap {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 1.4rem 1.1rem 0.9rem;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  color: var(--white);
  background: linear-gradient(transparent, rgba(0,0,0,0.55));
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.4s var(--ease), transform 0.4s var(--ease);
}
.gallery__item:hover .gallery__cap { opacity: 1; transform: translateY(0); }

/* ---------- Sobre mí ---------- */
.about {
  display: grid;
  grid-template-columns: 0.85fr 1fr;
  gap: clamp(2rem, 6vw, 5rem);
  align-items: start;
}
.about__media img { width: 100%; }
.about__lead {
  font-family: var(--serif);
  font-size: clamp(1.4rem, 3vw, 2rem);
  line-height: 1.3;
  margin: 0 0 1.6rem;
}
.about__text p { color: #4a463f; max-width: 56ch; }
.about__meta {
  margin-top: 2.2rem;
  border-top: 1px solid var(--line);
  padding-top: 1.4rem;
  display: grid;
  gap: 0.8rem;
}
.about__meta li { font-size: 0.92rem; }
.about__meta span {
  display: inline-block;
  min-width: 9.5rem;
  font-size: 0.68rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}
@media (max-width: 760px) {
  .about { grid-template-columns: 1fr; }
  .about__media { max-width: 360px; }
}

/* ---------- Contacto ---------- */
.section--contact { padding-bottom: clamp(4rem, 10vw, 9rem); }
.contact__lead {
  font-family: var(--serif);
  font-size: clamp(1.6rem, 4vw, 2.6rem);
  line-height: 1.2;
  margin: 0 0 0.6rem;
}
.contact__email {
  display: inline-block;
  font-size: clamp(1rem, 2vw, 1.25rem);
  border-bottom: 1px solid var(--ink);
  padding-bottom: 2px;
  margin-bottom: 3rem;
}
.contact__form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.4rem;
  max-width: 640px;
}
.field { display: flex; flex-direction: column; gap: 0.5rem; }
.field--full { grid-column: 1 / -1; }
.field label {
  font-size: 0.68rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}
.field input, .field textarea {
  font-family: var(--sans);
  font-size: 1rem;
  color: var(--ink);
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--line);
  padding: 0.6rem 0;
  transition: border-color 0.3s var(--ease);
}
.field textarea { resize: vertical; }
.field input:focus, .field textarea:focus {
  outline: none;
  border-bottom-color: var(--ink);
}
.contact__submit {
  grid-column: 1 / -1;
  justify-self: start;
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--bg);
  background: var(--ink);
  border: 1px solid var(--ink);
  padding: 0.9rem 2.2rem;
  border-radius: 100px;
  transition: background 0.35s var(--ease), color 0.35s var(--ease);
}
.contact__submit:hover { background: transparent; color: var(--ink); }
.contact__status { grid-column: 1 / -1; font-size: 0.9rem; color: var(--muted); margin: 0; }
.contact__social {
  display: flex;
  gap: 2rem;
  margin-top: 3rem;
}
.contact__social a {
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  border-bottom: 1px solid transparent;
  padding-bottom: 2px;
  transition: border-color 0.3s var(--ease);
}
.contact__social a:hover { border-bottom-color: var(--ink); }
@media (max-width: 540px) { .contact__form { grid-template-columns: 1fr; } }

/* ---------- Footer ---------- */
.site-footer {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 2rem var(--gut) 3rem;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  color: var(--muted);
}
.to-top { font-size: 0.78rem; letter-spacing: 0.1em; }

/* ---------- Reveal on scroll ---------- */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
}
.reveal.is-visible { opacity: 1; transform: none; }

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(20, 19, 17, 0.94);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s var(--ease), visibility 0.4s;
  padding: clamp(1rem, 5vw, 4rem);
}
.lightbox.is-open { opacity: 1; visibility: visible; }
.lightbox__figure { margin: 0; max-width: 92vw; max-height: 88vh; text-align: center; }
.lightbox__img {
  max-width: 100%;
  max-height: 80vh;
  margin: 0 auto;
  box-shadow: 0 30px 80px rgba(0,0,0,0.5);
}
.lightbox__caption {
  color: #d8d4cc;
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  margin-top: 1rem;
}
.lightbox__close, .lightbox__nav {
  position: absolute;
  background: none;
  border: none;
  color: #f7f5f1;
  transition: opacity 0.3s var(--ease);
  opacity: 0.7;
}
.lightbox__close:hover, .lightbox__nav:hover { opacity: 1; }
.lightbox__close { top: clamp(1rem, 3vw, 2rem); right: clamp(1rem, 3vw, 2.5rem); font-size: 1.4rem; }
.lightbox__nav { top: 50%; transform: translateY(-50%); font-size: 3rem; line-height: 1; padding: 0 1rem; }
.lightbox__nav--prev { left: clamp(0.2rem, 2vw, 1.5rem); }
.lightbox__nav--next { right: clamp(0.2rem, 2vw, 1.5rem); }
@media (max-width: 540px) { .lightbox__nav { font-size: 2rem; } }

/* ---------- Mobile nav ---------- */
@media (max-width: 700px) {
  .nav__toggle { display: flex; }
  .nav__menu {
    position: fixed;
    inset: 0 0 0 auto;
    width: min(78vw, 320px);
    flex-direction: column;
    justify-content: center;
    gap: 2rem;
    padding: var(--gut);
    background: var(--bg);
    transform: translateX(100%);
    transition: transform 0.45s var(--ease);
    box-shadow: -20px 0 60px rgba(0,0,0,0.08);
  }
  .nav__menu.is-open { transform: translateX(0); }
  .nav__menu a { font-size: 1rem; }
  .nav.is-open .nav__toggle span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
  .nav.is-open .nav__toggle span:nth-child(2) { opacity: 0; }
  .nav.is-open .nav__toggle span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }
}
