:root {
  --color-accent: #8fcff3;
  --color-background: #0E161B;
  --color-surface: #FFFFFF;

  --font-primary: 'IBM Plex Mono', monospace;

  --font-size-h1: 35px;
  --font-size-h2: 30px;
  --font-size-h3: 20px;
  --font-size-body: 14px;

  --font-weight-light: 300;
  --font-weight-regular: 400;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  width: 100%;
  min-height: 100%;
  background: var(--color-surface);
  color: var(--color-background);
  font-family: var(--font-primary);
  font-size: var(--font-size-body);
  font-weight: var(--font-weight-light);
}

h1,
h2,
h3,
p,
a,
li,
button {
  font-family: var(--font-primary);
}

h1 {
  font-size: var(--font-size-h1);
  font-weight: var(--font-weight-regular);
  line-height: 1.2;
  margin-bottom: 1rem;
}

h2 {
  font-size: var(--font-size-h2);
  font-weight: var(--font-weight-regular);
  line-height: 1.25;
  margin-bottom: 0.8rem;
}

h3 {
  font-size: var(--font-size-h3);
  font-weight: var(--font-weight-regular);
  line-height: 1.3;
}

p {
  font-size: var(--font-size-body);
  line-height: 1.65;
  font-weight: var(--font-weight-light);
}

a {
  color: inherit;
}

/* Landing */
.gallery-link {
  display: block;
  width: 100vw;
  height: 100vh;
  position: relative;
  text-decoration: none;
  overflow: hidden;
}

.gallery-link img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: brightness(0.84) saturate(0.9);
  transition: transform 0.8s ease, filter 0.8s ease;
}

.gallery-link:hover img {
  transform: scale(1.03);
  filter: brightness(0.65) saturate(1);
}

.overlay-text {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 1;
  pointer-events: none;
  padding: 1.5rem;
}

.overlay-text span {
  color: var(--color-surface);
  text-align: center;
  font-size: clamp(1.6rem, 3vw, 2.6rem);
  font-weight: var(--font-weight-regular);
  letter-spacing: 0.03em;
  line-height: 1.2;
  text-shadow: 0 0 26px rgba(14, 22, 27, 0.95);
}

/* Mobile top bar */
.topbar {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 56px;
  background: var(--color-surface);
  z-index: 200;
  align-items: center;
  padding: 0 1rem;
  border-bottom: 0.5px solid var(--color-background);
}

.topbar-title {
  text-decoration: none;
  color: var(--color-background);
  flex: 1;
  font-size: 1rem;
  font-weight: var(--font-weight-regular);
  letter-spacing: 0.02em;
}

.hamburger {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.hamburger span {
  display: block;
  width: 22px;
  height: 1px;
  background: var(--color-background);
  transition: all 0.3s ease;
}

.hamburger.open span:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}

.hamburger.open span:nth-child(2) {
  opacity: 0;
}

.hamburger.open span:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

/* Layout */
.page-wrap {
  display: flex;
  width: 100%;
  height: 100vh;
}

.sidebar {
  width: 23.5%;
  min-width: 320px;
  max-width: 360px;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 0;
  border-right: 0.5px solid var(--color-background);
  flex-shrink: 0;
  background: var(--color-surface);
  overflow-y: auto;
}

.sidebar-title {
  margin: 0;
  line-height: 1.5;
  padding: 2rem 2rem 0;
}

.sidebar-title a {
  color: var(--color-background);
  text-decoration: none;
  font-size: 14px;
  font-weight: var(--font-weight-regular);
  letter-spacing: 0.02em;
}

.sidebar-nav {
  list-style: none;
  margin-top: auto;
}

.sidebar-nav li {
  border-top: 0.5px solid var(--color-background);
}

.sidebar-nav li:last-child {
  border-bottom: 0.5px solid var(--color-background);
}

.sidebar-nav a {
  display: block;
  padding: 1.25rem 2rem;
  font-size: var(--font-size-h3);
  font-weight: var(--font-weight-regular);
  color: var(--color-background);
  text-decoration: none;
  transition: color 0.2s ease;
}

.sidebar-nav a:hover,
.sidebar-nav a.active,
.submenu a:hover,
.submenu a.active {
  color: var(--color-accent);
}

