/* ══ Damascus: the poem page (scroll-told night water) and the home band ══
   The scene is always night, in light theme too. Everything decorative is aria-hidden; the poem is real text.
   Reduced motion: the site-wide rule in style.css removes every animation and transition unless html.motion-ok. */

/* ── the boat and its oar (shared) ── */
.dm-rig{display:block;width:100%;height:auto;overflow:visible}
.dm-rig .bob{transform-origin:420px 250px;animation:dm-bob 6.5s ease-in-out infinite alternate}
.dm-rig .tt{transform-origin:572px 118px;animation:dm-sway 3.8s ease-in-out infinite alternate}
.dm-rig .rp ellipse{opacity:0;stroke-width:1;transform-box:fill-box;transform-origin:center}
.dm-rig .rp .r1,.dm-rig .rp .r2,.dm-rig .rp .r3{animation:dm-rip 5.2s ease-out infinite}
.dm-rig .rp .r2{animation-delay:-1.75s}.dm-rig .rp .r3{animation-delay:-3.5s;animation-duration:6s}
.dm-rig .wake{animation:dm-wake 9s linear infinite}
@keyframes dm-bob{from{transform:translateY(-1.5px) rotate(-.45deg)}to{transform:translateY(2px) rotate(.55deg)}}
@keyframes dm-sway{from{transform:rotate(-9deg)}to{transform:rotate(9deg)}}
@keyframes dm-rip{0%{opacity:0;transform:scale(.35)}14%{opacity:.5}100%{opacity:0;transform:scale(3.4)}}
@keyframes dm-wake{to{stroke-dashoffset:-248}}

