/* Viaje por el Caribe: sistema de diseño de toda la web. Ver docs/guion-viaje.md */

:root {
  --ink: #0a2533;
  --ink-soft: #2d444e;
  --muted: #3d5560;
  --teal: #0d9488;
  --teal-deep: #0b625b;
  --sky: #0284c7;
  --foam: #f2fbfb;
  --sea-bg: #7fc8e6;
  --font: 'Poppins', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --serif: 'Playfair Display', Georgia, serif;
  --mono: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', monospace;
  --radius: 28px;
  --header-h: 68px;
  --focus: #0369a1;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

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

html {
  overscroll-behavior-y: none;
  background: var(--sea-bg);
  scroll-padding-top: calc(var(--header-h) + 12px);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--ink);
  background: transparent;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img,
picture,
svg {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
}

h1,
h2,
h3,
p,
ul,
ol,
figure {
  margin: 0;
}

ul,
ol {
  padding: 0;
  list-style: none;
}

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

.panel--dark :focus-visible,
.site-header[data-tone='dark'] :focus-visible {
  outline-color: #fff;
}

::selection {
  background: var(--teal);
  color: #fff;
}

/* ---------- lienzo del mar ---------- */
#sea {
  position: fixed;
  inset: 0;
  z-index: -1;
  width: 100%;
  height: 100%;
  display: block;
  opacity: 0;
  transition: opacity 1.4s ease;
  pointer-events: none;
}

html.engine-ready #sea {
  opacity: 1;
}

html[data-engine='off'] #sea {
  display: none;
}

/* ---------- accesibilidad ---------- */
.skip {
  position: fixed;
  left: 16px;
  top: -80px;
  z-index: 200;
  padding: 12px 18px;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font-weight: 500;
  text-decoration: none;
  transition: top 0.2s ease;
}

.skip:focus {
  top: 12px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- íconos ---------- */
.icon {
  width: 1.1em;
  height: 1.1em;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---------- cabecera ---------- */
.site-header {
  --hd-bg: rgba(246, 252, 252, 0.7);
  --hd-fg: var(--ink);
  --hd-line: rgba(10, 37, 51, 0.1);
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  background: var(--hd-bg);
  color: var(--hd-fg);
  border-bottom: 1px solid var(--hd-line);
  -webkit-backdrop-filter: blur(14px) saturate(1.3);
  backdrop-filter: blur(14px) saturate(1.3);
  transition: background-color 0.5s ease, color 0.5s ease, border-color 0.5s ease;
}

.site-header[data-tone='dark'] {
  --hd-bg: rgba(3, 31, 48, 0.78);
  --hd-fg: #f2fbfd;
  --hd-line: rgba(255, 255, 255, 0.14);
}

html[data-motion='lite'] .site-header,
html[data-motion='lite'] .panel {
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

.site-header__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: var(--header-h);
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 clamp(16px, 4vw, 40px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  text-decoration: none;
  font-weight: 600;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.brand img {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: #fff;
  padding: 3px;
  object-fit: contain;
}

.nav {
  display: none;
  align-items: center;
  gap: clamp(14px, 2vw, 28px);
  font-size: 0.82rem;
  font-weight: 500;
}

.nav a {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  text-decoration: none;
  opacity: 0.78;
  transition: opacity 0.2s ease;
}

.nav a::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 8px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.35s var(--ease);
}

.nav a:hover,
.nav a[aria-current='true'] {
  opacity: 1;
}

.nav a[aria-current='true']::after,
.nav a:hover::after {
  transform: scaleX(1);
}

.header-tools {
  display: flex;
  align-items: center;
  gap: 10px;
}

.header-tools .motion-switch {
  --ms-fg: var(--hd-fg);
  --ms-bg: rgba(255, 255, 255, 0.55);
  --ms-border: var(--hd-line);
  display: none;
}

.site-header[data-tone='dark'] .motion-switch {
  --ms-bg: rgba(255, 255, 255, 0.1);
}

.site-header[data-tone='dark'] .motion-switch button[aria-pressed='true'] {
  background: #fff;
  color: var(--ink);
}

.lang {
  display: inline-flex;
  padding: 2px;
  border-radius: 999px;
  border: 1px solid var(--hd-line);
  background: rgba(255, 255, 255, 0.4);
  font: 600 12px/1 var(--mono);
}

.site-header[data-tone='dark'] .lang {
  background: rgba(255, 255, 255, 0.1);
}

.lang a,
.lang span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  min-height: 30px;
  border-radius: 999px;
  text-decoration: none;
}

.lang span {
  background: var(--teal-deep);
  color: #fff;
}

.site-header[data-tone='dark'] .lang span {
  background: #fff;
  color: var(--ink);
}

.menu-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: inherit;
  cursor: pointer;
}

.menu-btn .icon {
  width: 24px;
  height: 24px;
}

.menu-btn .icon--close,
.menu-btn[aria-expanded='true'] .icon--open {
  display: none;
}

.menu-btn[aria-expanded='true'] .icon--close {
  display: block;
}

.mobile-panel {
  display: none;
  padding: 8px clamp(16px, 4vw, 40px) 20px;
  border-top: 1px solid var(--hd-line);
}

.mobile-panel.is-open {
  display: block;
}

.mobile-panel a.m-link {
  display: flex;
  align-items: center;
  min-height: 48px;
  font-weight: 500;
  text-decoration: none;
  border-bottom: 1px solid var(--hd-line);
}

.mobile-panel .motion-switch {
  --ms-fg: var(--hd-fg);
  --ms-bg: rgba(255, 255, 255, 0.5);
  --ms-border: var(--hd-line);
  display: flex;
  justify-content: space-between;
  padding-top: 16px;
}

.mobile-panel .motion-switch__label {
  display: inline;
  flex: 1;
}

@media (min-width: 980px) {
  .nav {
    display: flex;
  }

  .header-tools .motion-switch {
    display: inline-flex;
  }

  .menu-btn,
  .mobile-panel {
    display: none !important;
  }
}

/* ---------- escenas ---------- */
.wrap {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 clamp(20px, 5vw, 56px);
}

.scene {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 100svh;
  padding: calc(var(--header-h) + clamp(28px, 7vh, 80px)) 0 clamp(56px, 10vh, 120px);
}

.scene--short {
  min-height: 0;
}

/* ---------- sin motor de agua: el mismo mar, en imágenes fijas por tramo ---------- */
html[data-engine='off'] .intro,
html[data-engine='off'] .scene[data-stage] {
  background-size: cover;
  background-position: center top;
  background-repeat: no-repeat;
}

html[data-engine='off'] .intro {
  background-color: #7fc8e6;
  background-image: url('../img/mar-intro-d.webp');
  background-image: image-set(url('../img/mar-intro-d.avif') type('image/avif'), url('../img/mar-intro-d.webp') type('image/webp'));
}

html[data-engine='off'] #como-trabajo {
  background-color: #2fa3de;
  background-image: url('../img/mar-como-d.webp');
  background-image: image-set(url('../img/mar-como-d.avif') type('image/avif'), url('../img/mar-como-d.webp') type('image/webp'));
}

