/* ============================================
   CUSTOM PROPERTIES
   ============================================ */
:root {
  --bg:           #ffffff;
  --text:         #0a0a0a;
  --muted:        rgba(10, 10, 10, 0.38);
  --muted-strong: #666666;
  --border:       var(--border);
  --font:         'Inter', system-ui, -apple-system, sans-serif;
  --header-h:     60px;
  --pad-x:        clamp(48px, 6vw, 96px);
}

/* ============================================
   RESET & BASE
   ============================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: 15px;
  scroll-behavior: smooth;
  scroll-snap-type: y mandatory;
  overflow-y: scroll;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-weight: 300;
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; height: auto; }
a   { color: var(--text); text-decoration: none; }
button { cursor: pointer; font-family: var(--font); }

/* ============================================
   LANG TOGGLE
   ============================================ */
#lang-fixed {
  position: fixed;
  top: 20px;
  right: var(--pad-x);
  z-index: 500;
  transition: opacity 0.3s ease;
}

/* Se oculta cuando el header sticky aparece (clase aplicada por JS) */
#lang-fixed.hidden {
  opacity: 0;
  pointer-events: none;
}

#langToggle {
  font-family: var(--font);
  font-size: 12px;
  font-weight: 300;
  letter-spacing: -0.02em;
  color: var(--text);
  cursor: pointer;
  user-select: none;
  display: inline-block;
  padding: 0.15em 0.35em;
  border-radius: 2px;
  transition: background 0.15s ease, color 0.15s ease;
}

#langToggle:hover {
  background: var(--text);
  color: var(--bg);
}

.header-lang {
  cursor: pointer;
  user-select: none;
}

/* ============================================
   HEADER STICKY
   ============================================ */
#siteHeader {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 300;
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--pad-x);
  background: var(--bg);
  border: none;
  box-shadow: none;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

#siteHeader.visible {
  opacity: 1;
  pointer-events: auto;
}

/* Visible encima del overlay de proyecto */
#siteHeader.over-overlay {
  opacity: 1;
  pointer-events: auto;
  z-index: 450;
}

.header-name {
  font-size: clamp(14px, 1.2vw, 18px);
  font-weight: 500;
  letter-spacing: -0.05em;
  color: var(--text);
  text-decoration: none;
}

.header-nav {
  display: flex;
  gap: 2em;
  padding-right: 48px;
}

.header-nav-link {
  font-size: clamp(13px, 1vw, 16px);
  font-weight: 300;
  letter-spacing: -0.05em;
  color: var(--text);
  padding: 0.1em 0.3em;
  border-radius: 2px;
  transition: background 0.15s ease, color 0.15s ease;
}

.header-nav-link:hover {
  background: var(--text);
  color: var(--bg);
}

.header-nav-link.active {
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

.header-nav-link.active:hover {
  text-decoration: none;
}

/* ============================================
   SECCIONES — scroll snap
   ============================================ */
section {
  min-height: 100vh;
  scroll-snap-align: start;
  padding-left: var(--pad-x);
  padding-right: var(--pad-x);
  display: flex;
  flex-direction: column;
}

#home {
  justify-content: center;
  position: relative;
  overflow: hidden;
}

#about,
#work {
  justify-content: flex-start;
  padding-top: 100px;
  padding-bottom: 80px;
}

#contact {
  justify-content: center;
  padding-top: 0;
  padding-bottom: 0;
}

/* ============================================
   TÍTULO DE SECCIÓN
   ============================================ */
.section-title {
  font-size: clamp(48px, 7vw, 96px);
  font-weight: 400;
  letter-spacing: -0.1em;
  line-height: 1;
  margin-bottom: 0.6em;
  color: var(--text);
}

/* ============================================
   LANDING — #home
   ============================================ */
.hero-bg-video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;         /* viewport directo — no depende del padre */
  display: block;
  object-fit: cover;
  object-position: right bottom;
  z-index: 0;
  pointer-events: none;
}

.home-block {
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 1;
}

.home-greeting {
  font-size: clamp(32px, 4.5vw, 64px);
  font-weight: 400;
  letter-spacing: -0.1em;
  line-height: 1;
}

.greeting-light { font-weight: 300; }
.greeting-bold  { font-weight: 500; }

/* Nav inline en la landing */
.home-nav {
  display: flex;
  gap: 0.45em;
  margin-top: 0.1em;
}

.landing-nav-item {
  font-size: clamp(32px, 4.5vw, 64px);
  font-weight: 300;
  letter-spacing: -0.1em;
  line-height: 1;
  display: inline-block;
  padding: 0.04em calc(0.12em + 0.1em) 0.04em 0.12em;
  color: var(--text);
  text-decoration: none;
  border-radius: 2px;
  transition: background 0.15s ease, color 0.15s ease;
}

.landing-nav-item:hover {
  background: var(--text);
  color: var(--bg);
  text-decoration: none;
}

/* sección activa — subrayado */
.landing-nav-item.active {
  text-decoration: underline;
  text-underline-offset: 0.1em;
}

.landing-nav-item.active:hover {
  text-decoration: none;
  background: var(--text);
  color: var(--bg);
}

