:root{
  --base-bg:#2c2c2c;

  --fg:#f6f4ef;
  --muted:#666;
  --center-w: 960px;
   --base-width: 1280;
  --base-height: 800;

  /* columnas internas */
  --col1: 350px;
  --col3: 350px;
  --col5: 235px;
  /* gap calculado para que todo sume 960 */
  --gap: calc((var(--center-w) - (var(--col1) + var(--col3) + var(--col5))) / 2); /* ~12.5px */

  /* filas originales: 150, 480, 438, 174  → escala a total 1024 */
  --r1: 124px;  /* 150 * 0.8245 */
  --r2: 396px;  /* 480 * 0.8245 */
  --r3: 361px;  /* 438 * 0.8245 */
  --r4: 144px;  /* 174 * 0.8245 */

  /* gutters laterales (opcionales) */
  --gutter: 123px;
}

* {
  box-sizing: border-box;     /* ✅ Bien. Estabiliza paddings y dimensiones. */
}

html, body {
  height: 100%;               /* ✅ Recomendado para layouts full-page */
  margin: 0;                  /* ✅ Sin márgenes erráticos */
    overflow-x: hidden;
  overflow-y: auto;
  
}

body {
  background: var(--base-bg);
  width: 100%;
  height: 100%;
  color: var(--fg);
  font-family: "Spectral", serif;
  position: relative;
    overflow-x: hidden;
  overflow-y: auto;
  z-index: auto;

}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image: var(--bg-image);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  mix-blend-mode: difference;     /* o soft-light, multiply, difference */
  filter: brightness(1.1) contrast(0.9);
  /*opacity: var(--bg-opacity, 0.25);*/
  pointer-events: none;
  z-index: -1;
  opacity: .5;
}

/* ====== H-SCROLL ====== */

.h-scroll {
  display: flex;
  min-height: 100vh;
  height: auto;
  overflow-x: auto;
  overflow-y: visible;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  
}

.panel {
  flex: 0 0 100vw;
  min-height: 100vh;
  scroll-snap-align: start;
  display: grid;
  place-items: center;
  position: relative;
  background: transparent !important;
    height: auto;

  display: block;
}

.panel-inner {
  width: min(1100px, 86vw);
  margin: auto;
  padding: 24px;
}

.panel--vscroll{ 
  overflow-y: auto;
    height: auto;           /* ← necesario para que crezca con el contenido */
  min-height: 100vh; 

}

.home-grid{
  width: var(--base-width);
  margin: 0 auto;
  display: grid;
  
  grid-template-columns:
    [L1 left] var(--gutter)
    [L2 c1]   var(--col1)     /* 350 (col 1 central) */
    [L3 g1]   var(--gap)
    [L4 c3]   var(--col3)     /* 350 (col 2 central) */
    [L5 g2]   var(--gap)
    [L6 c5]   var(--col5)     /* 235 (col 3 central) */
    [L7 right-gutter] var(--gutter) [L8 right];
  grid-template-rows:
    [T1 top] var(--r1)
    [T2]     var(--r2)
    [T3]     var(--r3)
    [T4]     var(--r4) [T5 bottom];
  position: relative;

}



/* ===== contenedor general ===== */
.frame{
  width: min(1280px, 100vw);
  margin-inline: auto;
  padding-inline: 0;                  /* <-- antes usaba var(--gutter) */
}



.trace{
  grid-column: c1;   /* 350 central (col 2) */
  grid-row:    T2;   /* fila 2 (480) */
  align-self: start; 
  justify-self: start;
   position: absolute;
  top: -60px;     /* AJUSTAR ESTOS VALORES UNA SOLA VEZ */
  left: 10px;   /* AJUSTAR ESTOS VALORES UNA SOLA VEZ */

  width: 320px; 
  height: auto;
z-index: 1;
  mix-blend-mode: multiply;
  opacity: .9;
  overflow: visible !important;
}

/*.trace-base {
  position: absolute;
   top: 30px;     
  left: 10px;   

  width: 320px; 
  height: auto;
  z-index: 5;
  pointer-events: none;
  mix-blend-mode: multiply;
}*/

.ornament {
  height: 75%; width: auto;
  grid-column: c5;
  grid-row: T2;
  align-self: end;
  justify-self: end;
  object-fit: contain;
  mix-blend-mode: multiply;
  z-index: 1;
  transform: translate(-110px, 140px);
}