html[data-engine='off'] #proyectos {
  background-color: #1f8fa6;
  background-image: url('../img/mar-quantum-d.webp');
  background-image: image-set(url('../img/mar-quantum-d.avif') type('image/avif'), url('../img/mar-quantum-d.webp') type('image/webp'));
}

html[data-engine='off'] #defuga {
  background-color: #0e6c88;
  background-image: url('../img/mar-defuga-d.webp');
  background-image: image-set(url('../img/mar-defuga-d.avif') type('image/avif'), url('../img/mar-defuga-d.webp') type('image/webp'));
}

html[data-engine='off'] #yegoo {
  background-color: #2f9aa8;
  background-image: url('../img/mar-yegoo-d.webp');
  background-image: image-set(url('../img/mar-yegoo-d.avif') type('image/avif'), url('../img/mar-yegoo-d.webp') type('image/webp'));
}

html[data-engine='off'] #mas-trabajo {
  background-color: #4ab5b8;
  background-image: url('../img/mar-mas-d.webp');
  background-image: image-set(url('../img/mar-mas-d.avif') type('image/avif'), url('../img/mar-mas-d.webp') type('image/webp'));
}

html[data-engine='off'] #sobre-mi {
  background-color: #3c93a6;
  background-image: url('../img/mar-sobre-d.webp');
  background-image: image-set(url('../img/mar-sobre-d.avif') type('image/avif'), url('../img/mar-sobre-d.webp') type('image/webp'));
}

html[data-engine='off'] #contacto {
  background-color: #b0577f;
  background-image: url('../img/mar-contacto-d.webp');
  background-image: image-set(url('../img/mar-contacto-d.avif') type('image/avif'), url('../img/mar-contacto-d.webp') type('image/webp'));
}

html[data-engine='off'] body[data-fixed-stage]::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  background-size: cover;
  background-position: center;
  background-color: #0e6c88;
}

html[data-engine='off'] body[data-fixed-stage='2']::before {
  background-image: url('../img/mar-defuga-d.webp');
  background-image: image-set(url('../img/mar-defuga-d.avif') type('image/avif'), url('../img/mar-defuga-d.webp') type('image/webp'));
}

html[data-engine='off'] body[data-fixed-stage='3']::before {
  background-image: url('../img/mar-yegoo-d.webp');
  background-image: image-set(url('../img/mar-yegoo-d.avif') type('image/avif'), url('../img/mar-yegoo-d.webp') type('image/webp'));
}

/* ---------- bordes de ola variados entre secciones (sin animaciones) ---------- */
html[data-engine='off'] {
  --wave-a: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 64' preserveAspectRatio='none'%3E%3Cpath d='M0 26Q90 6 180 26T360 26T540 26T720 26T900 26T1080 26T1260 26T1440 26V64H0Z' fill='%23000'/%3E%3C/svg%3E");
  --wave-b: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 64' preserveAspectRatio='none'%3E%3Cpath d='M0 34C160 6 320 6 480 34S800 62 960 34S1280 6 1440 30V64H0Z' fill='%23000'/%3E%3C/svg%3E");
  --wave-c: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 64' preserveAspectRatio='none'%3E%3Cpath d='M0 30Q30 14 60 30T120 28Q200 4 280 30T400 26Q440 10 480 28T600 30Q700 2 800 30T960 26Q1000 12 1040 28T1180 30Q1260 6 1340 28T1440 24V64H0Z' fill='%23000'/%3E%3C/svg%3E");
  --wave-d: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 64' preserveAspectRatio='none'%3E%3Cpath d='M0 44C240 6 480 6 720 30S1200 58 1440 18V64H0Z' fill='%23000'/%3E%3C/svg%3E");
}

