/* ==========================================================
   MAJAGUA v2 · "Inmersión"
   La página es una bajada: el agua se oscurece a medida que
   se baja, el medidor marca la profundidad y suben burbujas.
   ========================================================== */

:root {
  --superficie: #3AD2EC;
  --majagua:    #0090B8;
  --corriente:  #03648E;
  --profundo:   #07557B;
  --abisal:     #052F47;
  --linterna:   #FFC94A;   /* acento único */
  --espuma:     #EAF8FC;
  --espuma-2:   #A9D7E6;
  --tinta:      #04263A;
  --linea:      rgba(169, 215, 230, .22);

  --font: 'Bricolage Grotesque', system-ui, sans-serif;
  --mono: 'Martian Mono', ui-monospace, monospace;

  --t-sm: 0.875rem;
  --t-base: 1.0625rem;
  --t-md: 1.333rem;
  --t-lg: clamp(1.4rem, 2.4vw, 1.777rem);
  --t-xl: clamp(2.6rem, 7vw, 6rem);
  --t-hero: clamp(4.8rem, 22vw, 17rem);

  --gutter: clamp(16px, 5vw, 72px);
  --gauge-space: 0px;
  --measure: 38rem;

  /* Cursor burbuja para todo lo que se puede clickear */
  --cursor-bubble: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32'%3E%3Ccircle cx='16' cy='16' r='12' fill='rgba(58,210,236,.35)' stroke='%23EAF8FC' stroke-width='2'/%3E%3Ccircle cx='11.5' cy='11.5' r='3' fill='%23fff'/%3E%3C/svg%3E") 16 16, pointer;
}
@media (min-width: 861px) { :root { --gauge-space: 72px; } }

*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  background: linear-gradient(180deg, #08577C 0%, #064A6C 30%, #053C59 60%, var(--abisal) 85%) var(--abisal);
}
body {
  margin: 0;
  font-family: var(--font);
  font-size: var(--t-base);
  line-height: 1.55;
  color: var(--espuma);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-underline-offset: 4px; }
a, button, summary, label, select, [data-video], input[type="file"] { cursor: var(--cursor-bubble); }
h1, h2, h3 { margin: 0; font-weight: 700; line-height: 1.05; }
p { margin: 0; }
[hidden] { display: none !important; }

:focus-visible { outline: 3px solid var(--linterna); outline-offset: 3px; border-radius: 4px; }

.skip {
  position: absolute; left: -999px; top: 8px; z-index: 60;
  background: var(--linterna); color: var(--tinta); padding: 8px 14px; border-radius: 999px;
}
.skip:focus { left: 16px; }

.wrap {
  width: 100%; max-width: 1240px; margin-inline: auto;
  padding-left: var(--gutter);
  padding-right: max(var(--gutter), var(--gauge-space));
}

/* ---------- Burbujas ---------- */
.bubbles { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 120; }

/* ---------- Barra superior ---------- */
.top {
  position: fixed; inset: 0 0 auto 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px var(--gutter);
  color: var(--espuma);
  transition: background-color .3s ease, color .3s ease;
}
.top.on-light { color: var(--tinta); }
.top.is-solid, .top.menu-open { background: rgba(5, 47, 71, .9); backdrop-filter: blur(10px); color: var(--espuma); }

.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 800; font-size: var(--t-md); letter-spacing: -0.02em; }
.brand img { width: 32px; height: 32px; }

.menu { list-style: none; display: flex; align-items: center; gap: clamp(14px, 2.4vw, 32px); margin: 0; padding: 0; }
.menu a { text-decoration: none; font-weight: 500; font-size: var(--t-sm); }
.menu a:hover, .menu a[aria-current] { text-decoration: underline; }
.nav-cta { padding: 7px 16px; border-radius: 999px; border: 1.5px solid currentColor; }
.menu-btn { display: none; background: none; border: 0; color: inherit; font-size: 1.4rem; padding: 6px 8px; }

