/* VIVIO's own section navigation, inspired by the interaction of Ashfall Lab.
   All original sections stay semantic and usable if enhancement is unavailable. */
body.spatial-navigation { overflow: hidden; background: #171717; }
.spatial-navigation .header { position: fixed; inset: 0 0 auto; z-index: 90; background: #171717; border: 0; }
.spatial-navigation .header-inner { width: calc(100% - 56px); max-width: none; gap: 20px; }
.spatial-navigation .header .brand > span { font-size: 9px; letter-spacing: .12em; }
.spatial-navigation .header nav { font-size: 11px; gap: 22px; }
.scene-stage { position: fixed; inset: var(--scene-header, 88px) 0 var(--scene-footer, 58px); overflow: hidden; touch-action: pan-x; }
.scene-viewport { display: contents; }
.scene-universe { position: absolute; inset: 0; perspective: 1400px; perspective-origin: 54% 43%; transform-style: preserve-3d; transition: filter 240ms ease-out, opacity 240ms ease-out; }
.scene-v { position: absolute; left: 54%; top: 43%; width: clamp(170px, 20vw, 270px); aspect-ratio: 1; transform: translate(-50%, -50%); pointer-events: none; user-select: none; }
.scene-v > img, .scene-v > canvas { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.scene-v[data-renderer="webgl"] > img { visibility: hidden; }
.scene-v canvas { visibility: hidden; }
.scene-v[data-renderer="webgl"] canvas { visibility: visible; }
.scene-universe { will-change: transform; }
.scene-controls .scene-pause { flex: 0 0 32px; width: 32px; }
.scene-pause[aria-pressed="true"] { color: var(--yellow); border-color: var(--yellow); }
.scene-card { position: absolute; left: 54%; top: 43%; width: clamp(200px, 18vw, 260px); aspect-ratio: 1.53; padding: 0; border: 0; background: transparent; color: white; cursor: pointer; transform-style: preserve-3d; text-align: left; border-radius: 0; display: block; text-decoration: none; }
.scene-card > img, .scene-card > .scene-caption { display: none; }
.scene-facet { position: absolute; top: 0; left: 50%; height: 100%; overflow: hidden; border-block: 1px solid #8888; background: #17171708; opacity: var(--screen-seam,1); pointer-events: inherit; }
.scene-facet-start { border-left: 1px solid #8888; }
.scene-facet:last-child { border-right: 1px solid #8888; }
.scene-facet-art { position: absolute; top: 0; height: 100%; max-width: none; object-fit: cover; object-position: top; opacity: var(--screen-alpha,.45); }
.scene-facet > .scene-facet-label { background: linear-gradient(transparent,#07070744 40%); }
.scene-card:hover .scene-facet, .scene-card:focus-visible .scene-facet { border-color: var(--yellow); }
.scene-card:hover .scene-facet-art, .scene-card:focus-visible .scene-facet-art { opacity: .5; }
.scene-card:focus-visible { outline: 2px solid var(--yellow); outline-offset: 5px; }
.scene-caption { position: absolute; bottom: 0; left: 0; width: 100%; padding: 22px 13px 12px; display: flex; align-items: baseline; gap: 10px; background: linear-gradient(transparent, #070707f5 40%); font: 12px/1.4 var(--ui); pointer-events: none; }
.scene-caption small { color: var(--yellow); font: 11px var(--mono); }
.scene-intro { position: absolute; left: 28px; bottom: 90px; width: min(330px, 28vw); pointer-events: none; }
.scene-intro h1 { font: 45px/1.04 var(--display); letter-spacing: -.02em; margin: 0; }
.scene-intro h1 > span, .scene-intro h1 > em { display: block; }
.scene-intro h1 > em { color: var(--yellow); font-style: normal; }
.scene-intro .hero-typing { display: grid; position: relative; padding-bottom: .15em; }
/* Más presente que antes, pero secundaria: un punto más de contraste, tamaño y peso. */
.scene-hint { margin-top: 20px; max-width: 260px; color: #e4e4e4; font: 500 12px/1.65 var(--ui); letter-spacing: .01em; }
.scene-hint span { display: block; }
.scene-controls { position: absolute; bottom: 18px; left: 28px; display: flex; align-items: center; gap: 10px; }
.scene-controls button { width: 36px; height: 36px; border: 1px solid #5b5b5b; border-radius: 50%; background: transparent; color: var(--white); cursor: pointer; display: grid; place-items: center; }
.scene-selector { width: 255px; height: 40px; padding: 0 30px 0 12px; background: #171717; border: 0; border-bottom: 1px solid #696969; color: var(--white); font: 12px var(--ui); cursor: pointer; }
.scene-selector option { background: #171717; color: var(--white); }
.scene-controls button:hover { color: var(--yellow); border-color: var(--yellow); }
.scene-controls button:active, .section-close:active { transform: scale(.97); }
.section-open .scene-universe { filter: blur(8px); opacity: .25; }
.section-open .scene-intro, .section-open .scene-controls { visibility: hidden; }
.section-panel { position: fixed; top: var(--scene-header, 88px); right: 0; bottom: var(--scene-footer, 58px); width: min(860px, 56vw); background: #0d0d0d; border-left: 1px solid #3b3b3b; z-index: 75; overflow-y: auto; overscroll-behavior: contain; outline: none; animation: panel-enter 260ms cubic-bezier(.22,1,.36,1); }
.section-panel[hidden] { display: none; }
.section-toolbar { height: 44px; position: sticky; top: 0; z-index: 10; background: #0d0d0df5; border-bottom: 1px solid #333; display: flex; align-items: center; justify-content: space-between; padding: 0 28px; gap: 16px; }
.section-toolbar p { margin: 0; color: #bbb; font: 11px var(--mono); }
.section-close { border: 0; background: transparent; color: var(--white); padding: 10px 0 10px 12px; font: 12px var(--ui); cursor: pointer; white-space: nowrap; display: flex; align-items: center; gap: 8px; }
.section-close:hover { color: var(--yellow); }
.section-panel .scene-content { display: none; }
.section-panel .scene-content.scene-active { display: block; }
.section-panel .container { width: calc(100% - 64px); margin-inline: auto; }
.section-panel .scene-content { padding-block: 36px 56px; }
.section-panel .hero { grid-template-columns: 1fr; }
.section-panel h1 { font-size: clamp(44px, 4.4vw, 68px); }
.section-panel h2 { font-size: clamp(38px, 3.6vw, 56px); }
.section-panel .hero-visual { margin-top: 40px; }
.section-panel .hero-product { max-width: 620px; }
.section-panel .scope-strip > .container { flex-wrap: wrap; }
.section-panel .scope-strip p { flex-wrap: wrap; }
.section-panel .editorial-mark { font-size: 60px; }
.section-panel .section-heading { display: block; margin-bottom: 28px; }
.section-panel .problem-grid, .section-panel .solution-layout, .section-panel .pricing, .section-panel .contact { grid-template-columns: 1fr; }
.section-panel .problem-grid, .section-panel .solution-layout, .section-panel .contact { display: grid; gap: 28px; }
.section-panel .pricing.scene-active { display: grid; gap: 28px; }
.section-panel .cases-grid, .section-panel .team-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.section-panel .technology-grid { grid-template-columns: 1fr; }
.section-panel .why-heading { display: block; }
.section-panel .why-brand { display: none; }
.section-panel .google-reviews { grid-template-columns: 1fr; }
.section-panel .reviews-quotes { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.section-panel .review-card:nth-child(3) { grid-column: 1 / -1; }
.section-panel .process-panel { grid-template-columns: 1fr; }
.section-panel .contact-layout { grid-template-columns: 1fr; gap: 30px; }
.section-panel .crew-grid, .section-panel .service-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.section-panel .use-cases { grid-template-columns: 1fr; }
.section-panel .why-pulse { width: 140px; margin: 24px auto; }
.section-panel .process-tabs { gap: 8px; }
.section-panel #equipo .why-grid { gap: 24px; }
.section-panel #equipo .why-grid article > span { font-size: 20px; line-height: 1.2; padding-bottom: 8px; margin-bottom: 12px; }
.section-panel #equipo .why-grid h3 { font-size: 18px; line-height: 1.35; margin-bottom: 8px; }
.section-panel #equipo .why-grid p { line-height: 1.5; }
.section-panel #equipo .crew { margin-top: 28px; padding-top: 24px; }
.spatial-navigation .footer { position: fixed; bottom: 0; left: 0; z-index: 85; width: 100%; max-width: none; padding: 0 28px; background: #171717; border: 0; }
.spatial-navigation .footer-bottom { min-height: 52px; padding: 12px 0; margin: 0; border-top: 1px solid #393939; gap: 18px; }
.spatial-navigation .footer-bottom > div { display: flex; flex-wrap: wrap; gap: 14px; }
.spatial-navigation .footer-bottom .text-button { font-size: 10px; }
.scene-info { border: 0; background: transparent; color: #aaa; padding: 0; font: 10px var(--ui); cursor: pointer; }
.scene-info:hover { color: var(--yellow); }
.spatial-navigation .footer-top[hidden] { display: none; }
.spatial-navigation .footer-top { position: absolute; bottom: 100%; left: 0; right: 0; padding: 28px; margin: 0; background: #171717; border-top: 1px solid #555; display: flex; align-items: center; justify-content: space-between; gap: 20px; box-shadow: 0 -20px 50px #0007; }
@keyframes panel-enter { from { transform: translateX(35px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@media (max-width: 1150px) {
  .spatial-navigation .brand .brand-full { display: none; }
  .spatial-navigation .brand .brand-mobile { display: inline; }
  .spatial-navigation .header nav { gap: 14px; }
  .spatial-navigation .header .btn { font-size: 11px; padding-inline: 12px; }
  .scene-intro { width: 260px; }
  .scene-intro h1 { font-size: 38px; }
  .section-panel { width: 66vw; }
}
/* Mask a 2D viewport around the well, never the 3D universe itself. */
@media (max-width: 800px), (max-height: 500px) and (max-width: 1000px) {
  .scene-viewport {
    display: block;
    position: absolute;
    inset: 0;
    overflow: hidden;
    -webkit-mask-image: linear-gradient(to bottom, transparent, #000 18px, #000 calc(100% - 18px), transparent);
    mask-image: linear-gradient(to bottom, transparent, #000 18px, #000 calc(100% - 18px), transparent);
  }
}
@media (max-width: 800px) {
  .spatial-navigation .header { height: 110px; }
  .spatial-navigation .header-inner { width: calc(100% - 32px); height: 100%; display: grid; grid-template-columns: 82px 1fr; grid-template-rows: 54px 40px; align-content: center; gap: 2px 12px; }
  .spatial-navigation .header .brand img { width: 82px; height: auto; }
  .spatial-navigation .header .brand > span, .spatial-navigation .header nav { display: none; }
  .spatial-navigation .header-actions { display: contents; }
  .spatial-navigation .header .btn { grid-column: 2; grid-row: 1; justify-self: end; min-width: 0; max-width: 100%; font-size: 11px; padding: 11px 12px; white-space: normal; text-align: left; }
  .spatial-navigation .header-actions .lang-switch { position: static; grid-column: 1 / -1; grid-row: 2; justify-self: end; padding: 2px; }
  .spatial-navigation .lang-switch a { padding: 5px 8px; font-size: 11px; }
  .scene-viewport { bottom: calc(var(--scene-intro-height, 150px) + 100px); }
  .scene-universe { bottom: 0; perspective: 1100px; perspective-origin: 50% 50%; }
  .scene-card, .scene-v { left: 50%; top: 50%; }
  .scene-card { width: 160px; }
  .scene-caption { padding: 17px 9px 8px; font-size: 10px; gap: 8px; }
  .scene-v { width: 135px; transform: translate(-50%, -50%); }
  .scene-intro { width: calc(100% - 36px); left: 18px; bottom: 82px; }
  .scene-intro h1 { font-size: 30px; max-width: 400px; }
  .scene-intro h1 > span { display: inline; }
  .scene-intro .hero-typing { max-width: 400px; }
  .scene-hint { margin-top: 8px; max-width: none; font-size: 11px; }
  .scene-controls { width: calc(100% - 36px); left: 50%; transform: translateX(-50%); bottom: 13px; justify-content: center; gap: 8px; }
  .scene-selector { width: min(255px, calc(100vw - 164px)); font-size: 11px; }
  .section-panel { width: 100%; border-left: 0; }
  .section-panel .container { width: calc(100% - 36px); }
  .section-panel .scene-content { padding-block: 26px 44px; }
  .section-panel h1 { font-size: 47px; }
  .section-panel h2 { font-size: 43px; }
  .section-toolbar { padding-inline: 18px; }
  .section-panel .cases-grid, .section-panel .team-grid { grid-template-columns: 1fr; }
  .section-panel .crew-grid, .section-panel .service-grid, .section-panel .product-showcase, .section-panel .product-callouts, .section-panel .why-grid { grid-template-columns: 1fr; }
  .section-panel .reviews-quotes { grid-template-columns: 1fr; }
  .section-panel .review-card:nth-child(3) { grid-column: auto; }
  .spatial-navigation .footer { padding-inline: 16px; }
  .spatial-navigation .footer-bottom { min-height: 68px; gap: 7px 10px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; font-size: 9px; }
  .spatial-navigation .footer-bottom > div { width: 100%; justify-content: space-between; gap: 6px; }
  .spatial-navigation .footer-bottom .text-button, .scene-info { font-size: 9px; }
  .spatial-navigation .footer-top { display: block; padding: 22px 18px; }
  .spatial-navigation .footer-top p { margin-block: 12px; }
  html[lang="zh-CN"] .scene-intro h1 { font-size: 22px; line-height: 1.35; }
  html[lang="zh-CN"] .section-panel h1 { font-size: 34px; }
  html[lang="zh-CN"] .section-panel h2 { font-size: 32px; }
}
@media (max-height: 720px) and (min-width: 801px) {
  .scene-card { width: 200px; }
  .scene-intro { bottom: 75px; }
  .scene-intro h1 { font-size: 32px; }
}
@media (max-height: 700px) and (max-width: 800px) {
  .scene-intro h1 { font-size: 24px; }
  .scene-card { width: 135px; }
  .scene-hint { margin-top: 5px; }
}
/* On short landscape phones the well must stay beside, rather than over, the title. */
@media (max-height: 500px) and (max-width: 800px) {
  .scene-viewport { bottom: 82px; }
  .scene-universe { left: 50%; }
  .scene-card { width: 76px; }
  .scene-v { width: 80px; }
  .scene-caption { padding: 12px 5px 5px; font-size: 8px; gap: 4px; }
  .scene-caption small { font-size: 8px; }
  .scene-intro { width: 46%; }
  .scene-intro h1 { font-size: 18px; }
  .scene-hint { display: none; }
  html[lang="zh-CN"] .scene-intro h1 { font-size: 14px; }
}
@media (max-height: 500px) and (min-width: 801px) and (max-width: 1000px) {
  .scene-viewport { bottom: 75px; }
}
@media (max-height: 500px) and (min-width: 801px) {
  .scene-universe { left: 34%; perspective-origin: 50% 43%; }
  .scene-card, .scene-v { left: 50%; }
  .scene-intro { width: 28%; }
}
@media (prefers-reduced-motion: reduce) {
  .scene-universe, .scene-card { transition: none; }
  .section-panel { animation: none; }
}