html[data-engine='off'] #como-trabajo { --edge: var(--wave-b); }
html[data-engine='off'] #proyectos { --edge: var(--wave-c); }
html[data-engine='off'] #defuga { --edge: var(--wave-a); }
html[data-engine='off'] #yegoo { --edge: var(--wave-d); }
html[data-engine='off'] #mas-trabajo { --edge: var(--wave-b); }
html[data-engine='off'] #sobre-mi { --edge: var(--wave-d); }
html[data-engine='off'] #contacto { --edge: var(--wave-c); }

/* cada sección sube con un borde de ola quieto sobre la anterior: se nota el cambio de profundidad */
html[data-engine='off'] .scene[data-stage] {
  margin-top: -56px;
  padding-top: calc(var(--header-h) + clamp(28px, 7vh, 80px) + 56px);
  -webkit-mask-image: var(--edge, var(--wave-a)), linear-gradient(#000, #000);
  mask-image: var(--edge, var(--wave-a)), linear-gradient(#000, #000);
  -webkit-mask-size: 100% 64px, 100% 100%;
  mask-size: 100% 64px, 100% 100%;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: 0 0, 0 63px;
  mask-position: 0 0, 0 63px;
}

@media (max-width: 819px) {
  html[data-engine='off'] .intro {
    background-color: #7fc8e6;
    background-image: url('../img/mar-intro-m.webp');
    background-image: image-set(url('../img/mar-intro-m.avif') type('image/avif'), url('../img/mar-intro-m.webp') type('image/webp'));
  }

  html[data-engine='off'] #como-trabajo {
    background-color: #2fa3de;
    background-image: url('../img/mar-como-m.webp');
    background-image: image-set(url('../img/mar-como-m.avif') type('image/avif'), url('../img/mar-como-m.webp') type('image/webp'));
  }

  html[data-engine='off'] #proyectos {
    background-color: #1f8fa6;
    background-image: url('../img/mar-quantum-m.webp');
    background-image: image-set(url('../img/mar-quantum-m.avif') type('image/avif'), url('../img/mar-quantum-m.webp') type('image/webp'));
  }

  html[data-engine='off'] #defuga {
    background-color: #0e6c88;
    background-image: url('../img/mar-defuga-m.webp');
    background-image: image-set(url('../img/mar-defuga-m.avif') type('image/avif'), url('../img/mar-defuga-m.webp') type('image/webp'));
  }

  html[data-engine='off'] #yegoo {
    background-color: #2f9aa8;
    background-image: url('../img/mar-yegoo-m.webp');
    background-image: image-set(url('../img/mar-yegoo-m.avif') type('image/avif'), url('../img/mar-yegoo-m.webp') type('image/webp'));
  }

  html[data-engine='off'] #mas-trabajo {
    background-color: #4ab5b8;
    background-image: url('../img/mar-mas-m.webp');
    background-image: image-set(url('../img/mar-mas-m.avif') type('image/avif'), url('../img/mar-mas-m.webp') type('image/webp'));
  }

  html[data-engine='off'] #sobre-mi {
    background-color: #3c93a6;
    background-image: url('../img/mar-sobre-m.webp');
    background-image: image-set(url('../img/mar-sobre-m.avif') type('image/avif'), url('../img/mar-sobre-m.webp') type('image/webp'));
  }

  html[data-engine='off'] #contacto {
    background-color: #b0577f;
    background-image: url('../img/mar-contacto-m.webp');
    background-image: image-set(url('../img/mar-contacto-m.avif') type('image/avif'), url('../img/mar-contacto-m.webp') type('image/webp'));
  }

  html[data-engine='off'] body[data-fixed-stage='2']::before {
    background-image: url('../img/mar-defuga-m.webp');
    background-image: image-set(url('../img/mar-defuga-m.avif') type('image/avif'), url('../img/mar-defuga-m.webp') type('image/webp'));
  }

  html[data-engine='off'] body[data-fixed-stage='3']::before {
    background-image: url('../img/mar-yegoo-m.webp');
    background-image: image-set(url('../img/mar-yegoo-m.avif') type('image/avif'), url('../img/mar-yegoo-m.webp') type('image/webp'));
  }
}

/* Las ilustraciones (velero, palmera, algas, corales, tortuga...) van dibujadas dentro de cada fondo (scripts/dev/capture-mar.mjs). */
html[data-engine='off'] .intro,
html[data-engine='off'] .scene[data-stage] {
  position: relative;
  overflow-x: clip;
}

/* ---------- tipografía ---------- */
.eyebrow {
  font: 600 0.8rem/1.4 var(--mono);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--teal-deep);
}

.panel--dark .eyebrow,
.on-dark .eyebrow {
  color: #8ff0f2;
}