@media (max-width: 860px) {
  .menu-btn { display: block; }
  .menu {
    position: fixed; inset: 64px 0 auto 0; height: calc(100svh - 64px);
    flex-direction: column; align-items: flex-start; gap: 4px;
    padding: 24px var(--gutter);
    background: rgba(5, 47, 71, .97);
    transform: translateY(-110%); visibility: hidden;
    transition: transform .3s ease, visibility .3s;
  }
  .menu-open .menu { transform: none; visibility: visible; }
  .menu a { font-size: 2rem; font-weight: 700; display: block; padding: 6px 0; }
  .nav-cta { border: 0; padding: 6px 0; color: var(--linterna); }
}

/* ---------- Medidor de profundidad ---------- */
.gauge {
  position: fixed; z-index: 35; right: clamp(10px, 2vw, 28px); top: 50%; transform: translateY(-50%);
  display: grid; justify-items: end; gap: 8px; font-family: var(--mono); pointer-events: none;
}
.gauge-track {
  position: relative; width: 14px; height: 38vh; color: rgba(234, 248, 252, .45);
  background:
    repeating-linear-gradient(180deg, currentColor 0 1px, transparent 1px 20%) right / 14px 100% no-repeat,
    repeating-linear-gradient(180deg, currentColor 0 1px, transparent 1px 4%) right / 7px 100% no-repeat;
}
.gauge-mark {
  position: absolute; right: 0; top: 0; width: 22px; height: 3px; border-radius: 2px;
  background: var(--linterna); box-shadow: 0 0 12px var(--linterna); transform: translateY(var(--y, 0));
}
.gauge-read { font-size: var(--t-sm); font-weight: 600; color: var(--linterna); font-variant-numeric: tabular-nums; }
.gauge-read span::before { content: "−"; }
.gauge-zone { font-size: 0.6875rem; color: var(--espuma-2); max-width: 10ch; text-align: right; line-height: 1.3; }
@media (max-width: 860px) {
  .gauge { top: auto; bottom: 12px; transform: none; grid-auto-flow: column; align-items: center;
           padding: 6px 12px; border-radius: 999px; background: rgba(5, 47, 71, .9); }
  .gauge-track { display: none; }
}

