/* K11 Portfolio — implementación del Figma (Homepage + Contact, 1920 / 1024 / 390) */
:root {
  --black: #000;
  --white: #fff;
  --charcoal-900: #1e1e1e;
  --charcoal-700: #5a5a5a;
  --charcoal-600: #787878;
  --charcoal-500: #969696;
  --charcoal-400: #b4b4b4;
  --charcoal-300: #c8c8c8;

  --s3: 8px;
  --s4: 16px;
  --s5: 24px;
  --s6: 32px;
  --s7: 40px;
  --s8: 48px;
  --s9: 56px;
  --s10: 64px;
  --s14: 96px;

  --r-lg: 16px;
  --r-md: 8px;

  --font-sans: "Inter Tight", system-ui, sans-serif;
  --font-mono: "Fragment Mono", ui-monospace, monospace;

  --h1: 72px;
  --h2: 56px;
  --h3: 48px;
  --h5: 32px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--black);
  color: var(--white);
  font-family: var(--font-sans);
  font-weight: 500;
  line-height: 1.1;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
p, h1, h2, h3 { margin: 0; font-weight: 500; }

/* ---------- Tipografía ---------- */
.h1 { font-size: var(--h1); letter-spacing: -0.04em; }
.h2 { font-size: var(--h2); letter-spacing: -0.04em; }
.h3 { font-size: var(--h3); letter-spacing: -0.04em; }
.h5 { font-size: var(--h5); letter-spacing: -0.04em; }
.body-lg { font-size: 20px; }
.mono { font-family: var(--font-mono); font-weight: 400; text-transform: uppercase; letter-spacing: -0.04em; }
.mono-16 { font-size: 16px; }
.mono-20 { font-size: 20px; }
.eyebrow { color: var(--charcoal-600); }
.muted { color: var(--charcoal-400); }

/* ---------- Layout ---------- */
.page { position: relative; }
.section { padding: var(--s9) var(--s5); }
.stack-48 { display: flex; flex-direction: column; gap: var(--s8); }
.header { display: flex; flex-direction: column; gap: var(--s3); }
.header h2 { max-width: 771px; }
.divider { height: 1px; background: var(--charcoal-700); border: 0; margin: 0; }

/* ---------- Navegación ---------- */
.nav {
  position: absolute;
  z-index: 20;
  top: 48px;
  left: 50%;
  transform: translateX(-50%);
  width: min(1242px, calc(100% - 48px));
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--s5) var(--s6);
  background: rgba(0, 0, 0, 0.2);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-radius: var(--r-lg);
}
.nav__logo, .logo-text { font-size: 24px; letter-spacing: -0.04em; line-height: 1; }
.nav__links { display: flex; gap: var(--s4); align-items: center; }
.nav__links a { transition: opacity .2s; }
.nav__links a:hover, .nav__links a[aria-current="page"] { opacity: .6; }
.nav__toggle { display: none; }

/* ---------- Imagen con contenido encima ---------- */
.frame {
  position: relative;
  overflow: hidden;
  border-radius: var(--r-lg);
  background: var(--charcoal-900);
}
.frame > img.bg {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
}

/* Hero */
.hero { padding: var(--s5); }
.hero .frame { height: 1000px; }
.hero__title {
  position: absolute;
  left: 50%;
  top: calc(50% - 79px);
  transform: translateX(-50%);
  width: min(928px, 100%);
  text-align: center;
  padding: 0 var(--s5);
}
.hero__foot {
  position: absolute;
  left: 24px; right: 24px; bottom: 24px;
  display: flex; align-items: center; justify-content: space-between;
  color: var(--charcoal-300);
}
.hero__foot img { width: 24px; height: 24px; }

/* ---------- Work ---------- */
.project {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s4);
}
.project__text { width: min(771px, 50%); display: flex; flex-direction: column; gap: var(--s4); }
.project__image { width: 928px; max-width: 50%; height: 560px; flex-shrink: 0; }
.badge {
  position: absolute; top: 24px; right: 24px;
  padding: var(--s3) var(--s4);
  border-radius: var(--r-md);
  background: rgba(0, 0, 0, 0.2);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  font-size: 16px;
}
.project .frame img { transition: transform .6s cubic-bezier(.2,.7,.2,1); }
.project:hover .frame img { transform: scale(1.03); }