.display {
  font-size: clamp(2.35rem, 6.4vw, 5.2rem);
  font-weight: 600;
  line-height: 1.04;
  letter-spacing: -0.035em;
}

.h2 {
  font-size: clamp(1.9rem, 4.2vw, 3.4rem);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.03em;
}

.display em,
.h2 em {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--teal-deep);
}

.panel--dark .h2 em,
.on-dark .h2 em {
  color: #8ff0f2;
}

.lead {
  font-size: clamp(1.05rem, 1.5vw, 1.28rem);
  line-height: 1.65;
  color: var(--ink-soft);
}

.panel--dark .lead,
.panel--dark p {
  color: #dcecf1;
}

/* ---------- paneles ---------- */
.panel {
  border-radius: var(--radius);
  padding: clamp(24px, 3.4vw, 48px);
  -webkit-backdrop-filter: blur(16px) saturate(1.25);
  backdrop-filter: blur(16px) saturate(1.25);
}

.panel--light {
  background: rgba(250, 253, 253, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.75);
  box-shadow: 0 24px 60px -28px rgba(4, 52, 66, 0.45);
  color: var(--ink);
}

.panel--dark {
  background: rgba(3, 31, 48, 0.66);
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 30px 70px -30px rgba(0, 12, 22, 0.75);
  color: #f2fbfd;
}

html[data-motion='lite'] .panel--light {
  background: rgba(250, 253, 253, 0.92);
}

html[data-motion='lite'] .panel--dark {
  background: rgba(3, 31, 48, 0.84);
}

.panel .h2 {
  font-size: clamp(1.75rem, 3vw, 2.7rem);
  margin-bottom: 14px;
}

