/* Keep the illustration inside the original paper ground, not full bleed. */
.lake-chapter { position:relative; min-height:var(--screen); }
/* The invisible filter must not add a line below the final paper frame. */
.lake-paper-definitions { position:absolute; }
html:not([data-dive="moving"]) .lake-chapter { z-index:5; }
.lake-frame { position:relative; width:100%; height:var(--screen); overflow:hidden; background:#f9f7f4; }
.lake-landscape { position:absolute; top:9%; left:2.7%; width:63.5%; height:82%; transform-origin:50% 55%; display:grid; place-items:center; container-type:size; pointer-events:none; }
.lake-picture { position:relative; width:min(100%,143.777cqh); aspect-ratio:670 / 466; user-select:none; }
.lake-art,.lake-bank-art,.lake-rain-pigment,.lake-contact-pigment,.lake-pigment { position:absolute; inset:0; display:block; width:100%; height:100%; pointer-events:none; }
.lake-rain-pigment:not([data-wet]),.lake-pigment:not([data-active]),.lake-contact-pigment:not([data-contact]) { visibility:hidden; }
html[data-dive="moving"] .inspiration[data-scroll-story] { --lake-overlap:calc(.48 * var(--screen)); min-height:calc(2.20 * var(--screen) + var(--lake-overlap)); }
html[data-dive="moving"] .inspiration .paper-rest { bottom:calc(var(--screen) + var(--lake-overlap) - 1px); }
html[data-dive="moving"] .lake-frame { position:fixed; inset:0; z-index:3; }
html[data-dive="moving"] .lake-frame:not([data-settled]) { pointer-events:none; }
.inspiration-prop[data-departing] { translate:0 var(--exit-y); pointer-events:none; }

/* The actual Chapter 3 surface inherits its original size and note layout.
   Its original folded-paper canvas now uses the inverse of the resting
   sheet's basis, so the desk-to-camera handoff doesn't change a single node
   or introduce a replacement texture. The parent carries them as one. */
.inspiration-stock[data-lake-travel] {
  position:fixed; z-index:4; left:var(--carry-x); top:var(--carry-y);
  transform:translate(-50%,-50%) var(--carry-transform);
  pointer-events:none;
}
.inspiration-stock[data-lake-travel] > .paper-flight {
  position:absolute; z-index:-1; inset:auto; left:50%; top:50%;
  width:var(--carry-screen-w); height:var(--carry-screen-h);
  transform:translate(-50%,-50%) var(--carry-canvas-basis);
}
.inspiration-stock[data-lake-curl] {
  filter:url(#lake-paper-curl);
}
.inspiration-stock[data-lake-curl]::after {
  content:""; position:absolute; inset:1px;
  background:linear-gradient(var(--curl-slope,105deg),#394c54a2,transparent 23% 59%,#fff9e6ba 82%,transparent);
  opacity:var(--curl-light,0); pointer-events:none;
}
@media (max-width:719px), (max-aspect-ratio:49/50) {
  .lake-landscape { left:1%; top:22%; width:98%; height:44%; }
}

/* Text is in ordinary document order for static/file previews. In the
   scroll story it comes into view only after the actual paper has touched. */
.lake-copy {
  position:absolute; top:50%; left:67%; right:5.8%; transform:translateY(-50%);
  color:#263e4c; opacity:var(--lake-copy-alpha,1);
}
.lake-copy h2 {
  margin:0 0 .72em; font:600 clamp(24px,2.85vw,51px)/1.27 "Songti SC","STSong","SimSun","Noto Serif CJK SC",serif;
  letter-spacing:-.035em;
}
.lake-copy h2 span {display:block;}
.lake-copy p {margin:0; max-width:26em; color:#455965; font-size:clamp(14px,1.1vw,18px); line-height:1.83; text-wrap:pretty;}
.lake-copy p+p {margin-top:.7em;}
html[data-dive="moving"] .lake-frame:not([data-copy-visible]) .lake-copy {visibility:hidden;}
@media (max-width:719px), (max-aspect-ratio:49/50) {
  .lake-copy {top:calc(var(--lake-art-bottom,43.7% + min(31svh,34.1vw)) + 6px); left:max(8%,calc(50% - 17rem)); right:max(9%,calc(50% - 17rem)); transform:none;}
  .lake-copy h2 {font-size:clamp(24px,6.85vw,36px); line-height:1.23; margin-bottom:.42em;}
  .lake-copy p {font-size:clamp(13px,3.4vw,16px); line-height:1.55;}
  .lake-copy p+p {margin-top:.42em;}
}
@media (max-width:360px), (max-height:640px) and (max-aspect-ratio:49/50) {
  .lake-landscape {top:10.8%; height:57%;}
  .lake-copy {top:calc(var(--lake-art-bottom,39.3% + min(28.5svh,34.1vw)) + 6px);}
  .lake-copy h2 {font-size:clamp(21px,6.45vw,32px);}
  .lake-copy p {font-size:13px; line-height:1.48;}
}
@media (max-width:719px) and (min-aspect-ratio:5/4) {
  .lake-landscape {top:10%; left:2.5%; width:58%; height:80%;}
  .lake-copy {top:50%; left:63%; right:6%; transform:translateY(-50%);}
  .lake-copy h2 {font-size:clamp(16px,2.65vw,20px);}
  .lake-copy p {font-size:12px; line-height:1.48;}
}

/* Chapter five owns its travel after the original chapter-four anchor. */
.lake-depth-run { position:relative; min-height:var(--screen); }
.lake-depth-rest { position:absolute; inset:auto 0 0; height:var(--screen); overflow:hidden; background:linear-gradient(166deg,#a9e3cf,#70bebb 34%,#438ea7 76%,#2b7592); }
.lake-dive-view,.lake-depth-still { display:block; position:absolute; width:100%; height:100%; inset:0; pointer-events:none; }
.lake-dive-view { display:none; }
html[data-dive="moving"] .lake-depth-run { min-height:calc(2.4 * var(--screen)); pointer-events:none; }
html[data-dive="moving"] .lake-depth-rest { background:none; }
html[data-dive="moving"] .lake-depth-still { display:none; }
.lake-frame[data-tilting] .lake-dive-view { display:block; }
.lake-water-motion {display:none;position:absolute;inset:0;width:100%;height:100%;pointer-events:none;}
.lake-frame[data-tilting] .lake-water-motion[data-running] {display:block;}
.lake-water-finale {display:none;position:absolute;z-index:0;inset:0;pointer-events:none;}
.lake-frame[data-tilting] .lake-water-finale[data-running] {display:block;}
.lake-water-finale > canvas {position:absolute;inset:0;width:100%;height:100%;}

.lake-frame[data-tilting] .lake-landscape { visibility:hidden; }
html:not([data-dive="moving"]) .lake-depth-run { z-index:5; }

html[data-dive="moving"] .lake-depth-run { z-index:5; }

.site-footer {
  position:relative; z-index:6;
  display:grid; place-items:center; min-height:100px;
  padding:10px max(12px,env(safe-area-inset-right)) max(12px,env(safe-area-inset-bottom)) max(12px,env(safe-area-inset-left));
  color:#f3fcfa;
}
html:not([data-dive="moving"]) .site-footer {
  background:linear-gradient(158deg,#32778f,#235a70);
}
.site-footer-glass {
  display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap;
  width:min(100%,720px); min-height:76px; gap:0 22px; padding:6px clamp(14px,3vw,28px);
  border:1px solid #dcf5fa64; border-radius:19px;
  background:linear-gradient(135deg,#dcf9fb2c,#dcf9fb0a),#15394c9c;
  box-shadow:inset 0 1px 0 #f7ffff3b,0 8px 20px #142e3d3d;
  -webkit-backdrop-filter:blur(15px) saturate(1.15);
  backdrop-filter:blur(15px) saturate(1.15);
}
.site-footer-brand {
  display:inline-flex; align-items:center; gap:9px;
  font:400 clamp(18px,2vw,25px)/1.2 Georgia,serif; letter-spacing:-.02em; white-space:nowrap;
}
.site-footer-brand img { display:block; width:38px; height:auto; }
.site-footer nav {
  display:flex; align-items:center; flex-wrap:wrap;
  justify-content:center; gap:0 clamp(11px,2vw,22px); max-width:100%;
}
.site-footer a {
  display:inline-grid; place-items:center; min-height:44px; color:inherit;
  font-size:13px; text-underline-offset:.26em; text-decoration-thickness:1px;
  text-decoration-color:#d8f5f79c;
}
.site-footer a:hover { color:#fff; text-decoration-color:currentColor; }
.site-footer a:focus-visible { outline:2px solid #ecfaf8; outline-offset:2px; border-radius:2px; }
@media (max-width:560px) {
  .site-footer-glass { justify-content:center; row-gap:2px; padding-block:9px 4px; }
  .site-footer-brand { justify-content:center; width:100%; }
  .site-footer nav { row-gap:0; }
}
@media (pointer:coarse) and (max-width:600px), (pointer:coarse) and (max-height:480px) {
  .site-footer { padding-block-end:calc(12px + env(safe-area-inset-bottom, 0px)); }
  /* Keep the home-indicator inset on the same water palette, clear of the links. */
  html[data-dive="moving"] .site-footer {
    background-image:linear-gradient(to bottom,transparent,#235a70);
    background-position:center bottom;
    background-size:100% env(safe-area-inset-bottom, 0px);
    background-repeat:no-repeat;
  }
}
@media (forced-colors:active) {
  .site-footer-glass { border-color:CanvasText; backdrop-filter:none; }
  .site-footer a { color:LinkText; }
}

/* The small landing shadow is on the water, not another traveling sheet.
   Its opacity returns to zero at rest; nothing is added to the lake art. */
.lake-chapter[data-paper-contact-shadow]::after {
  content:""; position:fixed; z-index:3; pointer-events:none;
  left:var(--leaf-shadow-x); top:var(--leaf-shadow-y);
  width:var(--leaf-shadow-w); height:var(--leaf-shadow-h);
  transform:translate(-50%,-50%) rotate(-9deg);
  background:radial-gradient(ellipse closest-side,#374765ad,#53688949 47%,transparent);
  opacity:var(--leaf-shadow-opacity,0);
}

/* Chapter five sets the physical paper width before layout. Only its
   texture is rescaled; the live print is rendered at its reading size. */
.inspiration-stock[data-lake-travel][data-archive-paper] { width:var(--archive-paper-width); }
.inspiration-stock[data-archive-paper] > .paper-flight {
  transform:translate(-50%,-50%) scale(var(--archive-texture-scale)) var(--carry-canvas-basis);
}
/* Ink and stock now share a local coordinate system, clipping and transform.
   At the floating edge-on beat the desk ink is switched, never copied. */
.inspiration-stock:not([data-closing-ink]) > .lake-closing-ink,
.inspiration-stock[data-closing-ink] > :is(.inspiration-heading,.inspiration-writing),
html[data-dive="moving"] .lake-still-paper { display:none; }
.inspiration-stock[data-closing-ink],.lake-still-paper { container-type:inline-size; }
.lake-still-paper {
  position:absolute; left:50%; top:46%; width:min(57vw,32vh,295px);
  aspect-ratio:.706349206; transform:translate(-50%,-50%) rotate(-.032rad);
  pointer-events:none;
}
.lake-closing-ink {
  position:absolute; z-index:1; inset:0; margin:0; padding:0 8% 2%;
  display:flex; flex-flow:column; align-items:center; justify-content:center;
  color:#283d39; font:400 9.6cqw/1.53 EchoUserHandwriting,serif;
  font-synthesis:none; letter-spacing:.018em; text-align:center;
}
.lake-closing-ink > span { display:block; white-space:nowrap; }
.lake-closing-ink [lang="en"] { margin-inline-start:.13em; }

/* Water falls on the same projected sheet, with the print kept above its
   optics. Start with the far spill of the original shadow, then let the
   submerged fringe retain just a soft jade edge. */
.inspiration-stock[data-immersed-paper] {
  clip-path:inset(calc(-45px + 46px * var(--paper-wet)) round calc(1.5px * var(--paper-wet)));
}
.inspiration-stock[data-immersed-paper]::before {
  content:""; position:absolute; z-index:0; inset:0; pointer-events:none;
  opacity:var(--paper-wet);
  background:
    radial-gradient(ellipse 78% 7% at var(--paper-light-x) var(--paper-light-y),
      rgb(255 251 216 / calc(.43 * var(--paper-shimmer))), transparent 88%),
    radial-gradient(ellipse 97% 12% at calc(var(--paper-light-x) - 13%) calc(var(--paper-light-y) + 9%),
      rgb(229 247 207 / calc(.38 * var(--paper-shimmer))), transparent 82%),
    radial-gradient(ellipse 57% 6% at calc(var(--paper-light-x) - 22%) calc(var(--paper-light-y) + 16%),
      transparent 13%, rgb(234 250 218 / calc(.29 * var(--paper-shimmer))) 41%, transparent 88%),
    radial-gradient(ellipse 61% 57% at var(--paper-light-x) var(--paper-light-y),
      #faf8d934, transparent 92%),
    linear-gradient(var(--paper-light-angle), #559cab50, #b7d8ac38 42%, #73baba42 72%, #4a928e47);
  box-shadow:inset 0 -2px 9px #346d7326, inset 0 1px 1px #edf4d769;
}
