:root {
  --bg: #f7f5f0;
  --text: #111;
  --muted: #777;
  --line: #d7d4ce;
  --pad: clamp(18px, 3vw, 48px);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "DM Sans", Arial, sans-serif;
  font-size: 14px;
  font-weight: 400;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
}

/* =========================================================
   INTRO
   ========================================================= */

.intro {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  background: var(--bg);
  animation: introOut 1.1s ease 1.5s forwards;
}

.intro-logo {
  font-size: clamp(28px, 5vw, 72px);
  letter-spacing: -.04em;
  animation: logoIn 1.2s ease forwards;
}

@keyframes logoIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes introOut {
  0% {
    opacity: 1;
    visibility: visible;
  }

  75% {
    opacity: 1;
  }

  100% {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
  }
}

/* =========================================================
   HEADER
   ========================================================= */

.site-header {
  position: fixed;
  z-index: 50;
  top: 0;
  left: 0;
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 22px var(--pad);
  mix-blend-mode: multiply;
}

.logo {
  font-size: 15px;
  letter-spacing: -.025em;
  white-space: nowrap;
}

.main-nav {
  display: flex;
  gap: clamp(18px, 3vw, 42px);
}

.main-nav a,
.filter {
  position: relative;
  border: 0;
  background: none;
  padding: 0;
  cursor: pointer;
  font-size: 13px;
}

.main-nav a::after,
.filter::after {
  content: "";
  position: absolute;
  left: 0;
  right: 100%;
  bottom: -4px;
  height: 1px;
  background: currentColor;
  transition: right .25s ease;
}

.main-nav a:hover::after,
.filter:hover::after,
.filter.active::after {
  right: 0;
}

/* =========================================================
   PAGES
   ========================================================= */

.page {
  min-height: 100vh;
  padding: 100px var(--pad) 60px;
}

/* =========================================================
   HOME / VIDEO
   ========================================================= */

.page-home {
  min-height: 100svh;
  min-height: 100dvh;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-video {
  position: relative;
  width: 100%;
  height: 100svh;
  height: 100dvh;
  overflow: hidden;
}

.video-portada {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center center;
}

/* =========================================================
   MOBILE VIDEO & HOME SPACING
   ========================================================= */

@media (max-width: 650px) {
  .page-home {
    width: 100%;
    min-height: auto;
    height: auto;
    padding-top: 75px; /* Espacio para no quedar tapado por el header */
    padding-bottom: 0;
    display: block;
  }

  .hero-video {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9; /* Proporción panorámica exacta en móvil */
    overflow: hidden;
  }

  .video-portada {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    object-position: center center;
  }

  /* Distancia limpia y proporcionada con Work en móvil */
  .page-work {
    padding-top: 40px !important;
    min-height: auto;
  }
}

/* =========================================================
   WORK
   ========================================================= */

.page-work {
  padding-top: 125px;
}

.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 30px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 18px;
  margin-bottom: 0;
}

h1 {
  margin: 0;
  font-size: clamp(28px, 5vw, 60px);
  font-weight: 400;
  letter-spacing: -.05em;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
}

/* =========================================================
   PROJECTS (Ajuste uniforme de proporción y llenado)
   ========================================================= */

.project {
  border-bottom: 1px solid var(--line);
  padding: 24px 0 28px;
  scroll-margin-top: 100px;
}

.project-image {
  display: block;
  background: #e4e1da;
  color: #8b8881;
  max-width: 820px;
  margin: 0 auto;
  overflow: hidden;
  aspect-ratio: 16 / 10;
}

.project-image img {
  width: 100%;
  height: 100% !important;
  object-fit: cover;
  object-position: center center;
  display: block;
}

.project-image:hover {
  opacity: .8;
}

.project-info {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 25px;
  align-items: baseline;
  padding-top: 14px;
  max-width: 820px;
  margin: 0 auto;
}

.project-info h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 400;
}

.project-info span {
  color: var(--muted);
  font-size: 12px;
}

.project.hidden {
  display: none;
}

/* =========================================================
   EMPTY PAGES
   ========================================================= */

.empty-page {
  min-height: 100vh;
}

/* =========================================================
   MOBILE — MAIN WEBSITE
   ========================================================= */

