/* =====================================================================
   FANTASIA — full-screen chapters over living water (inner pages)
   Turned on by <html class="chapters"> and <section data-ch="Name">.
   Sea chapters: text straight on the water.
   Foam chapters: a frosted sheet floating over the water, for tools.
   ===================================================================== */
html.chapters{scroll-snap-type:y proximity;background:#1d737d}
html.chapters body{background:#1d737d}

#fxWater{position:fixed;inset:0;width:100%;height:100%;z-index:0;display:block;pointer-events:none}
#waterFb{position:fixed;inset:0;z-index:0;pointer-events:none}
#waterFb .wbg{position:absolute;inset:0;background-size:cover;background-position:center;opacity:0;transform:scale(1.06);transition:opacity 1.3s var(--ease),transform 6s linear}
#waterFb .wbg.on{opacity:1;transform:scale(1)}
#waterFb::after{content:'';position:absolute;inset:0;background:linear-gradient(90deg,rgba(21,84,91,.55),rgba(21,84,91,.08) 72%),radial-gradient(ellipse at 92% 0%,rgba(255,205,130,.35),transparent 55%)}

/* every chapter fills the screen and lets the water through */
.chapters section.ch{position:relative;z-index:2;min-height:100vh;min-height:100svh;scroll-snap-align:start;background:transparent!important}
.chapters section.ch-flex{display:flex;flex-direction:column;justify-content:center}
.chapters section.ch > .wrap{width:100%}
.chapters section.ch-sea::before,.chapters section.ch-sea::after{display:none}
.chapters section.ch-tall.ch-flex{display:block}
.chapters section.ch-sea{color:#fff}
.chapters section.ch-sea h1,.chapters section.ch-sea h2,.chapters section.ch-sea h3{text-shadow:0 2px 24px rgba(14,54,58,.45),0 1px 3px rgba(14,54,58,.25)}

/* the frosted sheet */
.ch-sheet{position:absolute;z-index:-1;inset:clamp(12px,2vw,30px);border-radius:clamp(24px,3vw,40px);background:rgba(255,252,245,.86);backdrop-filter:blur(20px) saturate(1.25);-webkit-backdrop-filter:blur(24px) saturate(1.25);box-shadow:0 40px 100px rgba(11,45,49,.35),inset 0 1px 0 rgba(255,255,255,.9);pointer-events:none}
.ch-sheet::after{content:'';position:absolute;inset:0;border-radius:inherit;border:1px solid rgba(255,255,255,.7)}
.chapters section.ch-foam{padding-left:clamp(12px,2vw,30px);padding-right:clamp(12px,2vw,30px)}

/* the page hero becomes a chapter on the water */
.chapters .phero{color:#fff}
.chapters .phero::before{display:none}
.chapters .phero-bg{display:none!important}
.chapters .phero .wrap{padding-right:calc(var(--gutter) + 120px)}
.chapters .phero h1{color:#fff;max-width:14ch}
.chapters .phero h1 i{color:var(--gold)}
.chapters .phero .lead{color:rgba(255,255,255,.8);text-shadow:0 2px 18px rgba(11,45,49,.5)}
.chapters .phero .eyebrow{color:var(--gold)}
.chapters .phero .crumbs,.chapters .phero .crumbs a{color:rgba(255,255,255,.75)}
.chapters .phero-meta{border-top-color:rgba(255,255,255,.22)}
.chapters .phero .scroll-cue{color:#fff}
.chapters .ph-route .rp{stroke:rgba(255,255,255,.35)}
.chapters .ph-route circle[fill="#175b63"]{fill:#fff}
.chapters .ph-ship path:nth-child(2){fill:#fff}
.chapters .ph-ship path:nth-child(3){fill:#175b63}
.chapters .ph-ship path:nth-child(1){stroke:rgba(255,255,255,.55)}
.chapters .ph-seal{right:calc(var(--gutter) + 110px);bottom:20%;background:rgba(255,255,255,.16);border:1px solid rgba(255,255,255,.2);backdrop-filter:blur(12px);-webkit-backdrop-filter:blur(12px);box-shadow:none}
.chapters .ph-seal text{fill:var(--gold)}

/* chapter rail + counter */
.ch-nav{position:fixed;right:calc(var(--gutter) * .55);top:50%;transform:translateY(-50%);z-index:40;display:flex;flex-direction:column;gap:6px;transition:opacity .5s}
.ch-nav button{all:unset;cursor:pointer;display:flex;align-items:center;justify-content:flex-end;gap:14px;height:26px;color:rgba(255,255,255,.6);font-size:10.5px;letter-spacing:3px;text-transform:uppercase;font-weight:600;text-shadow:0 1px 10px rgba(11,45,49,.6)}
.ch-nav .lb{opacity:0;transform:translateX(8px);transition:opacity .4s,transform .5s var(--ease);white-space:nowrap}
.ch-nav .tk{width:16px;height:1.5px;background:currentColor;border-radius:2px;transition:width .6s var(--ease),background .4s}
.ch-nav button.on .lb,.ch-nav:hover .lb{opacity:1;transform:none}
.ch-nav button.on{color:#fff}.ch-nav button.on .tk{width:42px;background:var(--gold)}
.on-foam .ch-nav button{color:rgba(23,91,99,.55);text-shadow:none}
.on-foam .ch-nav button.on{color:var(--navy)}
.ch-count{position:fixed;left:var(--gutter);bottom:calc(38px + var(--safe-b));z-index:40;display:flex;align-items:center;gap:16px;pointer-events:none;transition:opacity .5s}
.ch-count b{font-family:var(--serif);font-weight:400;font-size:2.2rem;line-height:1;font-style:italic;color:var(--gold);min-width:1.4em;display:inline-block;overflow:hidden;height:1.05em}
.ch-count b span{display:block;transition:transform .8s var(--ease)}
.ch-count .bar{width:90px;height:1.5px;background:rgba(255,255,255,.25);position:relative;overflow:hidden}
.on-foam .ch-count .bar{background:rgba(23,91,99,.15)}
.ch-count .bar i{position:absolute;inset:0;background:var(--gold);transform-origin:0 50%;transform:scaleX(0);transition:transform .9s var(--ease)}
.foot-zone .ch-nav,.foot-zone .ch-count{opacity:0;pointer-events:none}
footer.foot{position:relative;z-index:2;scroll-snap-align:end}

@media (min-width:1025px){.chapters section.ch-foam > .wrap{padding-right:calc(var(--gutter) + 70px)}}
@media (max-width:1024px){.chapters .phero .wrap{padding-right:var(--gutter)}.ch-nav{display:none}.ch-count{display:none}}
@media (max-width:760px){
  .ch-sheet{inset:8px;border-radius:24px}
  .chapters section.ch-foam{padding-left:8px;padding-right:8px}
}
.chapters .ph-seal{display:none}
.chapters .phero .lead{max-width:540px}

/* summer: bright water needs a soft shadow under light text */
.chapters section.ch-sea p,.chapters section.ch-sea li,.chapters section.ch-sea .eyebrow,.chapters section.ch-sea span{text-shadow:0 1px 14px rgba(14,54,58,.5)}
.chapters section.ch-sea p{font-weight:400}
.chapters section.ch-sea h1 i,.chapters section.ch-sea h2 i,.chapters section.ch-sea h3 i,.chapters section.ch-sea blockquote i{color:var(--gold)}

/* hero route: yacht, wake and ports clearly visible */
.chapters .phero .ph-route{bottom:calc(52px + var(--safe-b))}
.chapters .phero .ph-route .rp{stroke:rgba(255,255,255,.85)!important;stroke-width:2.2;stroke-dasharray:7 9;animation:rpFlow 2.4s linear infinite;filter:drop-shadow(0 0 6px rgba(255,255,255,.55))}
@keyframes rpFlow{to{stroke-dashoffset:-32}}
.chapters .phero .ph-route circle{transform-box:fill-box;transform-origin:center}
.chapters .phero .ph-route circle[fill="rgba(255,181,71,.3)"]{fill:rgba(255,201,77,.55);animation:portPulse 2.6s ease-in-out infinite}
.chapters .phero .ph-route circle[r="2.6"]{fill:#ffc94d!important;transform:scale(1.9)}
@keyframes portPulse{0%,100%{transform:scale(1);opacity:.9}50%{transform:scale(2.4);opacity:.25}}
.chapters .phero .ph-ship > g{transform:scale(1.25)}
.chapters .phero .ph-ship{filter:drop-shadow(0 0 6px rgba(255,255,255,.6)) drop-shadow(0 6px 14px rgba(16,62,67,.45))}
.chapters .phero .ph-ship path:nth-child(1){stroke:rgba(255,255,255,.95)!important;stroke-width:1.6;stroke-dasharray:3 3}
.chapters .phero .ph-ship rect{fill:#ffc94d}
@media (max-width:760px){.chapters .phero .ph-ship > g{transform:scale(1.5)}.chapters .phero .ph-route .rp{stroke-width:3}}

/* v6 · one sea theme on inner pages: panels become translucent marine sea glass (matching Bunkering simulator panel) */
#waterFb::after{background:linear-gradient(180deg,rgba(22,86,93,.45),rgba(22,86,93,.6))!important;transition:opacity .7s var(--ease)}
body.on-foam #waterFb::after{opacity:.14!important}
.ch-sheet{
  background:linear-gradient(145deg, rgba(28,110,119, 0.44) 0%, rgba(17,66,71, 0.48) 100%) !important;
  backdrop-filter:blur(20px) saturate(1.35) !important;
  -webkit-backdrop-filter:blur(20px) saturate(1.35) !important;
  box-shadow:0 30px 70px rgba(6,25,28, 0.38), inset 0 1px 0 rgba(255, 255, 255, 0.18) !important;
}
.ch-sheet::after{border-color:rgba(43,168,181, 0.35)!important}
.chapters section.ch-foam{color:#fff}
.chapters section.ch-foam :is(h1,h2,h3,h4,h5,h6,p,li,span,small,label,dt,dd,blockquote,figcaption,strong,b,em,td,th,a:not(.btn),summary,.lead,.body,.num,.k,.v){color:inherit}
.chapters section.ch-foam :is(h1,h2,h3) i,.chapters section.ch-foam .eyebrow{color:var(--gold)!important}
.chapters section.ch-foam p,.chapters section.ch-foam li{color:rgba(255,255,255,.82)}
.chapters section.ch-foam .lightbox{color:#144e54}
.chapters section.ch-foam .lightbox :is(p,li){color:rgba(20,78,84,.85)}
.chapters section.ch-foam :is(hr,.rule){border-color:rgba(255,255,255,.18)}
.chapters section.ch-foam .btn.b-line,.chapters section.ch-foam .b-line{color:#fff;border-color:rgba(255,255,255,.6)}
.chapters section.ch-foam :is(button:not(.btn):not([aria-pressed="true"]),.acc-q,.g-code,.g-name,.hz-year){color:inherit}
.chapters section.ch-foam .hz-year{color:var(--gold)!important}

/* v6 · bunkering calculator, grades and FAQ restyled as sea glass to match the new design */
.chapters .ch-foam :is(.grade,.out){background:rgba(255,255,255,.07)!important;border:1px solid rgba(255,255,255,.16)!important;color:#fff!important;backdrop-filter:blur(6px)}
.chapters .ch-foam .grade[aria-pressed="true"],.chapters .ch-foam .out.src{background:rgba(255,201,77,.12)!important;border-color:var(--sun,#ffc94d)!important}
.chapters .ch-foam :is(.grade .g-code,.out b){color:#fff!important}
.chapters .ch-foam .grade[aria-pressed="true"] .g-code{color:var(--gold)!important}
.chapters .ch-foam :is(.grade .g-name,.out span){color:var(--gold)!important;opacity:.9}
.chapters .ch-foam :is(.grade p,.fine){color:rgba(255,255,255,.75)!important}
.chapters .ch-foam .conv-in{background:rgba(19,76,83,.7)!important;border:1px solid rgba(255,255,255,.14)}
.chapters .ch-foam :is(.acc,.acc-item){border-color:rgba(255,255,255,.16)!important}
.chapters .ch-foam .acc-q{color:#fff!important}
.chapters .ch-foam .acc-q .pm{border-color:rgba(255,255,255,.35)!important}
.chapters .ch-foam .acc-q .pm::before,.chapters .ch-foam .acc-q .pm::after{background:var(--gold)!important}
.chapters .ch-foam .acc-item.open .pm{background:var(--gold)!important;border-color:var(--gold)!important}
.chapters .ch-foam .acc-item.open .pm::before,.chapters .ch-foam .acc-item.open .pm::after{background:#16565d!important}
.chapters .ch-foam .acc-a,.chapters .ch-foam .acc-a *{color:rgba(255,255,255,.8)}
.chapters .ch-foam :is(.specs,.card){background:rgba(255,255,255,.07)!important;border:1px solid rgba(255,255,255,.16)!important;color:#fff!important;box-shadow:none!important}
.chapters .ch-foam .specs *{border-color:rgba(255,255,255,.14)!important}
.chapters .ch-foam :is(.specs,.card) :is(small,.k,em){color:var(--gold)!important}
.chapters .ch-foam :is(.flip-f,.grp){background:rgba(16,63,68,.48)!important;border:1px solid rgba(255,181,71,.28)!important;color:#fff!important;backdrop-filter:blur(20px) saturate(1.25)!important;-webkit-backdrop-filter:blur(20px) saturate(1.25)!important;box-shadow:0 18px 45px rgba(6,25,28,.4),inset 0 1px 0 rgba(255,255,255,.18)!important}
.chapters .ch-foam :is(.flip-f,.grp) :is(p,li){color:rgba(231,247,249,.8)!important}
.chapters .ch-foam :is(.flip-f,.grp) :is(h3,h4,b,strong,span,button,label){color:#fff!important}
/* v6 · clearer right-hand chapter list (client: font not clear) */
.ch-nav button,.on-foam .ch-nav button{font-size:12.5px!important;letter-spacing:.16em!important;font-weight:600;color:rgba(255,255,255,.82)!important;text-shadow:0 1px 12px rgba(13,49,53,.6)!important}
.ch-nav button.on,.on-foam .ch-nav button.on{color:#fff!important}
.on-foam .ch-count *{color:#fff}
/* v6 · services drawer in the same deep sea */
.drawer{background:linear-gradient(180deg,#1b6972,#16565d)!important;color:#fff}
.drawer :is(h1,h2,h3,h4,b,strong,span,small,label,li,a:not(.btn),button:not(.btn)){color:inherit}
.drawer p,.drawer li{color:rgba(255,255,255,.82)!important}
.drawer :is(h2,h3) i,.drawer .eyebrow{color:var(--gold)!important}
.drawer *{border-color:rgba(255,255,255,.16)}
/* v8 · smaller, finer route boat */
.chapters .ph-ship > g{transform:scale(.72)!important}
.chapters .ph-ship{filter:drop-shadow(0 2px 6px rgba(16,62,67,.35))!important}
.chapters .ph-ship path:nth-child(1){stroke-width:1!important;opacity:.7}
@media (max-width:760px){.chapters .ph-ship > g{transform:scale(1)!important}}
/* aqua trial: lighter water veil and glass panels in #3FB6C2 */
#waterFb::after{background:linear-gradient(180deg,rgba(63,182,194,.30),rgba(20,89,96,.5))!important}
.ch-sheet{background:linear-gradient(180deg,rgba(63,182,194,.82),rgba(20,89,96,.9))!important}
.chapters :is(.card,.grade,.specs,.conv-in,.out,.flip-f,.era-body,.grp,.panel,.pcard,.feat > div,.rcard){background:linear-gradient(170deg,rgba(63,182,194,.42),rgba(20,89,96,.62))!important;border-color:rgba(255,255,255,.28)!important}
.chapters section :is(h1,h2,h3,p,li){text-shadow:0 1px 10px rgba(10,60,66,.28)}
