/* ================================================================
   5SEIS — SUBWEBS (craft · 3D · website)
   Archivo compartido: es el mismo en las tres carpetas.
   Si se modifica, copiarlo a craft/, 3D/ y website/ (assets/sub.css).
   Tokens dark-first, redefinidos en [data-theme="light"]
   ================================================================ */

:root {
  --bg:      #0A0A0A;
  --bg2:     #111214;
  --surface: #17181B;
  --text:    #F2F0EA;
  --text2:   #C9CED1;
  --dim:     rgba(242, 240, 234, .28);
  --line:    rgba(242, 240, 234, .12);
  --line2:   rgba(242, 240, 234, .3);
  --accent:  #7CFF4F;   /* verde 5SEIS */
  --on-acc:  #0A0A0A;
  --blue:    #2F6BFF;
  --violet:  #8B3DFF;
  --tile:    linear-gradient(135deg, #0B1F4A 0%, #121A3A 45%, #2A1257 100%);
  --nav-bg:  rgba(10, 10, 10, .72);

  --sans: 'Host Grotesk', system-ui, sans-serif;
  --mono: 'Roboto Mono', ui-monospace, monospace;
  --px:   clamp(16px, 6vw, 110px);
  --max:  1440px;
  --ease: cubic-bezier(.32, .72, 0, 1);
  --r:    14px;
  color-scheme: dark;
}

[data-theme="light"] {
  --bg:      #F2F0EA;
  --bg2:     #E9E6DE;
  --surface: #E1DDD3;
  --text:    #0A0A0A;
  --text2:   #34363A;
  --dim:     rgba(10, 10, 10, .28);
  --line:    rgba(10, 10, 10, .12);
  --line2:   rgba(10, 10, 10, .3);
  --accent:  #2E7D12;
  --tile:    linear-gradient(135deg, #DCE4F5 0%, #E4E2F0 50%, #E8DDF5 100%);
  --nav-bg:  rgba(242, 240, 234, .78);
  color-scheme: light;
}

/* --- Reset --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; cursor: none; }
@media (hover: none) { *, *::before, *::after { cursor: auto; } }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg); color: var(--text);
  font-family: var(--sans); font-size: 16px; line-height: 1.6;
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
  transition: background .4s var(--ease), color .4s var(--ease);
}
img, svg, iframe { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: none; text-align: inherit; }
ol, ul { list-style: none; }
[hidden] { display: none !important; }
::selection { background: var(--accent); color: var(--on-acc); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
section { scroll-margin-top: 84px; }
/* Nav, menú, footer, cursor, barra y volver arriba: shared/5seis-shell.css */

.skip {
  position: fixed; top: 10px; left: 10px; z-index: 9000;
  padding: .6rem 1rem; border-radius: 999px;
  background: var(--accent); color: var(--on-acc); font-size: .85rem;
  transform: translateY(-160%); transition: transform .3s var(--ease);
}
.skip:focus { transform: none; }
.mono { font-family: var(--mono); font-size: 11px; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; }
.ico { width: 18px; height: 18px; flex-shrink: 0; }
.logo { height: 20px; width: auto; aspect-ratio: 348.64 / 95.59; color: currentColor; }
.sec-label { color: var(--accent); margin-bottom: 1.6rem; display: block; }

.grain {
  position: fixed; inset: 0; z-index: 7000; pointer-events: none; opacity: .045;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ================================================================
   BOTONES
   ================================================================ */
.btn {
  display: inline-flex; align-items: center; gap: .6rem;
  min-height: 46px; padding: 0 1.3rem; border-radius: 999px;
  font-family: var(--mono); font-size: 11.5px; font-weight: 500; letter-spacing: .1em; text-transform: uppercase;
  transition: transform .4s var(--ease), background .3s var(--ease), color .3s var(--ease), border-color .3s var(--ease);
}
.btn .ico { width: 16px; height: 16px; transition: transform .4s var(--ease); }
.btn:hover { transform: translateY(-2px); }
.btn:hover .ico { transform: translateX(2px); }
.btn-acc { background: #7CFF4F; color: #0A0A0A; }
.btn-line { border: 1px solid var(--line2); }
.btn-line:hover { border-color: var(--text); }
.btn-lg { min-height: 58px; padding: 0 1.8rem; font-size: 12.5px; }
.btn-tag {
  display: inline-flex; align-items: center; min-height: 46px; padding: 0 1.1rem; border-radius: 999px;
  border: 1px dashed var(--line2); color: var(--text2);
  font-family: var(--mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase;
}

/* ================================================================
   HERO
   ================================================================ */
.hero {
  position: relative; overflow: hidden;
  min-height: 100svh; display: flex; flex-direction: column; justify-content: flex-end;
  padding: 120px 0 clamp(2rem, 4vw, 3rem);
}
.glow { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
.glow span {
  position: absolute; border-radius: 50%; filter: blur(90px); opacity: .55;
  animation: drift 18s ease-in-out infinite alternate;
}
.glow .g1 { width: 55vw; height: 55vw; left: -18vw; bottom: -22vw; background: #1FD15A; }
.glow .g2 { width: 50vw; height: 50vw; right: -14vw; top: -16vw; background: var(--blue); animation-delay: -6s; }
.glow .g3 { width: 34vw; height: 34vw; right: 18vw; bottom: -12vw; background: var(--violet); opacity: .45; animation-delay: -11s; }
[data-theme="light"] .glow span { opacity: .3; }
@keyframes drift { to { transform: translate3d(4vw, -3vw, 0) scale(1.08); } }

.hero-inner { position: relative; z-index: 1; padding: 0 var(--px); max-width: var(--max); width: 100%; margin: 0 auto; }
.hero-label { color: var(--text2); display: flex; align-items: center; gap: .8rem; margin-bottom: 1.4rem; }
.hero-label::before { content: ''; width: 28px; height: 1px; background: var(--accent); }
.hero-title {
  font-weight: 800; text-transform: uppercase; letter-spacing: -.045em; line-height: .86;
  font-size: clamp(3.4rem, 14.5vw, 14rem);
}
/* Borde limpio: el texto se dibuja lleno y el filtro SVG #outline deja solo el contorno
   exterior (evita las líneas internas que -webkit-text-stroke marca en la fuente variable) */
.hero-title .o { display: block; color: var(--text); filter: url(#outline); }
.hero-title .s { display: block; color: var(--accent); }
.hero-row {
  display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 1.5rem 3rem;
  margin-top: clamp(1.5rem, 3vw, 2.5rem);
}
.hero-sub { font-size: clamp(1.05rem, 1.5vw, 1.3rem); line-height: 1.5; max-width: 40ch; }
.hero-see { display: inline-flex; align-items: center; gap: .5rem; color: var(--text); }
.hero-see .ico { width: 16px; height: 16px; transition: transform .4s var(--ease); }
.hero-see:hover .ico { transform: translateY(3px); }

.hero .hero-label, .hero-title .o, .hero-title .s, .hero-row { animation: rise 1.1s var(--ease) both; }
.hero-title .o { animation-delay: .08s; }
.hero-title .s { animation-delay: .18s; }
.hero-row { animation-delay: .35s; }
@keyframes rise { from { opacity: 0; transform: translateY(28px); } to { opacity: 1; transform: none; } }

/* Marquesina de imágenes reales */
.marquee {
  position: relative; z-index: 1; overflow: hidden;
  margin-top: clamp(2rem, 4vw, 3.5rem);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
          mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.marquee-track { display: flex; gap: 12px; width: max-content; animation: slide 60s linear infinite; }
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee figure { height: clamp(140px, 22vh, 230px); border-radius: var(--r); overflow: hidden; flex-shrink: 0; background: var(--tile); }
.marquee img { height: 100%; width: auto; object-fit: cover; }
.mode-mockup .marquee img { object-fit: contain; padding: 10px; }
@keyframes slide { to { transform: translateX(-50%); } }

/* ================================================================
   EL SERVICIO
   ================================================================ */
.sec { padding: clamp(4.5rem, 9vw, 8rem) var(--px); max-width: var(--max); margin: 0 auto; }
.svc { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: clamp(2rem, 6vw, 7rem); align-items: end; }
.svc-lead { font-size: clamp(1.8rem, 3.6vw, 3.4rem); font-weight: 600; letter-spacing: -.035em; line-height: 1.06; }
.svc-body { color: var(--text2); font-size: clamp(1rem, 1.25vw, 1.12rem); line-height: 1.7; }
.svc-tags { display: flex; flex-wrap: wrap; gap: .45rem; margin-top: 1.6rem; }
.svc-tags li {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase;
  padding: .4rem .8rem; border: 1px solid var(--line2); border-radius: 999px; color: var(--text2);
}
@media (max-width: 900px) { .svc { grid-template-columns: 1fr; align-items: start; } }

/* ================================================================
   LISTADO EXPANDIBLE (estilo servicios de 5seis.com)
   ================================================================ */
.list-sec { padding-top: 0; }
.idx { border-top: 1px solid var(--line); }
.row { border-bottom: 1px solid var(--line); scroll-margin-top: 80px; }
.row-h { font: inherit; }
.row-btn {
  width: 100%; display: grid; grid-template-columns: 3rem minmax(0, 1fr) auto 28px; align-items: center;
  gap: clamp(.8rem, 2.5vw, 2.5rem);
  padding: clamp(1rem, 2vw, 1.6rem) 0;
}
.row-n { color: var(--accent); transition: color .38s; }
.row-t {
  font-size: clamp(1.7rem, 4.8vw, 4.8rem); font-weight: 800; text-transform: uppercase;
  letter-spacing: -.04em; line-height: .92; color: var(--text); transition: color .38s;
}
.row-c { color: var(--text2); text-align: right; transition: color .38s; }
.row-x { position: relative; width: 28px; height: 28px; border: 1px solid var(--line2); border-radius: 50%; transition: transform .45s var(--ease), background .3s, border-color .3s; }
.row-x::before, .row-x::after { content: ''; position: absolute; left: 50%; top: 50%; width: 10px; height: 1.5px; background: currentColor; transform: translate(-50%, -50%); }
.row-x::after { transform: translate(-50%, -50%) rotate(90deg); transition: transform .45s var(--ease); }
.row.open .row-x { background: #7CFF4F; border-color: #7CFF4F; color: #0A0A0A; }
.row.open .row-x::after { transform: translate(-50%, -50%) rotate(0deg); }
.row.open .row-t { color: var(--accent); }
/* Atenuar el resto en hover */
.idx.has-hover .row:not(.is-active) .row-t { color: var(--dim); }
.idx.has-hover .row:not(.is-active) .row-c { color: var(--dim); }
.idx.has-hover .row:not(.is-active) .row-n { color: rgba(124, 255, 79, .3); }
@media (max-width: 700px) {
  .row-btn { grid-template-columns: 2rem minmax(0, 1fr) 28px; row-gap: .4rem; }
  .row-c { grid-column: 2; grid-row: 2; text-align: left; }
  .row-x { grid-column: 3; grid-row: 1 / span 2; }
}

/* Panel: se abre en el mismo lugar */
.row-p { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .55s var(--ease); }
.row.open .row-p { grid-template-rows: 1fr; }
.row-in { overflow: hidden; min-height: 0; }
.pj-grid {
  display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: clamp(2rem, 4vw, 4.5rem); align-items: start;
  padding: .5rem 0 clamp(2.5rem, 5vw, 4rem) calc(3rem + clamp(.8rem, 2.5vw, 2.5rem));
  opacity: 0; transform: translateY(12px); transition: opacity .5s var(--ease), transform .6s var(--ease);
}
.row.open .pj-grid { opacity: 1; transform: none; transition-delay: .15s; }
.pj-info { position: sticky; top: 100px; }
.pj-meta { display: flex; flex-wrap: wrap; gap: .4rem; }
.pj-meta li { font-size: .8rem; color: var(--text2); padding: .3rem .7rem; border: 1px solid var(--line); border-radius: 999px; }
.pj-desc { margin-top: 1.4rem; color: var(--text2); font-size: 1.02rem; line-height: 1.65; max-width: 46ch; }
.pj-specs { display: flex; align-items: center; flex-wrap: wrap; gap: .5rem 1rem; margin-top: 1.4rem; color: var(--text); }
.pj-specs .ico { color: var(--accent); }
.pj-specs span { font-family: var(--mono); font-size: 12px; letter-spacing: .06em; }
.pj-specs span + span::before { content: '·'; margin-right: 1rem; color: var(--text2); }
.pj-actions { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1.8rem; }
@media (max-width: 900px) {
  .pj-grid { grid-template-columns: 1fr; padding-left: 0; }
  .pj-info { position: static; }
}

/* Galería */
.gal { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; }
.gal button {
  position: relative; overflow: hidden; border-radius: var(--r);
  background: var(--surface); grid-column: span 2; aspect-ratio: 1 / 1;
}
.gal button:first-child { grid-column: 1 / -1; aspect-ratio: 16 / 9; }
.gal[data-n="2"] button:not(:first-child) { grid-column: 1 / -1; aspect-ratio: 16 / 9; }
.gal[data-n="3"] button:not(:first-child) { grid-column: span 3; aspect-ratio: 4 / 3; }
.gal[data-n="5"] button:not(:first-child), .gal[data-n="9"] button:not(:first-child) { grid-column: span 3; aspect-ratio: 4 / 3; }
.gal img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.1s var(--ease), opacity .6s var(--ease); opacity: 0; }
.gal img.ok { opacity: 1; }
.gal button:hover img { transform: scale(1.04); }
.gal button::after { content: ''; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 1px var(--line); pointer-events: none; }
.mode-mockup .gal button { background: var(--tile); }
.mode-mockup .gal img { object-fit: contain; padding: 4%; }
.mode-mockup .gal button:first-child img { padding: 3% 6%; }
@media (max-width: 600px) {
  .gal button, .gal[data-n] button:not(:first-child) { grid-column: span 3; aspect-ratio: 1 / 1; }
}

/* Pila de imágenes que sigue al mouse */
.float {
  position: fixed; top: 0; left: 0; z-index: 550; pointer-events: none;
  width: clamp(420px, 46vw, 680px); height: 0;
}
.float-in { position: absolute; left: -50%; top: -80px; width: 100%; opacity: 0; transform: scale(.9); transition: opacity .3s ease, transform .4s cubic-bezier(.16, 1, .3, 1); }
.float.visible .float-in { opacity: 1; transform: scale(1); }
.float-card {
  position: absolute; top: 0; width: 34%; aspect-ratio: 16 / 9;
  border-radius: 10px; overflow: hidden; background: var(--tile);
  box-shadow: 0 16px 40px rgba(0, 0, 0, .6), 0 0 0 1px rgba(255, 255, 255, .07);
  opacity: 0; transition: opacity .35s ease, transform .45s cubic-bezier(.16, 1, .3, 1);
}
.float-card img { width: 100%; height: 100%; object-fit: cover; }
.mode-mockup .float-card img { object-fit: contain; padding: 6%; }
.float-card:nth-child(1) { left: 0;               z-index: 1; transform: rotate(-5deg) translateY(12px) scale(.9); }
.float-card:nth-child(2) { left: calc(33% - 5px); z-index: 2; transform: rotate(3deg)  translateY(20px) scale(.9); }
.float-card:nth-child(3) { left: calc(66% - 10px); z-index: 3; transform: rotate(-2deg) translateY(6px)  scale(.9); }
.float.visible .float-card:nth-child(1) { opacity: 1; transform: rotate(-5deg) translateY(12px) scale(1); }
.float.visible .float-card:nth-child(2) { opacity: 1; transform: rotate(3deg)  translateY(20px) scale(1); transition-delay: 90ms; }
.float.visible .float-card:nth-child(3) { opacity: 1; transform: rotate(-2deg) translateY(6px)  scale(1); transition-delay: 180ms; }
@media (hover: none), (max-width: 900px) { .float { display: none; } }

/* ================================================================
   CIERRE
   ================================================================ */
.end { position: relative; overflow: hidden; border-top: 1px solid var(--line); }
.end .glow span { opacity: .35; }
.end-inner { position: relative; z-index: 1; }
.end-title { font-size: clamp(2.4rem, 6.5vw, 6.2rem); font-weight: 700; letter-spacing: -.04em; line-height: .98; max-width: 14ch; }
.end-title em { font-style: normal; color: var(--accent); }
.end-p { color: var(--text2); font-size: clamp(1.02rem, 1.4vw, 1.2rem); margin: 1.6rem 0 2.2rem; max-width: 44ch; }
.end-ctas { display: flex; flex-wrap: wrap; align-items: center; gap: .7rem; }

/* ================================================================
   DIÁLOGOS (galería y video)
   ================================================================ */
dialog {
  border: 0; padding: 0; margin: 0; max-width: none; max-height: none;
  width: 100vw; height: 100dvh; background: rgba(6, 6, 8, .94); color: #F2F0EA;
}
dialog::backdrop { background: rgba(0, 0, 0, .6); }
dialog[open] { display: grid; place-items: center; animation: fade .3s var(--ease); }
@keyframes fade { from { opacity: 0; } }
.dlg-stage { width: min(92vw, 1600px); height: min(80dvh, 1000px); display: grid; place-items: center; }
.dlg-stage img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 8px; }
.mode-mockup .dlg-stage img { background: var(--tile); padding: 3%; }
.dlg-video { width: min(92vw, 1400px); aspect-ratio: 16 / 9; max-height: 82dvh; }
.dlg-video.v { width: auto; height: min(82dvh, 900px); aspect-ratio: 9 / 16; }
.dlg-video iframe { width: 100%; height: 100%; border: 0; border-radius: 10px; background: #000; }
.dlg-btn {
  position: absolute; width: 48px; height: 48px; border-radius: 50%;
  display: grid; place-items: center; color: #F2F0EA;
  border: 1px solid rgba(242, 240, 234, .3); background: rgba(10, 10, 10, .5);
  transition: border-color .3s var(--ease);
}
.dlg-btn:hover { border-color: #7CFF4F; }
.dlg-close { top: 18px; right: 18px; }
.dlg-prev { left: 18px; top: 50%; transform: translateY(-50%); }
.dlg-next { right: 18px; top: 50%; transform: translateY(-50%); }
.dlg-count { position: absolute; bottom: 22px; left: 50%; transform: translateX(-50%); color: #C9CED1; }
.dlg-ext { position: absolute; bottom: 18px; left: 50%; transform: translateX(-50%); color: #F2F0EA; display: inline-flex; gap: .5rem; align-items: center; }
@media (max-width: 600px) {
  .dlg-prev, .dlg-next { top: auto; bottom: 14px; transform: none; }
  .dlg-count { bottom: 30px; }
}

/* Reveal */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .9s var(--ease), transform .9s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition-duration: .01ms !important; }
  .reveal { opacity: 1; transform: none; }
  .marquee { overflow-x: auto; }
}
