/* Stillwick wave 3: the lake stage (one pinned camera move) and the night footer */
.lake { position: relative; height: 1200vh; background: var(--ink); color: var(--paper); }
.stage { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; touch-action: pan-y; }
.stage > canvas, .stage-poster { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.stage > canvas { opacity: 0; transition: opacity .3s; }
.gl-ready .stage > canvas { opacity: 1; }
.stage-shade { position: absolute; inset: 0; pointer-events: none; background:
  linear-gradient(180deg, rgba(17, 26, 24, .42) 0, rgba(17, 26, 24, 0) 22%, rgba(17, 26, 24, 0) 58%, rgba(17, 26, 24, .55) 100%); }

/* intro: a caption on the photo, not a hotel headline */
.intro { position: absolute; left: var(--pad); bottom: calc(var(--pad) + 130px); max-width: 820px; will-change: transform, opacity; }
.h1 { font: 400 clamp(46px, 6.4vw, 112px)/.92 var(--serif); letter-spacing: -.025em; }
.h1 .ln { display: block; overflow: hidden; padding-bottom: .07em; }
.h1 .ln > span { display: block; }
.intro-p { margin-top: 18px; max-width: 40ch; font-size: clamp(17px, 1.3vw, 20px); line-height: 1.5; color: #f1ede5; text-shadow: 0 1px 2px rgba(10, 16, 14, .6), 0 0 22px rgba(10, 16, 14, .7); }
.intro::before { content: ''; position: absolute; left: calc(-1 * var(--pad)); right: -18%; top: -14%; bottom: -22%; z-index: -1; background: radial-gradient(ellipse at 30% 60%, rgba(12, 18, 16, .62), rgba(12, 18, 16, 0) 70%); pointer-events: none; }

/* the clock runs through the whole stage */
.clock { position: absolute; right: var(--pad); top: 92px; text-align: right; text-shadow: 0 1px 14px rgba(10, 16, 14, .55); z-index: 3; }
.clock-t { font: 400 clamp(40px, 5.2vw, 84px)/1 var(--mono); letter-spacing: -.03em; font-feature-settings: 'tnum' 1; display: flex; justify-content: flex-end; }
.clock-t .dg { display: inline-block; width: .62em; height: 1em; overflow: hidden; position: relative; }
.clock-t .dg i { display: block; font-style: normal; text-align: center; }
.clock-t .colon { width: .4em; text-align: center; }
.beat { margin: 12px 0 0 auto; max-width: 31ch; min-height: 3em; font-size: 16px; line-height: 1.45; color: rgba(236, 232, 223, .92); }

/* rail: 05:00 to 08:00 the next morning */
.rail { position: absolute; left: var(--pad); right: var(--pad); bottom: calc(var(--pad) + 66px); height: 22px; z-index: 2; transition: opacity .4s; }
.rail-ticks { position: absolute; inset: 0; background-image: linear-gradient(90deg, rgba(236, 232, 223, .45) 1px, transparent 1px); background-size: calc(100% / 12) 6px; background-repeat: repeat-x; background-position: 0 100%; border-bottom: 1px solid rgba(236, 232, 223, .45); }
.rail-mark { position: absolute; bottom: -4px; left: 0; width: 9px; height: 9px; background: var(--paper); will-change: transform; }
.rail-h { position: absolute; top: -18px; font: 500 12px/1 var(--mono); letter-spacing: .08em; color: rgba(236, 232, 223, .72); transform: translateX(-50%); white-space: nowrap; }
.rail-h:first-of-type { transform: none; }
.rail-h:last-of-type { transform: translateX(-100%); }

.bookbar { position: absolute; left: var(--pad); right: var(--pad); bottom: var(--pad); display: grid; grid-template-columns: 1fr 1fr 1fr auto; background: var(--paper); color: var(--ink); z-index: 4; transition: opacity .4s, transform .4s var(--ease); }
.bookbar label { display: flex; flex-direction: column; justify-content: center; gap: 2px; padding: 8px 16px; border-right: 1px solid var(--line); min-height: 52px; }
.bookbar label span { font: 500 12px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--moss); }
.bookbar input, .bookbar select { border: 0; background: transparent; font-size: 16px; width: 100%; padding: 0; outline-offset: 2px; }
.bookbar .btn { border-radius: 0; min-height: 52px; }
.stage.map-in .bookbar, .stage.map-in .rail, .stage.map-in .clock { opacity: 0; pointer-events: none; transform: translateY(12px); }
.clock { transition: opacity .3s; }

/* cabin tags: pinned to the windows, appear as each lamp comes on */
.tags { list-style: none; position: absolute; inset: 0; pointer-events: none; z-index: 2; }
.tg { position: absolute; left: 0; top: 0; opacity: 0; visibility: hidden; will-change: transform, opacity; }
.tg a { position: absolute; left: 0; bottom: 0; transform: translate(calc(-50% + var(--dx, 0px)), -14px); display: block; width: max-content; max-width: 220px; padding: 10px 12px 9px; background: rgba(236, 232, 223, .94); color: var(--ink); text-decoration: none; pointer-events: auto; transition: background .2s, transform .35s var(--ease); }
.tg a::after { content: ''; position: absolute; left: calc(50% - var(--dx, 0px)); top: 100%; width: 1px; height: 14px; background: rgba(236, 232, 223, .9); }
.tg a:hover, .tg a:focus-visible { background: var(--paper); transform: translate(calc(-50% + var(--dx, 0px)), -20px); }
.tg b { display: block; font: 400 21px/1 var(--serif); }
.tg span { display: block; margin-top: 5px; font-size: 13px; line-height: 1.3; color: #b7bec4; }
.tg em { display: block; margin-top: 6px; font: 500 13px/1 var(--mono); font-style: normal; color: var(--red); }
.tg.far a { background: rgba(17, 26, 24, .72); color: var(--paper); box-shadow: inset 0 0 0 1px rgba(236, 232, 223, .45); }
.tg.far a::after { background: none; border-left: 1px dashed rgba(236, 232, 223, .7); }
.tg.far span { color: rgba(236, 232, 223, .82); }
.tg.far em { color: #e8b48f; }
.tg.on { visibility: visible; }

/* the grounds layer: same framing as the last photo, then the camera tours the plan */
.grounds.map { position: absolute; inset: 0; border: 0; background: var(--paper); color: var(--ink); visibility: hidden; opacity: 0; z-index: 3; overflow: hidden; }
.stage.map-in .grounds { visibility: visible; opacity: 1; box-shadow: 0 -30px 60px -20px rgba(0, 0, 0, .6); will-change: transform; }
.stage.is-map .grounds { box-shadow: none; }
.map-art { position: absolute; left: 0; top: 0; transform-origin: 0 0; will-change: transform; }
.map-art img { position: absolute; inset: 0; width: 100%; height: 100%; }
.map-art .m-shade { mix-blend-mode: multiply; will-change: transform; }
.map-art svg { position: relative; z-index: 1; display: block; width: 100%; height: 100%; }
.map .lbl { paint-order: stroke; stroke: rgba(236, 232, 223, .85); stroke-width: 3px; }
.map .lbl-s, .map .cab .nm { paint-order: stroke; stroke: rgba(236, 232, 223, .85); stroke-width: 3px; }
.map .cab.dim { opacity: .35; }
.grounds .bld { fill: #f3ede0; stroke: #1c1a17; stroke-width: 1.4; stroke-linejoin: round; }
.grounds .cab.is-on .bld, .grounds .cab:hover .bld { fill: #f6dfc4; }
.grounds .misc { fill: rgba(226, 221, 210, .85); }
.map .cab.fit .ring { opacity: .7; stroke-dasharray: 3 4; }
.map .cab.is-on .ring { opacity: 1; stroke-width: 2.4; stroke-dasharray: none; }
.g-h { position: absolute; left: var(--pad); top: 92px; max-width: 15ch; font: 400 clamp(30px, 3.4vw, 54px)/.98 var(--serif); letter-spacing: -.015em; background: rgba(236, 232, 223, .92); padding: 10px 14px 12px; border-left: 2px solid var(--ink); z-index: 2; pointer-events: none; }

.mcard { position: absolute; right: var(--pad); top: 92px; width: min(330px, 34vw); background: var(--paper); border: 1px solid var(--ink); padding: 12px 12px 14px; z-index: 2; box-shadow: 0 18px 40px -24px rgba(17, 26, 24, .55); }
.mcard:empty { display: none; }
.mcard .ph { position: relative; aspect-ratio: 3/2; overflow: hidden; background: var(--deep); margin-bottom: 12px; }
.mcard .ph img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.mcard b { display: block; font: 400 28px/1 var(--serif); }
.mcard p { font-size: 15px; margin: 6px 0 10px; color: #b7bec4; }
.mcard .row { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; border-top: 1px solid var(--line); padding-top: 10px; }
.mcard .row em { font: 500 14px var(--mono); font-style: normal; color: var(--red); }
.mcard .row a { font-size: 14px; }

.note { position: absolute; left: var(--pad); bottom: var(--pad); width: min(470px, 46vw); background: #f4f1ea; border: 1px solid var(--ink); padding: 16px 18px 18px; z-index: 2; transform: rotate(-1.2deg); box-shadow: 0 22px 40px -26px rgba(17, 26, 24, .6); }
.note-l { font: 400 clamp(24px, 2.2vw, 32px)/1.35 var(--serif); }
.note .slot { display: inline-flex; align-items: center; gap: 6px; border-bottom: 2px solid var(--ink); padding: 0 2px; }
.note .step { width: 34px; height: 34px; border: 1px solid var(--line); background: transparent; font: 400 20px/1 var(--mono); cursor: pointer; }
.note .step:hover { background: var(--ink); color: var(--paper); }
.note output { min-width: 1.1ch; text-align: center; font-feature-settings: 'tnum' 1; }
.note .tog { border: 0; background: none; font: inherit; color: var(--red); cursor: pointer; border-bottom: 2px solid var(--red); padding: 0 2px; }
.note-r { margin: 10px 0 12px; font-size: 15px; line-height: 1.45; color: #b7bec4; min-height: 2.9em; }
.note-r b { color: var(--ink); font-weight: 600; }

/* night footer: the lantern */
.ft-h { font-size: clamp(40px, 5.6vw, 92px); max-width: 14ch; }
.ft-ph { height: clamp(420px, 62vw, 820px); cursor: none; touch-action: pan-y; }
.ft-ph canvas { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; transition: opacity .6s; }
.ft-ph.gl-on canvas { opacity: 1; }
.ft-ph.gl-on .ft-poster { opacity: 0; }
.ft-hint { position: absolute; right: var(--pad); bottom: 22%; z-index: 2; font: 500 12px var(--mono); letter-spacing: .12em; text-transform: uppercase; color: rgba(236, 232, 223, .7); }
.ft-ph:not(.gl-on) .ft-hint { display: none; }

.h2 .u { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: .12em; }

@media (max-width: 820px) {
  .lake { height: 1100vh; }
  .intro { bottom: calc(var(--pad) + 186px); right: var(--pad); }
  .h1 { font-size: clamp(40px, 11vw, 60px); }
  .intro-p { font-size: 15px; }
  .clock { top: 78px; }
  .clock-t { font-size: 38px; }
  .beat { font-size: 15px; max-width: 24ch; text-shadow: 0 1px 10px rgba(10, 16, 14, .85); }
  .rail { bottom: calc(var(--pad) + 122px); }
  .rail-h:nth-of-type(3) { display: none; }
  .bookbar { grid-template-columns: 1fr 1fr; }
  .bookbar .g { display: none; }
  .bookbar .btn { grid-column: 1 / -1; justify-content: center; }
  .tg a { max-width: 180px; padding: 8px 10px; }
  .tg b { font-size: 18px; }
  .g-h { top: 76px; font-size: 26px; max-width: 13ch; }
  .mcard { top: 76px; bottom: auto; left: var(--pad); right: var(--pad); width: auto; padding: 8px; display: grid; grid-template-columns: 38% 1fr; gap: 0 10px; align-items: start; }
  .mcard .ph { margin: 0; grid-row: span 3; }
  .grounds.touring .g-h { opacity: 0; }
  .g-h { transition: opacity .3s; }
  .mcard b { font-size: 20px; }
  .mcard p { display: none; }
  .mcard .row { padding-top: 6px; flex-direction: column; gap: 4px; }
  .note { left: var(--pad); right: var(--pad); width: auto; padding: 12px 14px 14px; transform: rotate(-.6deg); }
  .note-l { font-size: 21px; }
  .note-r { font-size: 14px; margin: 6px 0 8px; }
  .note .btn { min-height: 42px; }
  .ft-ph { cursor: auto; height: 78vh; }
  .rail { transition: opacity .4s, transform .5s var(--ease); }
  .stage.past-intro .bookbar { opacity: 0; pointer-events: none; transform: translateY(16px); }
  .stage.past-intro .rail { transform: translateY(112px); }
  .intro { top: 84px; bottom: auto; }
  .h1 { font-size: 40px; }
  .intro-p { max-width: 32ch; }
  .clock { transition: opacity .4s; }
  .stage:not(.past-intro) .clock { opacity: 0; }
  .intro::before { left: calc(-1 * var(--pad)); right: calc(-1 * var(--pad)); top: -84px; bottom: -36px; background: linear-gradient(180deg, rgba(12, 18, 16, .8) 0, rgba(12, 18, 16, .62) 62%, rgba(12, 18, 16, 0) 100%); }
  .stage-shade { background: linear-gradient(180deg, rgba(17, 26, 24, .62) 0, rgba(17, 26, 24, .2) 26%, rgba(17, 26, 24, 0) 40%, rgba(17, 26, 24, 0) 62%, rgba(17, 26, 24, .55) 100%); }
}

/* without motion the stage is a plain, complete page */
html:not(.mo) .lake { height: auto; }
html:not(.mo) .stage { position: relative; height: auto; overflow: visible; display: flex; flex-direction: column; }
html:not(.mo) .stage-poster { position: relative; height: 80vh; }
html:not(.mo) .stage > canvas, .rm .rail, .rm .clock, .rm .stage-shade { display: none; }
html:not(.mo) .intro { position: absolute; top: 40vh; bottom: auto; }
html:not(.mo) .bookbar { position: relative; left: auto; right: auto; bottom: auto; margin: 0 var(--pad) 24px; }
html:not(.mo) .tags { position: relative; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; padding: 0 var(--pad) 32px; }
html:not(.mo) .tg { position: relative; opacity: 1; visibility: visible; }
html:not(.mo) .tg a { position: relative; transform: none; max-width: none; width: auto; }
html:not(.mo) .tg a::after { display: none; }
html:not(.mo) .grounds.map { position: relative; visibility: visible; opacity: 1; display: flex; flex-direction: column; gap: 16px; padding: 24px var(--pad) 48px; }
html:not(.mo) .map-art { position: relative; width: 100% !important; height: auto !important; aspect-ratio: 1800 / 1041; transform: none !important; }
html:not(.mo) .g-h, .rm .mcard, .rm .note { position: relative; inset: auto; width: auto; max-width: 560px; transform: none; }
html:not(.mo) .ft-ph { cursor: auto; }

/* wave 6e: once WebGL runs, the shader does the darkening; a CSS gradient over a live canvas costs frames */
.gl-ready .stage-shade { display: none; }

/* wave 6g: the night map is one painting; no sun shade, no separate crown layer; roofs carry a soft night shadow */
.map-art .m-shade, .map-art .m-trees { display: none; }
#mapSvg .roof { filter: drop-shadow(1.5px 2px 1.5px rgba(2, 6, 10, .75)); pointer-events: none; }
