/* === VARIABLES === */
:root {
  --cream:     #F0EDE6;
  --ink:       #1A1714;
  --ink-light: #6B6660;
  --ink-faint: #B8B3AD;
  --gold:      #A8906A;
  --white:     #FAFAF7;
  --border:    rgba(26,23,20,.1);
}

/* === RESET === */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: "DM Mono", monospace;
  background: var(--cream);
  color: var(--ink);
  cursor: none;
  overflow-x: hidden;
}

/* === CURSOR PERSONALIZADO === */
#cursor {
  position: fixed; width: 10px; height: 10px;
  background: #1A1714;
  border: 2px solid #FAFAF7;
  border-radius: 50%;
  pointer-events: none; z-index: 9999;
  transform: translate(-50%, -50%);
  transition: width .25s, height .25s;
  top: -20px; left: -20px;
}
#cursor.big {
  width: 54px; height: 54px;
  background: transparent;
  border: 1.5px solid #1A1714;
}

/* === NAV === */
nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 500;
  display: flex; justify-content: space-between; align-items: center;
  padding: 26px 56px;
  transition: background .4s, backdrop-filter .4s;
}
nav.scrolled {
  background: rgba(240,237,230,.94);
  backdrop-filter: blur(14px);
}
.nav-logo {
  font-family: "Cormorant Garamond", serif;
  font-size: 22px; font-weight: 300;
  letter-spacing: .12em; text-decoration: none;
  color: var(--ink); text-transform: lowercase;
}
.nav-links { display: flex; gap: 44px; list-style: none; }
.nav-links a {
  font-size: 10px; letter-spacing: .2em;
  text-transform: uppercase; color: var(--ink);
  text-decoration: none; opacity: .5;
  transition: opacity .3s;
  position: relative; padding-bottom: 4px;
}
.nav-links a::after {
  content: ""; position: absolute;
  bottom: 0; left: 0; width: 0; height: 1px;
  background: var(--ink); transition: width .3s;
}
.nav-links a:hover,
.nav-links a.active { opacity: 1; }
.nav-links a:hover::after,
.nav-links a.active::after { width: 100%; }

/* === PAGE HERO (páginas interiores) === */
.page-hero {
  padding: 160px 56px 80px;
  border-bottom: 1px solid var(--border);
}
.page-hero-eyebrow {
  font-size: 9px; letter-spacing: .24em;
  text-transform: uppercase; color: var(--gold);
  margin-bottom: 16px;
}
.page-hero-title {
  font-family: "Cormorant Garamond", serif;
  font-size: clamp(56px,9vw,120px);
  font-weight: 300; line-height: .9; letter-spacing: -.03em;
}
.page-hero-sub {
  margin-top: 28px; font-size: 10px;
  letter-spacing: .16em; text-transform: uppercase;
  color: var(--ink-light); line-height: 1.9; max-width: 400px;
}

/* === PROYECTO ENTRY (sistema editorial) === */
.proj-entry {
  position: relative; padding: 0 56px;
  transition: opacity .5s;
}
.proj-entry.hidden { display: none; }

.proj-row {
  position: relative; padding: 90px 0;
  border-top: 1px solid var(--border);
}
.proj-row:last-child { border-bottom: 1px solid var(--border); }

/* Número decorativo de fondo */
.proj-num {
  position: absolute; top: 50px; left: 0;
  font-family: "Cormorant Garamond", serif;
  font-size: 180px; font-weight: 300; line-height: 1;
  color: transparent;
  -webkit-text-stroke: 1px rgba(26,23,20,.13);
  user-select: none; pointer-events: none; z-index: 0;
}

/* Imagen wrapper */
.proj-img-wrap {
  position: relative; z-index: 1;
  overflow: hidden; cursor: none;
  height: 480px;
}
.proj-img-wrap img,
.proj-img-wrap svg {
  display: block; width: 100%; height: 100%;
  transition: transform .85s cubic-bezier(.77,0,.18,1);
}
.proj-img-wrap img { object-fit: cover; }
.proj-img-wrap svg { filter: grayscale(12%); }
.proj-img-wrap:hover img,
.proj-img-wrap:hover svg { transform: scale(1.04); }
.proj-img-wrap:hover svg { filter: grayscale(0%); }