/* ---------- Services ---------- */
.services__intro { max-width: 1085px; }
.cards { display: flex; gap: var(--s4); }
.card {
  flex: 1;
  min-height: 350px;
  display: flex; flex-direction: column; justify-content: space-between;
  padding: var(--s6);
  border-radius: var(--r-lg);
  background: var(--charcoal-900);
}
.card__head { display: flex; flex-direction: column; gap: var(--s3); }

/* ---------- Feature / CTA con imagen ---------- */
.feature .frame, .cta .frame { height: 800px; }
.feature__text {
  position: absolute; top: 56px; left: 56px;
  width: min(1344px, calc(100% - 112px));
}
.glass-btn {
  display: inline-flex; align-items: center; gap: var(--s3);
  padding: var(--s6) var(--s8);
  border-radius: var(--r-md);
  background: rgba(0, 0, 0, 0.2);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  color: var(--white);
  font-size: 20px;
  border: 0; cursor: pointer;
  transition: background .2s;
}
.glass-btn--light { background: rgba(255, 255, 255, 0.2); }
.glass-btn:hover { background: rgba(255, 255, 255, 0.3); }
.feature .glass-btn { position: absolute; left: 56px; bottom: 56px; }
.cta__inner {
  position: absolute; left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  width: min(928px, 100%);
  padding: 0 var(--s5);
  display: flex; flex-direction: column; align-items: center; gap: var(--s5);
  text-align: center;
}

/* ---------- Testimonials ---------- */
.testimonial { padding-left: calc(50% + 8px); display: flex; flex-direction: column; gap: var(--s7); }
.testimonial__text { display: flex; flex-direction: column; gap: var(--s4); }
.avatars { display: flex; gap: var(--s3); }
.avatar {
  width: 64px; height: 64px; border-radius: 999px; overflow: hidden;
  padding: 0; border: 1px solid transparent; background: none; cursor: pointer;
  opacity: .4; transition: opacity .2s, border-color .2s;
}
.avatar.is-active { opacity: 1; border-color: var(--white); }
.avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 999px; }
.testimonial__text { transition: opacity .25s; }
.testimonial__text.is-fading { opacity: 0; }

/* ---------- Articles ---------- */
.articles { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--s4); }
.article { display: flex; flex-direction: column; gap: var(--s4); }
.article__img { aspect-ratio: 1; }
.article__img img { transition: transform .6s cubic-bezier(.2,.7,.2,1); }
.article:hover .article__img img { transform: scale(1.04); }
.article__head { display: flex; flex-direction: column; gap: var(--s3); }

/* ---------- Footer ---------- */
.footer { padding: var(--s9) var(--s5) 0; }
.footer__box {
  border-top: 1px solid var(--charcoal-700);
  padding: var(--s9) 0;
  display: flex; flex-direction: column; gap: var(--s10);
}
.footer__top, .footer__bottom { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s4); }
.footer__brand { display: flex; flex-direction: column; gap: var(--s5); }
.footer__brand img.logo { width: 61px; height: 24px; }
.newsletter {
  display: flex; align-items: flex-start; gap: var(--s4);
  padding: var(--s4) 0;
  border-bottom: 1px solid var(--charcoal-700);
  max-width: 456px; width: 100%;
}
.newsletter input {
  flex: 1; min-width: 0;
  background: none; border: 0; outline: 0; padding: 0;
  color: var(--white); font: inherit; font-size: 20px; line-height: 1.1;
}
.newsletter input::placeholder { color: var(--white); opacity: 1; }
.newsletter button { background: none; border: 0; padding: 0; cursor: pointer; }
.newsletter button img { width: 22px; height: 22px; }
.footer__links { display: flex; flex-direction: column; gap: var(--s4); font-size: 20px; }
.footer__links a:hover { opacity: .6; }
.footer__bottom { color: var(--charcoal-500); font-size: 16px; }

