/* Portafolio Trabajo
   Inicio transcrito de shameelnasir.com a 1440 px: columna de 1200, tarjetas de
   1200 x 810 pegadas a 160 px del borde, 144 px entre tarjetas, titulares Manrope 500.
   Fondo negro, texto blanco, cada tarjeta con el color de su proyecto. */

:root {
  --base: #0a0303;
  --fg: #ffffff;
  --fg-mid: rgba(255, 255, 255, 0.6);
  --fg-soft: rgba(255, 255, 255, 0.14);
  --accent: #e20b23;
  --font: "Manrope", "Helvetica Neue", Arial, sans-serif;
  --mono: "DM Mono", ui-monospace, Menlo, monospace;
  --col: 1200px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--base);
  color: var(--fg);
  font-family: var(--font);
  font-weight: 500;
  font-size: 18px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
p, h1, h2, ul { margin: 0; }
ul { padding: 0; list-style: none; }
a:focus-visible { outline: 2px solid var(--fg); outline-offset: 4px; }
::selection { background: var(--accent); color: var(--fg); }

.wrap {
  width: min(var(--col), 100% - 48px);
  margin-inline: auto;
  position: relative;
}

/* Grilla de fondo en todo el ancho, alineada a la columna: una línea cada 150 px */
.grid-lines {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image: linear-gradient(to right, rgba(255, 255, 255, 0.07) 1px, transparent 1px);
  /* Diez columnas de lado a lado de la pantalla, desfasadas media columna:
     ninguna línea cae en el borde ni en el filo del contenido. */
  background-size: 10vw 100%;
  background-position: 5vw 0;
}
@media (max-width: 1260px) {
  .grid-lines { background-size: calc(100vw / 6) 100%; background-position: calc(100vw / 12) 0; }
}

header, main, footer { position: relative; z-index: 1; }

/* Barra superior: banda de lado a lado que tapa la grilla */
.site-head {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(10, 3, 3, 0.72);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--fg-soft);
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 90px;
}
.brand { font-size: 20px; font-weight: 400; letter-spacing: -0.4px; }
.nav nav, .foot nav { display: flex; gap: 48px; font-weight: 400; font-size: 16px; letter-spacing: -0.4px; }
.nav nav a, .foot nav a { color: var(--fg-mid); }
.nav nav a:hover, .foot nav a:hover, .nav nav a[aria-current] { color: var(--fg); }
/* Íconos de teléfono y correo en la barra de arriba */
.nav .icon { display: inline-flex; color: var(--fg-mid); transition: color .2s ease; }
.nav .icon:hover { color: var(--fg); }
.nav .icon svg { width: 20px; height: 20px; }
.nav .icon + .icon { margin-left: -26px; } /* los dos íconos juntos, a 22 px */

/* Selector de idioma: EN / ES, el actual en blanco y el otro apagado */
.nav nav { align-items: center; }
.brand { white-space: nowrap; }
.lang { display: flex; align-items: baseline; font-family: var(--mono); font-weight: 300; font-size: 14px; letter-spacing: 0; color: var(--fg-mid); }
.lang > :last-child::before { content: "/"; padding: 0 8px; color: var(--fg-mid); opacity: .6; }
.lang span[aria-current] { color: var(--fg); }
.nav .lang a:hover { color: var(--fg); }

/* Apertura */
.intro { padding-top: 112px; }
h1 {
  font-size: 104px;
  line-height: 130px;
  letter-spacing: -4px;
  font-weight: 500;
}
.lead {
  margin-top: 80px;
  font-size: 64px;
  line-height: 86.4px;
  letter-spacing: -2.7px;
  text-wrap: balance;
}

/* Título que rota: la línea de abajo sale hacia arriba y entra la siguiente
   desde abajo, en medio segundo (como el inicio de shameelnasir.com). */
.intro h1 > span { display: block; }
.intro h1 > .rotator {
  display: grid;
  /* recorta lo que sale y lo que entra: nunca se monta sobre la primera línea.
     El relleno de abajo deja espacio a las letras con cola (g, p, y). */
  overflow: hidden;
  padding-bottom: 0.14em;
  margin-bottom: -0.14em;
}
.rot-item {
  grid-area: 1 / 1;
  opacity: 0;
  white-space: nowrap;
  transform: translateY(115%);
  transition: transform .5s cubic-bezier(.22, .61, .36, 1), opacity .5s cubic-bezier(.22, .61, .36, 1);
}
.rot-item.is-on { opacity: 1; transform: none; }
.rot-item.is-out { opacity: 0; transform: translateY(-115%); }
@media (prefers-reduced-motion: reduce) {
  .rot-item, .rot-item.is-out { transform: none; transition: opacity .3s linear; }
}