/* Círculo "Abrir" al hover */
.proj-cue {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(26,23,20,0);
  transition: background .4s; z-index: 2; pointer-events: none;
}
.proj-cue-inner {
  width: 80px; height: 80px; border-radius: 50%;
  border: 1px solid rgba(250,250,247,.75);
  display: flex; align-items: center; justify-content: center;
  font-size: 9px; letter-spacing: .18em;
  text-transform: uppercase; color: var(--white);
  opacity: 0; transform: scale(.75);
  transition: opacity .38s, transform .38s;
}
.proj-img-wrap:hover .proj-cue { background: rgba(26,23,20,.3); }
.proj-img-wrap:hover .proj-cue-inner { opacity: 1; transform: scale(1); }

/* Texto info del proyecto */
.proj-info { position: absolute; z-index: 2; }
.proj-cat {
  font-size: 9px; letter-spacing: .22em;
  text-transform: uppercase; color: var(--gold); margin-bottom: 10px;
}
.proj-name {
  font-family: "Cormorant Garamond", serif;
  font-size: 46px; font-weight: 300;
  letter-spacing: -.015em; line-height: 1.1; color: var(--ink);
}
.proj-meta {
  margin-top: 10px; font-size: 9px;
  letter-spacing: .15em; text-transform: uppercase;
  color: var(--ink-faint); line-height: 2;
}
.proj-arrow {
  display: inline-block; margin-top: 22px;
  font-size: 9px; letter-spacing: .2em;
  text-transform: uppercase; color: var(--ink);
  cursor: none; position: relative; padding-bottom: 5px;
}
.proj-arrow::after {
  content: ""; position: absolute;
  bottom: 0; left: 0; width: 100%; height: 1px;
  background: var(--ink);
  transform: scaleX(0); transform-origin: right;
  transition: transform .4s cubic-bezier(.77,0,.18,1);
}
.proj-img-wrap:hover ~ .proj-info .proj-arrow::after { transform: scaleX(1); transform-origin: left; }

/* === 6 LAYOUTS EDITORIALES === */
/* LA: imagen derecha 66%, texto izquierda */
.la .proj-img-wrap { margin-left: auto; width: 66%; }
.la .proj-info { top: 0; left: 0; width: 27%; padding-top: 12px; }

/* LB: imagen izquierda portrait 44%, texto derecha */
.lb .proj-img-wrap { width: 44%; }
.lb .proj-info { top: 0; right: 0; width: 48%; padding-top: 12px; text-align: right; }

/* LC: imagen centrada 60%, texto debajo derecha */
.lc .proj-img-wrap { width: 60%; margin: 0 auto; }
.lc .proj-info { position: relative; margin-top: 26px; text-align: right; padding-right: 8%; }

/* LD: imagen full bleed, texto overlay */
.ld { padding-top: 0 !important; padding-bottom: 0 !important; }
.ld .proj-img-wrap { width: 100%; }
.ld .proj-info { top: 28px; left: 40px; }
.ld .proj-name { color: var(--white); }
.ld .proj-meta { color: rgba(250,250,247,.45); }
.ld .proj-arrow { color: var(--white); }
.ld .proj-arrow::after { background: var(--white); }

/* LE: imagen derecha portrait 40%, título XL izquierda */
.le .proj-img-wrap { margin-left: auto; width: 40%; }
.le .proj-info { top: 0; left: 0; width: 52%; padding-top: 8px; }
.le .proj-info .proj-name { font-size: 54px; }

/* LF: imagen izquierda 72%, texto derecha compacto */
.lf .proj-img-wrap { width: 72%; }
.lf .proj-info { top: 0; right: 0; width: 22%; padding-top: 12px; text-align: right; }

/* === REVEAL ANIMATION === */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .9s cubic-bezier(.77,0,.18,1), transform .9s cubic-bezier(.77,0,.18,1); }
.reveal.visible { opacity: 1; transform: translateY(0); }
.rd1 { transition-delay: .1s; }
.rd2 { transition-delay: .22s; }
.rd3 { transition-delay: .38s; }

