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

:root {
  --bg: #ffffff;
  --fg: #000000;
  --nav-h: 56px;
  --col-gap: 40px;
  --side-pad: 60px;
  --font: var(--font-primary, 'Helvetica Neue', Helvetica, Arial, sans-serif);
}

html {
  background: var(--bg);
  /* Body height is set by JS to match smooth-wrapper height */
}

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
a:hover { opacity: 0.5; }

/* ── Smooth scroll wrapper ────────────────────────────────── */
#smooth-wrapper {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  will-change: transform;
  background: transparent;
}

/* ── Nav ──────────────────────────────────────────────────── */
nav {
  position: relative;
  z-index: 10;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--side-pad);
}

.nav-logo {
  font-size: 13px;
  letter-spacing: 0.08em;
  font-weight: 400;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 24px;
  font-size: 13px;
  letter-spacing: 0.05em;
}

.nav-socials {
  display: flex;
  align-items: center;
  gap: 16px;
}

.nav-socials svg {
  width: 16px;
  height: 16px;
  fill: var(--fg);
  display: block;
}

/* ── Masonry grid ─────────────────────────────────────────── */
.grid {
  display: flex;
  gap: var(--col-gap);
  padding: 40px var(--side-pad) 20px;
  align-items: flex-start;
  max-width: 1080px;
  margin: 0 auto;
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.filter-open .grid {
  transform: translateX(-80px);
}

.col {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 32px;
  max-width: 320px;
}

.col-mid   { padding-top: 80px; }
.col-right { padding-top: 40px; }

/* ── Project card ─────────────────────────────────────────── */
.project {
  /* Reveal state: hidden by default, JS adds .visible */
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 0.75s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.75s cubic-bezier(0.4, 0, 0.2, 1);
}

.project.visible {
  opacity: 1;
  transform: translateY(0);
}

.project.hidden {
  display: none;
}

/* Stagger delay between cards in the same column */
.col .project:nth-child(2) { transition-delay: 0.08s; }
.col .project:nth-child(3) { transition-delay: 0.16s; }
.col .project:nth-child(4) { transition-delay: 0.24s; }

.project-img-wrap {
  display: block;
  overflow: hidden;
  line-height: 0;
  width: 100%;
}

.project-img-wrap img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.project:hover .project-img-wrap img {
  transform: scale(1.04);
}

.project-info {
  margin-top: 14px;
}

.project-title {
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.project-tag {
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  padding: 3px 8px;
  transition: opacity 0.2s;
}

.project-tag:hover { opacity: 0.75; }

.project-tag[data-tag="cartel"]      { background: #efe26a; color: #000; }
.project-tag[data-tag="ilustración"] { background: #ed7757; color: #fff; }
.project-tag[data-tag="collage"]     { background: #7b9965; color: #fff; }
.project-tag[data-tag="tipografía"]  { background: #58beca; color: #fff; }
.project-tag[data-tag="branding"]    { background: #f4a4c4; color: #000; }
.project-tag[data-tag="web-design"]   { background: #6d75b5; color: #fff; }
.project-tag[data-tag="risografía"]   { background: #9b8ea0; color: #fff; }

/* ── Filter ───────────────────────────────────────────────── */
#filter-btn {
  position: fixed;
  bottom: 28px;
  left: var(--side-pad);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  z-index: 100;
  background: none;
  border: none;
  color: var(--fg);
  font-family: var(--font);
  padding: 0;
  transition: opacity 0.2s;
}
#filter-btn:hover { opacity: 0.4; }

#filter-panel {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 260px;
  background: var(--bg);
  border-top: 1px solid rgba(0,0,0,0.1);
  border-right: 1px solid rgba(0,0,0,0.1);
  padding: 24px var(--side-pad) 28px;
  z-index: 99;
  transform: translateY(100%);
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

#filter-panel.open { transform: translateY(0); }

.filter-label {
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  opacity: 0.35;
}

.filter-list {
  list-style: none;
  margin-top: 10px;
}

.filter-list li {
  font-size: 13px;
  letter-spacing: 0.05em;
  padding: 7px 0;
  cursor: pointer;
  border-bottom: 1px solid rgba(0,0,0,0.07);
  transition: opacity 0.2s;
}

.filter-list li:last-child { border-bottom: none; }
.filter-list li:hover { opacity: 0.4; }
.filter-list li.active { font-weight: 700; }

/* ── Filter dropdown ──────────────────────────────────────── */
.filter-dropdown {
  position: relative;
}

.filter-dropdown-btn {
  background: rgba(0, 0, 0, 0.06);
  border: none;
  font-family: var(--font);
  font-size: 13px;
  letter-spacing: 0.05em;
  color: var(--fg);
  cursor: pointer;
  padding: 6px 12px;
  transition: background 0.2s;
}

.filter-dropdown-btn:hover {
  background: rgba(0, 0, 0, 0.1);
}


.filter-dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  background: var(--bg, #fff);
  list-style: none;
  min-width: 140px;
  border: 1px solid rgba(0,0,0,0.1);
  padding: 8px 0;
  z-index: 200;
}

.filter-dropdown.open .filter-dropdown-menu {
  display: block;
}

.filter-dropdown-menu li {
  font-size: 12px;
  letter-spacing: 0.05em;
  padding: 8px 20px;
  cursor: pointer;
  transition: opacity 0.2s;
  white-space: nowrap;
}

.filter-dropdown-menu li:hover { opacity: 0.45; }
.filter-dropdown-menu li.active { font-weight: 700; }

/* ── Nav dropdown (Diseño) ────────────────────────────────── */
.nav-dropdown {
  position: relative;
}

.nav-dropdown-btn {
  font-family: var(--font);
  font-size: 13px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--fg);
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  transition: opacity 0.2s;
}

.nav-dropdown-btn:hover { opacity: 0.5; }

.nav-dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  list-style: none;
  background: none;
  border: none;
  padding-top: 10px;
  z-index: 200;
  flex-direction: column;
  gap: 8px;
  white-space: nowrap;
}

.nav-dropdown:hover .nav-dropdown-menu {
  display: flex;
}

.nav-dropdown-menu li a {
  font-size: 10px;
  letter-spacing: 0.05em;
  opacity: 0.35;
  transition: opacity 0.2s;
  white-space: nowrap;
}

.nav-dropdown-menu li a:hover { opacity: 1; }

/* ── Language toggle ──────────────────────────────────────── */
.lang-toggle {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  letter-spacing: 0.08em;
}

.lang-toggle span {
  opacity: 0.25;
}

.lang-btn {
  background: none;
  border: none;
  padding: 0;
  font-family: var(--font);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--fg);
  cursor: pointer;
  opacity: 0.35;
  transition: opacity 0.2s;
}

.lang-btn.active {
  opacity: 1;
}

.lang-btn:hover {
  opacity: 0.6;
}

/* ── Lightbox ─────────────────────────────────────────────── */
#lightbox {
  position: fixed;
  inset: 0;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 500;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

#lightbox.open {
  opacity: 1;
  pointer-events: all;
}

#lightbox-img {
  max-width: 90vw;
  max-height: 88vh;
  object-fit: contain;
  transform: scale(0.96);
  transition: transform 0.3s ease;
}

#lightbox.open #lightbox-img {
  transform: scale(1);
}

#lightbox-close {
  position: absolute;
  top: 24px;
  right: 32px;
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: var(--fg);
  opacity: 0.4;
  transition: opacity 0.2s;
  line-height: 1;
  padding: 4px;
}

#lightbox-close:hover { opacity: 1; }

#lightbox-tags {
  position: absolute;
  top: 60px;
  right: 32px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

#lightbox-tags span {
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-family: var(--font);
  padding: 3px 8px;
}