/* ---------- Contact ---------- */
.contact-hero { padding: var(--s5); }
.contact-hero .frame { height: 800px; }
.contact {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: var(--s4);
  padding: var(--s9) var(--s5) var(--s14);
}
.form { width: min(613px, 100%); display: flex; flex-direction: column; gap: var(--s5); }
.field {
  display: block;
  border-bottom: 1px solid var(--charcoal-700);
  padding: var(--s4) 0;
  transition: border-color .2s;
}
.field:focus-within { border-color: var(--white); }
.field input, .field textarea {
  width: 100%; background: none; border: 0; outline: 0; padding: 0; resize: none;
  color: var(--white); font: inherit; font-size: 20px; line-height: 1.1;
}
.field textarea { height: 148px; }
.field input::placeholder, .field textarea::placeholder { color: var(--white); opacity: 1; }
.form .glass-btn { align-self: flex-start; background: rgba(255,255,255,.2); }
.form__status { min-height: 1.1em; color: var(--charcoal-400); font-size: 16px; }
.info { width: min(928px, 100%); display: flex; flex-direction: column; gap: var(--s6); }
.info__item { display: flex; flex-direction: column; gap: var(--s4); }
.info__item a { transition: opacity .2s; }
.info__item a:hover { opacity: .6; }
.info__socials { display: flex; flex-direction: column; gap: var(--s4); font-size: var(--h5); letter-spacing: -0.04em; }

/* ---------- Tablet (≤1100px, diseño 1024) ---------- */
@media (max-width: 1100px) {
  .nav { top: 48px; width: calc(100% - 96px); }
  .project { align-items: center; }
  .project__text { width: calc(50% - 8px); max-width: none; }
  .project__image { width: calc(50% - 8px); max-width: none; height: 290px; }
  .header h2 { max-width: 645px; }
  .cards { flex-direction: column; }
  .card { min-height: 300px; }
  .hero .frame { height: 1000px; }
  .feature .frame, .cta .frame { height: 600px; }
  .testimonial { padding-left: 331px; }
  .articles { grid-template-columns: repeat(2, 1fr); row-gap: var(--s5); }
  .footer__top, .footer__bottom { grid-template-columns: repeat(3, 1fr); }
  .contact-hero .frame { height: 600px; }
  .contact { flex-direction: column; gap: var(--s10); }
  .form { width: 645px; max-width: 100%; margin-left: 331px; }
  .info { width: 100%; }
}