/* ---------- Hero de la home: la superficie ---------- */
.hero {
  position: relative; overflow: hidden;
  min-height: 100svh; display: flex; align-items: flex-start;
  padding-top: calc(96px + 5vh);
  background: #5DD7F1;   /* el agua de arriba: se ve si las capas se mueven */
  color: var(--tinta);
}
/* Luz que entra desde la superficie */
.hero::before {
  content: ""; position: absolute; inset: -20% -10% 30% -10%; pointer-events: none;
  background: repeating-linear-gradient(100deg, rgba(255,255,255,0) 0 60px, rgba(255,255,255,.16) 60px 90px, rgba(255,255,255,0) 90px 170px);
  mask-image: linear-gradient(180deg, #000 0%, transparent 85%);
  -webkit-mask-image: linear-gradient(180deg, #000 0%, transparent 85%);
  animation: luz 14s ease-in-out infinite alternate;
}
@keyframes luz { from { transform: translateX(-4%) skewX(-4deg); } to { transform: translateX(4%) skewX(4deg); } }
.hero .wrap { position: relative; }
.hero h1 {
  font-size: var(--t-hero); font-weight: 800; font-variation-settings: "opsz" 96;
  letter-spacing: -0.055em; line-height: .82; margin-left: -0.05em; padding-bottom: .12em;
}
.hero-lead { margin-top: clamp(12px, 3vh, 28px); max-width: 24ch; font-size: clamp(1.35rem, 2.8vw, 2.2rem); font-weight: 500; line-height: 1.15; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }

.btn { display: inline-flex; align-items: center; gap: 10px; padding: 12px 22px; border-radius: 999px; font-weight: 600; text-decoration: none; font-size: var(--t-base); }
.btn-solid { background: var(--tinta); color: var(--espuma); }
.btn-solid:hover { background: #000; }
.btn-line { border: 2px solid currentColor; }
.btn-line:hover { background: rgba(255, 255, 255, .12); }
.btn-light { background: var(--linterna); color: var(--tinta); }
.btn-light:hover { background: #fff; }

/* ---------- Bloques ---------- */
.block { padding-block: clamp(80px, 14vh, 160px); }
.block h2, .page-title { font-size: var(--t-xl); font-weight: 800; letter-spacing: -0.045em; line-height: .92; margin-bottom: clamp(36px, 7vh, 72px); }

/* Qué hacemos: filas grandes */
.services { margin: 0; border-top: 1px solid var(--linea); }
.services > div {
  display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 12px 48px;
  align-items: baseline; padding: clamp(20px, 3.5vh, 32px) 0; border-bottom: 1px solid var(--linea);
}
.services dt { font-size: clamp(1.6rem, 3.4vw, 2.6rem); font-weight: 700; letter-spacing: -0.03em; line-height: 1.05; }
.services dd { margin: 0; color: var(--espuma-2); max-width: 36ch; }
@media (max-width: 760px) { .services > div { grid-template-columns: 1fr; } }

/* Nosotras: una al lado de la otra */
.people { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(40px, 6vw, 96px); }
.person-photo {
  width: min(100%, 300px); aspect-ratio: 1; object-fit: cover; margin-bottom: 28px;
  border-radius: 50% 50% 50% 8% / 50% 50% 50% 8%;   /* la gota del logo */
}
.person:nth-child(2) .person-photo { border-radius: 50% 50% 8% 50% / 50% 50% 8% 50%; }
.person h3 { font-size: clamp(1.8rem, 3.4vw, 2.6rem); letter-spacing: -0.03em; }
.person-role { color: var(--linterna); margin: 8px 0 14px; font-weight: 500; }
.person p { max-width: var(--measure); }
.credits { margin-top: 14px; color: var(--espuma-2); font-size: var(--t-sm); }
.person-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin-top: 22px; }
@media (max-width: 760px) { .people { grid-template-columns: 1fr; } .person-photo { width: 220px; } }

/* Íconos de redes */
.icon-links { display: flex; flex-wrap: wrap; gap: 10px; }
.icon-links a {
  display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%;
  border: 1.5px solid var(--linea); color: var(--espuma); font-size: 1.1rem; text-decoration: none;
  transition: background-color .2s, color .2s, border-color .2s;
}
.icon-links a:hover { background: var(--espuma); color: var(--tinta); border-color: var(--espuma); }

/* Proyectos: filas */
.rows { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--linea); }
.rows li { border-bottom: 1px solid var(--linea); }
.rows a {
  display: grid; grid-template-columns: 64px minmax(0, 1fr) minmax(0, 1.3fr);
  align-items: center; gap: 28px; padding: 24px 0; text-decoration: none;
}
.row-icon {
  width: 64px; height: 64px; object-fit: cover; border-radius: 50% 50% 50% 12%;
  display: grid; place-items: center; font-size: 1.5rem; background: var(--majagua); color: var(--espuma);
}
.row-name { font-size: clamp(1.5rem, 3vw, 2.4rem); font-weight: 700; letter-spacing: -0.03em; line-height: 1.05; }
.row-desc { color: var(--espuma-2); }
.rows a:hover .row-name { color: var(--linterna); }
@media (max-width: 700px) {
  .rows a { grid-template-columns: 52px minmax(0, 1fr); gap: 4px 16px; }
  .row-icon { width: 52px; height: 52px; grid-row: span 2; font-size: 1.2rem; }
}

/* Tools */
.tools-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 12px 40px; margin-bottom: clamp(36px, 7vh, 72px); }
.tools-head h2, .tools-head .page-title { margin-bottom: 0; }
.tools-head p { max-width: 36ch; color: var(--espuma-2); }
.tool-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 2px; }
.tool-list a { display: grid; align-content: start; gap: 6px; height: 100%; padding: 24px; text-decoration: none; background: rgba(3, 100, 142, .3); }
.tool-list a:hover { background: rgba(3, 100, 142, .6); }
.tool-list i { color: var(--linterna); font-size: 1.3rem; margin-bottom: 10px; }
.tool-list b { font-size: var(--t-md); font-weight: 700; line-height: 1.2; }
.tool-list span { color: var(--espuma-2); font-size: var(--t-sm); }
.tools-custom { margin-top: 32px; color: var(--espuma-2); }
.tools-custom a { color: var(--linterna); font-weight: 600; }