.panel .lead {
  font-size: clamp(1rem, 1.2vw, 1.12rem);
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  font: 600 0.78rem/1.3 var(--mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.tag::before {
  content: '';
  width: 28px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  opacity: 0.7;
}

/* ---------- botones ---------- */
.btn {
  background: transparent;
  color: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  min-height: 50px;
  padding: 0 1.5rem;
  border: 1.5px solid transparent;
  border-radius: 999px;
  font: 500 0.95rem/1 var(--font);
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.35s var(--ease), background-color 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn--primary {
  background: var(--teal-deep);
  color: #fff;
}

.btn--primary:hover {
  background: #084b46;
}

.btn--ghost {
  border-color: rgba(10, 37, 51, 0.35);
  color: var(--ink);
  background: rgba(255, 255, 255, 0.35);
}

.btn--ghost:hover {
  border-color: var(--ink);
  background: rgba(255, 255, 255, 0.7);
}

.btn--light {
  background: #fff;
  color: var(--ink);
}

.btn--light:hover {
  background: #e5f8fa;
}

.btn--ghost-light {
  border-color: rgba(255, 255, 255, 0.5);
  color: #fff;
}

.btn--ghost-light:hover {
  border-color: #fff;
  background: rgba(255, 255, 255, 0.12);
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

/* ---------- entrada: cortina y hero ---------- */
.intro {
  --run: 90svh;
  position: relative;
  height: calc(100svh + var(--run));
  overflow-x: clip;
}

.intro__anchor {
  position: absolute;
  top: calc(var(--run) * 0.92);
  left: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
}

.intro__stick {
  position: sticky;
  top: 0;
  height: 100svh;
  overflow: hidden;
}

.hero {
  height: 100%;
  min-height: 0;
  align-items: center;
  padding: calc(var(--header-h) + 2vh) 0 clamp(24px, 5vh, 56px);
}

.hero__inner {
  position: relative;
  isolation: isolate;
  display: grid;
  gap: clamp(10px, 2.4vh, 26px);
  max-width: 860px;
}

.hero__inner::before {
  content: '';
  position: absolute;
  z-index: -1;
  inset: -10% -4% -10% -8%;
  background: radial-gradient(ellipse closest-side at 46% 50%, rgba(244, 252, 252, 0.62) 0%, rgba(244, 252, 252, 0.4) 55%, rgba(244, 252, 252, 0) 100%);
  pointer-events: none;
}

.hero .display,
.hero .lead,
.hero .eyebrow {
  text-shadow: 0 0 22px rgba(244, 252, 252, 0.7), 0 0 3px rgba(244, 252, 252, 0.4);
}

.hero .eyebrow {
  color: var(--ink);
}

.hero .display {
  font-size: clamp(2rem, min(6.2vw, 9vh), 5.2rem);
}

.hero .display em {
  color: #075e57;
}

.hero .lead {
  max-width: 560px;
  font-size: clamp(0.98rem, min(1.4vw, 2.5vh), 1.25rem);
  color: #0f2a35;
}

/* cortina: se levanta con el scroll (--ce va de 0 a 1) */
.curtain {
  display: none;
  position: absolute;
  inset: 0;
  z-index: 6;
  pointer-events: none;
  transform: translate3d(0, calc(var(--ce, 0) * -1 * (100% + 160px)), 0);
  backface-visibility: hidden;
}

html.rv-ready:not([data-motion='off']) .curtain {
  display: block;
}

html:not(.cv-ok) .curtain {
  animation: curtain-failsafe 0.01s linear 5s forwards;
}

@keyframes curtain-failsafe {
  to {
    transform: translate3d(0, -130%, 0);
    visibility: hidden;
  }
}

.curtain__sheet {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, #eef9f8 0%, #d6f1f0 55%, #bfe8e9 100%);
}

.curtain__edge {
  position: absolute;
  left: 0;
  bottom: -159px;
  width: 100%;
  height: 160px;
  color: #bfe8e9;
}

.curtain__face {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 12px;
  padding: 0 24px;
  text-align: center;
  color: var(--ink);
  opacity: calc(1 - var(--ce, 0) * 1.7);
  will-change: opacity;
}

.curtain__face img {
  width: 60px;
  height: 60px;
  padding: 7px;
  border-radius: 18px;
  background: #fff;
  object-fit: contain;
  box-shadow: 0 16px 34px -16px rgba(4, 52, 66, 0.55);
}

.curtain__name {
  font: 500 0.78rem/1.3 var(--mono);
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.curtain__role {
  font-size: clamp(1.4rem, 3.4vw, 2.2rem);
  font-weight: 600;
  letter-spacing: -0.02em;
}

.curtain__hint {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-top: 26px;
  font: 500 0.78rem/1 var(--mono);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.curtain__hint i {
  width: 2px;
  height: 36px;
  background: currentColor;
  opacity: 0.6;
  animation: hint 1.9s ease-in-out infinite;
}

@keyframes hint {
  0% {
    transform: scaleY(0.15);
    transform-origin: top;
  }

  50% {
    transform: scaleY(1);
    transform-origin: top;
  }

  51% {
    transform-origin: bottom;
  }

  100% {
    transform: scaleY(0.15);
    transform-origin: bottom;
  }
}

/* sin animaciones: sin cortina y hero normal */
html[data-motion='off'] .intro {
  height: auto;
}

html[data-motion='off'] .intro__stick {
  position: relative;
  height: auto;
  overflow: visible;
}

html[data-motion='off'] .hero {
  height: auto;
  min-height: 100svh;
}

/* ---------- cómo trabajo ---------- */
.how__grid {
  display: grid;
  gap: clamp(28px, 5vw, 72px);
  align-items: center;
}

.how__intro .h2 {
  margin: 14px 0 20px;
}

.steps {
  display: grid;
  gap: 4px;
  counter-reset: step;
}

.steps li {
  position: relative;
  padding: 20px 0 20px 64px;
  border-top: 1px solid rgba(10, 37, 51, 0.12);
}

.steps li:first-child {
  border-top: 0;
}

.steps li::before {
  counter-increment: step;
  content: counter(step, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 22px;
  font: 500 0.95rem/1 var(--mono);
  color: var(--teal-deep);
}

.steps strong {
  display: block;
  margin-bottom: 4px;
  font-size: 1.08rem;
  font-weight: 600;
}

.steps span {
  color: var(--ink-soft);
}

/* ---------- Quantum ---------- */
.quantum__grid {
  display: grid;
  gap: clamp(28px, 4vw, 64px);
  align-items: start;
}

.quantum__text .h2 {
  margin-bottom: 18px;
}

.mini {
  margin: 26px 0 10px;
  font: 600 0.8rem/1.3 var(--mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #8ff0f2;
}

.ticks li {
  position: relative;
  padding: 7px 0 7px 28px;
  color: #dcecf1;
}

.ticks li::before {
  content: '';
  position: absolute;
  left: 2px;
  top: 16px;
  width: 12px;
  height: 7px;
  border-left: 2px solid #8ff0f2;
  border-bottom: 2px solid #8ff0f2;
  transform: rotate(-45deg);
}

.closing {
  margin-top: 22px;
  font-weight: 500;
  color: #fff;
}

.quantum__visual {
  position: relative;
  padding-bottom: 14%;
}

.porthole {
  overflow: hidden;
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: #0b2a3a;
  box-shadow: 0 40px 90px -30px rgba(0, 12, 22, 0.8);
}

.porthole img {
  width: 100%;
  height: auto;
}

.quantum__phone {
  position: absolute;
  right: -3%;
  bottom: 0;
  width: 33%;
}

.porthole--phone {
  border: 6px solid #0a1c27;
  border-radius: 28px;
}

.par {
  will-change: auto;
  translate: 0 var(--py, 0px);
}

html:not([data-motion='off']) .porthole {
  animation: bob 9s ease-in-out infinite;
}

html:not([data-motion='off']) .porthole--phone {
  animation-delay: -4s;
}

@keyframes bob {
  0%,
  100% {
    translate: 0 0;
  }

  50% {
    translate: 0 -10px;
  }
}

/* ---------- Defuga ---------- */
.defuga {
  display: grid;
  gap: 22px;
  max-width: 880px;
}

.defuga .h2 span {
  display: block;
  font-family: var(--serif);
  font-style: italic;
  font-weight: 500;
  color: #8ff0f2;
}

.defuga .label {
  font: 500 0.82rem/1.3 var(--mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #8ff0f2;
}

/* ---------- Yegoo ---------- */
.yegoo__grid {
  display: grid;
  gap: clamp(28px, 4vw, 64px);
  align-items: center;
}

.yegoo__text .h2 {
  margin: 14px 0 18px;
}

.yegoo__text p {
  color: var(--ink-soft);
}

.browser {
  overflow: hidden;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  background: #fff;
  box-shadow: 0 40px 80px -34px rgba(3, 56, 72, 0.7);
  rotate: -2deg;
  transition: rotate 0.6s var(--ease);
}

.browser:hover {
  rotate: 0deg;
}

.browser__bar {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 14px;
  background: #e6f1f2;
}

.browser__bar i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #b4c9cd;
}

.browser img {
  width: 100%;
  height: auto;
}

/* ---------- más trabajo ---------- */
.more__head {
  max-width: 640px;
  margin-bottom: clamp(24px, 4vw, 44px);
}

.more__head .h2 {
  margin-top: 12px;
}

.cards {
  display: grid;
  gap: 18px;
}

.card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 22px;
  text-decoration: none;
  transition: transform 0.5s var(--ease), box-shadow 0.5s var(--ease);
}

.card__img {
  overflow: hidden;
  aspect-ratio: 16 / 10;
  background: #d8eeef;
}

.card__img picture {
  display: block;
  width: 100%;
  height: 100%;
}

.card__img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.8s var(--ease);
}

.card__body {
  display: grid;
  gap: 6px;
  padding: 20px 22px 24px;
}

.card__body h3 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 1.1rem;
  font-weight: 600;
}

.card__body p {
  font-size: 0.92rem;
  color: var(--ink-soft);
}

.card__days {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.card__days a {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(10, 37, 51, 0.22);
  font: 500 0.8rem/1 var(--mono);
  text-decoration: none;
}

.card__days a:hover {
  background: var(--teal-deep);
  border-color: var(--teal-deep);
  color: #fff;
}

@media (hover: hover) {
  html:not([data-motion='off']) .card:hover {
    transform: translateY(-8px);
    box-shadow: 0 34px 60px -30px rgba(4, 52, 66, 0.6);
  }

  .card:hover .card__img img {
    transform: scale(1.05);
  }
}

/* ---------- sobre mí ---------- */
.about {
  display: grid;
  gap: clamp(24px, 4vw, 56px);
  align-items: center;
  max-width: 980px;
}

.about .h2 {
  margin: 12px 0 14px;
}

/* ---------- contacto ---------- */
.contact {
  align-items: center;
}

.contact__panel {
  display: grid;
  gap: 22px;
  max-width: 820px;
}

.contact__panel .h2 {
  font-size: clamp(2.2rem, 5.6vw, 4.4rem);
}

.mail-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.foot {
  margin-top: clamp(32px, 6vh, 64px);
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  justify-content: space-between;
  font-size: 0.82rem;
  color: #dcecf1;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 150;
  padding: 12px 20px;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font-size: 0.88rem;
  opacity: 0;
  pointer-events: none;
  translate: -50% 16px;
  transition: opacity 0.3s ease, translate 0.3s ease;
}

.toast.is-on {
  opacity: 1;
  translate: -50% 0;
}

/* ---------- secciones tipo telón: la ola sube y descubre cada panel ---------- */
@property --my {
  syntax: '<length>';
  inherits: false;
  initial-value: 100000px;
}

.mk {
  --my: 100000px;
}

html.rv-ready:not([data-motion='off']) .mk:not(.mk-done) {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 64' preserveAspectRatio='none'%3E%3Cpath d='M0 26Q90 6 180 26T360 26T540 26T720 26T900 26T1080 26T1260 26T1440 26V64H0Z' fill='%23000'/%3E%3C/svg%3E"), linear-gradient(#000, #000);
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 64' preserveAspectRatio='none'%3E%3Cpath d='M0 26Q90 6 180 26T360 26T540 26T720 26T900 26T1080 26T1260 26T1440 26V64H0Z' fill='%23000'/%3E%3C/svg%3E"), linear-gradient(#000, #000);
  -webkit-mask-size: 100% 64px, 100% 100%;
  mask-size: 100% 64px, 100% 100%;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: 0 var(--my), 0 calc(var(--my) + 63px);
  mask-position: 0 var(--my), 0 calc(var(--my) + 63px);
}

.mk.is-in {
  animation: mk-reveal 1.4s cubic-bezier(0.22, 0.7, 0.2, 1) var(--d, 0s) both;
}

@keyframes mk-reveal {
  from {
    --my: var(--mh, 100000px);
  }

  to {
    --my: -64px;
  }
}

html.rv-ready:not([data-motion='off']):not(.cv-ok) .mk {
  animation: mk-failsafe 0.01s linear 5s forwards;
}

@keyframes mk-failsafe {
  to {
    -webkit-mask-image: none;
    mask-image: none;
  }
}

/* ---------- cortina ligada al scroll nativo (sin JavaScript en cada cuadro) ---------- */
@supports (animation-timeline: scroll()) {
  html:not([data-motion='off']) .curtain {
    transform: none;
    animation: curtain-lift cubic-bezier(0.42, 0, 0.58, 1) both;
    animation-timeline: scroll(root block);
    animation-range: 0px var(--run);
  }

  html:not([data-motion='off']) .curtain__face {
    opacity: 1;
    animation: face-fade linear both;
    animation-timeline: scroll(root block);
    animation-range: 0px calc(var(--run) * 0.55);
    will-change: auto;
  }

  html:not([data-motion='off']) .intro .hero .rv {
    animation: hero-in cubic-bezier(0.22, 0.7, 0.2, 1) both;
    animation-timeline: scroll(root block);
    animation-range: calc(var(--run) * (0.4 + var(--i, 0) * 0.07)) calc(var(--run) * (0.68 + var(--i, 0) * 0.07));
  }
}

@keyframes curtain-lift {
  to {
    transform: translate3d(0, calc(-100% - 160px), 0);
  }
}

@keyframes face-fade {
  to {
    opacity: 0;
  }
}

@keyframes hero-in {
  from {
    opacity: 0;
    transform: translate3d(0, 28px, 0);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

/* ---------- piezas que flotan hacia la superficie ---------- */
:where(html.rv-ready:not([data-motion='off'])) .fl:not(.is-in) {
  opacity: 0;
  transform: translate3d(var(--fx, 0px), 90px, 0) rotate(var(--fr, 0deg)) scale(0.94);
}

.fl.is-in {
  animation: float-up 2s cubic-bezier(0.16, 0.84, 0.24, 1) var(--d, 0s) backwards;
}

@keyframes float-up {
  0% {
    opacity: 0;
    transform: translate3d(var(--fx, 0px), 90px, 0) rotate(var(--fr, 0deg)) scale(0.94);
  }

  35% {
    opacity: 1;
  }

  62% {
    transform: translate3d(calc(var(--fx, 0px) * -0.35), 22px, 0) rotate(calc(var(--fr, 0deg) * -0.45)) scale(0.985);
  }

  100% {
    opacity: 1;
    transform: none;
  }
}

html.rv-ready:not([data-motion='off']):not(.cv-ok) .fl {
  animation: rv-failsafe 0.01s linear 6s forwards;
}

/* ---------- aparición con el scroll ---------- */
html.rv-ready:not([data-motion='off']) .rv {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 1s var(--ease) var(--d, 0s), transform 1s var(--ease) var(--d, 0s);
  animation: rv-failsafe 0.01s linear 6s forwards;
}

html.rv-ready:not([data-motion='off']) .rv.is-in {
  opacity: 1;
  transform: none;
}

/* El respaldo de 6 s solo vale si el JavaScript no corrió: con JS manda la cortina y el observador. */
html.cv-ok:not([data-motion='off']) .rv {
  animation: none;
}

@keyframes rv-failsafe {
  to {
    opacity: 1;
    transform: none;
  }
}

/* ---------- sin animaciones ---------- */
html[data-motion='off'] *,
html[data-motion='off'] *::before,
html[data-motion='off'] *::after {
  animation: none !important;
  transition: none !important;
  scroll-behavior: auto !important;
}

/* ---------- adaptación ---------- */
@media (min-width: 820px) {
  .how__grid {
    grid-template-columns: 1fr 1fr;
  }

  .quantum__grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  }

  .quantum__visual {
    position: sticky;
    top: calc(var(--header-h) + 5vh);
  }

  .yegoo__grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  }

  .cards {
    grid-template-columns: repeat(2, 1fr);
  }

}

@media (min-width: 1100px) {
  .cards {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (max-width: 819px) {
  .scene {
    min-height: 0;
  }

  .quantum__visual {
    margin-top: 8px;
  }
}

/* ---------- tarjetas con botón, retrato y formación ---------- */
.card__body {
  flex: 1;
}

.card__actions {
  margin-top: auto;
  padding-top: 14px;
}

.card__label {
  margin-bottom: 8px;
  font: 600 0.78rem/1.3 var(--mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--teal-deep);
}

.btn--sm {
  min-height: 42px;
  padding: 0 1.1rem;
  font-size: 0.88rem;
}

.about-wrap {
  display: grid;
  gap: 18px;
}

.about__photo {
  width: min(300px, 100%);
  aspect-ratio: 4 / 5;
  overflow: hidden;
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.85);
  background: #d8eeef;
}

.about__photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 20%;
}

.study {
  display: grid;
  gap: 22px;
  max-width: 980px;
}

.study__title {
  margin: 8px 0 6px;
  font-size: clamp(1.3rem, 2.2vw, 1.8rem);
  font-weight: 600;
  letter-spacing: -0.02em;
}

.study__sub {
  margin-bottom: 14px;
  color: var(--ink-soft);
  font-size: 0.95rem;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 10px;
}

.chips a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid rgba(10, 37, 51, 0.3);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.5);
  color: var(--ink);
  font-size: 0.88rem;
  font-weight: 500;
  text-decoration: none;
  transition: background-color 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}

.chips a:hover {
  background: var(--teal-deep);
  border-color: var(--teal-deep);
  color: #fff;
}

.chips .icon {
  width: 0.95em;
  height: 0.95em;
}

@media (min-width: 820px) {
  .about {
    grid-template-columns: 300px 1fr;
  }

  .study {
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
    align-items: start;
  }
}

/* ---------- páginas de casos ---------- */
.scene--case {
  min-height: 0;
  align-items: flex-start;
  padding: clamp(20px, 4vh, 44px) 0;
}

.scene--case:first-of-type {
  padding-top: calc(var(--header-h) + clamp(28px, 6vh, 64px));
}

.scene--end {
  padding-bottom: clamp(64px, 12vh, 140px);
}

.back {
  display: flex;
  width: fit-content;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  margin-bottom: 10px;
  font-weight: 500;
  font-size: 0.92rem;
  text-decoration: none;
  opacity: 0.85;
}

.back:hover {
  opacity: 1;
}

.panel .case-title {
  font-size: clamp(2rem, 4.4vw, 3.6rem);
  margin: 10px 0 18px;
}

.prose {
  max-width: 68ch;
}

.facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 1px;
  margin: 30px 0 0;
  overflow: hidden;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.16);
}

.facts div {
  padding: 16px 18px;
  background: rgba(3, 31, 48, 0.55);
}

.facts dt {
  font: 600 0.76rem/1.3 var(--mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #8ff0f2;
}

.facts dd {
  margin: 4px 0 0;
  font-weight: 500;
}

.facts--light {
  background: rgba(10, 37, 51, 0.12);
}

.facts--light div {
  background: rgba(255, 255, 255, 0.6);
}

.facts--light dt {
  color: var(--teal-deep);
}

.section-head {
  display: inline-block;
  padding: 16px 28px;
  margin-bottom: 18px;
}

.section-head .h2 {
  margin: 0;
}

.grid-3 {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.feature {
  padding: 26px 26px 28px;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(3, 31, 48, 0.66);
  color: #f2fbfd;
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}

.feature h3 {
  margin-bottom: 8px;
  font-size: 1.05rem;
  font-weight: 600;
}

.feature p {
  color: #dcecf1;
  font-size: 0.96rem;
}

.two-col {
  display: grid;
  gap: 18px;
}

.two-col .panel .lead {
  margin-bottom: 14px;
}

.shots {
  display: grid;
  gap: 22px;
  margin-top: 28px;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.shots--pair {
  grid-template-columns: 1fr;
  align-items: start;
}

.shots--tools {
  margin-top: 18px;
}

.shot figcaption {
  padding: 10px 4px 0;
  font-size: 0.85rem;
  opacity: 0.85;
}

.shot--phone {
  max-width: 280px;
}

.shot .porthole--phone {
  width: 100%;
}

.porthole--light {
  border-color: rgba(255, 255, 255, 0.8);
  background: #fff;
  box-shadow: 0 30px 60px -34px rgba(3, 56, 72, 0.7);
}

.shot .browser {
  rotate: 0deg;
}

.panel--light .ticks li {
  color: var(--ink-soft);
}

.panel--light .ticks li::before {
  border-color: var(--teal-deep);
}

.ticks--two {
  display: grid;
  gap: 0 32px;
  margin-top: 18px;
}

@media (min-width: 820px) {
  .two-col {
    grid-template-columns: 1fr 1fr;
  }

  .ticks--two {
    grid-template-columns: 1fr 1fr;
  }

  .shots--pair {
    grid-template-columns: minmax(0, 2.2fr) minmax(0, 1fr);
  }

  .shots--four {
    grid-template-columns: 1fr 1fr;
  }
}

/* ---------- móvil: todo centrado y solo lo importante ---------- */
@media (max-width: 819px) {
  .hero .eyebrow {
    display: none;
  }

  .hero__inner {
    justify-items: center;
    text-align: center;
  }

  .hero__inner::before {
    inset: -10% -8%;
    background: radial-gradient(ellipse closest-side at 50% 50%, rgba(244, 252, 252, 0.62) 0%, rgba(244, 252, 252, 0.4) 55%, rgba(244, 252, 252, 0) 100%);
  }

  .hero .lead {
    margin-inline: auto;
  }

  .btn-row {
    justify-content: center;
  }

  .panel,
  .card__body,
  .feature,
  .contact__panel,
  .defuga,
  .study,
  .about {
    text-align: center;
  }

  .panel .btn-row,
  .card__days,
  .chips,
  .tag,
  .about,
  .study__head {
    justify-content: center;
    justify-items: center;
  }

  .tag::before {
    display: none;
  }

  .steps li,
  .ticks li,
  .facts,
  .facts dd {
    text-align: left;
  }

  .steps li {
    padding-left: 56px;
  }

  .ticks li:nth-child(n + 3) {
    display: none;
  }

  .facts div:nth-child(n + 4) {
    display: none;
  }

  .about__photo {
    width: min(220px, 62%);
    margin-inline: auto;
  }

  .about {
    justify-items: center;
  }

  .mail-row {
    justify-content: center;
  }

  .mail-row .btn,
  .contact__panel .btn {
    width: 100%;
    max-width: 340px;
  }

  .foot {
    justify-content: center;
    text-align: center;
  }

  .card__actions {
    display: grid;
    justify-items: center;
  }

  .quantum__visual {
    padding-bottom: 18%;
  }
}

@media (max-width: 819px) {
  .card__body h3 {
    justify-content: center;
  }

  .card__img {
    aspect-ratio: 2 / 1;
  }
}
