/* The next panel scrolls across a held, progressively defocused scene. */
main > section { position:relative; isolation:isolate; }
main > section.reading-held { translate:0 var(--pin-offset); }
.reading-gap { pointer-events:none; }
main > section.being-covered::after {
  content:''; pointer-events:none; position:absolute; inset:0; z-index:4;
  background:#a5a9ac; opacity:var(--wash);
}
.being-covered.hero :is(.hero-content,.strip),
.being-covered.bridge .bridge-pin p,
.being-covered.chapters :is(aside,.chapter-list article:last-child),
.being-covered.pratica > div {
  filter:blur(var(--defocus)); scale:var(--magnify);
}
.pratica.wrap { width:100%; padding-inline:max(5vw,calc((100vw - 1360px)/2)); background:var(--paper); }
body:has(#topic-picker[open]) { overflow:hidden; }
main { overflow-x:clip; }
.nav {
  width:var(--nav-width,min(300px,calc(100% - 28px)));
  height:var(--nav-height,50px); padding-left:18px;
  justify-content:space-between; gap:8px;
}
.nav .mark { width:54px;height:44px;flex-shrink:0; }
.nav .mark img { width:112px;height:112px; }
.nav nav {
  position:absolute; left:50%; transform:translate(-50%,4px);
  opacity:0; visibility:hidden; pointer-events:none;
  transition:opacity .22s,transform .22s,visibility .22s;
}
.nav.links-visible nav { opacity:1;visibility:visible;pointer-events:auto;transform:translate(-50%,0); }
.nav-end { margin-left:auto; }
.contact select[hidden] { display:none; }
.topic-button {
  display:flex; align-items:center; justify-content:space-between;
  width:min(304px,100%); margin:0 auto 20px; padding:13px 14px 13px 18px;
  background:#ffffffda; border:1px solid #adbfce; border-radius:14px;
  color:var(--ink); scale:var(--picker-scale,1); transform-origin:center;
}
.topic-button b { width:25px;height:25px;border-radius:50%;background:#e8f0f5;display:grid;place-items:center;line-height:1; }
#topic-picker {
  position:fixed; inset:auto; margin:0; width:min(340px,calc(100vw - 16px));
  overflow-y:auto; overscroll-behavior:contain; padding:17px;
  color:var(--ink); background:#fcfdfe; border:1px solid #c5d2dc;
  border-radius:18px; box-shadow:0 16px 65px #172e482e,0 2px 8px #172e480b;
}
#topic-picker::backdrop { background:rgba(18,38,62,.11); }
.picker-head { display:flex; align-items:center; justify-content:space-between;gap:10px;margin-bottom:11px; }
.picker-head h3 { font-size:18px;letter-spacing:-.04em;line-height:1.2; }
.picker-head button { border-radius:50%;width:30px;height:30px;font-size:22px;line-height:1;background:#edf2f6; }
#topic-picker fieldset { display:grid;gap:3px;border:0;padding:0;margin:0; }
#topic-picker legend { position:absolute;clip-path:inset(50%);width:1px;height:1px;overflow:hidden; }
#topic-picker label { cursor:pointer;display:flex;align-items:center;gap:13px;border-radius:9px;padding:10px 12px;min-height:42px;font-size:14px; }
#topic-picker input { accent-color:#153a60; width:16px;height:16px;margin:0; }
#topic-picker label:is(:hover,:focus-within) { background:#eef3f6; }
#topic-picker label:has(:checked) { color:#132e4c;background:#e3edf5;font-weight:600; }
.picker-wa { display:none;text-align:center;margin-top:12px;border-radius:10px;background:var(--ink);color:white;padding:12px;font-size:13px;font-weight:600; }
.from-bar .picker-wa { display:block; }
@media (prefers-reduced-motion:no-preference) {
  .motion-on #topic-picker[open] { animation:picker-in .2s ease-out; }
  @keyframes picker-in { from { opacity:0;transform:translateY(-3px) scale(.97); } to { opacity:1;transform:none; } }
}
@media (prefers-reduced-motion:reduce) { .reading-held { translate:none; } }

/* Keep the scroll surfaces operable without showing a track. */
html, body, .strip, #drawer, #topic-picker, #topic-picker fieldset {
  scrollbar-width: none;
}
:is(html, body, .strip, #drawer, #topic-picker, #topic-picker fieldset)::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}
.topic-button {
  min-height: 50px;
  background: #fff;
  font-weight: 550;
  box-shadow: 0 2px 8px #16345609;
}
.topic-button b::after {
  content: '';
  width: 6px;
  height: 6px;
  border: solid currentColor;
  border-width: 0 1.5px 1.5px 0;
  transform: translateY(-2px) rotate(45deg);
}
.topic-button[aria-expanded=true] b::after { transform: translateY(1px) rotate(225deg); }
#topic-picker[open] {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.picker-head, .picker-wa { flex: none; }
.picker-head button {
  flex: none;
  width: 40px;
  height: 40px;
}
#topic-picker fieldset {
  min-height: 0;
  min-width: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}
#topic-picker label {
  flex-direction: row-reverse;
  justify-content: space-between;
  min-height: 46px;
  font-size: 15px;
}
#topic-picker label:has(:focus-visible) { outline: 2px solid #517fce; outline-offset: -2px; }
@media (max-width: 640px), (pointer: coarse) and (max-height: 540px) {
  #topic-picker {
    inset: auto 0 0;
    width: min(100%, 540px);
    max-width: 100%;
    margin-inline: auto;
    max-height: calc(100dvh - max(12px, env(safe-area-inset-top)));
    border-radius: 23px 23px 0 0;
    border-bottom: 0;
    padding: 15px max(18px, env(safe-area-inset-right)) max(18px, env(safe-area-inset-bottom)) max(18px, env(safe-area-inset-left));
  }
  #topic-picker::backdrop { background: rgb(12 31 51 / .32); }
  .picker-head h3 { font-size: 20px; line-height: 1.2; }
  .picker-head button { width: 44px; height: 44px; }
  #topic-picker label { padding: 12px 15px; min-height: 49px; font-size: 16px; }
  #topic-picker fieldset { display: flex; flex-direction: column; }
  #topic-picker label { flex-shrink: 0; }
  .picker-wa { min-height: 46px; }
  .topic-button { width: min(100%, 340px); }
}
@media (max-width: 640px) and (prefers-reduced-motion: no-preference) {
  .motion-on #topic-picker[open] { animation: sheet-entry .24s cubic-bezier(.22,.75,.25,1); }
  @keyframes sheet-entry { from { translate: 0 32px; opacity: .5; } to { translate: 0 0; opacity: 1; } }
}