/* tagline en la franja central (desde col 2 hasta antes del 235) */
.tagline{
  grid-column: 2 / 6;      /* ocupa 350 + gap + 350 + gap */
  grid-row: 3;             /* fila 438 */
  align-self: top; justify-self: start;
  text-transform: uppercase;
  letter-spacing: .22em;
  font-family: "DM Mono", ui-monospace, monospace;
  font-size: 14px;
  line-height: 1.45;
   transform: translateX(50px) translateY(-100px); 
   z-index: 5000;
}

/* firma en la base, alineada a la línea 7---clamp 18-22 */
.signature{
  grid-column: 4 / 6;      /* aprox centro-derecha del área central */
  grid-row: 2;             /* fila 174 */
  justify-self: end;       /* pega a la línea 7 */
  align-self: end;
  font-family: "DM Mono", ui-monospace, monospace;
  letter-spacing: .25em;
  font-size: 18px;
  transform: translate(-20px, 120px);
}

.line-ornament{

  grid-column: c5;  /* misma columna que .ornament */
  grid-row:    T2;  /* misma fila que .ornament */
  justify-self: end;  /* al borde derecho de la celda */
  align-self:   end;  /* al borde inferior de la celda */
transform: translate(-180px, 140px);
  width: var(--w, 420px); /* AJUSTA este valor a ojo o al ancho de .signature */
  height: 1px;
  background-color: var(--fg);
  opacity: .6;
  
}

.ornament-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  order: 3;
}

.signature-wrapper {
  position: relative;
   width: 100%;
  height: auto;
}

/* Contenedor flotante */
.orb {
  grid-column: c3;
  grid-row: top / T1;
  align-self: start;
  position: relative; /* Para que el menú se ancle abajo */
}

.orb-img {
  display: block;
  cursor: pointer;
  max-width: 100%;
  height: auto;
}

.floating-orb{
  position: fixed;
  top: clamp(16px, 4vh, 48px);
  right: clamp(16px, 4vw, 48px);
  z-index: 9000; /* por encima de todo */
  isolation: isolate; /* 🔥 clave: fuerza un stacking context independiente */
}
.floating-orb img{
  display:block;
  width: 100px;
  height:auto;
  cursor:pointer;
}


/* solo invierte, sin re-rasterizar */
.floating-orb img:hover {
  filter: invert(100%);
}

.floating-orb.active img {
  animation: orbBreath 4s ease-in-out infinite;
}

@keyframes orbBreath {
  0%, 100% {
    transform: scale(1);
    opacity: 0.9;
  }
  50% {
    transform: scale(1.15);
    opacity: 1;
  }
}



.menu-box[hidden]{ display:none; }
.menu-box{
  position:absolute;
  top: calc(100% + 8px);
   right: 0;           /* ancla por la derecha del PNG */
  left: auto;         /* (por si antes había left) */
  transform: translateX(-56px) translateY(-10px);
  
  width: fit-content;           /* o max-content si prefieres */
  min-width: 220px;             /* base fija */
  max-width: 280px;             /* límite para evitar desbordes */
  box-sizing: border-box;

  padding: 10px 0;
  background: #4f4e4e;
  opacity: .65;
  border: 1px solid var(--fg);
  border-radius: 0;
  z-index: 9100;
  will-change: transform;       /* suave al abrir/cerrar */
}
.menu-box ul{ margin:0; padding:0; list-style:none; }
.menu-box li{ padding:8px 18px; }
.menu-box a{
  text-decoration:none;
  color:var(--fg);
  font-family:"DM Mono", ui-monospace, monospace;
  font-size:14px;
}


.menu-box a:hover {
  box-shadow: inset 0 0 50px 0 #0a0a0a;
  color: #e2e2e2;
  font-family: 'archivo narrow', sans-serif;
  font-size: .8rem;
  letter-spacing: 0.7em;
  text-transform: uppercase;
  text-decoration: line-through;
  transition: color .3s ease-in-out, box-shadow .3s ease-in-out;
}

.menu-box, .floating-orb img {
  mix-blend-mode: normal !important;
}



/* === BLOQUE FINAL DEL HOME === */
.home-bottom {
  grid-column: 1 / -1;       /* ocupa todo el ancho del grid */
  display: flex;
  justify-content: center;
  margin-top: 6vh;
  margin-bottom: 8vh;
}

.home-bottom-box {
  max-width: 780px;
  text-align: left;
  padding: 1.5vw 4vw;
}