.has-submenu {
  margin: 0;
}

.submenu {
  list-style: none;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease;
  border-top: 0.5px solid var(--color-background);
}

.submenu.open {
  max-height: 220px;
}

.submenu li {
  border-top: 0;
}

.submenu a {
  padding: 0.75rem 2rem;
  font-size: 14px;
  color: var(--color-background);
}

.submenu-toggle {
  cursor: pointer;
}

.content-area,
.content-area-info {
  flex: 1;
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  background: var(--color-surface);
  color: var(--color-background);
}

.content-area-info section,
#proyecto,
#proceso {
  padding: 4rem 5rem;
  max-width: 900px;
}

.content-area-info h1,
.content-area-info h2,
.content-area-info h3 {
  color: var(--color-background);
}

.content-area-info h3 {
  margin-bottom: 2.5rem;
}

.content-area-info p {
  margin-bottom: 1.75rem;
  line-height: 1.75;
  max-width: 760px;
}

.video-wrapper {
  width: 100%;
  height: 100vh;
}

/* Aproximaciones home: video fondo en toda la ventana */
.video-bg-page {
  position: relative;
  background: var(--color-background);
  color: var(--color-surface);
}

.video-bg-page .video-bg-layer {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  overflow: hidden;
  background: var(--color-background);
}

.video-bg-page .video-bg-layer iframe {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 177.78vh;
  height: 56.25vw;
  min-width: 100vw;
  min-height: 100vh;
  transform: translate(-50%, -50%);
  border: 0;
  pointer-events: none;
}

#video-fallback {
  display: none;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.video-bg-page .page-wrap,
.video-bg-page .topbar {
  position: relative;
  z-index: 1;
}

.video-bg-page .topbar {
  background: var(--color-background);
  border-bottom: 1px solid rgba(143, 207, 243, 0.35);
}

.video-bg-page .topbar-title {
  color: var(--color-surface);
}

.video-bg-page .hamburger span {
  background: var(--color-surface);
}

.video-bg-page .content-area {
  background: transparent;
}

.video-bg-page .project-info {
  background: rgba(14, 22, 27, 0.72);
  backdrop-filter: blur(1px);
}

.video-bg-page .project-info h1,
.video-bg-page .project-info h2,
.video-bg-page .project-info h3 {
  color: var(--color-accent);
}

.video-bg-page .project-info .project-description,
.video-bg-page .project-info .collaborators-list li {
  color: var(--color-surface);
}

.video-bg-page .sidebar {
  background: rgba(14, 22, 27, 0.7);
  border-right: 1px solid rgba(143, 207, 243, 0.35);
}

.video-bg-page .sidebar-title a,
.video-bg-page .sidebar-nav a,
.video-bg-page .submenu a {
  color: var(--color-surface);
}

.video-bg-page .sidebar-nav li,
.video-bg-page .sidebar-nav li:last-child,
.video-bg-page .submenu {
  border-color: rgba(143, 207, 243, 0.35);
}

.video-ratio {
  width: 100%;
  height: 100%;
  position: relative;
}

.video-ratio iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

.project-info {
  min-height: auto;
  background: var(--color-surface);
  padding: 2.2rem;
  border-top: 0.5px solid var(--color-background);
}

.project-description,
.collaborators-list li {
  color: var(--color-background);
  opacity: 0.9;
}

.collaborators-list {
  list-style: none;
  margin-top: 0.5rem;
}

.collaborators-list li {
  padding: 0.3rem 0;
}

.thumbnail {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  display: block;
}

.image-container {
  margin: 0;
}

.image-container h3 {
  margin-top: 0.8rem;
  margin-bottom: 0.4rem;
  font-size: 18px;
  color: var(--color-background);
}

.image-container p {
  opacity: 0.85;
}

/* Participant cards con overlay hover */
.participant-card {
  position: relative;
  overflow: hidden;
  margin: 0;
}

.participant-card .thumbnail {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
}

.participant-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 1rem;
  background: transparent;
  transition: background 0.3s ease;
}

.participant-overlay h3,
.participant-overlay p {
  color: var(--color-background);
  opacity: 0;
  transition: opacity 0.3s ease;
  margin: 0;
}

