/* Página «Webs que hemos hecho recientemente» (/trabajos): la misma letra, colores, botones y vídeo
   emergente que la portada. Panel Abyss arriba y abajo; en medio, cada web con su vídeo y su ficha,
   alternando lados. */
@font-face {
  font-family: "Inter Var";
  src: url("/assets/fonts/inter-latin-opsz.woff2") format("woff2-variations"),
       url("/assets/fonts/inter-latin-opsz.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --font: "SF Pro Display", -apple-system, BlinkMacSystemFont, "Inter Var", system-ui, sans-serif;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --abyss: #183d61;
  --sprout: #acd99c;
  --gold: #e0cd39;
  --abyss-rgb: 24 61 97;
  --sprout-rgb: 172 217 156;
  --gold-rgb: 224 205 57;
  --tide-rgb: 71 133 146;
  --ground: #f3f5f7;
  --ink: var(--abyss);
  --ink-rgb: var(--abyss-rgb);
  --ink-soft: #3b5a79;
  --ink-faint: #4c6a86;
  --accent: #2f6c81;
  --wash-tide: #dae7e9;
  --wash-sprout: #def0d7;
  --wash-gold: #f5efc0;
  --shade: var(--abyss-rgb);
  --gutter: clamp(16px, 4vw, 40px);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { color-scheme: light; background-color: var(--ground); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.55;
  color: var(--ink);
  background: var(--ground);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* ---------- Botones (los de la portada) ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 22px;
  border: 0;
  border-radius: 999px;
  font: 600 0.9688rem/1 var(--font);
  letter-spacing: -0.005em;
  text-decoration: none;
  cursor: pointer;
  transition: transform 300ms var(--ease-out), background-color 200ms, box-shadow 300ms var(--ease-out);
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0) scale(0.98); }
.btn--ink { color: #fff; background: var(--ink); box-shadow: 0 10px 24px -12px rgb(var(--ink-rgb) / 0.6); }
.btn--ink:hover { background: #2f5071; }
.btn--gold { color: var(--abyss); background: var(--gold); box-shadow: 0 12px 26px -14px rgb(0 0 0 / 0.55); }
.btn--gold:hover { background: #e5d557; }
.btn--glass-w { color: #fff; box-shadow: inset 0 0 0 1.5px rgb(255 255 255 / 0.4); }
.btn--glass-w:hover { background: rgb(255 255 255 / 0.1); }

/* ---------- Cabecera ---------- */
.tj-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; width: min(100% - 2 * var(--gutter), 1240px); margin: 0 auto; padding: max(16px, env(safe-area-inset-top)) 0 14px; }
.tj-brand { display: inline-flex; align-items: center; gap: 10px; font-size: 1rem; line-height: 1; text-decoration: none; }
.tj-brand img { width: auto; height: 22px; }
.tj-brand b { font-weight: 700; letter-spacing: 0.04em; }
.tj-brand span { font-weight: 400; color: var(--ink-soft); }
.tj-nav { display: flex; align-items: center; gap: clamp(12px, 2vw, 24px); }
.tj-back { font-size: 0.9375rem; font-weight: 600; text-decoration: none; color: var(--ink-soft); }
.tj-back:hover { color: var(--ink); }
.tj-nav .btn { min-height: 42px; padding: 0 18px; }
@media (max-width: 480px) { .tj-back { display: none; } }

/* ---------- Paneles Abyss con brillos (como la sección de proyectos de la portada) ---------- */
.tj-hero, .tj-cta { position: relative; isolation: isolate; overflow: hidden; overflow: clip; margin-inline: clamp(8px, 1.2vw, 16px); border-radius: clamp(28px, 4vw, 48px); color: #fff; background: var(--abyss); }
.tj-hero::before, .tj-hero::after, .tj-cta::before { content: ""; position: absolute; z-index: -1; aspect-ratio: 1; border-radius: 50%; pointer-events: none; }
.tj-hero::before { left: -18%; top: -60%; width: 70%; background: radial-gradient(circle, rgb(var(--tide-rgb) / 0.85) 0%, rgb(var(--tide-rgb) / 0.35) 38%, transparent 68%); animation: glow-a 19s ease-in-out infinite alternate; }
.tj-hero::after { right: -16%; bottom: -80%; width: 60%; background: radial-gradient(circle, rgb(var(--sprout-rgb) / 0.42) 0%, rgb(var(--sprout-rgb) / 0.14) 40%, transparent 68%); animation: glow-b 23s ease-in-out infinite alternate; }
.tj-cta::before { left: 50%; top: -70%; width: 80%; translate: -50% 0; background: radial-gradient(circle, rgb(var(--tide-rgb) / 0.7) 0%, rgb(var(--tide-rgb) / 0.25) 40%, transparent 68%); }
@keyframes glow-a { to { translate: 14% 22%; scale: 1.15; } }
@keyframes glow-b { to { translate: -16% -14%; scale: 1.12; } }

.tj-hero { padding: clamp(64px, 8.5vw, 124px) var(--gutter) clamp(52px, 6.5vw, 96px); }
.tj-hero-in { width: min(100%, 1240px); margin: 0 auto; }
.tj-hero h1 { max-width: 13ch; margin: 0; font-size: clamp(3rem, 9vw, 8.2rem); font-weight: 600; line-height: 0.94; letter-spacing: -0.05em; text-wrap: balance; }
.tj-hero h1 em { font-family: var(--serif); font-style: italic; font-weight: 500; letter-spacing: -0.03em; color: var(--sprout); }
.tj-hero h1 i { font-style: normal; color: var(--gold); }
.tj-lead { max-width: 44ch; margin: clamp(22px, 3vw, 34px) 0 0; font-size: clamp(1.0625rem, 1.6vw, 1.3125rem); line-height: 1.5; color: rgb(255 255 255 / 0.78); }

/* ---------- Las webs ---------- */
.tj-list { display: grid; gap: clamp(72px, 11vw, 150px); width: min(100% - 2 * var(--gutter), 1240px); margin: clamp(48px, 6vw, 84px) auto 0; padding: 0; list-style: none; }
.tj-item { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); align-items: center; gap: clamp(28px, 5vw, 80px); }
.tj-item:nth-child(even) .tj-media { order: 2; }

.tj-media { display: block; width: 100%; padding: 0; border: 0; border-radius: clamp(14px, 1.6vw, 22px); background: none; cursor: zoom-in; }
.tj-media:focus-visible { outline: 3px solid var(--gold); outline-offset: 5px; }
.tj-media .pc-face {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: inherit;
  background: #0e2740;
  box-shadow: 0 50px 90px -50px rgb(var(--shade) / 0.75), 0 0 0 1px rgb(var(--ink-rgb) / 0.06);
  transition: transform 700ms var(--ease-out), box-shadow 700ms var(--ease-out);
}
.pc-vid { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
/* Sin el botón de play que pone el iPhone cuando no deja reproducir solo (modo ahorro) */
.pc-vid::-webkit-media-controls, .pc-vid::-webkit-media-controls-start-playback-button { display: none !important; -webkit-appearance: none; }
.tj-play { position: absolute; left: clamp(10px, 1.4vw, 18px); bottom: clamp(10px, 1.4vw, 18px); display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px 6px 6px; border-radius: 999px; font-size: 0.875rem; font-weight: 600; line-height: 1; color: var(--abyss); background: #fff; box-shadow: 0 10px 24px -12px rgb(0 0 0 / 0.5); }
.tj-play i { width: 24px; height: 24px; border-radius: 50%; background: var(--gold) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M9 7.5v9l7.5-4.5z' fill='%23183d61'/%3E%3C/svg%3E") center / 18px no-repeat; }
@media (hover: hover) {
  .tj-media:hover .pc-face { transform: scale(1.015); box-shadow: 0 60px 100px -50px rgb(var(--shade) / 0.8), 0 0 0 2px var(--sprout); }
}

.tj-text { display: grid; gap: 12px; align-content: center; }
.tj-num { font-size: 0.875rem; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--ink-faint); }
.tj-text h2 { margin: 0; font-size: clamp(2.2rem, 4.4vw, 3.6rem); font-weight: 600; line-height: 1; letter-spacing: -0.045em; }
.tj-kind { margin: -2px 0 4px; font-size: clamp(1rem, 1.3vw, 1.125rem); font-weight: 500; color: var(--accent); }
.tj-desc { max-width: 46ch; margin: 0; font-size: clamp(1rem, 1.25vw, 1.0938rem); line-height: 1.6; color: var(--ink-soft); text-wrap: pretty; }
.tj-tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 0; padding: 0; list-style: none; }
.tj-tags li { padding: 7px 12px; border-radius: 999px; font-size: 0.8125rem; font-weight: 600; line-height: 1.2; background: var(--wash-sprout); }
.tj-tags li:nth-child(2) { background: var(--wash-tide); }
.tj-tags li:nth-child(3) { background: var(--wash-gold); }

@media (max-width: 820px) {
  .tj-item { grid-template-columns: minmax(0, 1fr); gap: 22px; }
  .tj-item:nth-child(even) .tj-media { order: 0; }
}

/* ---------- Final ---------- */
.tj-cta { margin-top: clamp(88px, 13vw, 170px); padding: clamp(56px, 9vw, 110px) var(--gutter); text-align: center; }
.tj-cta h2 { margin: 0; font-size: clamp(2.2rem, 5.6vw, 4.4rem); font-weight: 600; line-height: 1; letter-spacing: -0.045em; }
.tj-cta h2 em { font-family: var(--serif); font-style: italic; font-weight: 500; letter-spacing: -0.02em; color: var(--sprout); }
.tj-cta p { max-width: 44ch; margin: 18px auto 0; font-size: clamp(1rem, 1.4vw, 1.125rem); line-height: 1.55; color: rgb(255 255 255 / 0.78); }
.tj-btns { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 28px; }

.tj-foot { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 20px; padding: 28px 16px max(28px, env(safe-area-inset-bottom)); font-size: 0.875rem; color: var(--ink-soft); }
.tj-foot a { text-decoration: none; }
.tj-foot a:hover { color: var(--ink); }

/* ---------- Aparecen al bajar (solo con JavaScript y sin movimiento reducido) ---------- */
.tj-anim .tj-item { opacity: 0; translate: 0 32px; transition: opacity 900ms var(--ease-out), translate 900ms var(--ease-out); }
.tj-anim .tj-item.is-in { opacity: 1; translate: 0 0; }

/* ---------- El vídeo entero en una ventana emergente (igual que en la portada) ---------- */
.pj-dialog { width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: max(16px, env(safe-area-inset-top)) clamp(12px, 3vw, 48px) max(16px, env(safe-area-inset-bottom)); border: 0; overflow: hidden; color: #fff; background: transparent; }
.pj-dialog[open] { display: grid; place-items: center; }
.pj-dialog::backdrop { background: rgb(24 61 97 / 0.86); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.pj-dialog[open]::backdrop { animation: pj-in 420ms ease-out; }
.pj-dialog.is-closing::backdrop { animation: pj-out 380ms ease-in forwards; }
.pj-dialog.is-closing .pj-cap, .pj-dialog.is-closing .pj-close { opacity: 0; transition: opacity 180ms; }
@keyframes pj-in { from { opacity: 0; } }
@keyframes pj-out { to { opacity: 0; } }
.pj-player { display: grid; justify-items: center; gap: 14px; width: 100%; margin: 0; }
.pj-video { --ar: 16 / 9; display: block; width: min(100%, (100dvh - 130px) * var(--ar)); height: auto; aspect-ratio: var(--ar); border-radius: clamp(10px, 1.4vw, 20px); background: #000; box-shadow: 0 40px 100px -30px rgb(0 0 0 / 0.7); }
.pj-cap { font-size: 1rem; color: rgb(255 255 255 / 0.7); text-align: center; }
.pj-cap b { font-weight: 600; color: #fff; }
.pj-close { position: absolute; top: max(14px, env(safe-area-inset-top)); right: 14px; z-index: 2; display: grid; place-items: center; width: 46px; height: 46px; padding: 0; border: 0; border-radius: 50%; cursor: pointer; color: var(--abyss); background: #fff; }
.pj-close:hover { background: var(--sprout); }
.pj-close svg { width: 20px; height: 20px; }

@media (prefers-reduced-motion: reduce) {
  .tj-hero::before, .tj-hero::after { animation: none; }
  .btn, .tj-media .pc-face { transition: none; }
}