.home-bottom-box p {
  font-family: "DM Mono", monospace;
  letter-spacing: 0.25em;
  font-size: 16px;
  line-height: 1.6;
  margin: 3em 0;
}

.fern-bottom {
  display: block;
  margin: 2.5em auto 0;
  width: 680px;
  opacity: 0.9;
}

.bg-video {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  object-fit: cover;

  /* 👇 Estos replican EXACTAMENTE lo que hace tu GIF */
  mix-blend-mode: difference;
  filter: brightness(1.1) contrast(0.9);
  opacity: 0.35;
 animation: breathe 18s ease-in-out infinite;
  pointer-events: none;
  z-index: -2; /* debajo del body::before, que sigue existiendo */

}

@keyframes breathe {
  0%, 100% { opacity: 0.40; transform: scale(1); }
  50% { opacity: 0.32; transform: scale(1.02); }
}

/* ===== ICONOS DE SCROLL ===== */

/* Flecha hacia abajo (scroll vertical) */
.scroll-down-icon {
  position: fixed;
  bottom: 3vh;
  left: 50%;
  transform: translateX(-50%);
  font-size: 1.8rem;
  color: var(--fg);
  opacity: 0.8;
  animation: bounceDown 1.8s infinite;
  cursor: pointer;
  z-index: 50;
}

@keyframes bounceDown {
  0%, 100% { transform: translate(-50%, 0); opacity: 0.7; }
  50% { transform: translate(-50%, 8px); opacity: 1; }
}

/* Flecha hacia la derecha (slide horizontal) */
.scroll-right-icon {
  position: fixed;
  right: 3vw;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.8rem;
  color: var(--fg);
  opacity: 0.8;
  animation: bounceRight 1.8s infinite;
  cursor: pointer;
  z-index: 50;
}

@keyframes bounceRight {
  0%, 100% { transform: translateY(-50%) translateX(0); opacity: 0.7; }
  50% { transform: translateY(-50%) translateX(8px); opacity: 1; }
}




.panel--home{
  position: relative;
  width: 1280px;
  height: 800px;   /* ← TU CANVAS REAL */
  margin: 0 auto;
  overflow: visible; /* ← nada se recorta */
  
}


/* CANVAS BASE FIJO */
.home-fit {
   position: relative;
  width: 1280px;
  height: 800px;
  overflow: visible;
  transform: none !important; /* ← bloquea escalados accidentales */
  margin: 0 auto;
  transform-origin: top center;
}

.panel--home.panel--vscroll {
  overflow-y: auto;   /* ← este es el scroll que necesitas */
  overflow-x: hidden;
}
/* ESCALADO AUTOMÁTICO SEGÚN EL VIEWPORT 
@media (min-width: 1280px) {
  .home-fit {
    transform: scale(calc(100vw / 1280));
  }
}

@media (max-width: 1280px) {
  .home-fit {
    transform: scale(calc(100vw / 1280));
  }
}*/


/* SOLO reducir cuando la ventana es MÁS CHICA */
@media (max-width: 1280px), (max-height: 800px) {
  .home-fit {
    transform: scale(calc(100vw / 1280));
    transform-origin: top center;
  }
}
.svg-sequence {
  position: absolute;
  top: 0;
  left: 0;
  width: 1440px;  /* mismo que tu diseño base */
  height: 1024px;
  pointer-events: none; /* importante si no quieres interacción */
  z-index: 2; /* encima de fondo pero debajo de ornamento */
}

.svg-animation {
  opacity: 0;
  transition: opacity .6s ease;
  mix-blend-mode: multiply;
 
}

body.svg-ready .svg-animation {
  opacity: 1;
}


main {
  position: relative;
  z-index: 2;
}



.svg-ornamento-container {
  position: relative;
  width: 100%;
  height: 100%;
  mix-blend-mode: multiply;

}

/* LUZ SEGUIDORA 
.cursor-light {
  pointer-events: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 40vw;
  height: 40vw;
  max-width: 500px;
  max-height: 500px;
  transform: translate(-50%, -50%);
  background: radial-gradient(
    circle,
    rgba(255,255,255,0.25) 0%,
    rgba(255,255,255,0.08) 50%,
    rgba(255,255,255,0) 80%
  );
  border-radius: 50%;
  mix-blend-mode: soft-light;
  z-index: -1;
}*/