.participant-overlay h3 {
  font-size: 16px;
  margin-bottom: 0.25rem;
}

.participant-card:hover .participant-overlay {
  background: rgba(143, 207, 243, 0.75);
}

.participant-card:hover .participant-overlay h3,
.participant-card:hover .participant-overlay p {
  opacity: 1;
}

.logo-th {
  background: transparent;
}

/* Mosaic */
.mosaic,
.image-gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  width: 100%;
}

.mosaic img,
.gallery-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.gallery-img {
  cursor: pointer;
  transition: filter 0.25s ease;
}

.gallery-img:hover {
  filter: brightness(0.88);
}

#proyecto .project-mosaic-gallery {
  width: 100%;
  margin-left: 0;
  margin-right: 0;
  margin-top: 1.75rem;
  margin-bottom: 2rem;
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  grid-auto-flow: dense;
  gap: 0;
}

#proyecto .project-mosaic-gallery .gallery-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  margin: 0;
  grid-column: span 3;
  aspect-ratio: 3 / 4;
}

#proyecto .project-mosaic-gallery .gallery-img.tile-h {
  grid-column: span 6;
  aspect-ratio: 4 / 3;
}

#publicacion .publication-mosaic-gallery {
  width: 100%;
  margin-left: 0;
  margin-right: 0;
  margin-top: 1.75rem;
  margin-bottom: 2rem;
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  grid-auto-flow: dense;
  gap: 0;
}

#publicacion .publication-mosaic-gallery .gallery-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  margin: 0;
  grid-column: span 3;
  aspect-ratio: 3 / 4;
}

#publicacion .publication-mosaic-gallery .gallery-img.tile-h {
  grid-column: span 6;
  aspect-ratio: 4 / 3;
}

#metafora .metafora-mosaic-gallery {
  width: 100%;
  margin-left: 0;
  margin-right: 0;
  margin-top: 1.75rem;
  margin-bottom: 2rem;
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  grid-auto-flow: dense;
  gap: 0;
}

#metafora .metafora-mosaic-gallery .gallery-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  margin: 0;
  grid-column: span 3;
  aspect-ratio: 3 / 4;
}

#metafora .metafora-mosaic-gallery .gallery-img.tile-h {
  grid-column: span 6;
  aspect-ratio: 4 / 3;
}

.metafora-page .content-area-info {
  scroll-snap-type: y proximity;
}

#metafora {
  max-width: 960px;
}

#metafora .metafora-panel {
  min-height: 88vh;
  padding-bottom: 10vh;
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

#metafora .metafora-panel > h2 {
  margin-bottom: 1rem;
}

#metafora .metafora-panel-video .metafora-video-stage {
  width: 100%;
  max-width: none;
  height: 0;
  padding-bottom: 56.25%;
  margin-bottom: 1.25rem;
}

#metafora .metafora-panel-video .metafora-video-stage iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

#metafora .metafora-panel-album .metafora-album-layout {
  flex: 1;
  align-items: center;
  margin-bottom: 1rem;
}

#metafora .metafora-panel-album .thumbnail {
  aspect-ratio: 4 / 5;
}

#metafora .metafora-panel-mosaic {
  min-height: 92vh;
}

/* Proceso: masonry compacta sin recortes */
#proceso .process-gallery {
  display: block;
  column-count: 3;
  column-gap: 0;
  line-height: 0;
}

#proceso .process-gallery .gallery-img {
  width: 100%;
  height: auto;
  object-fit: contain;
  display: block;
  margin: 0;
  break-inside: avoid;
}

/* Buttons */
.btn-circle {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background-color: var(--color-surface);
  color: var(--color-background);
  font-family: var(--font-primary);
  font-size: 12px;
  font-weight: var(--font-weight-regular);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  line-height: 1.4;
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 300;
  text-decoration: none;
}

.btn-text {
  font-family: var(--font-primary);
  font-size: var(--font-size-body);
  font-weight: var(--font-weight-regular);
  color: var(--color-background);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  text-decoration: none;
  display: inline-block;
}

.btn-text:hover {
  color: var(--color-accent);
}

/* Modal */
.image-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(14, 22, 27, 0.94);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.image-modal.active {
  display: flex;
}