/* ══ home band ══ */
.dmb-sec{padding-bottom:0}
.dmb{position:relative;display:grid;grid-template-columns:minmax(0,1.05fr) minmax(0,1fr);border:1px solid var(--line);border-radius:6px;overflow:hidden;background:#060b11;color:#e8edf0;color-scheme:dark}
.dmb-art{position:relative;overflow:hidden;height:310px;container-type:size;background:linear-gradient(180deg,#02050a 0,#08131e 38%,#102233 61.5%,#0c1b28 61.5%,#07111a 100%)}
.dmb-art .dm-stars{position:absolute;left:0;top:0;width:100%;height:60%;fill:#dfe9f0}
.dmb-moon{position:absolute;right:16%;top:11%;width:30px;height:30px;border-radius:50%;background:radial-gradient(circle at 38% 36%,#f4f7f8,#c5d3dc 70%);box-shadow:0 0 26px 6px rgba(170,205,230,.22)}
.dmb-water i{position:absolute;left:-40%;width:180%;height:1px;background:repeating-linear-gradient(90deg,rgba(170,200,220,.34) 0 46px,transparent 46px 120px);animation:dm-drift 16s linear infinite}
.dmb-water i:nth-child(1){top:70%}.dmb-water i:nth-child(2){top:80%;animation-duration:11s;opacity:.7}.dmb-water i:nth-child(3){top:91%;animation-duration:8s;opacity:.5}
@keyframes dm-drift{to{transform:translateX(120px)}}
.dmb-boat{position:absolute;left:0;width:100cqw;top:calc(61.5cqh - 100cqw*.3906)}
.dmb .oar{animation:dm-row 6.4s ease-in-out infinite}
.dmb .polish{opacity:.08}.dmb .glow{opacity:.5}
.dmb .sheen{animation:dm-sheen 9s ease-in-out infinite}
@keyframes dm-row{0%,100%{transform:translate(300px,170px) rotate(-32deg) translate(-300px,0)}55%{transform:translate(300px,170px) rotate(-19deg) translate(-300px,0)}}
@keyframes dm-sheen{0%,55%{opacity:0;transform:translate(-60px,0) skewX(-24deg)}62%{opacity:.7}85%{opacity:.7}100%{opacity:0;transform:translate(500px,0) skewX(-24deg)}}
.dmb-art.idle *{animation-play-state:paused!important}
.dmb-copy{display:flex;flex-direction:column;justify-content:center;gap:1rem;padding:1.7rem clamp(1.3rem,3.6vw,2.6rem)}
.dmb-copy h2{font:italic 300 1.7rem/1.1 var(--display);display:flex;align-items:baseline;gap:.6rem}
.dmb-copy h2 .jp{font-style:normal;color:var(--accent);font-size:1.25rem}
.dmb-q{display:grid}
.dmb .q{grid-area:1/1;margin:0;opacity:0;transform:translateY(5px);transition:opacity .9s ease,transform .9s ease;pointer-events:none}
.dmb .q.on{opacity:1;transform:none;pointer-events:auto}
.dmb .q span{display:block;font:italic 300 clamp(1.08rem,1.7vw,1.3rem)/1.55 var(--display);color:#e8edf0}
.dmb-foot{display:flex;align-items:center;justify-content:space-between;gap:1rem;margin-top:.2rem}
.dmb-go{font:400 .84rem var(--mono);color:#f0775f;border-bottom:1px solid transparent;padding:.2rem 0;transition:border-color .2s}.dmb-go:hover{border-color:#f0775f}
.dmb-dots{display:flex}
.dmb-dots button{width:24px;height:30px;background:none;border:0;cursor:pointer;display:grid;place-items:center}
.dmb-dots button::before{content:"";width:6px;height:6px;border-radius:50%;border:1px solid rgba(220,232,240,.6);transition:background .25s,border-color .25s}
.dmb-dots button[aria-current]::before{background:#f0775f;border-color:#f0775f}
.dmb a:focus-visible,.dmb button:focus-visible{outline-color:#f0775f}
@media(max-width:760px){
 .dmb{grid-template-columns:1fr}.dmb-art{height:220px}
 .dmb-copy{padding:1.3rem 1.2rem 1.1rem}
}

/* ══ the poem page ══ */
.dm-bar{display:flex;align-items:center;justify-content:space-between;gap:1rem;padding-top:1.5rem;padding-bottom:1rem}
.dm-bar .back{margin:0}
.dm-toggle{font:400 .8rem var(--mono);color:var(--muted);background:none;border:1px solid var(--line);border-radius:999px;padding:.32rem .95rem;cursor:pointer;transition:color .2s,border-color .2s}
.dm-toggle:hover{color:var(--text);border-color:var(--accent)}
.dm-toggle .off{display:none}
html:not(.dm-live) .dm-toggle .on{display:none}html:not(.dm-live) .dm-toggle .off{display:inline}

/* plain reading: simple static text, in the site's own theme */
.dm-scene,.dm-rail,.dm-hint{display:none}
.dm-poem{max-width:640px;margin:0 auto;padding:1.2rem var(--gutter) 1rem}
.dm-title h1{font:italic 300 clamp(2rem,5.5vw,3rem)/1.1 var(--display);margin-bottom:2rem}
.dm-st{font:italic 300 clamp(1.15rem,2.4vw,1.4rem)/2.05 var(--display);margin-top:2rem}
.dm-st .ln{display:block}
.dm-date{max-width:640px;padding-bottom:2.5rem}

/* the scene */
html.dm-live .dm-track{height:calc(var(--segs,9)*92vh + 100vh)}
@supports(height:1svh){html.dm-live .dm-track{height:calc(var(--segs,9)*92svh + 100svh)}}
html.dm-live .dm-stage{--hz:55%;--bw:min(46vw,720px);--bl:2vw;--tx:53%;--tr:5.5%;--ty:36%;position:sticky;top:var(--navh,3.6rem);height:calc(100vh - var(--navh,3.6rem));overflow:hidden;isolation:isolate;background:#04080d;color:#e9eff2;color-scheme:dark;contain:layout paint}
@supports(height:1svh){html.dm-live .dm-stage{height:calc(100svh - var(--navh,3.6rem))}}
html.dm-live .dm-scene{display:block;position:absolute;inset:0;pointer-events:none}
html.dm-live .dm-scene>*{position:absolute}
html.dm-live .dm-date{max-width:none;padding-top:1rem}
.sc-sky{inset:0;background:linear-gradient(180deg,#02050a 0,#07111b 30%,#0f2030 calc(var(--hz) - 8%),#1a3144 var(--hz),#0b1a27 var(--hz))}
.sc-dawn{left:0;right:0;bottom:calc(100% - var(--hz));height:26%;opacity:0;background:linear-gradient(0deg,rgba(255,122,84,.95) 0,rgba(246,176,118,.5) 1.4%,rgba(239,91,63,.16) 5%,rgba(160,175,200,.16) 12%,rgba(60,90,120,.08) 40%,transparent 100%);-webkit-mask-image:linear-gradient(90deg,transparent,#000 22%,#000 78%,transparent);mask-image:linear-gradient(90deg,transparent,#000 22%,#000 78%,transparent)}
.dm-stars{left:0;top:0;width:100%;height:var(--hz);fill:#e2ecf2}
.sc-moon{left:11%;top:12%;width:62px;height:62px;will-change:opacity}
.sc-moon i{position:absolute;inset:-90%;background:radial-gradient(circle,rgba(180,210,235,.25),transparent 62%)}
.sc-moon svg{position:relative;display:block;width:100%;height:100%}
.sc-ridge{left:-12%;width:124%;bottom:calc(100% - var(--hz));will-change:transform}
.sc-ridge svg{display:block;width:100%;height:100%}
.sc-ridge.r1{height:14%}.sc-ridge.r2{height:8.5%}
.sc-storm{-webkit-mask-image:linear-gradient(90deg,transparent,#000 16%);mask-image:linear-gradient(90deg,transparent,#000 16%);left:0;right:0;bottom:calc(100% - var(--hz) - .4%);height:24%;opacity:0;will-change:transform,opacity}
.sc-storm svg{display:block;width:100%;height:100%}
.sc-crane{left:0;top:calc(var(--hz) - 15%);width:46px;opacity:0;will-change:transform,opacity}
.sc-crane svg{display:block;width:100%;overflow:visible}
.sc-crane .cw{transform-origin:24px 25px;animation:dm-flap 1.8s ease-in-out infinite alternate}
@keyframes dm-flap{from{transform:scaleY(1)}to{transform:scaleY(.55)}}
.sc-water{left:0;right:0;top:var(--hz);bottom:0;overflow:hidden;background:linear-gradient(180deg,#0e202e 0,#09141e 38%,#04090f 100%)}
.sc-water .wv{position:absolute;left:0;top:0;width:200%;height:100%;will-change:transform}
.sc-water .wc{opacity:0}
.sc-water .wreck{opacity:0}
.sc-moonlane{position:absolute;left:11%;top:0;width:62px;opacity:.9;transform-origin:50% 0;will-change:opacity}
.sc-moonlane i{display:block;height:2px;margin:11px auto 0;border-radius:2px;background:rgba(205,228,244,.42);animation:dm-shim 5s ease-in-out infinite alternate}
.sc-moonlane i:nth-child(1){width:78%}.sc-moonlane i:nth-child(2){width:62%;animation-delay:-1.3s}.sc-moonlane i:nth-child(3){width:50%;animation-delay:-2.6s}.sc-moonlane i:nth-child(4){width:36%;animation-delay:-.7s}.sc-moonlane i:nth-child(5){width:22%;animation-delay:-3.4s}
@keyframes dm-shim{from{transform:scaleX(.85);opacity:.55}to{transform:scaleX(1.1);opacity:1}}
.sc-dawnwater{position:absolute;left:0;right:0;top:0;height:22%;opacity:0;background:linear-gradient(180deg,rgba(239,91,63,.34),rgba(239,91,63,0));-webkit-mask-image:linear-gradient(90deg,transparent,#000 25%,#000 75%,transparent);mask-image:linear-gradient(90deg,transparent,#000 25%,#000 75%,transparent)}
.sc-mist{left:0;right:0;top:calc(var(--hz) - 12%);height:36%;opacity:0;background:linear-gradient(180deg,transparent,rgba(125,155,175,.2) 40%,rgba(125,155,175,.3) 62%,transparent)}
.sc-boat{width:var(--bw);left:var(--bl);top:calc(var(--hz) + 15% - var(--bw)*.3906);will-change:transform}
.sc-boat .dm-rig{will-change:contents}
.sc-dim{inset:0;opacity:0;background:radial-gradient(ellipse 70% 62% at 34% 70%,rgba(0,0,0,0) 0,rgba(0,0,0,.55) 58%,rgba(0,0,0,.9) 100%)}

/* the poem over the scene */
html.dm-live .dm-poem{position:absolute;inset:0;max-width:none;margin:0;padding:0;z-index:3;pointer-events:none}
html.dm-live .dm-title,html.dm-live .dm-st{position:absolute;left:var(--tx);right:var(--tr);top:var(--ty);margin:0;transform:translateY(-50%);opacity:0;transition:opacity .55s ease;font-size:calc(clamp(1.3rem,1.95vw,1.95rem)*var(--fit,1));line-height:1.5;color:#eaf0f3;text-shadow:0 1px 16px rgba(2,6,12,.95),0 0 3px rgba(2,6,12,.85)}
html.dm-live .dm-title.on,html.dm-live .dm-st.on{opacity:1}
html.dm-live .dm-title.on{pointer-events:auto}
html.dm-live .dm-title h1{font:italic 300 clamp(3.4rem,9vw,8.5rem)/.95 var(--display);margin:0;letter-spacing:-.015em;color:#eef3f5}
html.dm-live .dm-hint{display:block;margin-top:1.6rem;font:400 .8rem var(--mono);color:#a9b9c4}
html.dm-live .dm-hint::before{content:"";display:inline-block;width:2.2rem;height:1px;background:#ef5b3f;vertical-align:middle;margin-right:.8rem}
html.dm-live .dm-st{text-wrap:pretty}
html.dm-live .dm-st.on{}
html.dm-live .dm-st .ln{padding-left:1.4em;text-indent:-1.4em;opacity:0;transform:translateY(.55em);transition:opacity .9s ease,transform .9s cubic-bezier(.2,.7,.2,1);width:fit-content;max-width:100%}
html.dm-live .dm-st .ln.v{opacity:1;transform:none}
html.dm-live .dm-st:not(.on) .ln{transition-duration:.3s}
/* presentation of single stanzas: the words stay exactly as written */
html.dm-live .dm-st[data-s="2"] .ln{margin-left:calc(var(--j)*.85em)}
html.dm-live .dm-st[data-s="4"]{line-height:1.3}
html.dm-live .dm-st[data-s="4"] .ln{transition-duration:.35s}
html.dm-live .dm-st[data-s="4"] .ln:nth-child(odd){margin-left:1.1em}
html.dm-live .dm-st[data-s="4"] .ln:nth-child(3).v{animation:dm-shake .16s steps(2) infinite alternate}
@keyframes dm-shake{from{transform:translateX(-1.2px)}to{transform:translateX(1.2px)}}
html.dm-live .dm-st[data-s="5"]{color:#cdd7dd;letter-spacing:.015em}
html.dm-live .dm-st[data-s="5"] .ln{transition-duration:1.5s}
html.dm-live .dm-st[data-s="6"] .ln:nth-child(4){margin-top:.2em}
html.dm-live .dm-st[data-s="7"]{}
html.dm-live .dm-st[data-s="8"] .ln.xl{font-size:1.75em;line-height:1.2;margin-top:.1em}
html.dm-live .dm-st[data-s="8"] .ln.xl:nth-child(4){margin-top:.9em}
.ln.steel{background:linear-gradient(rgba(255,255,255,.34),rgba(255,255,255,.34)),url(/assets/damascus-steel.webp) center/100% 100%;-webkit-background-clip:text;background-clip:text;-webkit-text-fill-color:transparent;color:transparent;text-shadow:none!important;filter:brightness(1.35) drop-shadow(0 1px 6px rgba(2,6,12,.9))}
.dm-st .ln.steel{padding-right:.2em}

/* stanza rail */
html.dm-live .dm-rail{display:flex;position:absolute;z-index:4;right:clamp(.2rem,1.6vw,1.2rem);top:50%;transform:translateY(-50%);flex-direction:column}
.dm-rail button{width:26px;height:24px;background:none;border:0;cursor:pointer;display:grid;place-items:center}
.dm-rail button::before{content:"";width:6px;height:6px;border-radius:50%;border:1px solid rgba(220,232,240,.55);transition:background .25s,border-color .25s,transform .25s}
.dm-rail button:hover::before{border-color:#fff}
.dm-rail button[aria-current]::before{background:#ef5b3f;border-color:#ef5b3f;transform:scale(1.25)}
.dm-rail button:focus-visible{outline:2px solid #ef5b3f;outline-offset:-4px;border-radius:50%}

@media(max-width:760px){
 html.dm-live .dm-stage{--hz:60%;--bw:104vw;--bl:-2vw;--tx:6%;--tr:12%;--ty:5%}
 html.dm-live .dm-title,html.dm-live .dm-st{transform:none;font-size:calc(clamp(1.08rem,5.1vw,1.3rem)*var(--fit,1));line-height:1.45}
 html.dm-live .dm-title h1{font-size:clamp(3.2rem,19vw,5rem)}
 html.dm-live .dm-title{top:12%}
 .sc-moon{left:auto;right:13%;top:2.5%;width:40px;height:40px}.sc-moonlane{left:auto;right:13%;width:40px}
 .sc-boat{top:calc(var(--hz) + 12% - var(--bw)*.3906)}
 html.dm-live .dm-st[data-s="2"] .ln{margin-left:calc(var(--j)*.5em)}
 html.dm-live .dm-st[data-s="8"] .ln.xl{font-size:1.5em}
 .dm-rail button{width:22px}
}
@media(max-height:560px) and (min-width:761px){html.dm-live .dm-title,html.dm-live .dm-st{--fit:.8}}
@media print{html.dm-live .dm-track{height:auto}html.dm-live .dm-stage{position:static;height:auto;background:none;color:#000;contain:none}.dm-scene,.dm-rail,.dm-toggle{display:none!important}html.dm-live .dm-poem{position:static}html.dm-live .dm-title,html.dm-live .dm-st{position:static;opacity:1;transform:none;color:#000;text-shadow:none;margin-top:1.4rem}html.dm-live .dm-st .ln{opacity:1;transform:none}.ln.steel{background:none;-webkit-text-fill-color:#000;filter:none}}

html:not(.dm-live) .dm-auto{display:none}.dm-auto{margin-left:.5rem}