/* Clientes */
.logos { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 24px clamp(20px, 4vw, 48px); }
.logos a { display: grid; place-items: center; width: 148px; height: 96px; padding: 14px; background: var(--espuma); border-radius: 50% 50% 50% 14% / 50% 50% 50% 14%; }
.logos img { max-height: 64px; width: auto; object-fit: contain; }
.logos a:hover { background: #fff; }
@media (max-width: 520px) { .logos { justify-content: center; } .logos a { width: 128px; height: 84px; } }

/* ---------- Footer: el fondo del mar ---------- */
.fondo { position: relative; margin-top: clamp(40px, 8vh, 96px); }
.fondo-text {
  position: relative; z-index: 1; max-width: 1240px; margin: 0 auto clamp(-120px, -8vw, -24px);
  padding-left: var(--gutter); padding-right: max(var(--gutter), var(--gauge-space));
}
.fondo h2 { font-size: var(--t-xl); font-weight: 800; letter-spacing: -0.045em; line-height: .92; }
.mail {
  display: inline-block; margin: 18px 0 12px; font-size: clamp(1.15rem, 4.2vw, 3rem); font-weight: 700;
  letter-spacing: -0.02em; color: var(--linterna); text-underline-offset: 8px; text-decoration-thickness: 2px; overflow-wrap: anywhere;
}
.fondo-text p { color: var(--espuma-2); margin-bottom: 18px; }
.fondo-img { width: 100%; }
.copy { background: var(--profundo); color: var(--espuma-2); font-size: var(--t-sm); text-align: center; padding: 4px var(--gutter) 72px; margin-top: -1px; }
@media (min-width: 861px) { .copy { padding-bottom: 28px; } }

/* ---------- Páginas internas ---------- */
.page-hero { padding-top: calc(110px + 4vh); padding-bottom: clamp(40px, 8vh, 80px); }
.back { display: inline-flex; gap: 8px; align-items: center; color: var(--espuma-2); font-size: var(--t-sm); text-decoration: none; margin-bottom: 28px; }
.back:hover { color: var(--espuma); text-decoration: underline; }
.page-lead { max-width: 40ch; font-size: var(--t-lg); line-height: 1.25; color: var(--espuma-2); }

.profile { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: clamp(24px, 5vw, 64px); align-items: center; }
.profile .person-photo { width: clamp(160px, 24vw, 320px); margin: 0; }
.profile h1 { font-size: clamp(3rem, 9vw, 8rem); font-weight: 800; letter-spacing: -0.05em; line-height: .88; }
.profile .person-role { font-size: var(--t-md); margin: 16px 0 20px; }
@media (max-width: 700px) { .profile { grid-template-columns: 1fr; } }

/* Filtros */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 32px; }
.filters button {
  font: inherit; font-size: var(--t-sm); font-weight: 600; color: var(--espuma);
  background: transparent; border: 1.5px solid var(--linea); border-radius: 999px; padding: 8px 16px;
}
.filters button:hover { border-color: var(--espuma); }
.filters button[aria-pressed="true"] { background: var(--linterna); border-color: var(--linterna); color: var(--tinta); }

/* Portafolio: grilla de trabajos con portada */
.work-grid {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 44px 28px;
}
.work { width: 100%; height: 100%; display: grid; align-content: start; gap: 16px; text-align: left; font: inherit; color: inherit; background: none; border: 0; padding: 0; }
.work-thumb {
  position: relative; display: block; aspect-ratio: 16 / 9; overflow: hidden;
  border-radius: 22px 22px 22px 6px;   /* la gota */
  background: var(--corriente);
}
.work-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s ease, filter .4s ease; filter: saturate(.75); }
/* Velo de agua que se aclara al pasar el mouse */
.work-thumb::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(58, 210, 236, .18), rgba(5, 47, 71, .55));
  mix-blend-mode: multiply; transition: opacity .4s ease;
}
.work-play {
  position: absolute; z-index: 1; left: 50%; top: 50%; translate: -50% -50%;
  width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; padding-left: 4px;
  background: rgba(234, 248, 252, .2); border: 2px solid var(--espuma); color: var(--espuma); font-size: 1.2rem;
  backdrop-filter: blur(4px); transition: background-color .3s, color .3s, scale .3s;
}
.work:hover .work-thumb img, .work:focus-visible .work-thumb img { transform: scale(1.05); filter: saturate(1); }
.work:hover .work-thumb::after, .work:focus-visible .work-thumb::after { opacity: 0; }
.work:hover .work-play, .work:focus-visible .work-play { background: var(--linterna); border-color: var(--linterna); color: var(--tinta); scale: 1.1; }
.work-info { display: grid; gap: 6px; }
.work-top { display: flex; justify-content: space-between; gap: 12px; font-size: var(--t-sm); }
.work-role { color: var(--linterna); font-weight: 600; }
.work-year { font-family: var(--mono); color: var(--espuma-2); font-variant-numeric: tabular-nums; }
.work-title { font-size: clamp(1.35rem, 2.2vw, 1.75rem); font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; }
.work-meta { color: var(--espuma-2); font-size: var(--t-sm); }
.work:hover .work-title { color: var(--linterna); }