/* Casos: cada tarjeta se pega a 160 px y la siguiente sube encima.
   main.js la achica y la sube un poco mientras sigue el scroll. */
.cases {
  padding-top: 112px;
  display: flex;
  flex-direction: column;
  gap: 144px;
}
.case {
  position: sticky;
  top: 160px;
  transform-origin: 50% 50%;
}

.card {
  display: flex;
  flex-direction: column;
  height: min(810px, calc(100vh - 120px));
  min-height: 600px;
  padding: 24px;
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg);
  color: var(--fg-card);
  border: 1px solid var(--edge, transparent);
  box-shadow: 0 -48px 66px rgba(0, 0, 0, 0.25);
}

.card-top {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--rule);
  font-family: var(--mono);
  font-weight: 300;
  font-size: 14px;
  line-height: 1.3;
}
.card-top p:last-child { text-align: right; white-space: nowrap; }

.card-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 6px;
}
.card-title h2 {
  font-size: 64px;
  line-height: 86px;
  letter-spacing: -2.7px;
  font-weight: 500;
}
.arrow {
  width: 44px;
  height: 44px;
  color: var(--fg-card);
  flex: none;
}

/* Colores de cada proyecto. En el inicio van del más oscuro al más claro. */
.c-live   { --bg: #0a1838; --fg-card: #ffffff; --rule: rgba(255, 255, 255, 0.2); --dot: #3b6cff; --dot-fg: #ffffff; --frame: #ffffff; }
.c-oneone { --bg: #d9eadc; --fg-card: #101418; --rule: rgba(16, 20, 24, 0.14); --dot: #34d399; --dot-fg: #101418; --frame: #101418; }
.c-ffk    { --bg: #f3c9d7; --fg-card: #3d1a4f; --rule: rgba(61, 26, 79, 0.18); --dot: #e91e8c; --dot-fg: #ffffff; --frame: #3d1a4f; }
.c-pura   { --bg: #0f3a28; --fg-card: #f6f4ee; --rule: rgba(246, 244, 238, 0.2); --dot: #c9502a; --dot-fg: #ffffff; --frame: #f6f4ee; }
.c-zait   { --bg: #bfe3f5; --fg-card: #0d2a38; --rule: rgba(13, 42, 56, 0.18); --dot: #0d2a38; --dot-fg: #bfe3f5; --frame: #0d2a38; }
.c-pro    { --bg: #111113; --fg-card: #ffffff; --rule: rgba(255, 255, 255, 0.16); --dot: #ffffff; --dot-fg: #111113; --frame: #ffffff; --edge: #2a2a2e; }
.c-meta   { --bg: #ebe9e4; --fg-card: #111111; --rule: rgba(17, 17, 17, 0.14); --dot: #e20b23; --dot-fg: #ffffff; --frame: #111111; }
.c-loja   { --bg: #0c2a6b; --fg-card: #ffffff; --rule: rgba(242, 106, 27, 0.6); --dot: #f26a1b; --dot-fg: #ffffff; }
.c-yt     { --bg: #1a1210; --fg-card: #ffffff; --rule: rgba(255, 255, 255, 0.16); --edge: #2c211d; }
.c-frisia { --bg: #1f2318; --fg-card: #f1ede4; --rule: rgba(241, 237, 228, 0.2); --frame: #f1ede4; }
.c-3dcal  { --bg: #232323; --fg-card: #ffffff; --rule: rgba(255, 255, 255, 0.16); --edge: #333333; }
.c-stk    { --bg: #141414; --fg-card: #ffffff; --edge: #2a2a2a; }
.c-museo  { --bg: #8c8c91; --fg-card: #ffffff; }
.c-render { --bg: #0e0e0e; --fg-card: #ffffff; --edge: #262626; }
.c-scan   { --bg: #2a2825; --fg-card: #ffffff; }
.c-model  { --bg: #1c1c1c; --fg-card: #ffffff; --edge: #2c2c2c; }
.c-tv     { --bg: #cfc7ba; --fg-card: #1d1a16; --rule: rgba(29, 26, 22, 0.16); }

/* Composición de pantallas al pie de la tarjeta */
.shots {
  position: relative;
  flex: 1;
  margin-top: 22px;
  min-height: 0;
}
.shot {
  position: absolute;
  bottom: -24px;
  object-fit: cover;
  object-position: top;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
}
.shot--back { left: 46%; width: 38%; top: 0; height: calc(100% + 24px); }
.shot--front { left: 4%; width: 46%; top: 12%; height: calc(88% + 24px); }
/* dos capturas sin celular (Graphic design, 3D): mismo ancho, centradas, la de adelante más baja */
.shots--par .shot--back { left: 48%; width: 43%; top: 0; height: calc(100% + 24px); }
.shots--par .shot--front { left: 9%; width: 43%; top: 10%; height: calc(90% + 24px); }
/* 3D: las dos capturas completas (no son páginas web, se nota si se cortan). Mismo ancho que
   las de Graphic design (43%; 52% en celular), pero más bajas (1440 x 1580) para que se vean
   enteras; si el alto no alcanza, achican. La de adelante un poco más baja. */
.shots--entera { container-type: size; }
/* --h: alto de cada captura; el par (con el escalón de la de adelante) va centrado de alto */
.shots--entera .shot { --h: min(93cqh, 47.2cqw); --y: max(0px, (100cqh - var(--h) * 1.075) / 2);
  bottom: auto; width: auto; aspect-ratio: 1440 / 1580; height: var(--h); }
.shots--entera .shot--back { top: var(--y); left: 48%; }
.shots--entera .shot--front { top: calc(var(--y) + var(--h) * 0.075); left: auto; right: 48%; }
.phone {
  position: absolute;
  left: 81%;
  top: 7%;
  width: 14.5%;
  aspect-ratio: 132 / 272;
  padding: 5px;
  border-radius: 20px;
  background: var(--frame);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.4);
}
.phone img { width: 100%; height: 100%; object-fit: cover; object-position: top; border-radius: 15px; }

/* Mosaico de anuncios dentro de la tarjeta */
.mosaic {
  flex: 1;
  min-height: 0;
  margin-top: 22px;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 14px;
  overflow: hidden;
}
.mosaic-col { display: flex; flex-direction: column; gap: 14px; }
.mosaic-col:nth-child(even) { margin-top: -90px; }
.mosaic img { width: 100%; height: auto; border-radius: 6px; box-shadow: 0 10px 24px rgba(0, 0, 0, 0.22); }
.mosaic.m3 { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.mosaic.m3 .mosaic-col { gap: 20px; }
.mosaic.m3 .mosaic-col:nth-child(even) { margin-top: -60px; }
.mosaic.m5 { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 18px; }
.mosaic.m5 .mosaic-col { gap: 18px; }

/* Un render que llena la tarjeta (3D) */
.full { flex: 1; min-height: 0; margin-top: 22px; border-radius: 6px; overflow: hidden; }
.full img { width: 100%; height: 100%; object-fit: cover; }

/* Sobre mí: columna de 600 px con la etiqueta ".about" y su línea, como Shameel.
   La foto va a la derecha cuando llegue (img dentro de .about). */
.about {
  margin-top: 220px;
  display: grid;
  grid-template-columns: 600px 315px;
  column-gap: 200px; /* foto 30% más cerca del texto que pegada al borde */
  justify-content: start;
  align-items: center;
}
.about .label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-weight: 300;
  font-size: 18px;
  line-height: 1.1;
  color: rgba(255, 255, 255, 0.5);
}
.about .label::after { content: ""; flex: 1; height: 1px; background: rgba(255, 255, 255, 0.25); }
.about-text p:not(.label) {
  margin-top: 24px;
  font-size: 22px;
  line-height: 1.6;
  letter-spacing: -0.2px;
  color: rgba(255, 255, 255, 0.85);
}
.about-photo { width: 315px; height: 420px; object-fit: cover; border-radius: 8px; }
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 300px;
  height: 52px;
  margin-top: 56px;
  background: var(--accent);
  color: var(--fg);
  font-family: var(--mono);
  font-weight: 300;
  font-size: 18px;
}
.button svg { width: 14px; height: 14px; }
.button:hover { background: var(--fg); color: var(--base); }

/* Pie: banda de lado a lado que tapa la grilla */
.site-foot {
  margin-top: 140px;
  background: var(--base);
  border-top: 1px solid var(--fg-soft);
}
.foot {
  padding-block: 40px 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Flecha para regresar, en la barra de arriba de las páginas internas */
.crumb { display: flex; align-items: center; gap: 14px; }
.crumb span { color: var(--fg-mid); font-family: var(--mono); font-weight: 300; font-size: 14px; }
.back {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  margin-right: 6px;
  color: var(--fg);
  transition: transform .2s ease;
}
.back svg { width: 24px; height: 24px; }
.back:hover { transform: translateX(-4px); }

/* Página de cada proyecto */
.case-page { padding-top: 112px; }
.case-page .tagline {
  margin-top: 32px;
  font-family: var(--mono);
  font-weight: 300;
  font-size: 18px;
  color: var(--fg-mid);
}
.case-hero {
  margin-top: 72px;
  height: 700px;
  padding: 24px;
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  border: 1px solid var(--edge, transparent);
}
.case-hero .shots { margin-top: 0; }

/* Página de categoría: por proyecto, un collage chico, el título y sus links */
.projects { margin-top: 72px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 80px 24px; align-items: start; }
.mini {
  display: flex;
  flex-direction: column;
  height: 440px;
  padding: 24px 24px 0;
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg);
  border: 1px solid var(--edge, transparent);
  transition: transform .3s cubic-bezier(.22, .61, .36, 1);
}
.mini:hover { transform: translateY(-6px); }
.mini > .shots, .mini > .mosaic, .mini > .full { margin-top: 0; }
.mini > .full { margin-bottom: 24px; }
.mini .mosaic-col:nth-child(even) { margin-top: -60px; }
.mosaic.m2 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.mosaic.m4 { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.mosaic.m2 .mosaic-col { gap: 16px; }
.project h2 { margin-top: 24px; font-size: 40px; line-height: 1.2; letter-spacing: -1.4px; font-weight: 500; }
.project-buttons { margin-top: 18px; display: flex; flex-wrap: wrap; gap: 10px; }
.project-buttons a { padding: 11px 18px; border: 1px solid var(--fg-soft); border-radius: 4px; font-family: var(--mono); font-weight: 300; font-size: 14px; color: var(--fg); transition: background .2s ease, color .2s ease; }
.project-buttons a::after { content: " ↗"; }
.project-buttons a:hover { background: var(--fg); color: var(--base); }
.project-line { margin-top: 10px; font-family: var(--mono); font-weight: 300; font-size: 14px; line-height: 1.5; color: var(--fg-mid); }

/* Galería de piezas (diseño y 3D): columnas que respetan el formato de cada pieza */
.gallery { margin-top: 72px; columns: 3; column-gap: 16px; }
.gallery.g2 { columns: 2; }
.gallery.g1 { columns: 1; }
/* filas del mismo alto (3D scanning): cada imagen crece según su proporción, --a = ancho/alto */
.gallery.filas { columns: auto; display: flex; flex-direction: column; gap: 16px; }
.fila { display: flex; gap: 16px; }
.fila img { flex: var(--a) 1 0; min-width: 0; width: auto; margin-bottom: 0; }
.gallery img { display: block; width: 100%; height: auto; margin-bottom: 16px; border-radius: 6px; break-inside: avoid; }

/* Tres capturas chicas en fila, del mismo ancho que la imagen de arriba */
.big-shots { margin-top: 16px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.big-shots img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  object-position: top;
  border-radius: 6px;
  border: 1px solid var(--fg-soft);
}

.live { margin-top: 96px; }
.live-list { border-top: 1px solid var(--fg-soft); }
.live-list a {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 32px;
  padding-block: 28px;
  border-bottom: 1px solid var(--fg-soft);
  font-size: 32px;
  letter-spacing: -1px;
}
.live-list .url { font-family: var(--mono); font-weight: 300; font-size: 14px; color: var(--fg-mid); letter-spacing: 0; }
.live-list svg { width: 26px; height: 26px; }
.live-list a:hover { color: var(--accent); }
.live-list a:hover .url { color: var(--accent); }

/* Tablet */
@media (max-width: 1260px) {
  h1 { font-size: 80px; line-height: 1.2; letter-spacing: -3px; }
  .lead { font-size: 48px; line-height: 1.3; letter-spacing: -2px; }
  .about { grid-template-columns: minmax(0, 600px) 260px; gap: 40px; }
  .about-photo { width: 260px; height: 347px; }
  .cases { padding-top: 96px; gap: 110px; }
}

/* Celular */
@media (max-width: 760px) {
  .wrap { width: calc(100% - 32px); }
  .grid-lines { background-size: 25vw 100%; background-position: 12.5vw 0; }
  .nav { height: 72px; }
  .nav nav, .foot nav { gap: 24px; }
  .nav nav { gap: 18px; }
  .nav .icon + .icon { margin-left: -4px; }
  .lang > :last-child::before { padding: 0 5px; }
  .intro, .case-page { padding-top: 56px; }
  h1 { font-size: 52px; line-height: 1.1; letter-spacing: -2px; }
  .intro h1 { font-size: 42px; line-height: 1.15; letter-spacing: -1.6px; }
  .lead { margin-top: 32px; font-size: 30px; line-height: 1.3; letter-spacing: -1px; }
  .cases { padding-top: 56px; gap: 40px; }
  .case { top: 88px; }
  .card { height: 480px; min-height: 0; padding: 16px; }
  .card-top { font-size: 12px; flex-direction: column; gap: 4px; }
  .card-top p:last-child { text-align: left; }
  .card-title h2 { font-size: 36px; line-height: 1.3; letter-spacing: -1.4px; }
  .arrow { width: 30px; height: 30px; }
  .shot { bottom: -16px; }
  .shot--back { left: 34%; width: 52%; height: calc(100% + 16px); }
  .shot--front { left: 0; width: 56%; height: calc(88% + 16px); }
  .shots--par .shot--back { left: 47%; width: 52%; height: calc(100% + 16px); }
  .shots--par .shot--front { left: 1%; width: 52%; height: calc(90% + 16px); }
  .shots--entera .shot { --h: min(93cqh, 57cqw); }
  .shots--entera .shot--back { left: auto; right: 1%; }
  .shots--entera .shot--front { left: 1%; right: auto; }
  .phone { left: 76%; width: 23%; padding: 3px; border-radius: 12px; }
  .phone img { border-radius: 9px; }
  .mosaic { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
  .mosaic-col { gap: 8px; }
  .mosaic-col:nth-child(even) { margin-top: -40px; }
  .mosaic-col:nth-child(n+5) { display: none; }
  .mosaic.m3 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .mosaic.m5 { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
  .mosaic.m5 .mosaic-col, .mosaic.m3 .mosaic-col { gap: 8px; }
  .mosaic.m3 .mosaic-col:nth-child(3) { display: none; }
  .mosaic.m3 .mosaic-col:nth-child(even) { margin-top: -30px; }
  .gallery { margin-top: 40px; columns: 2; column-gap: 8px; }
  .projects { margin-top: 40px; grid-template-columns: 1fr; gap: 56px; }
  .mini { height: 300px; padding: 16px 16px 0; }
  .mini > .full { margin-bottom: 16px; }
  .mini .mosaic-col:nth-child(even) { margin-top: -30px; }
  .mosaic.m2, .mosaic.m4, .mosaic.m2 .mosaic-col { gap: 8px; }
  .project h2 { margin-top: 16px; font-size: 30px; letter-spacing: -1px; }
  .gallery.g2, .gallery.g1 { columns: 1; }
  .gallery img { margin-bottom: 8px; border-radius: 4px; }
  .gallery.filas, .fila { gap: 8px; }
  /* en celular, las filas de 4 van de 2 en 2 */
  .fila--4 { flex-wrap: wrap; }
  .fila--4 img { flex: 0 0 calc((100% - 8px) * var(--p)); }
  .about { margin-top: 120px; grid-template-columns: 1fr; gap: 40px; }
  .about-text p:not(.label) { font-size: 18px; line-height: 1.6; }
  .about-photo { width: 100%; height: auto; aspect-ratio: 3 / 4; }
  .case-page .tagline { font-size: 14px; margin-top: 20px; }
  .big-shots { gap: 8px; margin-top: 8px; }
  .big-shots img { border-radius: 4px; }
  .button { width: 100%; margin-top: 40px; }
  .crumb span { display: none; }
  .crumb ~ nav a[href$="#work"] { display: none; } /* la flecha de volver ya lleva ahí */
  .nav { gap: 16px; }
  .case-hero { height: 420px; margin-top: 40px; padding: 16px; }
  .live { margin-top: 72px; }
  .live-list a { grid-template-columns: minmax(0, 1fr) auto; font-size: 22px; gap: 16px; padding-block: 20px; }
  .live-list .url { display: none; }
  .site-foot { margin-top: 80px; }
}

.nw { white-space: nowrap; }

/* Celular angosto: que el nombre y el menú quepan en una línea con EN / ES */
@media (max-width: 400px) {
  .nav .brand { font-size: 17px; }
  .nav nav { gap: 14px; }
}
