/* Shared portal navigation and independent visual universes. No content zoom. */
body[data-portal-page]{--portal-header:79px;background:#080e10}
body[data-portal-page] main#main{padding:0;max-width:none;margin:0;overflow:clip}
html body main#main .portal-scene{--scene-height:calc(100svh - var(--portal-header));position:relative;isolation:isolate;min-height:var(--scene-height);height:var(--scene-height);width:100%;max-width:none;margin:0;padding:0;overflow:hidden;scroll-margin-top:var(--portal-header);background-color:#151d18!important;color:#fff}
.ifae-backdrop{position:absolute;inset:0;z-index:0;width:100%;height:100%;max-width:none;object-fit:cover;object-position:50% 50%;filter:brightness(.77) saturate(.85)}
.ifae-plane{position:absolute;left:50%;top:50%;width:max(100%,calc(var(--scene-height) * 1.776834));aspect-ratio:1672/941;transform:translate(-50%,-50%);pointer-events:none;z-index:1}
.ifae-subject-motion{position:absolute;left:-1%;top:-.5%;width:87%;z-index:3;transform-origin:45% 80%}
.ifae-subject{display:block;width:100%;height:auto;max-width:none;filter:brightness(.96)}
.ifae-dust{position:absolute;width:var(--dust-width,17%);height:auto;max-width:none;left:var(--dust-left,28%);top:auto;bottom:var(--dust-bottom,4%);opacity:.7;filter:sepia(.16) saturate(.75) brightness(.87);mix-blend-mode:normal;z-index:2;pointer-events:none;transform-origin:50% 95%;--dust-rise:clamp(60px,8vw,160px)}
.ifae-dust-front{z-index:5}
.ifae-leaves{position:absolute;inset:0;pointer-events:none;overflow:hidden;z-index:2}
.ifae-leaves-front{z-index:8}
.ifae-leaf{position:absolute;top:var(--leaf-y);left:-12%;width:var(--leaf-size);height:auto;max-width:none;opacity:0;filter:brightness(.8)}
.ifae-leaves-front .ifae-leaf{filter:none}
.ifae-shade{position:absolute;inset:0;z-index:7;pointer-events:none;background:linear-gradient(90deg,transparent 43%,rgba(5,10,16,.10) 55%,rgba(5,10,16,.79) 100%),linear-gradient(0deg,rgba(5,10,16,.2),transparent 24%)}
html body main#main .ifae-copy{position:absolute;z-index:8;right:7.5%;top:50%;transform:translateY(-50%);width:27%;max-width:480px;text-align:left}
html body main#main .ifae-copy h1{font-family:'EB Garamond',serif;font-weight:400;font-size:clamp(68px,6.3vw,124px);line-height:1;letter-spacing:.045em;color:#fff;margin:0 0 28px}
html body main#main .ifae-copy p{font-size:clamp(17px,1.1vw,21px);line-height:1.65;margin:0;color:#fff;text-wrap:pretty;text-shadow:0 2px 18px rgba(0,0,0,.4)}
html body main#main .ifae-copy p+p{margin-top:14px}
html body main#main .ifae-copy .pv-actions{margin-top:28px;display:flex;gap:12px;flex-wrap:wrap}
.portal-pause{display:none;position:fixed;left:22px;bottom:18px;z-index:60;border:1px solid rgba(190,161,102,.4);border-radius:0;background:rgba(5,10,16,.62);color:#eee0c4;font:12px 'Source Sans 3',sans-serif;padding:9px 12px;cursor:pointer}
.portal-ready .portal-pause{display:block}
.portal-pause:hover,.portal-pause:focus-visible{background:#bea166;color:#050a10}
.portal-ui-hidden .portal-dots,.portal-ui-hidden .portal-pause{visibility:hidden}
.portal-ready .ifae-subject-motion{animation:ifae-breathe 7.8s ease-in-out infinite alternate;animation-play-state:paused}
.portal-ready .ifae-dust{animation:ifae-dust-rise var(--dust-duration,6s) linear infinite;animation-delay:var(--dust-delay,0s);animation-play-state:paused}
.portal-ready .ifae-leaf{animation:ifae-leaf-flight var(--leaf-duration) linear infinite;animation-delay:var(--leaf-delay);animation-play-state:paused}
.portal-ready .portal-scene.is-active :is(.ifae-subject-motion,.ifae-dust,.ifae-leaf){animation-play-state:running}
.portal-ready .portal-scene:not(.is-active) :is(.ifae-subject-motion,.ifae-dust,.ifae-leaf){animation:none}
.portal-ready .portal-scene:not(.is-active) .ifae-leaf{opacity:0}
.portal-ready .portal-scene.is-entering .ifae-copy h1{animation:ifae-enter 1s ease both}
.portal-ready .portal-scene.is-entering .ifae-copy p{animation:ifae-enter 1s .18s ease both}
.portal-ready .portal-scene.is-entering .ifae-copy p+p{animation-delay:.3s}
.portal-ready .portal-scene.is-entering .ifae-copy .pv-actions{animation:ifae-enter .8s .5s ease both}
.portal-ready.portal-paused .portal-scene :is(.ifae-subject-motion,.ifae-dust,.ifae-leaf),.portal-ready.portal-hidden .portal-scene :is(.ifae-subject-motion,.ifae-dust,.ifae-leaf){animation-play-state:paused}
.portal-ready .ifae-copy:focus-within :is(h1,p,.pv-actions){animation:none!important;opacity:1!important;transform:none!important}
@keyframes ifae-breathe{0%{transform:translate3d(0,1px,0) rotate(-.035deg)}100%{transform:translate3d(1px,-2px,0) rotate(.035deg)}}
@keyframes ifae-dust-rise{0%{opacity:0;transform:translate3d(0,7px,0) scale(.52)}7%{opacity:var(--dust-density,1);transform:translate3d(0,0,0) scale(.7)}23%{opacity:calc(var(--dust-density,1) * .85);transform:translate3d(5px,-12px,0) scale(1)}58%{opacity:calc(var(--dust-density,1) * .38);transform:translate3d(calc(var(--dust-drift,30px) * .55),calc(var(--dust-rise) * -.48),0) scale(1.6)}100%{opacity:0;transform:translate3d(var(--dust-drift,30px),calc(var(--dust-rise) * -1),0) scale(2.25)}}
@keyframes ifae-leaf-flight{0%{transform:translate3d(0,0,0) rotate(-40deg) scale(.85);opacity:0}2%{opacity:var(--leaf-opacity)}30%{transform:translate3d(34vw,var(--leaf-drift),0) rotate(95deg) scale(1)}62%{transform:translate3d(72vw,calc(var(--leaf-drift) * -.6),0) rotate(240deg) scale(.8);opacity:var(--leaf-opacity)}98%{opacity:var(--leaf-opacity)}100%{transform:translate3d(125vw,70px,0) rotate(370deg) scale(1.05);opacity:0}}
@keyframes ifae-enter{from{opacity:0;transform:translateY(12px)}to{opacity:1;transform:translateY(0)}}
@media(max-width:860px){
 body[data-portal-page]{--portal-header:79px}
 .ifae-backdrop{inset:auto;left:65%;top:0;width:195%;height:auto;aspect-ratio:1672/941;transform:translate(-50%,0);object-fit:fill;filter:brightness(.72) saturate(.85);mask-image:linear-gradient(to bottom,#000 0%,#000 82%,transparent 100%)}
 .ifae-plane{width:195%;top:0;left:65%;transform:translate(-50%,0)}
 .ifae-shade{background:linear-gradient(0deg,rgba(5,10,16,.97) 0%,rgba(5,10,16,.85) 23%,rgba(5,10,16,.1) 56%,rgba(5,10,16,.12) 100%)}
 html body main#main .ifae-copy{top:auto;bottom:8%;right:auto;left:7%;width:82%;max-width:550px;transform:none}
 html body main#main .ifae-copy h1{font-size:54px;margin-bottom:16px}
 html body main#main .ifae-copy p{font-size:16px;line-height:1.5}
 html body main#main .ifae-copy p+p{margin-top:8px}
 html body main#main .ifae-copy .pv-actions{margin-top:28px}
 .portal-pause{left:7%;top:calc(var(--portal-header) + 12px);bottom:auto;font-size:11px;padding:7px 9px}
}
@media(max-width:860px) and (max-height:680px){
 html body main#main .portal-scene{min-height:640px;height:640px}
 .ifae-plane{top:0;width:160%;left:57%}
 .ifae-backdrop{top:0;width:160%;left:57%}
 html body main#main .ifae-copy{bottom:9%}
}
@media(min-width:861px) and (max-height:650px){html body main#main .portal-scene{min-height:560px;height:560px}}
@media(prefers-reduced-motion:reduce){html body .portal-scene *{animation:none!important;transition:none!important}.ifae-leaf{display:none}.portal-ready .portal-pause{display:none}}

html body[data-portal-page] main#main .portal-scene{background-color:#151d18!important}

/* IFAE depth: crop the feet and emission origins below the visual viewport. */
.ifae-visual{position:absolute;inset:0;overflow:hidden;container-type:size;pointer-events:none}
.ifae-visual .ifae-plane{top:100%;left:50%;width:max(100%,195cqh);transform:translate(-50%,-91%);translate:var(--ifae-subject-x,0px) var(--ifae-subject-y,0px)}
.ifae-visual .ifae-backdrop{inset:-24px;left:-24px;top:-24px;width:calc(100% + 48px);height:calc(100% + 48px);aspect-ratio:auto;object-fit:cover;transform:none;translate:var(--ifae-bg-x,0px) var(--ifae-bg-y,0px);filter:blur(1.6px) brightness(.77) saturate(.85);mask-image:none}
.ifae-visual .ifae-leaves{position:absolute;inset:0;overflow:hidden}
/* Both leaf layers use the visual viewport, not the enlarged horse plane. */
.ifae-visual .ifae-plane .ifae-leaves{height:79%;width:100%}
.ifae-visual .ifae-leaf{top:var(--leaf-start-y,-65px);left:var(--leaf-start-x,clamp(3%,calc(var(--leaf-y) * .3),18%));--leaf-opacity:1}
@keyframes ifae-leaf-flight{
 0%{transform:translate3d(-8cqw,0,0) rotate(-40deg);opacity:1}
 18%{transform:translate3d(9cqw,18cqh,0) rotate(28deg);opacity:1}
 36%{transform:translate3d(28cqw,32cqh,0) rotate(110deg);opacity:1}
 53%{transform:translate3d(39cqw,52cqh,0) rotate(165deg);opacity:1}
 72%{transform:translate3d(60cqw,68cqh,0) rotate(225deg);opacity:1}
 88%{transform:translate3d(72cqw,88cqh,0) rotate(300deg);opacity:1}
 100%{transform:translate3d(90cqw,calc(100cqh + 120px),0) rotate(340deg);opacity:1}
}
@media(max-width:860px){
 .ifae-visual{bottom:auto;height:55%;mask-image:linear-gradient(#000 99%,transparent)}
 .ifae-visual .ifae-plane{left:65%;width:max(195%,195cqh)}
 .ifae-visual .ifae-backdrop{filter:blur(1.2px) brightness(.72) saturate(.85)}
}
@media(prefers-reduced-motion:reduce){.ifae-visual .ifae-plane,.ifae-visual .ifae-backdrop{translate:0 0}}

/* Shift the subject and both dust layers together, independently of leaves.
   Keep approximately 50px before the tail where the desktop layout allows it. */
@media(min-width:861px){
 .ifae-visual .ifae-plane{--ifae-rest-shift:min(0px,calc(50px - 50cqw + 35%))}
 .ifae-visual .ifae-subject-motion{left:calc(-1% + var(--ifae-rest-shift))}
 .ifae-visual .ifae-dust{left:calc(var(--dust-left,28%) + var(--ifae-rest-shift))}
}

/* Original IFAE mark centered above the copy, with its native proportions. */
html body main#main .ifae-copy h1:has(.ifae-logo){display:flex;justify-content:center;line-height:1;margin-bottom:28px}
html body main#main .ifae-logo{display:block;height:clamp(130px,18vh,200px);width:auto;max-width:100%;object-fit:contain;filter:none}
@media(max-width:860px){
 html body main#main .ifae-logo{height:88px}
 html body main#main .ifae-copy h1:has(.ifae-logo){margin-bottom:16px}
 html body main#main .ifae-copy{bottom:4%}
}

/* Cirkozako: mirror only the photographic stage; copy and logo stay readable. */
.portal-cirkozako .ifae-visual{transform:scaleX(-1)}
.portal-cirkozako .ifae-visual .ifae-subject-motion{left:1%;top:-5%;width:43%;transform-origin:50% 70%}
.portal-cirkozako .ifae-visual .ifae-leaves:not(.ifae-leaves-front){z-index:0}
.portal-cirkozako .ifae-leaf{filter:none}
.portal-cirkozako .ifae-shade{background:linear-gradient(90deg,rgba(5,10,16,.82),rgba(5,10,16,.44) 31%,transparent 65%),linear-gradient(0deg,rgba(5,10,16,.2),transparent 24%)}
html body main#main .portal-cirkozako .ifae-copy{left:7.5%;right:auto;width:29%;max-width:520px}
html body main#main .portal-cirkozako h2{margin:0 0 28px;display:flex;justify-content:center;line-height:1}
html body main#main .cirkozako-portal-logo{display:block;width:auto;height:clamp(160px,24vh,265px);max-width:100%;object-fit:contain}
.portal-ready .portal-cirkozako.is-entering h2{animation:ifae-enter 1s ease both}
.portal-ready .portal-cirkozako .ifae-copy:focus-within h2{animation:none!important;opacity:1!important;transform:none!important}
@media(max-width:860px){
 .portal-cirkozako .ifae-visual{height:57%}
 .portal-cirkozako .ifae-visual .ifae-plane{left:100%;width:max(190%,195cqh)}
 .portal-cirkozako .ifae-visual .ifae-subject-motion{top:-6%;width:43%}
 .portal-cirkozako .ifae-shade{background:linear-gradient(0deg,rgba(5,10,16,.98) 0%,rgba(5,10,16,.9) 30%,rgba(5,10,16,.15) 59%,transparent 80%)}
 html body main#main .portal-cirkozako .ifae-copy{left:7%;width:82%;bottom:4%;top:auto;transform:none}
 html body main#main .portal-cirkozako h2{margin-bottom:14px}
 html body main#main .cirkozako-portal-logo{height:110px}
}

.portal-cirkozako .ifae-visual .ifae-leaf{width:calc(var(--leaf-size) * .48)}

@media(max-width:860px){.portal-cirkozako .ifae-visual{mask-image:linear-gradient(#000 84%,transparent 100%)}}
/* STYX_SECTION_NAV: white carousel dots, vertical chapter navigation. */
html body[data-portal-page] .portal-dots{position:fixed;z-index:29;right:clamp(10px,1.7vw,34px);top:50%;transform:translateY(-50%);isolation:isolate}
.portal-dots ol{display:flex;flex-direction:column;gap:2px;list-style:none;margin:0;padding:6px 0}
.portal-dots li{margin:0;padding:0}
html body[data-portal-page] .portal-section-link{position:relative;display:grid;place-items:center;width:32px;height:32px;padding:0;color:#fff;text-decoration:none;border:0;background:transparent;outline-offset:0;border-radius:50%;-webkit-tap-highlight-color:transparent}
.portal-section-dot{display:block;width:6px;height:6px;border-radius:50%;background:#fff;opacity:.5;box-shadow:0 1px 5px #0009,0 0 1px #0009;transition:scale 420ms cubic-bezier(.16,1,.3,1),opacity 300ms,box-shadow 500ms}
.portal-section-link[aria-current="location"] .portal-section-dot{opacity:1;scale:1.25}
.portal-section-link:is(:hover,:focus-visible) .portal-section-dot{opacity:1;scale:1.65;box-shadow:0 1px 5px #0009,0 0 14px #fff5}
.portal-section-link:active .portal-section-dot{scale:.9}
.portal-section-link:focus-visible{outline:1px solid #fff}
.portal-section-label{position:absolute;right:36px;top:50%;width:max-content;max-width:min(280px,calc(100vw - 76px));padding:7px 12px;color:#fff;font-family:var(--font-command,inherit);font-weight:500;font-size:12px;line-height:1.4;letter-spacing:.055em;text-transform:uppercase;text-align:right;background:linear-gradient(90deg,rgba(5,10,16,.32),rgba(5,10,16,.86));border-right:1px solid rgba(190,161,102,.4);text-shadow:0 1px 6px #000;opacity:0;filter:blur(5px);transform:translate(16px,-50%) scale(.96);transform-origin:right center;pointer-events:none;transition:opacity 280ms ease,filter 420ms ease,transform 540ms cubic-bezier(.22,.9,.24,1);transition-delay:calc((var(--portal-nav-last,5) - var(--portal-nav-order))*22ms)}
.portal-dots:is(:hover,:focus-within) .portal-section-label{opacity:1;filter:blur(0);transform:translate(0,-50%) scale(1);pointer-events:auto;transition-duration:420ms,620ms,760ms;transition-timing-function:ease,ease,cubic-bezier(.16,1.3,.3,1);transition-delay:calc(var(--portal-nav-order)*45ms)}
.portal-section-link:is(:hover,:focus-visible) .portal-section-label{color:#efdab0;border-right-color:#e8cc90;background:linear-gradient(90deg,rgba(5,10,16,.48),rgba(5,10,16,.95))}
html.mobile-menu-open .portal-dots{visibility:hidden}
@media(max-width:700px){html body[data-portal-page] .portal-dots{right:3px}html body[data-portal-page] .portal-section-link{width:30px;height:36px}.portal-section-label{right:32px;font-size:10px;max-width:calc(100vw - 62px)}}
@media(prefers-reduced-motion:reduce){.portal-section-dot,.portal-section-label{transition:none!important;filter:none}.portal-section-label{transform:translate(0,-50%)}}

html body[data-portal-page] .portal-dots{display:block;width:auto;left:auto;padding:0;background:none;border:0}
.portal-section-link:before{content:"";position:absolute;right:100%;top:0;width:8px;height:100%}