@media (max-width: 650px) {
  .site-header {
    align-items: flex-start;
    gap: 18px;
  }

  .main-nav {
    gap: 12px;
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .section-heading {
    display: block;
  }

  .filters {
    margin-top: 22px;
    gap: 12px 18px;
  }

  .project-info {
    grid-template-columns: 1fr auto;
  }

  .project-info span:last-child {
    grid-column: 1 / -1;
  }
}

/* =========================================================
   PROJECT PAGE
   ========================================================= */

.project-page {
  width: 100%;
  max-width: 100%;
  padding: 120px var(--pad) 60px;
  overflow-x: hidden;
}

.project-hero {
  width: 100%;
}

.project-hero-image {
  width: 100%;
  overflow: hidden;
  background: #e4e1da;
}

.project-hero-image img {
  width: 100%;
  height: auto;
  display: block;
}

.project-header {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 40px;
  align-items: baseline;
  padding: 18px 0 40px;
  border-bottom: 1px solid var(--line);
}

.project-header h1 {
  margin: 0;
  font-size: clamp(32px, 6vw, 72px);
  font-weight: 400;
  letter-spacing: -.05em;
}

.project-meta {
  display: flex;
  gap: 30px;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.project-content {
  width: 100%;
  padding-top: 60px;
}

.project-text {
  width: 100%;
  max-width: 600px;
  margin-bottom: 80px;
}

.project-text p {
  margin: 0;
  font-size: 16px;
  line-height: 1.5;
}

.project-image-large {
  width: 100%;
  margin-bottom: 24px;
  overflow: hidden;
}

.project-image-large img {
  width: 100%;
  height: auto;
  display: block;
}

.project-navigation {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 30px;
  padding-top: 50px;
  margin-top: 60px;
  border-top: 1px solid var(--line);
}

.project-navigation a {
  font-size: 13px;
}

.project-navigation a:hover {
  text-decoration: underline;
}

/* =========================================================
   PROJECT PAGE — TABLET
   ========================================================= */

@media (max-width: 900px) {
  .project-page {
    padding-top: 110px;
  }

  .project-header {
    gap: 25px;
  }

  .project-content {
    padding-top: 50px;
  }
}

/* =========================================================
   PROJECT PAGE — MOBILE
   ========================================================= */

@media (max-width: 650px) {
  .project-page {
    width: 100%;
    padding: 95px var(--pad) 40px;
    overflow-x: hidden;
  }

  .project-hero {
    width: 100%;
  }

  .project-hero-image {
    width: 100%;
  }

  .project-hero-image img {
    width: 100%;
    height: auto;
  }

  .project-header {
    display: block;
    padding: 16px 0 28px;
  }

  .project-header h1 {
    font-size: clamp(32px, 11vw, 52px);
    margin-bottom: 18px;
  }

  .project-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 20px;
    font-size: 12px;
    white-space: normal;
  }

  .project-content {
    width: 100%;
    padding-top: 40px;
  }

  .project-text {
    width: 100%;
    max-width: none;
    margin-bottom: 45px;
  }

  .project-text p {
    font-size: 14px;
    line-height: 1.55;
  }

  .project-image-large {
    width: 100%;
    margin-bottom: 16px;
  }

  .project-image-large img {
    width: 100%;
    height: auto;
    display: block;
  }

  .project-navigation {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    padding-top: 30px;
    margin-top: 40px;
  }

  .project-navigation a {
    font-size: 12px;
  }
}

/* =========================================================
   PROJECT PAGE — SMALL PHONES
   ========================================================= */

@media (max-width: 400px) {
  .project-page {
    padding-left: 18px;
    padding-right: 18px;
  }

  .project-header h1 {
    font-size: 34px;
  }

  .project-meta {
    gap: 6px 16px;
  }

  .project-navigation {
    font-size: 12px;
  }

  .project-image-large {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 24px;
    overflow: hidden;
  }

  .project-image-large img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: contain;
  }
}

/* =========================================================
   TWO IMAGES — MOBILE
   ========================================================= */

@media (max-width: 650px) {
  .project-image-large {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .project-image-large img {
    width: 100%;
    height: auto;
  }
}

/* =========================================================
   DESKTOP IMAGES SIZE LIMIT
   ========================================================= */

@media (min-width: 768px) {
  .project-hero-image,
  .project-image-large,
  .project-content .hero-video {
    max-width: 850px;
    margin-left: auto;
    margin-right: auto;
  }

  .project-hero-image img,
  .project-image-large img,
  .project-content video {
    width: 100%;
    height: auto;
    display: block;
  }
}

  .project-hero-image img,
  .project-image-large img,
  .project-content video {
    width: 100%;
    height: auto;
    display: block;
  }
}