#lightbox-tags span[data-tag="cartel"]      { background: #efe26a; color: #000; }
#lightbox-tags span[data-tag="ilustración"] { background: #ed7757; color: #fff; }
#lightbox-tags span[data-tag="collage"]     { background: #7b9965; color: #fff; }
#lightbox-tags span[data-tag="tipografía"]  { background: #58beca; color: #fff; }
#lightbox-tags span[data-tag="branding"]    { background: #f4a4c4; color: #000; }
#lightbox-tags span[data-tag="web-design"]   { background: #6d75b5; color: #fff; }
#lightbox-tags span[data-tag="risografía"]   { background: #9b8ea0; color: #fff; }

/* ── About / Contact pages ────────────────────────────────── */
.page-wrap {
  padding: calc(var(--nav-h) + 60px) var(--side-pad) 80px;
  min-height: 100vh;
}

.page-content {
  max-width: 560px;
}

.page-content h1 {
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 40px;
}

.page-content p {
  font-size: 14px;
  line-height: 1.8;
  margin-bottom: 20px;
  opacity: 0.7;
}

.page-content a {
  border-bottom: 1px solid rgba(0,0,0,0.2);
  padding-bottom: 1px;
}

/* ── Nav hamburguesa ──────────────────────────────────────── */
.nav-hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  flex-direction: column;
  gap: 5px;
  z-index: 300;
  color: inherit;
}

.nav-hamburger span {
  display: block;
  width: 22px;
  height: 1.5px;
  background: currentColor;
  transition: transform 0.3s, opacity 0.3s;
}

nav.nav-open .nav-hamburger span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
nav.nav-open .nav-hamburger span:nth-child(2) { opacity: 0; }
nav.nav-open .nav-hamburger span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 768px) {
  :root {
    --side-pad: 20px;
    --col-gap: 0px;
  }

  /* Nav móvil */
  .nav-hamburger { display: flex; }

  .nav-right {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100vh;
    background: #fff;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 32px;
    font-size: 16px;
    z-index: 200;
    color: #000;
  }

  nav.nav-open .nav-right { display: flex; }

  .nav-dropdown {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
  }

  .nav-dropdown-menu {
    position: static;
    display: flex !important;
    flex-direction: column;
    align-items: center;
    padding-top: 0;
    gap: 12px;
  }

  .nav-dropdown-menu li { text-align: center; }
  .nav-dropdown-menu li a { font-size: 14px; opacity: 0.5; }
  .nav-dropdown-btn { font-size: 16px; text-align: center; }

  /* Grid: 1 columna */
  .grid {
    flex-direction: column;
    padding: 20px var(--side-pad);
  }

  .col { max-width: 100%; }
  .col-mid, .col-right { padding-top: 0; }

  /* About: apilado */
  .about-row { flex-direction: column; gap: 24px; }
  .about-photo {
    width: 100% !important;
    margin-left: 0 !important;
    aspect-ratio: 3 / 4;
  }
  .about-wrap .page-content { max-width: 100% !important; }

  /* diseno-web */
  .grid-web { flex-direction: column; }
  .col-web:last-child { padding-top: 0; }

  nav { padding: 0 20px; }
}