/* === FILTROS === */
.filters { display: flex; gap: 28px; align-items: flex-end; }
.fbtn {
  background: none; border: none; cursor: none;
  font-family: "DM Mono", monospace;
  font-size: 10px; letter-spacing: .18em;
  text-transform: uppercase; color: var(--ink-faint);
  padding-bottom: 6px; position: relative; transition: color .3s;
}
.fbtn::after {
  content: ""; position: absolute;
  bottom: 0; left: 0; width: 0; height: 1px;
  background: var(--ink);
  transition: width .4s cubic-bezier(.77,0,.18,1);
}
.fbtn.active, .fbtn:hover { color: var(--ink); }
.fbtn.active::after { width: 100%; }

/* === PANEL DE DETALLE (overlay al hacer click) === */
#view-project {
  position: fixed; inset: 0;
  background: var(--cream); overflow-y: auto; z-index: 300;
  opacity: 0; pointer-events: none; transform: translateY(44px);
  transition: opacity .55s cubic-bezier(.77,0,.18,1), transform .55s cubic-bezier(.77,0,.18,1);
}
#view-project.open { opacity: 1; pointer-events: all; transform: translateY(0); }

.proj-detail-close {
  position: fixed; top: 32px; right: 56px; z-index: 600;
  background: none; border: none; cursor: none;
  font-family: "DM Mono", monospace;
  font-size: 10px; letter-spacing: .2em; text-transform: uppercase;
  color: var(--ink-light);
  display: flex; align-items: center; gap: 10px;
  transition: color .3s; padding: 0;
}
.proj-detail-close:hover { color: var(--ink); }
.close-line { width: 32px; height: 1px; background: currentColor; transition: width .3s; }
.proj-detail-close:hover .close-line { width: 48px; }

/* Hero del detalle */
.pd-hero {
  position: relative; overflow: hidden;
}
.pd-hero-img { display: block; }
.pd-hero-img img { display: block; width: 100%; height: auto; }
.pd-hero-content { position: absolute; bottom: 0; left: 0; right: 0; padding: 0 72px 80px; z-index: 2; }
.pd-hero-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(26,23,20,.78) 0%, rgba(26,23,20,.08) 55%, transparent 100%);
  z-index: 1;
}
.pd-hero-content { position: relative; z-index: 2; }
.pd-hero-cat { font-size: 10px; letter-spacing: .22em; text-transform: uppercase; color: var(--gold); margin-bottom: 14px; }
.pd-hero-title {
  font-family: "Cormorant Garamond", serif;
  font-size: clamp(56px,8vw,110px); font-weight: 300;
  color: var(--white); line-height: .9; letter-spacing: -.03em;
}
.pd-hero-meta { margin-top: 24px; display: flex; gap: 48px; flex-wrap: wrap; }
.pd-hero-meta span { font-size: 9px; letter-spacing: .2em; text-transform: uppercase; color: rgba(250,250,247,.45); }

/* Cuerpo del detalle */
.pd-body { padding: 0 72px 120px; }
.pd-info-bar {
  display: grid; grid-template-columns: repeat(4,1fr);
  gap: 40px; padding: 56px 0;
  border-bottom: 1px solid var(--border); margin-bottom: 80px;
}
.pd-info-item .label { font-size: 9px; letter-spacing: .2em; text-transform: uppercase; color: var(--ink-faint); margin-bottom: 10px; }
.pd-info-item .value { font-family: "Cormorant Garamond", serif; font-size: 22px; font-weight: 300; }

/* Galería del detalle */
.pd-gallery { display: flex; flex-direction: column; gap: 12px; }
.pg-row { display: flex; gap: 12px; }
.pg-img { overflow: hidden; flex-shrink: 0; }
.pg-img img, .pg-img svg {
  display: block; width: 100%; height: 100%; object-fit: cover;
  image-orientation: from-image;
  transition: transform .85s cubic-bezier(.77,0,.18,1);
}
.pg-img:hover img, .pg-img:hover svg { transform: scale(1.03); }
.pg-row.r-full .pg-img { width: 100%; max-height: 62vh; }
.pg-row.r-2eq .pg-img { flex: 1; height: 360px; }
.pg-row.r-2wide .pg-img:first-child { flex: 0 0 60%; height: 400px; }
.pg-row.r-2wide .pg-img:last-child { flex: 1; height: 400px; }