/* ---------- Móvil (≤700px, diseño 390) ---------- */
@media (max-width: 700px) {
  :root { --h1: 44px; --h2: 36px; --h3: 32px; --h5: 24px; }
  .section { padding: var(--s9) var(--s5); }
  .nav { top: 24px; width: calc(100% - 48px); padding: var(--s5); flex-wrap: wrap; }
  .nav__toggle {
    display: block; background: none; border: 0; padding: 0; cursor: pointer;
    color: var(--white); font-family: var(--font-mono); font-size: 16px; text-transform: uppercase; letter-spacing: -0.04em;
  }
  .nav__links {
    display: none; width: 100%; flex-direction: column; align-items: flex-start;
    gap: var(--s4); padding-top: var(--s5);
  }
  .nav.is-open .nav__links { display: flex; }
  .hero .frame { height: 700px; }
  .hero__title { top: calc(50% - 40px); }
  .project { flex-direction: column; align-items: stretch; gap: var(--s5); }
  .project__text, .project__image { width: 100%; }
  .project__image { height: 208px; }
  .project .h3 { font-size: 32px; }
  .card { padding: var(--s4); min-height: 320px; }
  .card .h3 { font-size: 24px; }
  .feature .frame, .cta .frame { height: 600px; }
  .feature__text { top: 24px; left: 24px; width: calc(100% - 48px); font-size: 24px; letter-spacing: -0.04em; }
  .feature .glass-btn { left: 24px; bottom: 24px; padding: var(--s5) var(--s6); }
  .testimonial { padding-left: 0; }
  .testimonial__text .h3 { font-size: 24px; }
  .articles { grid-template-columns: 1fr; row-gap: var(--s6); }
  .article .h5 { font-size: 24px; }
  .footer__top, .footer__bottom { grid-template-columns: 1fr; gap: var(--s6); }
  .footer__bottom { gap: var(--s4); }
  .contact-hero .frame { height: 600px; }
  .contact { padding-bottom: var(--s10); }
  .form { margin-left: 0; width: 100%; }
  .info__item .h3 { font-size: 24px; }
  .hero__foot { left: 16px; right: 16px; bottom: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}

/* ---------- Galería de fotos ---------- */
.filters { display: flex; flex-wrap: wrap; gap: var(--s3); }
.filters button {
  font: inherit; text-transform: uppercase; letter-spacing: -0.04em;
  color: var(--charcoal-400);
  background: transparent; border: 1px solid var(--charcoal-700);
  border-radius: var(--r-md); padding: var(--s3) var(--s4); cursor: pointer;
  transition: color .2s, background .2s, border-color .2s;
}
.filters button:hover { color: var(--white); border-color: var(--charcoal-500); }
.filters button.is-active { background: var(--white); color: var(--black); border-color: var(--white); }

.grid { column-count: 4; column-gap: var(--s4); }
.tile {
  display: block; width: 100%; margin: 0 0 var(--s4); padding: 0;
  border: 0; background: var(--charcoal-900); cursor: zoom-in;
  border-radius: var(--r-lg); overflow: hidden; break-inside: avoid;
}
.tile img { width: 100%; height: auto; display: block; transition: transform .6s cubic-bezier(.2,.7,.2,1), opacity .3s; }
.tile:hover img { transform: scale(1.03); }

.lightbox {
  border: 0; padding: 0; margin: 0; max-width: none; max-height: none;
  width: 100vw; height: 100dvh; background: rgba(0, 0, 0, 0.94); color: var(--white);
}
.lightbox[open] { display: grid; place-items: center; }
.lightbox::backdrop { background: rgba(0, 0, 0, 0.94); }
.lb__img { max-width: 96vw; max-height: 90dvh; width: auto; height: auto; border-radius: var(--r-md); object-fit: contain; }
.lb__btn {
  position: absolute; background: rgba(255,255,255,.12); color: var(--white);
  border: 0; border-radius: var(--r-md); cursor: pointer; padding: var(--s4) var(--s5);
  font-size: 16px; text-transform: uppercase; letter-spacing: -0.04em;
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); transition: background .2s;
}
.lb__btn:hover { background: rgba(255,255,255,.28); }
.lb__close { top: var(--s5); right: var(--s5); }
.lb__prev { left: var(--s5); top: 50%; transform: translateY(-50%); }
.lb__next { right: var(--s5); top: 50%; transform: translateY(-50%); }
.lb__count { position: absolute; bottom: var(--s5); left: 50%; transform: translateX(-50%); margin: 0; font-size: 16px; color: var(--charcoal-300); }

@media (max-width: 1100px) { .grid { column-count: 3; } }
@media (max-width: 700px) {
  .grid { column-count: 2; column-gap: var(--s3); }
  .tile { margin-bottom: var(--s3); border-radius: var(--r-md); }
  .lb__prev, .lb__next { top: auto; bottom: var(--s5); transform: none; }
  .lb__prev { left: var(--s5); } .lb__next { right: var(--s5); }
  .lb__img { max-height: 78dvh; }
}

/* Velo para que el texto del hero se lea sobre cualquier foto */
.hero .frame::after, .contact-hero .frame::after, .cta .frame::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(rgba(0,0,0,.18), rgba(0,0,0,.38));
}
.hero__title, .hero__foot, .cta__inner { z-index: 1; }
.hero__title { text-shadow: 0 2px 24px rgba(0,0,0,.35); }