/* El trabajo más reciente, destacado */
@media (min-width: 900px) {
  .work-grid > li:first-child:not([hidden]) { grid-column: span 2; grid-row: span 2; }
  .work-grid > li:first-child .work-title { font-size: clamp(2rem, 3.6vw, 3.2rem); }
  .work-grid > li:first-child .work-play { width: 92px; height: 92px; font-size: 1.7rem; }
}

/* Archivo web: tarjetas de sitios */
.site-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap: 2px; }
.site-grid a { display: grid; gap: 8px; height: 100%; padding: 24px; text-decoration: none; background: rgba(3, 100, 142, .3); }
.site-grid a:hover { background: rgba(3, 100, 142, .6); }
.site-grid img { width: 72px; height: 72px; object-fit: contain; background: var(--espuma); border-radius: 50% 50% 50% 14%; padding: 8px; margin-bottom: 8px; }
.site-grid b { font-size: var(--t-md); }
.site-grid span { color: var(--espuma-2); font-size: var(--t-sm); }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.tags em { font-style: normal; font-size: 0.75rem; padding: 3px 10px; border-radius: 999px; background: rgba(234, 248, 252, .12); }

/* Reproductor */
.video-modal { width: min(1100px, 94vw); padding: 0; border: 0; background: transparent; color: var(--espuma); overflow: visible; }
.video-modal::backdrop { background: rgba(2, 20, 31, .88); backdrop-filter: blur(4px); }
.video-frame { aspect-ratio: 16 / 9; background: #000; border-radius: 12px; overflow: hidden; }
.video-frame iframe { width: 100%; height: 100%; border: 0; display: block; }
.video-title { margin-top: 12px; font-weight: 600; }
.video-close { position: absolute; top: -52px; right: 0; width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--espuma); color: var(--tinta); font-size: 1.2rem; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero::before { animation: none; }
  .top, .menu { transition: none; }
}

/* ==========================================================
   EXTRAS DE INMERSIÓN
   ========================================================== */

/* ---------- Transición de buceo entre páginas (Chrome, Edge y Safari recientes) ---------- */
@view-transition { navigation: auto; }
.top { view-transition-name: barra; }
.gauge { view-transition-name: medidor; }
::view-transition-old(root) { animation: 0.55s cubic-bezier(.5, 0, .75, 0) both buceo-sale; }
::view-transition-new(root) { animation: 0.65s cubic-bezier(.2, .7, .3, 1) 0.1s both buceo-entra; }
@keyframes buceo-sale { to { transform: translateY(-22%); opacity: 0; filter: blur(6px) brightness(.55); } }
@keyframes buceo-entra { from { transform: translateY(26%); opacity: 0; filter: blur(6px); } }