/* ============================================
   SECTION-CONTENT — animación de entrada
   ============================================ */
.section-content {
  opacity: 0;
  transform: translateY(48px);
  transition: opacity 0.65s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.65s cubic-bezier(0.22, 1, 0.36, 1);
}

.section-content.in-view {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .section-content {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* ============================================
   ABOUT — #about
   ============================================ */
.about-inner {
  position: relative;
  min-height: 55vh;
}

.about-statement {
  font-size: clamp(24px, 3.4vw, 52px);
  font-weight: 400;
  letter-spacing: -0.05em;
  line-height: 1.08;
  color: var(--text);
  margin: 0 0 0.35em;
  position: relative;
  z-index: 1;
}

.about-statement strong { font-weight: 500; }

.about-cta {
  font-size: clamp(24px, 3.4vw, 52px);
  font-weight: 400;
  letter-spacing: -0.05em;
  line-height: 1.08;
  color: var(--text);
  text-decoration: none;
  display: inline-block;
  padding: 0.04em 0.12em;
  margin-left: -0.12em;
  border-radius: 2px;
  position: relative;
  z-index: 1;
  transition: background 0.15s ease, color 0.15s ease;
}

.about-cta:hover {
  background: var(--text);
  color: var(--bg);
}

.about-photo {
  position: absolute;
  top: 18%;
  right: 3%;
  width: clamp(200px, 30vw, 420px);
  height: auto;
  object-fit: cover;
  object-position: center top;
  display: block;
  z-index: 0;           /* detrás del texto */
}

/* ============================================
   WORK — #work
   ============================================ */
.project-grid-wrap {
  margin: 0 calc(-1 * var(--pad-x));
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.project-grid-wrap::-webkit-scrollbar { display: none; }

.project-grid {
  display: flex;
  gap: 20px;
  list-style: none;
  padding: 0 var(--pad-x);
}

.project-card {
  flex-shrink: 0;
  width: calc((100vw - var(--pad-x) * 2 - 60px) / 4 * 1.5);
  cursor: pointer;
  transition: opacity 0.25s ease;
  align-self: flex-start;
}

.project-grid:hover .project-card       { opacity: 0.45; }
.project-grid:hover .project-card:hover { opacity: 1; }

.project-card__cover {
  width: 100%;
  overflow: hidden;
  background: rgba(10, 10, 10, 0.05);
}

.project-card__cover img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 0.55s cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* Pícara — proporciones naturales, recorte suave de bordes */
.project-card--crop .project-card__cover { overflow: hidden; }
.project-card--crop .project-card__cover img {
  transform: scale(1.18);
  transform-origin: center center;
  transition: transform 0.55s cubic-bezier(0.16, 1, 0.3, 1);
}
.project-card--crop:hover .project-card__cover img {
  transform: scale(1.22);
}

/* Sommer — cuadrado con fondo negro, imagen contenida */
.project-card--sommer .project-card__cover {
  aspect-ratio: 1 / 1;
  background-color: #FCFCFC;
}
.project-card--sommer .project-card__cover img {
  height: 100%;
  object-fit: contain;
}

.project-card__title {
  margin-top: 10px;
  font-size: 13px;
  font-weight: 400;
  letter-spacing: -0.025em;
  color: var(--text);
}

.project-card__label {
  margin-top: 2px;
  font-size: 13px;
  font-weight: 300;
  letter-spacing: -0.025em;
  color: var(--muted);
}

/* ============================================
   CONTACT — #contact
   ============================================ */
.contact-inner {
  display: flex;
  flex-direction: column;
  gap: 2em;
  margin-bottom: 3em;
}

.contact-hablemos {
  font-size: clamp(48px, 7vw, 96px);
  font-weight: 400;
  letter-spacing: -0.1em;
  line-height: 1;
  color: var(--text);
  margin: 0;
}

.contact-links {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.contact-link {
  font-size: clamp(16px, 1.8vw, 22px);
  font-weight: 300;
  letter-spacing: -0.01em;
  line-height: 1.9;
  color: var(--text);
  text-decoration: none;
  display: block;
}

.contact-link:hover { text-decoration: underline; }

.contact-note {
  font-size: 0.7em;
  font-weight: 300;
  color: var(--muted);
  letter-spacing: 0;
}

.contact-cv {
  margin-top: 1.5em;
  font-size: clamp(16px, 1.8vw, 22px);
  font-weight: 300;
  letter-spacing: -0.01em;
  line-height: 1.9;
  color: var(--text);
}

.contact-cv__label,
.contact-cv__sep {
  color: var(--text);
}

.contact-cv__lang {
  display: inline-block;
  padding: 0 0.2em;
  margin: 0 -0.2em;
  border-radius: 2px;
  color: var(--text);
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
}

.contact-cv__lang:hover {
  background: var(--text);
  color: var(--bg);
}


/* ============================================
   HOVER PREVIEW
   ============================================ */
#work-preview {
  position: fixed;
  top: 0; left: 0;
  pointer-events: none;
  z-index: 150;
  opacity: 0;
  transform: scale(0.96) translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  will-change: left, top;
  border-radius: 2px;
  overflow: hidden;
}

#work-preview.visible {
  opacity: 1;
  transform: scale(1) translateY(0);
}

#work-preview-img {
  display: block;
  width: auto;
  height: auto;
  max-width: 260px;
  max-height: 320px;
  object-fit: contain;
}

/* ============================================
   CURSOR FOLLOWER
   ============================================ */
#cursor-follower {
  position: fixed;
  top: 0; left: 0;
  width: 26px; height: 26px;
  border: 1px solid rgba(10, 10, 10, 0.18);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  opacity: 0;
  will-change: transform;
  transition: opacity 0.35s ease, width 0.2s ease, height 0.2s ease;
}

