/* The scenery and instrument belong to the viewport; content keeps its natural height. */
:root{--dial-height:clamp(180px,40vw,240px);--safe-bottom:env(safe-area-inset-bottom,0px);--safe-top:env(safe-area-inset-top,0px);--header-height:98px;--text-scale:.7;--title-gradient:linear-gradient(100deg,#9fff91,#48f5ca,#50cfff,#b195ff,#9fff91);--u:1px}
html{scroll-behavior:auto;scroll-padding-bottom:calc(var(--dial-height) + var(--safe-bottom) + 24px)}
body{font-size:calc(var(--text-scale) * 16px);line-height:1.6;overflow-x:clip;background:#09131b}
body:before{content:'';position:fixed;inset:0;z-index:-4;background:#0c1822}
.site-shell{container-type:normal;--u:1px;--px:0px;--py:0px;--sy:0px;width:100%;max-width:none;min-height:100svh;display:block;overflow:visible;isolation:isolate;padding-bottom:calc(var(--dial-height) + var(--safe-bottom) + 48px);box-shadow:none}
.site-shell .world,.site-shell[data-view] .world{position:fixed;inset:-30px -24px -80px;z-index:-3;background-size:cover;background-position:center top;filter:none;transform:translate3d(var(--px),calc(var(--py) + var(--sy)),0) scale(1.02);transition:transform .3s ease,filter .6s;will-change:transform}
.world:before{content:'';position:absolute;inset:0;background:linear-gradient(180deg,#08131a24 0,#07121a36 26%,#07121ad9 75%,#07121aeb)}
.site-shell[data-view=trabajo] .world:after{display:none}
.ambient-light{position:fixed;inset:-15%;z-index:-2;background:radial-gradient(ellipse at 15% 65%,#22ec9c0d,transparent 42%),radial-gradient(ellipse at 85% 20%,#49a9ff1c,transparent 38%),radial-gradient(ellipse at 65% 95%,#9652fc10,transparent 35%);animation:atmosphere 18s ease-in-out infinite alternate;pointer-events:none;will-change:transform}
.site-shell .site-header,.site-shell[data-view] .site-header{height:auto;min-height:98px;max-width:1180px;margin:auto;padding:24px clamp(20px,4vw,40px);display:flex;align-items:center;gap:20px;position:relative}
.site-shell[data-view] .brand{gap:18px;min-width:0}
.site-shell[data-view] .brand img{width:72px;height:34px}
.site-shell[data-view] .brand>span{font:500 calc(var(--text-scale) * 12px)/1.5 var(--font);letter-spacing:2px;padding-left:18px}
.site-shell[data-view] .brand small{font-size:calc(var(--text-scale) * 11px);letter-spacing:2px;margin-top:3px}
.site-header .header-note,.site-shell[data-view=perfil] .header-note{font:calc(var(--text-scale) * 12px)/1.5 var(--mono);letter-spacing:2px;margin:0 60px 0 auto}
.site-shell[data-view] .menu-button{display:grid;place-items:center;position:absolute;right:20px;top:26px;width:44px;height:44px;border:1px solid #8da9b744;border-radius:50%;background:#102029aa}
.site-shell[data-view] .menu-button svg{width:22px;height:22px}
main{position:relative;width:100%;touch-action:pan-y pinch-zoom}
.view{animation:none!important;touch-action:pan-y pinch-zoom;transform-origin:center top}
.view.swipe-preview{pointer-events:none}
.is-sliding .view{will-change:transform,opacity}
.bevel{--cut:18px;border-radius:14px}
.bevel:before{background:linear-gradient(130deg,#24343def,#0d1b23f7 60%,#20303ae8)}
.bevel:after{opacity:.8;background:radial-gradient(300px circle at var(--lx,0px) var(--ly,0px),#64e8ff24,transparent 72%);transition:opacity .35s}
.bevel:hover:after{opacity:1}
.bevel:focus-within:after{opacity:1;background:radial-gradient(ellipse at 20% 0,#5fffbb20,transparent 65%)}
.view .chart{height:220px;aspect-ratio:auto}
.view .answers>button:first-child:not(.selected){border-color:#7396a563;box-shadow:none;background:linear-gradient(110deg,#253943b3,#20313c5c)}
.view .answers>button:first-child:not(.selected)>b{background:#9fafc3b3;color:#fff}
.view .answers>button:not(:disabled):hover{border-color:#85ffb4;box-shadow:0 0 15px #53fc992a}
.view #project-detail{scroll-margin-top:20px}
em,#profile-title,#work-title,#measure-title,#experiments-title,#menu h2{color:transparent;-webkit-text-fill-color:transparent;background:var(--title-gradient);background-size:250% 100%;background-clip:text;-webkit-background-clip:text;animation:color-flow 9s ease-in-out infinite}
button,a{touch-action:pan-y pinch-zoom}
button:active,.contact-card:active{filter:brightness(1.22)}
button:focus-visible,a:focus-visible{outline:2px solid #83ffd0;outline-offset:3px}
.dial-footer{--u:1px;position:fixed;z-index:30;left:50%;bottom:0;transform:translateX(-50%);width:min(100%,600px);height:calc(var(--dial-height) + var(--safe-bottom));margin:0;overflow:visible;pointer-events:none;background:none;border:0;isolation:isolate;padding-bottom:var(--safe-bottom)}
.dial-footer:before{content:'';position:absolute;inset:0 -20px 0;z-index:-1;background:radial-gradient(ellipse at 50% 110%,#061119f5 0,#061119de 30%,#07151a75 52%,transparent 71%);pointer-events:none}
.dial-footer>#dial-art{inset:0 0 auto;width:100%;height:var(--dial-height);overflow:hidden;stroke-width:1;pointer-events:none}
.gauge-back{fill:#091a23e6;stroke:none}.gauge-arc{stroke:#b4cfdd;stroke-width:1.5;fill:none;filter:drop-shadow(0 0 5px #78cbe83b)}
.minor-tick{stroke:#7c99ac;stroke-width:1}.major-tick{stroke:#d8e9f3;stroke-width:2}
.gauge-dot{fill:#cadfe9;stroke:#6e92a8;stroke-width:1;transition:fill .4s}
.gauge-dot.active{fill:#86ffcb;stroke:#6dffd5}
#gauge-needle,#gauge-indicator{transform-box:view-box;transition:transform .65s cubic-bezier(.22,1,.3,1)}
#gauge-needle{transform-origin:300px 226px;filter:drop-shadow(0 1px 3px #000a)}
#gauge-indicator{transform-origin:300px 226px}
.dial-footer .dial-links{position:absolute;inset:0 0 auto;height:var(--dial-height);pointer-events:none}
.dial-footer .dial-links>a{position:absolute;width:72px;min-width:44px;max-width:none;height:48px;min-height:44px;padding:3px 0;transform:translate(-50%,-50%);pointer-events:auto;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;color:#ccdae5;border:0;border-radius:0;background:none;backdrop-filter:none;transition:color .25s,text-shadow .25s}
.dial-footer .dial-links b,.dial-footer .dial-links>a[aria-current=page] b{font:600 calc(var(--text-scale) * 17px)/1 var(--display)}
.dial-footer .dial-links span{font:500 calc(var(--text-scale) * 12px)/1.2 var(--font);letter-spacing:.3px;margin:0;white-space:nowrap;pointer-events:none;text-shadow:0 1px 5px #071118}
.dial-footer .dial-links>a[aria-current=page]{color:#8affc0;text-shadow:0 0 16px #38fcca88;background:none}
.dial-footer .dial-links>a:hover{background:none;color:#d8fff0;text-shadow:0 0 12px #79ffdc}
dialog{font-size:calc(var(--text-scale) * 16px);max-height:calc(100dvh - 32px);overflow-y:auto;padding:28px;line-height:1.6}
dialog h2{font-size:calc(var(--text-scale) * 32px)}dialog .micro{font:calc(var(--text-scale) * 12px)/1.5 var(--mono);letter-spacing:2px}dialog nav a{min-height:56px;font-size:calc(var(--text-scale) * 18px)}
.dialog-close{min-width:44px;min-height:44px}
.paused *,.paused *:before,.paused *:after,.tab-inactive *,.tab-inactive *:before,.tab-inactive *:after{animation-play-state:paused!important}
.paused #gauge-needle,.paused #gauge-indicator{transition:none}
.paused .world{transform:none!important}
@keyframes atmosphere{to{transform:translate3d(3%,-3%,0) scale(1.08);opacity:.7}}
@media(max-width:600px){
  .site-header .header-note{display:none}
  .site-shell[data-view] .brand{gap:12px}
  .site-shell[data-view] .brand img{width:60px;height:29px}
  .site-shell[data-view] .brand>span{padding-left:12px;font-size:calc(var(--text-scale) * 11px);letter-spacing:1.3px}
  .site-shell[data-view] .brand small{font-size:calc(var(--text-scale) * 10px)}
  .site-shell .world,.site-shell[data-view] .world{background-size:auto 115vh;background-position:57% top;background-color:#09151e}
  .dial-footer .dial-links>a{width:64px}
  .dial-footer .dial-links b,.dial-footer .dial-links>a[aria-current=page] b{font-size:calc(var(--text-scale) * 16px)}
  .dial-footer .dial-links span{font-size:calc(var(--text-scale) * 12px);letter-spacing:0}
}
@media(max-height:500px) and (orientation:landscape){:root{--dial-height:170px}.dial-footer{width:440px}#dial-menu{left:8px}}
@media(max-width:360px){.dial-footer .dial-links>a{width:56px}.dial-footer .dial-links span{font-size:calc(var(--text-scale) * 11px)}}
@media(prefers-reduced-motion:reduce){.ambient-light,em,.status-dot,.availability-orb{animation:none!important}#gauge-needle,#gauge-indicator{transition:none}}

/* Native horizontal pages, with vertical reading contained in each page. */
html,body{width:100%;height:100%;overflow:hidden;overscroll-behavior:none}
.site-shell{position:fixed;inset:0;height:100dvh;min-height:0;padding:0;overflow:hidden}
#main{position:absolute;inset:calc(var(--header-height) + var(--safe-top)) 0 auto;width:100%;height:calc(100dvh - var(--header-height) - var(--safe-top) - var(--dial-height) + 24px - var(--safe-bottom));display:flex;align-items:stretch;overflow-x:auto;overflow-y:hidden;scroll-snap-type:x mandatory;overscroll-behavior-x:contain;scrollbar-width:none;touch-action:pan-x pan-y pinch-zoom;mask-image:linear-gradient(to bottom,#000 calc(100% - 72px),transparent calc(100% - 24px));-webkit-mask-image:linear-gradient(to bottom,#000 calc(100% - 72px),transparent calc(100% - 24px))}
#main::-webkit-scrollbar{display:none}
#main:focus{outline:none}
#main>.view{position:relative;flex:0 0 100%;width:100%;max-width:none;min-width:0;height:100%;min-height:0;margin:0;padding:0;overflow-x:hidden;overflow-y:auto;scroll-snap-align:start;scroll-snap-stop:always;overscroll-behavior-y:contain;touch-action:pan-x pan-y pinch-zoom;scrollbar-width:none;transform:none;scroll-padding-bottom:90px;-webkit-overflow-scrolling:touch}
#main>.view::-webkit-scrollbar{display:none}
.view-content{max-width:1100px;width:100%;margin:0 auto;padding:24px 20px 112px}
.view .site-header{max-width:1180px;margin:auto;flex-shrink:0}
#main button,#main a{touch-action:pan-x pan-y pinch-zoom}
.is-sliding .view{will-change:auto}
.is-sliding #gauge-needle,.is-sliding #gauge-indicator{transition:none}
.is-dragging #main,.is-dragging #main *{cursor:grabbing;user-select:none}
.dial-footer{z-index:100;contain:layout style;transform:translate3d(-50%,0,0);backface-visibility:hidden}
.dial-footer:before{background:linear-gradient(to bottom,transparent,#07131b12 50%,#07131b38);inset:0;z-index:-1}
.dial-footer .dial-links span{text-shadow:0 1px 7px #04121d,0 0 12px #04121d}
.dial-footer .dial-links>a[aria-current=page] span{text-shadow:0 0 12px #54ffc58f}
@media(min-width:640px){.view-content{padding:30px 32px 112px}}
@media(min-width:960px){.view-content{padding:38px 44px 112px}}
@media(max-width:359px){.view-content{padding-left:16px;padding-right:16px}}

/* One persistent header, outside both axes of page movement. */
.site-header{position:fixed;z-index:110;top:0;left:50%;transform:translateX(-50%);width:100%;max-width:1180px;height:calc(var(--header-height) + var(--safe-top));margin:0;padding:calc(20px + var(--safe-top)) clamp(16px,4vw,40px) 20px;display:flex;align-items:center;gap:20px;background:linear-gradient(#0b1724b3,#0b172466 70%,transparent);isolation:isolate}
.site-header .brand{display:flex;align-items:center;gap:18px;min-width:0;flex-shrink:1}
.site-header .brand img{width:72px;height:34px;flex-shrink:0}
.site-header .brand>span{font:500 calc(var(--text-scale) * 12px)/1.5 var(--font);letter-spacing:2px;padding-left:18px;border-left:1px solid #bfd2e496;white-space:nowrap}
.site-header .brand small{display:block;font-size:calc(var(--text-scale) * 11px);letter-spacing:2px;margin-top:3px}
.site-header .header-note{position:static;font:calc(var(--text-scale) * 12px)/1.5 var(--mono);letter-spacing:2px;margin:0 0 0 auto}
.header-controls{display:flex;gap:8px;align-items:center;margin-left:auto;flex-shrink:0}
.site-header .menu-button{position:static;inset:auto;transform:none;width:44px;height:44px;min-width:44px;min-height:44px;padding:0;display:grid;place-items:center;opacity:1;border:1px solid #7697a758;border-radius:50%;background:#0b1b2573;color:#c4dce8;font:calc(var(--text-scale) * 20px)/1 var(--display);touch-action:manipulation}
.site-header .menu-button svg{width:22px;height:22px}


/* Lower the complete instrument and reclaim the same height for reading. */
:root{--dial-drop:44px}
.dial-footer{bottom:calc(0px - var(--dial-drop))}
#main{height:calc(100dvh - var(--header-height) - var(--safe-top) - var(--dial-height) + 24px - var(--safe-bottom) + var(--dial-drop))}
.dial-footer>#dial-art{transform:none}
.dial-footer .dial-links>a{gap:0}

/* Keep the section marker and its introduction close at every breakpoint. */
.view .section-rail{margin-bottom:16px}
.view.home .hero,.view.contact .hero,.view .work-hero,.view .experiments-hero{padding-top:0;margin-top:0}
.view.profile .profile-intro{margin-top:0;align-items:start}
.view.profile .profile-text h2{align-self:start}
.view.profile .profile-summary{grid-column:1;grid-row:1 / span 2;align-self:start}
.view.profile .profile-summary .profile-lead{margin-top:16px}
@media(max-width:600px){
  :root{--header-height:82px}
  .site-header{gap:10px;padding-left:16px;padding-right:16px}
  .site-header .brand{gap:10px}
  .site-header .brand img{width:52px;height:26px}
  .site-header .brand>span{font-size:calc(var(--text-scale) * 11px);padding-left:10px;letter-spacing:1.3px}
  .site-header .brand small{font-size:calc(var(--text-scale) * 10px)}
  .site-header .header-note{display:none}
  .header-controls{gap:4px}
}

/* Phone refinements keep the instrument compact and its numbers at their existing size. */
@media(max-width:600px){
  :root{--text-scale:.77;--dial-height:110px;--dial-drop:24px;--mobile-instrument-width:min(82%,320px)}
  .view-content{padding-top:8px}
  #main{height:calc(100dvh - var(--header-height) - var(--safe-top) - var(--dial-height) + 14px - var(--safe-bottom) + var(--dial-drop))}
  .dial-footer>#dial-art,.dial-footer .dial-links{inset:auto auto var(--safe-bottom) 50%;width:var(--mobile-instrument-width);height:auto;aspect-ratio:5 / 2;transform:translateX(-50%)}
  .dial-footer .dial-links{--text-scale:.7}
  .dial-footer .dial-links>a{width:44px;height:44px;min-width:44px;min-height:44px}
  #measure-title{color:var(--ink);-webkit-text-fill-color:currentColor;background:none;animation:none}
  #measure-title .measure-action{color:transparent;-webkit-text-fill-color:transparent;background:var(--title-gradient);background-size:250% 100%;background-clip:text;-webkit-background-clip:text;animation:color-flow 9s ease-in-out infinite}
}
@media(max-width:360px){:root{--dial-drop:22px}}