/* Caption y proceso */
.pd-caption { margin-top: 64px; padding-top: 40px; border-top: 1px solid var(--border); display: grid; grid-template-columns: 1fr 1fr; gap: 80px; }
.pd-caption-text p { font-family: "Cormorant Garamond", serif; font-size: 24px; font-weight: 300; font-style: italic; line-height: 1.55; color: var(--ink); }
.pd-caption-aside p { font-size: 13px; letter-spacing: .03em; line-height: 2; color: var(--ink); }

.process-strip { margin-top: 64px; padding-top: 40px; border-top: 1px solid var(--border); }
.process-label { font-size: 9px; letter-spacing: .24em; text-transform: uppercase; color: var(--gold); margin-bottom: 28px; }
.process-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.process-grid img { display: block; width: 100%; height: auto; filter: grayscale(20%); transition: filter .4s, transform .4s; }
.process-grid img:hover { filter: grayscale(0%); transform: scale(1.02); }

/* Navegación anterior/siguiente */
.pd-nav { margin-top: 100px; padding-top: 40px; border-top: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
.pd-nav-btn { background: none; border: none; cursor: none; display: flex; flex-direction: column; gap: 8px; }
.pd-nav-btn .dir { font-size: 9px; letter-spacing: .2em; text-transform: uppercase; color: var(--ink-faint); }
.pd-nav-btn .pn { font-family: "Cormorant Garamond", serif; font-size: 30px; font-weight: 300; color: var(--ink); letter-spacing: -.01em; transition: letter-spacing .4s; }
.pd-nav-btn:hover .pn { letter-spacing: .015em; }
.pd-nav-btn.r { text-align: right; }

/* === FOOTER === */
footer { background: var(--ink); padding: 80px 56px 48px; }
.footer-inner { display: flex; justify-content: space-between; align-items: flex-start; padding-bottom: 48px; border-bottom: 1px solid rgba(250,250,247,.08); }
.footer-logo { font-family: "Cormorant Garamond", serif; font-size: 48px; font-weight: 300; color: var(--white); letter-spacing: -.02em; text-decoration: none; }
.footer-links { display: flex; gap: 40px; }
.footer-links a { font-size: 9px; letter-spacing: .2em; text-transform: uppercase; color: rgba(250,250,247,.35); text-decoration: none; transition: color .3s; }
.footer-links a:hover { color: var(--white); }
.footer-bottom { display: flex; justify-content: space-between; align-items: center; padding-top: 32px; }
.footer-copy { font-size: 9px; letter-spacing: .14em; color: rgba(250,250,247,.2); }
.footer-loc { font-family: "Cormorant Garamond", serif; font-style: italic; font-size: 14px; color: rgba(250,250,247,.22); }

/* === RESPONSIVE === */
@media (max-width: 900px) {
  nav { padding: 22px 28px; }
  .page-hero { padding: 130px 28px 60px; }
  .proj-entry { padding: 0 28px; }
  .la .proj-img-wrap, .le .proj-img-wrap, .lf .proj-img-wrap { width: 100%; margin-left: 0; }
  .la .proj-info, .lb .proj-info, .le .proj-info, .lf .proj-info { position: relative; width: 100%; padding-top: 20px; text-align: left; }
  .lb .proj-img-wrap { width: 82%; }
  .lc .proj-img-wrap { width: 96%; }
  .lc .proj-info { padding-right: 0; }
  .le .proj-info .proj-name { font-size: 36px; }
  .proj-num { font-size: 100px; }
  .pd-hero { padding: 0 28px 60px; }
  .pd-body { padding: 0 28px 80px; }
  .pd-info-bar { grid-template-columns: 1fr 1fr; }
  .pd-caption { grid-template-columns: 1fr; }
  .proj-detail-close { right: 28px; }
  .process-grid { grid-template-columns: repeat(3,1fr); }
  footer { padding: 60px 28px 40px; }
  .footer-inner { flex-direction: column; gap: 40px; }
  .footer-links { flex-wrap: wrap; gap: 24px; }
}