#cursor-follower.grow { width: 44px; height: 44px; }

/* ============================================
   OVERLAY — Detalle de proyecto
   ============================================ */
.overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: var(--bg);
  z-index: 400;
  display: none;
}

#view-detail {
  padding: calc(var(--header-h) + 28px) 80px 100px;
  overflow: hidden;
  flex-direction: row;
}

.detail-counter {
  position: fixed;
  bottom: 32px; right: 40px;
  font-size: 12px;
  color: var(--text);
  opacity: 0.28;
  letter-spacing: 0.02em;
  z-index: 5;
}


.detail {
  display: none;
  flex-direction: row;
  flex: 1;
  min-width: 0;
  gap: 48px;
}

.detail__info {
  width: 220px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding-bottom: 2px;
}

.detail__caption { font-size: 13px; }
.detail__title   { font-weight: 600; letter-spacing: -0.02em; }
.detail__year    { font-weight: 400; }

.detail__meta {
  font-size: 13px;
  letter-spacing: -0.025em;
  text-transform: none;
  color: var(--muted-strong);
  margin-top: 12px;
}

.detail__desc {
  font-size: 13px;
  line-height: 1.65;
  margin-top: 8px;
  color: var(--muted-strong);
  letter-spacing: -0.025em;
}

.detail__strip {
  flex: 1;
  min-width: 0;
  display: flex;
  gap: 4px;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
}

.detail__strip::-webkit-scrollbar { display: none; }

.detail__strip img {
  height: 100%;
  width: auto;
  max-width: none;
  flex-shrink: 0;
  display: block;
  transition: opacity 0.2s ease;
  cursor: zoom-in;
}

.detail__strip img:hover { opacity: 0.82; }

#detail-related {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: 16px 80px;
  display: flex;
  align-items: center;
  gap: 16px;
  border-top: 1px solid var(--border);
  background: var(--bg);
  z-index: 10;
}

.related__more {
  font-size: 13px;
  font-weight: 300;
  letter-spacing: -0.025em;
  color: var(--text);
  text-decoration: none;
  display: inline-block;
  padding: 0.04em 0.12em;
  border-radius: 2px;
  transition: background 0.15s ease, color 0.15s ease;
}

.related__more:hover {
  background: var(--text);
  color: var(--bg);
}

/* ============================================
   LIGHTBOX
   ============================================ */
#lightbox {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.96);
  z-index: 600;
  display: none;
  align-items: center;
  justify-content: center;
}

#lightbox.open { display: flex; }

#lbImg {
  max-width: 90vw;
  max-height: 90vh;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
  user-select: none;
}

#lbClose {
  position: fixed;
  top: 20px; right: 36px;
  background: none; border: none;
  color: #fff;
  font-size: 30px; font-weight: 300;
  opacity: 0.45;
  transition: opacity 0.15s ease;
  padding: 8px; line-height: 1;
}

#lbClose:hover { opacity: 1; }

.lb-arrow {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  background: none; border: none;
  color: #fff;
  font-size: 44px; font-weight: 300;
  padding: 20px;
  opacity: 0.28;
  transition: opacity 0.15s ease;
}

.lb-arrow:hover { opacity: 1; }
#lbPrev { left: 0; }
#lbNext { right: 0; }
.lb-arrow[hidden] { display: none; }

/* ============================================
   ANIMACIÓN ENTRADA
   ============================================ */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

#home .home-block {
  opacity: 0;
  animation: fadeUp 0.45s ease forwards 0.05s;
}

/* ============================================
   RESPONSIVE < 768px
   ============================================ */
@media (max-width: 768px) {
  :root { --pad-x: 24px; }

  #siteHeader { padding: 0 24px; }
  .header-nav { gap: 1.2em; padding-right: 36px; }

  .section-title { font-size: clamp(36px, 10vw, 64px); }

  .about-photo {
    top: 20%;
    right: -4px;
    width: clamp(100px, 32vw, 170px);
    transform: none;
  }


  .project-card { width: calc((100vw - var(--pad-x) * 2 - 20px) / 1.5); }

  #view-detail {
    padding: calc(var(--header-h) + 20px) 20px 80px;
    overflow-y: auto;
  }

  .detail { flex-direction: column; gap: 20px; }
  .detail__info { width: auto; justify-content: flex-start; }
  .detail__strip { min-height: 200px; }
  #detail-related { padding: 0 20px; }
}