.bridge-pin p { position:relative; }
.bridge-pin p em {
  background:linear-gradient(90deg,#315f89,#558bad,#315f89);
  background-clip:text;
  -webkit-background-clip:text;
  color:transparent;
}
.bridge-pin p::after {
  content:''; display:block; width:74px; height:2px;
  background:#648dac; margin:32px auto 0;
  transform-origin:center;
}
@keyframes statement-word {
  from { opacity:.15; filter:blur(5px); transform:translateY(14px); }
  to { opacity:1; filter:blur(0); transform:translateY(0); }
}
@keyframes statement-line {
  from { transform:scaleX(0); opacity:0; }
  to { transform:scaleX(1); opacity:1; }
}
@media (prefers-reduced-motion:no-preference) {
  .motion-on .statement-visible .token {
    display:inline-block;
    animation:statement-word .7s var(--word-delay,0ms) cubic-bezier(.2,.7,.2,1) backwards;
  }
  .motion-on .statement-visible .bridge-pin p::after {
    animation:statement-line .9s .5s ease-out backwards;
  }
}

/* The pointer follows the mouse exactly; only its shape animates. */
.motion-pointer {
  position:fixed; top:0; left:0; width:30px; height:34px;
  z-index:2147483647; pointer-events:none; opacity:0;
  margin:0; padding:0; overflow:visible;
  filter:drop-shadow(0 2px 2px #10244030);
}
.motion-pointer svg {
  display:block; width:100%; height:100%; overflow:visible;
  transform-origin:5px 4px;
  transition:transform .22s cubic-bezier(.2,.8,.2,1);
}
.motion-pointer path {
  fill:#183d60; stroke:white; stroke-width:1.8; stroke-linejoin:round;
  transition:fill .2s;
}
.motion-pointer.is-link svg { transform:rotate(-9deg) scale(1.14); }
.motion-pointer.is-link path { fill:#467fa7; }
.motion-pointer.is-down svg { transform:rotate(-5deg) scale(.86); }
@media (hover:hover) and (pointer:fine) and (prefers-reduced-motion:no-preference) {
  html.motion-cursor, html.motion-cursor * { cursor:none !important; }
  html.motion-cursor .motion-pointer { opacity:1; }
}

/* Stable geometry when the mobile address bar opens or retracts. */
@media (pointer:coarse) {
  .bridge { height:150svh; }
  .bridge-pin { height:88svh; }
}
@media (pointer:coarse) and (max-width:780px) {
  .bridge { height:105svh; }
  .bridge-pin { height:76svh; }
}
@media (pointer:coarse) and (max-width:600px) {
  .bridge, .bridge-pin { height:auto; }
}
.reading-held { will-change:transform; }

/* Native sticky compositing follows touch momentum without JS counter-scrolling. */
.native-touch-scroll main > section {
  position:sticky;
  top:var(--touch-pin-top,0px);
  z-index:var(--scene-order,1);
  translate:none;
}
.native-touch-scroll .reading-gap { display:none; }
.native-touch-scroll .being-covered.hero :is(.hero-content,.strip),
.native-touch-scroll .being-covered.bridge .bridge-pin p,
.native-touch-scroll .being-covered.chapters :is(aside,.chapter-list article:last-child),
.native-touch-scroll .being-covered.pratica > div {
  filter:none;
  scale:1;
}
.native-touch-scroll main > section.being-covered::after {
  background:#102440;
  opacity:calc(var(--wash) * .5);
}
.native-touch-scroll .bridge-pin { position:static; }
.native-touch-scroll .reading-held { will-change:auto; }
