/* Javier Álvarez · V14. One architectural background; the page itself is the
   navigation. Content stays in document order before the enhancement starts. */
body.public-site.story-site {
    --story-edge: clamp(28px, 3.125vw, 56px);
    --story-ink: #232a2c;
    --story-muted: #637075;
    --story-paper: #e9eceb;
    background: var(--story-paper);
    color: var(--story-ink);
    overflow-x: hidden;
    overflow-y: auto;
}

body.public-site.story-site.contact-drawer-ready { overflow-x: hidden; overflow-y: auto; }
body.public-site.story-site.contact-is-open { overflow: hidden; }
body.story-site .story-experience { position: relative; isolation: isolate; background: transparent; }
body.story-site .story-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

body.story-site .story-header {
    position: fixed;
    z-index: 20;
    top: 0;
    right: 0;
    left: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    min-height: 104px;
    padding: 24px var(--story-edge);
    pointer-events: none;
}
body.story-site .story-header > * { pointer-events: auto; }
body.story-site .story-brand { display: inline-flex; align-items: center; gap: 15px; min-height: 48px; }
body.story-site .story-mark { width: 46px; height: 46px; flex: 0 0 auto; }
body.story-site .story-wordmark { display: flex; flex-direction: column; gap: 3px; }
body.story-site .story-wordmark strong { font-size: 32px; font-weight: 500; line-height: 1.15; letter-spacing: -.045em; }
body.story-site .story-wordmark small { font-size: 8.5px; font-weight: 650; line-height: 1.4; letter-spacing: .3em; text-transform: uppercase; }
body.story-site .story-contact {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 17px;
    min-height: 44px;
    padding: 8px 0 8px 12px;
    font-size: 22px;
    font-weight: 400;
    line-height: 1.2;
    letter-spacing: -.035em;
}
body.story-site .story-contact svg { width: 25px; height: 25px; color: var(--ja-accent); transition: transform 200ms ease; }
@media (hover: hover) {
    body.story-site .story-contact:hover { color: #a94d2b; }
    body.story-site .story-contact:hover svg { transform: translate(2px, -2px); }
}

body.public-site.story-site .installation-scene.story-scene {
    position: fixed;
    z-index: 0;
    inset: 0;
    display: block;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    min-height: 0;
    max-width: none;
    margin: 0;
    padding: 0;
    aspect-ratio: auto;
    overflow: hidden;
    background: var(--story-paper);
    pointer-events: none;
}
body.story-site .story-scene::after {
    content: "";
    position: absolute;
    z-index: 2;
    inset: 0;
    pointer-events: none;
    background:
        linear-gradient(90deg, #e9ecebf5 0, #e9ecebf0 24%, #e9eceb00 43%),
        linear-gradient(180deg, #e9ecebbd 0, #e9eceb00 150px),
        linear-gradient(0deg, #e9ecebf2 0, #e9eceb00 160px);
}
body.story-site .story-scene .scene-canvas,
body.story-site .story-scene .scene-fallback { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
body.story-site .story-scene .scene-fallback { object-fit: cover; object-position: center; }
body.story-site .story-scene .scene-canvas canvas,
body.story-site .story-scene .scene-canvas canvas:active { cursor: auto; pointer-events: none; touch-action: auto; }
body.story-site .story-scene .scene-safe-area { position: absolute; top: 120px; right: 0; bottom: 80px; left: 28%; pointer-events: none; }
body.story-site .story-scene .scene-caption { right: var(--story-edge); bottom: 100px; left: 35%; }

body.story-site .story-chapter {
    position: relative;
    z-index: 3;
    display: flex;
    align-items: center;
    min-height: 110vh;
    min-height: 110svh;
    padding: 120px var(--story-edge);
    scroll-margin-top: 0;
}
body.story-site .story-chapter:last-of-type { min-height: 100vh; min-height: 100svh; }
body.story-site .story-copy { position: relative; width: min(430px, 33vw); }
body.story-site .story-copy h2 { font-size: clamp(60px, 5.3vw, 84px); font-weight: 300; line-height: 1.04; letter-spacing: -.055em; overflow-wrap: normal; text-wrap: balance; }
body.story-site .story-copy p { max-width: 340px; margin-top: 18px; color: var(--story-muted); font-size: clamp(18px, 1.57vw, 24px); font-weight: 400; line-height: 1.4; letter-spacing: -.035em; text-wrap: pretty; }
body.story-site.story-ready .story-copy {
    position: fixed;
    top: 48%;
    left: var(--story-edge);
    opacity: 0;
    transform: translate3d(0, calc(-50% + 25px), 0);
    pointer-events: none;
    transition: opacity 400ms ease, transform 650ms cubic-bezier(.2, .65, .2, 1);
}
body.story-site.story-ready .story-chapter.is-active .story-copy { opacity: 1; transform: translate3d(0, -50%, 0); }

body.story-site .story-status {
    position: fixed;
    z-index: 8;
    right: var(--story-edge);
    bottom: max(35px, env(safe-area-inset-bottom));
    left: var(--story-edge);
    display: grid;
    grid-template-columns: auto minmax(80px, 1fr) auto;
    align-items: center;
    gap: clamp(30px, 5vw, 78px);
    color: #3f4b50;
    pointer-events: none;
    transition: opacity 250ms ease;
}
body.story-site .story-area { font-size: 14px; font-weight: 400; line-height: 1.4; letter-spacing: -.035em; white-space: nowrap; }
body.story-site .story-progress { height: 1px; overflow: hidden; background: #aeb8bb; }
body.story-site .story-progress span { display: block; width: 100%; height: 100%; background: var(--ja-accent); transform: scaleX(0); transform-origin: left center; transition: transform 150ms linear; }
body.story-site .story-position { display: flex; align-items: center; justify-content: flex-end; gap: 24px; font-size: 13px; font-variant-numeric: tabular-nums; letter-spacing: .1em; white-space: nowrap; }
body.story-site .story-scroll-hint { display: inline-flex; align-items: center; gap: 16px; font-size: 16px; letter-spacing: -.025em; }
body.story-site .story-scroll-hint svg { width: 24px; height: 33px; color: var(--ja-accent); }
body.story-site.story-ended .story-status { opacity: 0; }

body.story-site .story-legal {
    position: relative;
    z-index: 9;
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 10px 30px;
    min-height: 110px;
    padding: 32px var(--story-edge);
    background: var(--story-paper);
    color: #4c595e;
    font-size: 13px;
    line-height: 1.4;
}
body.story-site .story-legal a { display: inline-flex; align-items: center; min-height: 44px; padding-block: 10px; }
body.story-site .story-legal a:hover { color: #a94d2b; }

@media (max-width: 1000px) and (min-width: 701px) {
    body.story-site .story-copy { width: 38vw; }
    body.story-site .story-copy h2 { font-size: clamp(46px, 6vw, 60px); }
    body.story-site .story-copy p { font-size: 18px; }
    body.story-site .story-wordmark strong { font-size: 27px; }
    body.story-site .story-wordmark small { font-size: 7.5px; letter-spacing: .26em; }
    body.story-site .story-status { gap: 25px; }
    body.story-site .story-position { gap: 18px; }
    body.story-site .story-scroll-hint { font-size: 14px; gap: 10px; }
    body.story-site .story-area { font-size: 12px; }
}

@media (max-width: 700px) {
    body.public-site.story-site { --story-edge: 22px; }
    body.story-site .story-header { gap: 15px; min-height: 78px; padding: 17px var(--story-edge); }
    body.story-site .story-brand { gap: 9px; min-height: 44px; }
    body.story-site .story-mark { width: 38px; height: 38px; }
    body.story-site .story-wordmark { gap: 3px; }
    body.story-site .story-wordmark strong { font-size: 20px; font-weight: 650; letter-spacing: -.04em; }
    body.story-site .story-wordmark small { font-size: 7px; font-weight: 650; letter-spacing: .1em; }
    body.story-site .story-contact { gap: 9px; min-height: 44px; padding-left: 4px; font-size: 16px; }
    body.story-site .story-contact svg { width: 20px; height: 20px; color: var(--story-ink); }
    body.story-site .story-chapter { align-items: flex-start; padding: 120px var(--story-edge) 110px; }
    body.story-site .story-copy { width: auto; max-width: none; }
    body.story-site .story-copy h2 { max-width: 13ch; font-size: clamp(38px, 10.77vw, 46px); font-weight: 300; line-height: 1.08; letter-spacing: -.06em; }
    body.story-site .story-copy p { max-width: 29ch; margin-top: 15px; font-size: 16px; line-height: 1.4; letter-spacing: -.035em; }
    body.story-site.story-ready .story-copy { top: 120px; right: var(--story-edge); left: var(--story-edge); transform: translate3d(0, 25px, 0); }
    body.story-site.story-ready .story-chapter.is-active .story-copy { transform: translate3d(0, 0, 0); }
    body.story-site .story-scene .scene-safe-area { top: 270px; right: 0; bottom: 80px; left: 0; }
    body.story-site .story-scene::after {
        background:
            linear-gradient(180deg, #e9ecebfa 0, #e9ecebf2 270px, #e9eceb00 355px),
            linear-gradient(0deg, #e9ecebfa 0, #e9ecebdb 70px, #e9eceb00 170px);
    }
    body.story-site .story-scene .scene-fallback { object-position: 47% 65%; }
    body.story-site .story-scene .scene-caption { right: 22px; bottom: 90px; left: 22px; font-size: 11px; }
    body.story-site .story-status { grid-template-columns: minmax(0, 1fr) auto; gap: 14px 15px; bottom: max(25px, env(safe-area-inset-bottom)); }
    body.story-site .story-area { font-size: 11px; }
    body.story-site .story-progress { grid-column: 1 / -1; grid-row: 2; height: 1.5px; }
    body.story-site .story-position { gap: 0; font-size: 11px; }
    body.story-site .story-scroll-hint { display: none; }
    body.story-site.story-start .story-position [data-story-count] { display: none; }
    body.story-site.story-start .story-scroll-hint { display: inline-flex; gap: 7px; font-size: 11px; }
    body.story-site.story-start .story-scroll-hint svg { width: 13px; height: 19px; }
    body.story-site .story-legal { justify-content: space-between; gap: 8px 20px; padding-block: 25px; font-size: 12px; }
}

@media (max-width: 360px) {
    body.public-site.story-site { --story-edge: 17px; }
    body.story-site .story-header { gap: 9px; }
    body.story-site .story-brand { gap: 7px; }
    body.story-site .story-mark { width: 34px; height: 34px; }
    body.story-site .story-wordmark strong { font-size: 18px; }
    body.story-site .story-wordmark small { font-size: 6.5px; letter-spacing: .075em; }
    body.story-site .story-contact { gap: 6px; font-size: 15px; }
    body.story-site .story-copy h2 { font-size: 38px; }
    body.story-site .story-area { font-size: 10px; }
}

@media (max-height: 550px) and (min-width: 600px) {
    body.public-site.story-site { --story-edge: 24px; }
    body.story-site .story-header { min-height: 64px; padding-block: 10px; }
    body.story-site .story-mark { width: 35px; height: 35px; }
    body.story-site .story-brand { gap: 10px; min-height: 44px; }
    body.story-site .story-wordmark strong { font-size: 21px; font-weight: 500; }
    body.story-site .story-wordmark small { font-size: 6px; letter-spacing: .25em; }
    body.story-site .story-contact { font-size: 17px; gap: 12px; }
    body.story-site .story-contact svg { width: 21px; height: 21px; }
    body.story-site .story-chapter { align-items: center; padding: 80px var(--story-edge); }
    body.story-site .story-copy { width: 39%; }
    body.story-site .story-copy h2 { max-width: none; font-size: clamp(35px, 4.9vw, 46px); line-height: 1.05; }
    body.story-site .story-copy p { max-width: 30ch; margin-top: 11px; font-size: 15px; line-height: 1.35; }
    body.story-site.story-ready .story-copy { top: 48%; right: auto; transform: translate3d(0, calc(-50% + 20px), 0); }
    body.story-site.story-ready .story-chapter.is-active .story-copy { transform: translate3d(0, -50%, 0); }
    body.story-site .story-scene .scene-safe-area { top: 65px; right: 0; bottom: 50px; left: 43%; }
    body.story-site .story-scene::after {
        background:
            linear-gradient(90deg, #e9ecebf7 0, #e9ecebbc 28%, #e9eceb00 53%),
            linear-gradient(180deg, #e9ecebf5 0, #e9ecebd9 44px, #e9eceb00 90px),
            linear-gradient(0deg, #e9ecebf2 0, #e9eceb00 75px);
    }
    body.story-site .story-status { grid-template-columns: auto minmax(80px, 1fr) auto; gap: 25px; bottom: max(16px, env(safe-area-inset-bottom)); }
    body.story-site .story-area { font-size: 11px; }
    body.story-site .story-progress { grid-column: auto; grid-row: auto; }
    body.story-site .story-position { font-size: 11px; }
    body.story-site .story-scroll-hint { display: none; }
    body.story-site.story-start .story-position [data-story-count] { display: none; }
    body.story-site.story-start .story-scroll-hint { display: inline-flex; gap: 7px; font-size: 11px; }
    body.story-site.story-start .story-scroll-hint svg { width: 13px; height: 19px; }
    body.story-site .story-scene .scene-caption { right: 24px; bottom: 48px; left: 45%; font-size: 10px; }
}

@media (prefers-reduced-motion: reduce) {
    body.story-site .story-copy,
    body.story-site .story-progress span,
    body.story-site .story-status,
    body.story-site .story-contact svg { transition: none; }
}

/* V13: stable first paint and an index of the eight original services. */
body.story-site .story-nav { display: none; }
html.story-boot body.story-site .story-nav,
body.story-site.story-ready .story-nav {
    position: fixed; z-index: 10; top: 49%; left: var(--story-edge);
    display: flex; flex-direction: column; width: min(29vw, 430px);
    max-height: calc(100svh - 200px); transform: translateY(-50%);
    overflow-y: auto; scrollbar-width: thin;
}
body.story-site .story-nav-link {
    position: relative; display: block; padding: 10px 0 10px 22px;
    color: #526067; min-height: 46px;
}
body.story-site .story-nav-link::before {
    content: ""; position: absolute; left: 1px; top: 15px; bottom: 15px;
    width: 1.5px; background: #ac714b; opacity: 0;
    transform: scaleY(.25); transform-origin: top; transition: opacity 250ms, transform 500ms;
}
body.story-site .story-nav-title {
    display: block; font-size: clamp(17px, 1.43vw, 22px); font-weight: 400;
    line-height: 1.25; letter-spacing: -.035em;
    transition: font-size 500ms cubic-bezier(.2,.65,.2,1), color 250ms;
}
body.story-site .story-nav-detail { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 500ms; }
body.story-site .story-nav-detail > span { overflow: hidden; font-size: clamp(15px, 1.3vw, 20px); line-height: 1.5; letter-spacing: -.025em; }
body.story-site .story-nav-link[aria-current] { color: var(--story-ink); padding-block: 15px 21px; }
body.story-site .story-nav-link[aria-current]::before { opacity: 1; transform: scaleY(1); }
body.story-site .story-nav-link[aria-current] .story-nav-title { font-size: clamp(37px, 3.7vw, 58px); font-weight: 300; line-height: 1.08; letter-spacing: -.055em; }
body.story-site .story-nav-link[aria-current] .story-nav-detail { grid-template-rows: 1fr; margin-top: 13px; color: #637075; }
body.story-site .story-nav-link:focus-visible { outline: 2px solid #ac714b; outline-offset: -2px; }
@media (hover: hover) { body.story-site .story-nav-link:hover { color: #8a5436; } }
html.story-boot body.story-site .story-copy,
body.story-site.story-ready .story-copy {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap;
}
body.story-site .story-scene .scene-canvas { opacity: 0; transition: opacity 800ms ease; }
body.story-site .story-scene[data-renderer="webgl"] .scene-canvas { opacity: 1; }
html.story-boot body.story-site .story-scene[data-renderer="pending"] .scene-fallback { opacity: 1; }
body.story-site.story-ready .story-scene[data-renderer="pending"] .scene-fallback { opacity: 1; }
body.story-site .story-scene .scene-safe-area { left: 30%; }
@media (max-width: 1000px) and (min-width: 701px) {
    html.story-boot body.story-site .story-nav, body.story-site.story-ready .story-nav { width: 34%; }
    body.story-site .story-nav-title { font-size: 17px; }
    body.story-site .story-nav-link[aria-current] .story-nav-title { font-size: 38px; }
    body.story-site .story-scene .scene-safe-area { left: 33%; }
}
@media (max-width: 700px) {
    html.story-boot body.story-site .story-nav, body.story-site.story-ready .story-nav {
        top: 238px; left: var(--story-edge); right: var(--story-edge); width: auto;
        max-height: none; transform: none; overflow: visible;
        display: grid; grid-template-columns: 1fr 1.15fr; column-gap: 10px;
    }
    body.story-site .story-nav-link,
    body.story-site .story-nav-link[aria-current] { min-height: 37px; padding: 8px 0; }
    body.story-site .story-nav-title,
    body.story-site .story-nav-link[aria-current] .story-nav-title { font-size: 13px; line-height: 1.3; font-weight: 450; letter-spacing: -.025em; }
    body.story-site .story-nav-link[aria-current] { color: #915c3b; }
    body.story-site .story-nav-link[aria-current] .story-nav-title { text-decoration: underline; text-underline-offset: 5px; text-decoration-thickness: 1px; }
    body.story-site .story-nav-detail, body.story-site .story-nav-link::before { display: none; }
    html.story-boot body.story-site .story-copy, body.story-site.story-ready .story-copy {
        position: fixed; top: 110px; left: var(--story-edge); right: var(--story-edge);
        width: auto; height: auto; margin: 0; clip: auto; white-space: normal; overflow: visible;
        opacity: 0; transform: translate3d(0, 14px, 0); pointer-events: none;
    }
    html.story-boot body.story-site .story-chapter.is-active .story-copy,
    body.story-site.story-ready .story-chapter.is-active .story-copy { opacity: 1; transform: none; }
    body.story-site .story-copy h2 { max-width: 16ch; font-size: 36px; line-height: 1.06; }
    body.story-site .story-copy p { max-width: 34ch; margin-top: 10px; font-size: 14px; }
    body.story-site .story-scene .scene-safe-area { top: 395px; right: 0; bottom: 72px; left: 0; }
    body.story-site .story-scene::after {
        background: linear-gradient(180deg,#e9eceb 0,#e9ecebf5 340px,#e9eceb00 420px), linear-gradient(0deg,#e9ecebf2 0,#e9eceb00 95px);
    }
}
@media (max-width: 700px) and (max-height: 740px) {
    html.story-boot body.story-site .story-copy, body.story-site.story-ready .story-copy { top: 94px; }
    body.story-site .story-copy h2 { font-size: 30px; }
    body.story-site .story-copy p { font-size: 13px; }
    html.story-boot body.story-site .story-nav, body.story-site.story-ready .story-nav { top: 205px; }
    body.story-site .story-nav-link, body.story-site .story-nav-link[aria-current] { min-height: 33px; padding-block: 7px; }
    body.story-site .story-nav-title, body.story-site .story-nav-link[aria-current] .story-nav-title { font-size: 12px; }
    body.story-site .story-scene .scene-safe-area { top: 345px; bottom: 66px; }
    body.story-site .story-scene::after { background: linear-gradient(180deg,#e9eceb 0,#e9ecebf2 300px,#e9eceb00 360px),linear-gradient(0deg,#e9ecebf2 0,#e9eceb00 85px); }
}
@media (max-height: 550px) and (min-width: 600px) {
    html.story-boot body.story-site .story-nav, body.story-site.story-ready .story-nav {
        display: flex; top: 73px; left: var(--story-edge); right: auto; width: 34%;
        transform: none; max-height: calc(100svh - 125px); overflow-y: auto;
    }
    body.story-site .story-nav-link, body.story-site .story-nav-link[aria-current] { padding: 4px 0 4px 14px; min-height: 24px; }
    body.story-site .story-nav-title { font-size: 13px; }
    body.story-site .story-nav-link[aria-current] .story-nav-title { font-size: 27px; }
    body.story-site .story-nav-detail { display: none; }
    body.story-site .story-nav-link::before { display: block; top: 6px; bottom: 6px; }
    html.story-boot body.story-site .story-copy, body.story-site.story-ready .story-copy { width: 1px; height: 1px; clip: rect(0,0,0,0); overflow: hidden; }
    body.story-site .story-scene .scene-safe-area { top: 65px; left: 36%; bottom: 50px; }
}
@media (prefers-reduced-motion: reduce) {
    body.story-site .story-nav-title, body.story-site .story-nav-detail,
    body.story-site .story-nav-link::before, body.story-site .story-scene .scene-canvas { transition: none; }
}

body.story-site .story-scene .scene-fallback { object-fit: fill; object-position: center; transition: opacity 800ms ease; }
@media(prefers-reduced-motion:reduce){body.story-site .story-scene .scene-fallback {transition:none;}}