/*.cursor-light-img {
  pointer-events: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 300px;           
  height: auto;
  transform: translate(-50%, -50%);
  opacity: 0.8;           
  mix-blend-mode: color-burn; 
  z-index: -1;
}*/

.tagline a {
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color .25s, color .25s;
  cursor: pointer;
  color: var(--fg);
}

.tagline a:hover {
  border-color: currentColor;
}

@keyframes drift {
  0%   { transform: translate(0,0); }
  50%  { transform: translate(1.5px, -1px); }
  100% { transform: translate(0,0); }
}

.drift {
  animation: drift 6s ease-in-out infinite;
}

#distortionLayer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 10;
  mix-blend-mode: color-dodge;
  opacity: 0.3;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255,255,255,0.12) 0 2px,
    rgba(255,255,255,0) 2px 6px
  );
  backdrop-filter: blur(2px) contrast(1.2);
}

#cursorGlow {
  position: fixed;
  width: 40vw;
  height: 40vw;
  border-radius: 50%;
  pointer-events:none;
  z-index: 5;
  mix-blend-mode: soft-light;
  background: radial-gradient(
    circle,
    rgba(255,255,255,0.4),
    rgba(255,255,255,0) 70%
  );
  transform: translate(-50%, -50%);
}
#filmNoise {
  position: fixed;
  inset: 0;
  z-index: 20;
  pointer-events:none;
  mix-blend-mode: screen;

  background:
    url('media/noise.gif') repeat,
    repeating-linear-gradient(
      to bottom,
      rgba(255,255,255,0.15) 0 2px,
      rgba(255,255,255,0) 2px 8px
    );

  opacity: .35;
  animation: shift 4s infinite;
}

@keyframes shift {
  0%   { transform: translateY(0); filter: blur(1px); }
  50%  { transform: translateY(-4px); filter: blur(2px); }
  100% { transform: translateY(0); filter: blur(1px); }
}


/* Micro-ajustes extra pequeños */
@media (max-width: 600px) {
  .ornament {
    width: 220px;
    max-height: 36svh;
  }

  .line-ornament {
    width: min(66vw, 420px);
  }
  

}

@media (max-width: 600px) {

  html, body {
    height: auto;
    overflow: visible;
    margin: 0;
  }

  .h-scroll {
    display: block;
    height: 100vh;
  overflow-x: auto;
  overflow-y: visible;
  }

  .panel {
    display: block;
    padding: 6vw 4vw;
    height: auto;
  }



  .home-fit {
    width: auto;
    height: auto;
    transform: none;
    margin: 0 auto;
  }

  .home-grid {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 2rem;
    max-width: 90vw;
    margin: 0 auto;
  }

  .trace,
  .tagline,
  .ornament,
  .signature,
  .line-ornament {
    position: static;
    width: auto;
    height: auto;
    transform: none;
    margin: 0;
  }

  .ornament-block {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
  }

  .ornament {
    width: 220px;
    max-height: 38vh;
    object-fit: contain;
  }

  .line-ornament {
    width: min(60vw, 480px);
    height: 1px;
    background-color: var(--fg);
    opacity: 0.6;
    margin-top: 8px;
  }

  .signature {
    text-align: right;
    font-size: clamp(16px, 1.4vw, 18px);
    letter-spacing: .25em;
  }

  .tagline {
    font-size: clamp(16px, 1.6vw, 20px);
    letter-spacing: .22em;
    text-align: left;
  }

  .pf-thumb img {
    object-fit: contain;
    max-width: 200px;
    height:auto;
  }


}


@media (min-width: 601px) {
  .home-fit {
    width: var(--base-width);
    height: var(--base-height);
    margin: 0 auto;
    transform: none;
  }

  .home-grid {
    width: var(--base-width);
    margin: 0 auto;
    display: grid;
    grid-template-columns:
      [L1 left] var(--gutter)
      [L2 c1]   var(--col1)
      [L3 g1]   var(--gap)
      [L4 c3]   var(--col3)
      [L5 g2]   var(--gap)
      [L6 c5]   var(--col5)
      [L7 right-gutter] var(--gutter) [L8 right];
    grid-template-rows:
      [T1 top] var(--r1)
      [T2]     var(--r2)
      [T3]     var(--r3)
      [T4]     var(--r4) [T5 bottom];
    position: relative;
  }



  .pf-thumb img {
    object-fit: contain;
    max-width: 200px;
    height:auto;
    margin-top: auto;
  }


}