.modal-content {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-image-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.modal-image {
  max-width: 100%;
  max-height: 78vh;
  object-fit: contain;
}

.modal-caption {
  color: var(--color-surface);
  font-size: 12px;
  margin-top: 0.8rem;
  opacity: 0.9;
}

.modal-close,
.modal-nav {
  background: none;
  border: 0;
  color: var(--color-surface);
  cursor: pointer;
}

.modal-close {
  position: absolute;
  top: -8px;
  right: -8px;
  font-size: 2rem;
}

.modal-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 2rem;
}

.modal-prev {
  left: -2.2rem;
}

.modal-next {
  right: -2.2rem;
}

@media (max-width: 991.98px) {
  .topbar {
    display: flex;
  }

  .page-wrap {
    padding-top: 56px;
  }

  .sidebar {
    position: fixed;
    top: 56px;
    left: 0;
    width: 100%;
    max-width: none;
    min-width: 0;
    height: calc(100vh - 56px);
    transform: translateX(-100%);
    transition: transform 0.35s ease;
    z-index: 250;
    border-right: none;
    border-bottom: 0.5px solid var(--color-background);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar-title {
    display: none;
  }

  .sidebar-nav a {
    font-size: 18px;
  }

  .content-area,
  .content-area-info {
    height: calc(100vh - 56px);
  }

  .video-wrapper {
    height: auto;
  }

  .video-ratio {
    height: 0;
    padding-bottom: 56.25%;
  }

  .video-ratio iframe {
    position: absolute;
    top: 0;
    left: 0;
  }

  .content-area-info section,
  #proyecto,
  #proceso,
  .project-info {
    padding: 1.8rem;
  }

  #proyecto .project-mosaic-gallery {
    grid-template-columns: repeat(8, minmax(0, 1fr));
  }

  #publicacion .publication-mosaic-gallery {
    grid-template-columns: repeat(8, minmax(0, 1fr));
  }

  #metafora .metafora-mosaic-gallery {
    grid-template-columns: repeat(8, minmax(0, 1fr));
  }

  #metafora .metafora-panel {
    min-height: 82vh;
    padding-bottom: 8vh;
  }

  #proyecto .project-mosaic-gallery .gallery-img,
  #publicacion .publication-mosaic-gallery .gallery-img,
  #metafora .metafora-mosaic-gallery .gallery-img {
    grid-column: span 4;
  }

  #proyecto .project-mosaic-gallery .gallery-img.tile-h,
  #publicacion .publication-mosaic-gallery .gallery-img.tile-h,
  #metafora .metafora-mosaic-gallery .gallery-img.tile-h {
    grid-column: span 8;
  }

  .mosaic,
  .image-gallery {
    grid-template-columns: repeat(2, 1fr);
  }

  #proceso .process-gallery {
    column-count: 2;
  }

  .btn-circle {
    width: 84px;
    height: 84px;
    bottom: 1rem;
    right: 1rem;
    font-size: 11px;
  }

  .modal-prev {
    left: 0;
  }

  .modal-next {
    right: 0;
  }

  .video-bg-page .sidebar {
    border-bottom: 1px solid rgba(143, 207, 243, 0.35);
  }
}

@media (max-width: 680px) {
  h1 {
    font-size: 30px;
  }

  h2 {
    font-size: 24px;
  }

  h3 {
    font-size: 18px;
  }

  .mosaic,
  .image-gallery {
    grid-template-columns: 1fr;
  }

  #proceso .process-gallery {
    column-count: 1;
  }

  #proyecto .project-mosaic-gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #publicacion .publication-mosaic-gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #metafora .metafora-mosaic-gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #metafora .metafora-panel {
    min-height: auto;
    padding-bottom: 2.4rem;
  }

  #proyecto .project-mosaic-gallery .gallery-img,
  #publicacion .publication-mosaic-gallery .gallery-img,
  #metafora .metafora-mosaic-gallery .gallery-img,
  #proyecto .project-mosaic-gallery .gallery-img.tile-h,
  #publicacion .publication-mosaic-gallery .gallery-img.tile-h,
  #metafora .metafora-mosaic-gallery .gallery-img.tile-h {
    grid-column: span 2;
  }
}