/* ---------- Modo linterna en el fondo ---------- */
.fondo { isolation: isolate; min-height: 100svh; display: flex; flex-direction: column; justify-content: flex-end; overflow: hidden; }
.fondo-veil {
  position: absolute; inset: 0; z-index: 2; pointer-events: none; opacity: 0; transition: opacity 1.4s ease;
  background:
    radial-gradient(circle 190px at var(--lx, 50%) var(--ly, 40%), rgba(255, 201, 74, .14), rgba(255, 201, 74, 0) 70%),
    radial-gradient(circle 200px at var(--lx, 50%) var(--ly, 40%), rgba(2, 14, 22, 0) 35%, rgba(2, 14, 22, .94) 100%);
}
.fondo.lit .fondo-veil { opacity: 1; }
.fondo.lit { cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16'%3E%3Ccircle cx='8' cy='8' r='4' fill='%23FFC94A'/%3E%3C/svg%3E") 8 8, auto; }
/* El correo y los íconos brillan sobre la oscuridad */
.fondo .mail, .fondo .icon-links { position: relative; z-index: 3; }
.fondo.lit .mail { text-shadow: 0 0 18px rgba(255, 201, 74, .55); }
.fondo.lit .icon-links a { border-color: rgba(255, 201, 74, .5); }

.criaturas { position: absolute; inset: 0; z-index: 3; pointer-events: none; opacity: 0; transition: opacity 2s ease .6s; }
.fondo.lit .criaturas { opacity: 1; }
.criatura { position: absolute; fill: none; stroke: #8CF6FF; stroke-width: 2.4; stroke-linecap: round; filter: drop-shadow(0 0 6px #8CF6FF) drop-shadow(0 0 16px rgba(140, 246, 255, .6)); }
.criatura .cuerpo { fill: rgba(140, 246, 255, .22); }
.m1 { width: clamp(56px, 7vw, 96px); left: 9%; top: 14%; animation: flotar 7s ease-in-out infinite, latido 3.2s ease-in-out infinite; }
.m2 { width: clamp(38px, 4.5vw, 64px); right: 14%; top: 34%; animation: flotar 9s ease-in-out -3s infinite, latido 4s ease-in-out -1s infinite; }
.rape { width: clamp(40px, 5vw, 70px); right: 34%; bottom: 26%; stroke: #FFE29A; filter: drop-shadow(0 0 8px #FFC94A); animation: latido 2.4s ease-in-out infinite; }
.rape .luz { fill: #FFE29A; }
@keyframes flotar { 50% { transform: translateY(-22px); } }
@keyframes latido { 50% { opacity: .55; } }
.plancton i { position: absolute; width: 3px; height: 3px; border-radius: 50%; background: #8CF6FF; box-shadow: 0 0 6px #8CF6FF; animation: titilar 6s ease-in-out infinite; }
@keyframes titilar { 0%, 100% { opacity: .15; } 50% { opacity: .9; } }

/* ---------- Botón de sonido ---------- */
.sound-btn {
  position: fixed; z-index: 36; left: clamp(10px, 2vw, 28px); bottom: 14px;
  width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(5, 47, 71, .85); color: var(--espuma); border: 1.5px solid var(--linea); font-size: 1rem;
  backdrop-filter: blur(6px);
}
.sound-btn:hover { border-color: var(--espuma); }
.sound-btn[aria-pressed="true"] { color: var(--tinta); background: var(--linterna); border-color: var(--linterna); }

/* ---------- Calculadora de timecode en la home ---------- */
.tc-mini { background: var(--espuma); color: var(--tinta); border-radius: 22px 22px 22px 6px; padding: clamp(20px, 3vw, 32px); margin-bottom: 28px; box-shadow: 0 24px 60px rgba(2, 20, 31, .35); }
.tc-mini-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px 24px; margin-bottom: 18px; }
.tc-mini h3 { font-size: var(--t-md); }
.tc-mini label { font-size: var(--t-sm); font-weight: 600; display: flex; align-items: center; gap: 10px; }
.tc-mini select, .tc-mini input {
  font: inherit; color: var(--tinta); background: #fff; border: 2px solid #C9E6EF; border-radius: 10px; padding: 10px 12px;
}
.tc-mini input { font-family: var(--mono); font-size: 1.05rem; width: 100%; min-width: 0; }
.tc-mini input:focus, .tc-mini select:focus { outline: none; border-color: var(--majagua); }
.tc-mini input.invalid { border-color: #D9534F; }
.tc-mini-row { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(0, 1.2fr); gap: 12px; align-items: center; }
.tc-mini-row select { font-size: 1.1rem; font-weight: 700; }
.tc-mini-eq { font-size: 1.4rem; font-weight: 700; color: var(--corriente); }
.tc-mini-out { font-family: var(--mono); font-weight: 600; font-size: clamp(1.3rem, 2.6vw, 2rem); font-variant-numeric: tabular-nums; color: var(--tinta); }
.tc-mini-sub { margin-top: 14px; font-size: var(--t-sm); color: #2D5266; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; }
.tc-mini-sub a { color: var(--corriente); font-weight: 700; }
@media (max-width: 640px) {
  .tc-mini-row { grid-template-columns: minmax(0, 1fr) auto; }
  .tc-mini-row input[name="b"] { grid-column: 1; }
  .tc-mini-eq { display: none; }
  .tc-mini-out { grid-column: 1 / -1; padding-top: 6px; }
}

/* ---------- Último episodio de Cine Arbitrario ---------- */
.podcast { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 24px 48px; align-items: center; margin-top: clamp(40px, 7vh, 64px); }
.podcast h3 { font-size: var(--t-lg); letter-spacing: -0.02em; margin-bottom: 10px; }
.podcast p { color: var(--espuma-2); max-width: 36ch; }
.podcast iframe { width: 100%; height: 200px; border: 0; border-radius: 18px; background: var(--espuma); }
@media (max-width: 760px) { .podcast { grid-template-columns: 1fr; } }

@media (prefers-reduced-motion: reduce) {
  ::view-transition-old(root), ::view-transition-new(root) { animation: none; }
  .criatura, .plancton i { animation: none; }
}
.fondo .fondo-text { z-index: auto; }
.fondo .copy { position: relative; z-index: 3; background: transparent; }

/* ---------- Hero en capas ---------- */
.capas { position: absolute; inset: 0; z-index: 0; overflow: hidden; }
.capas img {
  position: absolute; top: 0; left: -3%; width: 106%; height: 100%;
  max-width: none; object-fit: cover; object-position: 50% 100%; will-change: transform;
}
.hero::before { z-index: 1; }
.hero .wrap { z-index: 2; }

/* ---------- Nieve marina y cardúmenes (detrás del contenido) ---------- */
.nieve { position: fixed; inset: 0; width: 100vw; height: 100vh; z-index: -1; pointer-events: none; }
.cardumen {
  position: fixed; left: 0; z-index: -1; width: 160px; height: 90px; pointer-events: none;
  animation: cruzar 20s linear forwards;
}
.cardumen.izq { animation-name: cruzar-izq; }
.cardumen.izq i { scale: -1 1; }
.cardumen i { position: absolute; display: block; animation: nadar 1.6s ease-in-out infinite; }
.cardumen svg { display: block; width: 100%; fill: rgba(2, 24, 38, .55); }
@keyframes cruzar { from { transform: translateX(110vw); } to { transform: translateX(-200px); } }
@keyframes cruzar-izq { from { transform: translateX(-200px); } to { transform: translateX(110vw); } }
@keyframes nadar { 50% { transform: translateY(-6px); } }

/* ---------- Pulpitos bioluminiscentes del footer ---------- */
.pulpito { position: absolute; filter: drop-shadow(0 0 6px #8CF6FF) drop-shadow(0 0 18px rgba(140, 246, 255, .55)); }
.p1 { width: clamp(70px, 9vw, 130px); left: 26%; top: 58%; animation: nadar-pulpo 11s ease-in-out infinite, latido 3.6s ease-in-out infinite; }
.p2 { width: clamp(44px, 5vw, 72px); right: 6%; top: 12%; scale: -1 1; animation: nadar-pulpo 9s ease-in-out -4s infinite, latido 2.8s ease-in-out -1s infinite; }
.p3 { width: clamp(32px, 3.5vw, 50px); left: 58%; top: 8%; animation: nadar-pulpo 13s ease-in-out -7s infinite, latido 4.2s ease-in-out infinite; }
@keyframes nadar-pulpo {
  0%, 100% { transform: translate(0, 0) rotate(0); }
  30% { transform: translate(24px, -30px) rotate(6deg); }
  65% { transform: translate(-16px, -12px) rotate(-5deg); }
}
@media (max-width: 700px) { .p1 { left: 8%; top: 64%; } .p3 { left: 70%; top: 6%; } }
@media (prefers-reduced-motion: reduce) { .pulpito { animation: none; } }

/* ---------- Intro de inmersión (primera visita a la home) ---------- */
.intro { position: fixed; inset: 0; z-index: 100; overflow: hidden; pointer-events: auto; }
.intro-in { position: absolute; inset: 0 0 auto 0; height: 200vh; background: #5DD7F1; transition: transform 1.5s cubic-bezier(.65, 0, .35, 1); }
.intro-cielo { height: 52vh; background: linear-gradient(180deg, #EAF8FC, #BFEFFA); }
.intro-ola { display: block; width: 210%; height: 7vh; margin-top: -3.5vh; fill: #5DD7F1; animation: oleaje 3s linear infinite; }
.intro-agua { height: calc(148vh - 3.5vh); background: linear-gradient(180deg, #5DD7F1, #5DD7F1 60%); margin-top: -1px; }
.intro-logo { position: absolute; left: 50%; top: 52vh; width: 64px; translate: -50% -70%; animation: flotar-logo 2.4s ease-in-out infinite; }
@keyframes oleaje { to { transform: translateX(-50%); } }
@keyframes flotar-logo { 50% { transform: translateY(-8px) rotate(-4deg); } }
.intro.buceando .intro-in { transform: translateY(-100vh); }
.intro.fuera { opacity: 0; transition: opacity .8s ease; pointer-events: none; }

/* ---------- Ballena lejana ---------- */
.ballena {
  position: fixed; z-index: -1; top: 30vh; left: 0; width: min(70vw, 900px); pointer-events: none;
  animation: ballena 34s linear forwards;
}
.ballena svg { display: block; width: 100%; fill: rgba(2, 22, 35, .38); animation: ballena-sube 9s ease-in-out infinite; }
@keyframes ballena { from { transform: translateX(105vw); } to { transform: translateX(-110%); } }
@keyframes ballena-sube { 50% { transform: translateY(-30px) rotate(-1.5deg); } }

/* ---------- Sonar en el medidor ---------- */
.gauge-read { position: relative; }
.gauge.ping .gauge-read::after {
  content: ""; position: absolute; right: -6px; top: 50%; width: 14px; height: 14px; margin-top: -7px;
  border: 2px solid var(--linterna); border-radius: 50%; animation: sonar 1.1s ease-out forwards;
}
@keyframes sonar { from { opacity: .9; transform: scale(.4); } to { opacity: 0; transform: scale(5); } }

/* ---------- Luz de la superficie que baja y se apaga ---------- */
.rayos {
  position: fixed; inset: -10vh -10vw 0; z-index: -1; pointer-events: none; opacity: var(--luz, 1);
  background: repeating-linear-gradient(100deg, rgba(255,255,255,0) 0 70px, rgba(190,240,255,.08) 70px 110px, rgba(255,255,255,0) 110px 200px);
  mask-image: linear-gradient(180deg, #000, transparent 75%); -webkit-mask-image: linear-gradient(180deg, #000, transparent 75%);
  transform: translateY(var(--luz-y, 0));
  animation: luz 16s ease-in-out infinite alternate;
}
@media (prefers-reduced-motion: reduce) { .rayos { animation: none; } }

/* ---------- Franja: dónde se vio su trabajo ---------- */
.plataformas { padding-block: clamp(56px, 10vh, 110px); }
.plataformas h2 { font-size: var(--t-lg); font-weight: 600; letter-spacing: -0.01em; color: var(--espuma-2); margin-bottom: 24px; }
.pantallas { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 0; }
.pantallas li { font-size: clamp(1.9rem, 5.2vw, 4.4rem); font-weight: 800; letter-spacing: -0.04em; line-height: 1.05; }
.pantallas li:not(:last-child)::after {
  content: ""; display: inline-block; width: .22em; height: .22em; margin: 0 .45em; vertical-align: middle;
  background: var(--linterna); border-radius: 50% 50% 50% 12%;   /* la gota, como separador */
}
.services dt a, .services dd a { color: inherit; }
.services dd a { color: var(--linterna); font-weight: 600; }
.services dt a:hover { color: var(--linterna); }
