/* Experience: the stepwell, as one painting.
   The painting fills the window (two canvases: #paint for its tiles, #live for the loose drawings and the light that
   falls on the thing you are at), and a camera flies down into it.  The words of the opening lie on it; the card on the
   right (a sheet at the foot of a narrow window) says where you are, and the water gauge on the left says when.
   experience.js does the rest. */

:root {
  --paper: #ece2c7; --ink: #1b1613; --pale: #f6f0e2; --deep: #12172e; --sindoor: #a3261a; --maroon: #7a1321; --haldi: #f3bd45;
  --red: #b3301f; --gold: #c9982e;
  --rule: rgba(122, 19, 33, .34);
  --hh: clamp(44px, 7vh, 58px);         /* the frieze */
  --peek: 132px;                        /* how much of the sheet shows when it is down (set by experience.js) */
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0; background: #d9bf8a; color: var(--ink);
  font-family: 'Eczar', Georgia, 'Times New Roman', serif; font-size: 1.0625rem; line-height: 1.5;
}
a { color: inherit; text-decoration: underline; text-decoration-color: var(--sindoor); text-decoration-thickness: .09em; text-underline-offset: .2em; transition: color .15s ease; }
a:hover { color: var(--sindoor); }
:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; border-radius: 2px; }
::selection { background: var(--sindoor); color: var(--pale); }
.sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ---- the frieze: the same paper tabs as on the other pages ---- */
.top {
  display: flex; align-items: center; justify-content: space-between; gap: .5em 1em;
  padding: 6px clamp(10px, 2.4vw, 34px) 8px; min-height: var(--hh);
  background: url(assets/paper-frieze.webp) left center / auto 100% repeat-x;
}
.no-frieze .top { background: var(--red) radial-gradient(circle, rgba(246, 240, 226, .9) 0 2.2px, transparent 2.8px) 9px 50% / 22px 22px repeat-x; box-shadow: inset 0 3px 0 var(--ink), inset 0 5px 0 var(--gold), inset 0 -3px 0 var(--ink), inset 0 -5px 0 var(--gold); }
.tab {
  background: var(--pale); color: var(--ink); line-height: 1.25;
  box-shadow: inset 0 0 0 1px rgba(27, 22, 19, .5), 0 1px 2px rgba(30, 10, 4, .45);
}
.home { font-weight: 600; text-decoration: none; padding: .26em .8em .16em; transform: rotate(-1.2deg); white-space: nowrap; }
.home:hover { color: var(--sindoor); }
.tools { display: flex; align-items: baseline; gap: .1em .9em; padding: .1em .7em 0; font-size: .95rem; font-weight: 500; transform: rotate(.8deg); }
.tools button { font: inherit; color: inherit; background: none; border: 0; padding: .32em .1em .22em; cursor: pointer; opacity: .74; transition: opacity .15s ease; }
.tools button:hover, .tools button:focus-visible { opacity: 1; }
.tools button[aria-pressed="true"] { opacity: 1; text-decoration: underline; text-decoration-color: var(--sindoor); text-decoration-thickness: .14em; text-underline-offset: .3em; }
/* the hour of the day in the painting, as on the other pages (shown only when the painting has more than one) */
.moods { display: flex; gap: .7em; }
.tools button[aria-busy="true"] { opacity: .45; }
.tools [hidden] { display: none; }
.moods:not(:has(button:not([hidden]))) { display: none; }
html:not(.js) .tools { display: none; }

html.js body { overflow: hidden; overscroll-behavior: none; }
/* (a soft shadow under it, as of a strip of paper laid on the painting) */
html.js .top { position: fixed; z-index: 30; top: 0; left: 0; right: 0; filter: drop-shadow(0 2px 3px rgba(40, 20, 6, .32)); }
html.js body[data-mood="night"] .top { filter: drop-shadow(0 2px 3px rgba(4, 6, 16, .45)) brightness(.82) saturate(.9); }

/* ================================================================================================================
   The painting, filling the window
   ================================================================================================================ */
.well { display: none; }
html.js .well { display: block; position: fixed; inset: 0; z-index: 1; overflow: hidden; background: #d9bf8a; touch-action: none; }
.paint, .live { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.paint { z-index: 0; }
/* (another hour of the day, coming in over the painting: experience.js fades it in) */
.paint.over { will-change: opacity; }
.paint.over[hidden] { display: none; }
.live { z-index: 1; pointer-events: none; }
/* the edges of the window a little darker, as the light falls off in a well */
.veil {
  position: absolute; inset: 0; z-index: 2; pointer-events: none;
  background: radial-gradient(130% 100% at 50% 42%, transparent 58%, rgba(44, 22, 8, .2) 100%);
}

/* the things painted on the levels: buttons over the painting, in its own units (the layer is moved and scaled with the
   camera).  They show nothing themselves: experience.js puts a little warm light on a lit one. */
.hot { position: absolute; left: 0; top: 0; z-index: 3; transform-origin: 0 0; pointer-events: none; }
.obj {
  position: absolute; display: block; padding: 0; margin: 0; border: 0; border-radius: 8px; background: none;
  font: inherit; color: inherit; cursor: pointer; pointer-events: auto; -webkit-tap-highlight-color: transparent;
}
.obj:focus, .obj:focus-visible { outline: none; }
.well.moving .obj { pointer-events: none; }

/* the few words by a thing on another level than yours */
.tip {
  position: fixed; left: 0; top: 0; z-index: 12; margin: 0; pointer-events: none;
  padding: .3em .7em .2em; font-size: .9rem; font-weight: 600; line-height: 1.2; white-space: nowrap;
  background: var(--pale); color: var(--ink);
  box-shadow: inset 0 0 0 1px rgba(27, 22, 19, .5), inset 0 -2px 0 var(--haldi), 0 1px 2px rgba(30, 10, 4, .4), 0 6px 12px rgba(30, 10, 4, .18);
  opacity: 0; transition: opacity .18s ease;
}
.tip.on { opacity: 1; }
.tip.long { white-space: normal; width: max-content; max-width: min(27em, calc(100vw - 24px)); text-align: center; text-wrap: balance; line-height: 1.3; padding: .38em .8em .3em; }

/* ================================================================================================================
   The opening: the words on the whole painting.  They fade as the camera starts down (experience.js).
   ================================================================================================================ */
.hero { position: relative; }
html.js .hero { position: fixed; inset: 0; z-index: 10; pointer-events: none; }
.hero.gone { visibility: hidden; }
.hero-words {
  position: absolute; z-index: 3; left: clamp(12px, 2.4vw, 34px); top: calc(var(--hh) + clamp(10px, 2.6vh, 28px));
  width: min(17.5rem, calc(100% - 24px)); display: flex; flex-direction: column; align-items: flex-start; gap: .7rem;
  pointer-events: auto; will-change: opacity, transform;
  animation: words-in .9s .15s ease backwards;
}
@keyframes words-in { from { opacity: 0; translate: 0 8px; } }
.hero.going .hero-words { pointer-events: none; }
html:not(.js) .hero-words { position: static; padding: 1rem; }
/* the slip of paper the title is written on, as on the Projects page */
.slip { position: relative; width: 232px; aspect-ratio: 220 / 80; display: flex; align-items: center; justify-content: center; container-type: inline-size; transform: rotate(-2deg); }
.slip::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: url(assets/paper-slip.webp) center / 100% 100% no-repeat;
  filter: drop-shadow(0 1px 1px rgba(52, 30, 10, .34)) drop-shadow(0 5px 7px rgba(52, 30, 10, .26));
}
.no-slip .slip::before { background: var(--pale); box-shadow: inset 0 0 0 1px rgba(27, 22, 19, .3); }
.slip h1 { margin: 0; padding: 0 9cqw 0 2cqw; font-size: max(20px, 15.5cqw); font-weight: 700; line-height: 1; letter-spacing: -0.012em; color: var(--ink); white-space: nowrap; }
.note {
  margin: 0 0 0 .3rem; padding: .55em .85em .45em; font-size: .98rem; line-height: 1.42; text-wrap: pretty;
  background: var(--pale); color: var(--ink); transform: rotate(.7deg);
  box-shadow: inset 0 0 0 1px rgba(27, 22, 19, .42), 0 1px 2px rgba(30, 10, 4, .4), 0 6px 14px rgba(30, 10, 4, .18);
}
.cue {
  margin-left: .5rem; display: inline-flex; align-items: center; gap: .55em;
  font: inherit; font-size: 1.02rem; font-weight: 600; line-height: 1.2; color: var(--ink); cursor: pointer;
  padding: .42em .95em .34em; border: 0; background: var(--haldi); transform: rotate(-1deg);
  box-shadow: inset 0 0 0 1px rgba(27, 22, 19, .55), 0 1px 3px rgba(30, 10, 4, .45);
  transition: transform .15s ease, background-color .15s ease;
}
.cue:hover { transform: rotate(0deg) translateY(-1px); background: #f6ca62; }
.cue:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }
.cue .arrow { animation: bob 2.6s ease-in-out infinite; }
@keyframes bob { 0%, 60%, 100% { transform: translateY(-.06em) rotate(45deg); } 30% { transform: translateY(.16em) rotate(45deg); } }
body.still .cue .arrow { animation: none; }
html:not(.js) .cue { display: none; }

/* a small arrow drawn with two edges of a square */
.arrow { display: inline-block; flex: none; width: .5em; height: .5em; border: solid currentColor; border-width: 0 .14em .14em 0; transform: translateY(-.06em) rotate(45deg); }
.arrow.up { transform: translateY(.12em) rotate(-135deg); }

/* ================================================================================================================
   The card: where you are
   ================================================================================================================ */
.card { display: none; }
html.js .card {
  --f: 26px;
  position: fixed; z-index: 15; right: clamp(10px, 1.5vw, 24px); top: calc(var(--hh) + 12px); bottom: 12px;
  width: clamp(320px, 29vw, 420px);
  display: flex; flex-direction: column;
  /* the paper frame carries its own shadow, painted once into the image: a CSS shadow filter costs a fresh pass every frame the well moves */
  border: var(--f) solid transparent;
  border-image: url(assets/paper-card-sh.webp) 68 84 102 84 / calc(var(--f) * 68 / 36) calc(var(--f) * 84 / 36) calc(var(--f) * 102 / 36) calc(var(--f) * 84 / 36) / calc(var(--f) * 32 / 36) calc(var(--f) * 48 / 36) calc(var(--f) * 66 / 36) calc(var(--f) * 48 / 36) stretch;
  background: var(--pale) padding-box;
  /* it keeps a layer of its own, so coming in, sliding across and fading never make the browser paint it again */
  will-change: transform, translate, opacity;
  transition: opacity .45s ease, transform .45s cubic-bezier(.2, .7, .3, 1), visibility 0s;
}
.no-card .card { border: 0 !important; border-image: none !important; padding: 18px; box-shadow: inset 0 0 0 7px var(--pale), inset 0 0 0 9px var(--sindoor), inset 0 0 0 12px var(--pale), inset 0 0 0 13.5px var(--gold); }
/* the sindoor and gold double rule just inside its edge, and a fine line in kajal */
.card::before {
  content: ""; position: absolute; inset: -18px; z-index: 0; pointer-events: none;
  border: 2px solid var(--red); box-shadow: inset 0 0 0 2px var(--pale), inset 0 0 0 3.5px var(--gold), inset 0 0 0 4.5px rgba(27, 22, 19, .25);
}
.no-card .card::before { display: none; }
.card > * { position: relative; z-index: 1; }
body:not(.down) .card { opacity: 0; visibility: hidden; transform: translateX(24px); transition: opacity .3s ease, transform .3s ease, visibility 0s .3s; }
/* painted once at the start, all but clear, so that its paper and shadow are ready before the first move down (set up in
   the middle of the move, they held it up for a tenth of a second) */
.card.warm { visibility: visible !important; opacity: .004 !important; transform: none !important; transition: none !important; pointer-events: none !important; }

.grab { display: none; }

/* the row of years: a lamp for each, and one for the water; each goes to its year's first stop.  The year you are in
   is lit and ringed */
.lamps { flex: none; padding: .2rem 0 .55rem; border-bottom: 1px solid var(--rule); }
.lamps ol { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 2px; }
.lamp {
  width: 100%; display: flex; flex-direction: column; align-items: center; gap: .1rem; padding: .3rem 0 .2rem;
  font: inherit; font-size: .7rem; font-weight: 500; line-height: 1.1; color: rgba(27, 22, 19, .62); white-space: nowrap;
  background: none; border: 0; border-radius: 4px; cursor: pointer; transition: color .15s ease, background-color .15s ease;
}
.lamp:hover { color: var(--ink); background: rgba(201, 152, 46, .12); }
.lamp:focus-visible { outline: 2px solid var(--ink); outline-offset: 1px; }
/* the diya is the painter's own lamp, drawn into a small canvas by experience.js */
.diya {
  display: block; width: 44px; height: 35.75px;
  filter: grayscale(1) brightness(.72) contrast(.9); opacity: .5;
  -webkit-mask-image: linear-gradient(transparent 0 40%, #000 40%); mask-image: linear-gradient(transparent 0 40%, #000 40%);
  transition: filter .5s ease, opacity .5s ease;
}
.lamp.lit .diya { filter: none; opacity: 1; -webkit-mask-image: none; mask-image: none; }
.lamp[aria-current] { color: var(--ink); font-weight: 700; background: radial-gradient(closest-side at 50% 34%, rgba(243, 189, 69, .55), transparent); }
.lamp[aria-current] .lbl { box-shadow: 0 2px 0 var(--sindoor); }
.lamp[aria-current] .diya { filter: none; opacity: 1; -webkit-mask-image: none; mask-image: none; }

/* Two panes, one over the other: the stop you are leaving and the one you are coming to.  The upper one fades in over
   the lower as you scroll (experience.js), on paper of its own, so the change goes with the scroll.  Each keeps a layer
   of its own, so the fade does not make the browser paint the words again. */
.card-body { position: relative; flex: 1 1 auto; min-height: 0; }
.pane {
  position: absolute; inset: 0; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain;
  padding: .9rem .5rem .6rem;
  background: var(--pale); will-change: opacity;
  scrollbar-width: thin; scrollbar-color: rgba(122, 19, 33, .4) transparent;
}
.pane.up { z-index: 2; }
.pane.measure { visibility: hidden; inset: 0 0 auto; overflow: visible; }
/* when there is more below, the words fade at the foot */
.pane.more { -webkit-mask-image: linear-gradient(#000 calc(100% - 2.6rem), transparent); mask-image: linear-gradient(#000 calc(100% - 2.6rem), transparent); }
html.sheet .card:not(.open) .pane.more { -webkit-mask-image: none; mask-image: none; }
.lv-head { margin-bottom: .7rem; }
.lv-head h2 {
  margin: 0; font-size: 2.15em; font-weight: 700; line-height: 1; letter-spacing: -0.01em; outline: none;
  color: #3a2414; text-shadow: 0 1px 0 rgba(255, 255, 255, .7), 0 -1px 0 rgba(60, 30, 10, .25);
}
.lv-head h2:focus, .lv-head h2:focus-visible { outline: none; }   /* focus is only put here, to read on from; it is not a control */
.role { margin: .3rem 0 0; font-size: 1.04em; font-weight: 500; line-height: 1.3; }

.miles { list-style: none; margin: 0 0 .8rem; padding: 0; }
.mile { position: relative; padding: .4em .4em .32em 1.55em; margin: 0 -.4em; border-radius: 3px; font-size: .95em; line-height: 1.38; transition: background-color .2s ease; }
/* a small flood-mark plaque, its arrow pointing left */
.mile::before {
  content: ""; position: absolute; left: .45em; top: .78em; width: .78em; height: .5em;
  background: #c3a571; clip-path: polygon(30% 0, 100% 0, 100% 100%, 30% 100%, 0 50%);
}
.mile.sindoor::before { background: var(--sindoor); }
.mile.gold::before { background: var(--gold); }
.mile.soft::before { background: #6f8a8c; }
.mile.plain::before { background: rgba(27, 22, 19, .35); }
/* (the milestone of the thing you are at, when it has one) */
.mile.here { font-weight: 600; background: linear-gradient(90deg, rgba(243, 189, 69, .22), rgba(243, 189, 69, 0) 85%); }
.mile.lit { background: rgba(243, 189, 69, .26); }
.mile.flash { animation: flash 1.1s ease; }

/* the one thing of the stop: its picture across the card, then its name and its words */
.blk {
  padding: .75rem .5rem .6rem; margin: 0 -.5rem; border-top: 1px solid var(--rule); border-radius: 3px;
  transition: background-color .2s ease, box-shadow .2s ease;
}
.blk.lit { background: rgba(243, 189, 69, .2); box-shadow: inset 3px 0 0 var(--haldi); }
.blk.flash { animation: flash 1.1s ease; }
@keyframes flash { 0% { background: rgba(243, 189, 69, .55); } 100% { background: transparent; } }
.blk.lit.flash { animation: none; }
/* the small picture: a piece of the painting, framed as a little folio; pressing it takes the camera there */
.look {
  position: relative; display: block; width: calc(100% - 10px); margin: .2rem 5px .75rem; padding: 0;
  border: 0; background: none; cursor: zoom-in;
}
.look:disabled { cursor: default; }
.look:focus-visible { outline: 2px solid var(--ink); outline-offset: 6px; }
.thumb {
  display: block; width: 100%; height: auto; aspect-ratio: 16 / 9;
  background: #c9ad7b; box-shadow: 0 0 0 1px rgba(27, 22, 19, .45), 0 0 0 3px var(--pale), 0 0 0 4px rgba(201, 152, 46, .8), 0 2px 5px rgba(40, 22, 8, .25);
  transition: transform .2s ease, box-shadow .2s ease;
}
.look:not(:disabled):hover .thumb { transform: rotate(-.4deg); box-shadow: 0 0 0 1px rgba(27, 22, 19, .55), 0 0 0 3px var(--pale), 0 0 0 4.5px var(--haldi), 0 4px 9px rgba(40, 22, 8, .3); }
.blk h3 { margin: 0; font-size: 1.3em; font-weight: 700; line-height: 1.12; }
.thing { margin: .15rem 0 0; font-size: .86em; line-height: 1.3; color: rgba(27, 22, 19, .7); font-style: italic; }
.txt { margin-top: .55rem; }
.txt p { margin: 0 0 .45em; font-size: .94em; line-height: 1.45; text-wrap: pretty; }
.txt .go { display: flex; flex-wrap: wrap; gap: .2em 1.2em; font-weight: 600; margin: .55em 0 0; }
/* a smaller thing told of inside the block: its small picture on the left, its words beside it */
.part {
  display: grid; grid-template-columns: minmax(6rem, 36%) 1fr; gap: 0 .85rem; align-items: start;
  margin: .65rem -.4rem .3rem; padding: .5rem .4rem .4rem; border-radius: 3px; transition: background-color .2s ease, box-shadow .2s ease;
}
.part:not(:has(.look)) { grid-template-columns: 1fr; }
.part.lit { background: rgba(243, 189, 69, .2); box-shadow: inset 3px 0 0 var(--haldi); }
.part.flash { animation: flash 1.1s ease; }
.part.lit.flash { animation: none; }
.look.small { width: calc(100% - 8px); margin: .2rem 4px 0; }
.part-words p { margin: 0 0 .35em; }
.part-words .go { margin: .3em 0 0; }
.also { margin: .7rem 0 0; padding-top: .6rem; border-top: 1px solid var(--rule); font-size: .92em; line-height: 1.4; color: rgba(27, 22, 19, .82); }
.lv > .wl { margin: 0 0 .6em; font-size: .98em; line-height: 1.5; }

.updown { flex: none; display: flex; justify-content: space-between; gap: .5rem; padding-top: .6rem; border-top: 1px solid var(--rule); }
.updown button {
  display: inline-flex; align-items: center; gap: .5em; min-width: 0;
  font: inherit; font-size: .9rem; font-weight: 600; line-height: 1.2; color: var(--ink); cursor: pointer;
  padding: .42em .75em .34em; border: 0; background: var(--paper);
  box-shadow: inset 0 0 0 1px rgba(27, 22, 19, .5), 0 1px 2px rgba(30, 10, 4, .3);
  transition: background-color .15s ease;
}
.updown button:hover { background: var(--haldi); }
.updown button:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.updown button:disabled { opacity: .38; cursor: default; background: var(--paper); }
/* (when the two do not fit, the shorter keeps its width and the longer goes onto two lines) */
.ud-text { text-wrap: balance; }
#down { margin-left: auto; }

/* ================================================================================================================
   The year gauge: a carved staff on the left, standing in water, as on a dam.  The water line stays put (--wl, about
   three fifths down) and the staff slides with the camera (experience.js), so the year at the line is the year you are
   at.  The flood-mark plaques hang by it.  Press a year to go there.
   ================================================================================================================ */
.gauge { display: none; }
html.js .gauge {
  --gx: 12px; --gw: 136px; --wl: 60vh; --gs: 1;
  display: block; position: fixed; z-index: 14; left: 0; top: 0; bottom: 0; width: calc(var(--gx) + var(--gw) + var(--po, 0px) + 130px);
  overflow: hidden; pointer-events: none; will-change: opacity;
}
.gauge.off { visibility: hidden; }
.g-staff { position: absolute; left: var(--gx); top: 0; will-change: transform; }
.g-art { display: block; }
/* a year: its numbers cut in the face of the staff, just above its groove */
.g-year {
  position: absolute; left: 0; width: 100%; translate: 0 -100%; margin: 0; pointer-events: auto;
  padding: .3em 0 .18em calc(46px * var(--gs)); border: 0; background: none; cursor: pointer; text-align: left;
  font: inherit; font-size: .9rem; font-weight: 700; line-height: 1; letter-spacing: .01em; color: #3a2414;
  text-shadow: 0 1px 0 rgba(255, 244, 220, .75), 0 -1px 0 rgba(70, 36, 12, .3);
  transition: color .3s ease;
}
.g-year:disabled { cursor: default; }
.g-year:hover { color: var(--sindoor); }
.g-year.now { color: var(--sindoor); }
.g-year:focus-visible { outline: 2px solid var(--ink); outline-offset: -2px; }
.gauge.painted .g-yl { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.gauge.painted .g-year { height: 2.2em; }
/* on the painter's staff, the year set in its blank face (experience.js puts each button on its face) */
.gauge.painted .g-face {
  translate: none; padding: 0; display: flex; align-items: center; justify-content: center; text-align: center;
  font-size: calc(36px * var(--gs)); letter-spacing: .02em;
}
/* a flood-mark plaque, nailed by the staff and pointing at it */
.g-mark {
  position: absolute; left: calc(100% - 4px); translate: 0 -50%; will-change: transform; display: flex; flex-direction: column; white-space: nowrap;
  padding: .28em .6em .2em 1.05em; font-size: .64rem; font-weight: 600; line-height: 1.12; color: var(--pale);
  background: #8a6a3e; clip-path: polygon(.62em 0, 100% 0, 100% 100%, .62em 100%, 0 50%);
  filter: drop-shadow(0 1px 1px rgba(30, 12, 4, .45));
}
.g-mark.sindoor { background: var(--sindoor); }
.g-mark.gold { background: var(--gold); color: var(--ink); }
.g-mark.soft { background: #5d7b7e; }
.g-m1 { font-weight: 700; font-size: 1.08em; }
/* the water, and the line on it */
.g-water { position: absolute; left: 0; top: var(--wl); pointer-events: none; }
.g-wtex { position: absolute; left: 0; top: 0; display: block; }
.g-rip { position: absolute; left: 0; top: -3px; display: block; will-change: transform, opacity; animation: rip 5s ease-in-out infinite alternate; }
.g-rip.b { top: 1px; animation-delay: -2.5s; animation-direction: alternate-reverse; }
@keyframes rip { from { opacity: .2; transform: translateX(-5px); } to { opacity: .9; transform: translateX(5px); } }
.g-line {
  position: absolute; left: 0; right: 0; top: -1px; height: 2px; will-change: transform;
  background: linear-gradient(90deg, rgba(240, 250, 246, .9), rgba(240, 250, 246, .75) 62%, rgba(240, 250, 246, 0));
  animation: swell 3.6s ease-in-out infinite alternate;
}
@keyframes swell { from { transform: translateY(-1px); } to { transform: translateY(1px); } }
/* the float at the water line, round the staff, with the year on its reel in large type, inked (experience.js sizes it,
   draws the stand-in plate or sets the painter's, and turns the reel) */
.g-float { position: absolute; --fs: clamp(28px, 2.3vw, 36px); will-change: transform; animation: swell 3.6s ease-in-out infinite alternate; }
.g-fcan { position: absolute; top: 0; display: block; }
.g-fart { position: absolute; left: 0; top: 0; display: block; }
/* (experience.js draws the wash on the plate's foot into this canvas, through the plate's alpha) */
.g-fwet { position: absolute; left: 0; display: block; }
.g-odo {
  position: absolute; overflow: hidden;
  -webkit-mask-image: linear-gradient(transparent, #000 13%, #000 87%, transparent); mask-image: linear-gradient(transparent, #000 13%, #000 87%, transparent);
}
/* (in the painter's plate the window is its face, which is only a little taller than the ink, so it fades less) */
.g-float.painted { --fs: clamp(26px, 1.95vw, 31px); }
.g-float.painted .g-odo {
  -webkit-mask-image: linear-gradient(transparent, #000 8%, #000 92%, transparent); mask-image: linear-gradient(transparent, #000 8%, #000 92%, transparent);
}
.g-reel { width: max-content; will-change: transform; }
.g-row {
  display: block; font-size: var(--fs); font-weight: 700; line-height: 1.12; text-align: center; white-space: nowrap;
  color: #3a2210; text-shadow: 0 0 .7px rgba(58, 34, 16, .55), 0 .3px .9px rgba(58, 34, 16, .3); font-variant-numeric: lining-nums;
}
body.still .g-rip, body.still .g-line, body.still .g-float { animation-play-state: paused; }
/* the staff, its water and the float are stone, water and brass in the well, so they take the hour's light as the
   painting does: warmer at dusk, under the night's indigo at night.  The year cut in the face stays readable. */
/* (each keeps the same list of filters in every hour, the day's doing nothing, so a change of hour is a tween of
   numbers on the graphics card.  With no filter by day, a layer was made at the start of each change and let go at its
   end, and that cost a frame or two at 1920x1080) */
html.js .g-art { filter: brightness(1) saturate(1) sepia(0) hue-rotate(0deg); }
html.js .g-fart { filter: brightness(1) saturate(1) sepia(0); }
html.js .g-water { filter: brightness(1) saturate(1); }
.g-art, .g-fart, .g-water { transition: filter 1.1s ease; }
html.js body[data-mood="dusk"] .g-art { filter: brightness(.93) saturate(1.1) sepia(.2) hue-rotate(0deg); }
html.js body[data-mood="dusk"] .g-fart { filter: brightness(.93) saturate(1.1) sepia(.2); }
html.js body[data-mood="night"] .g-art { filter: brightness(.6) saturate(.65) sepia(.25) hue-rotate(185deg); }
html.js body[data-mood="night"] .g-fart { filter: brightness(.74) saturate(.85) sepia(0); }
html.js body[data-mood="night"] .g-water { filter: brightness(.55) saturate(.8); }
html.js body[data-mood="night"] .g-year { text-shadow: 0 1px 0 rgba(200, 210, 240, .3), 0 -1px 0 rgba(10, 12, 30, .4); }
html.js body[data-mood="night"] .g-mark { filter: drop-shadow(0 1px 1px rgba(4, 6, 16, .5)) brightness(.85); }

/* ================================================================================================================
   A narrow window: the card is a sheet at the foot
   ================================================================================================================ */
html.sheet .card {
  --f: 16px;
  left: 0; right: 0; bottom: 0; top: auto; width: auto;
  height: min(80vh, calc(100vh - var(--hh) - 16px)); height: min(80dvh, calc(100dvh - var(--hh) - 16px));
  border-bottom-width: 0;
  border-image: url(assets/paper-sheet-sh.webp) 116 100 0 100 / calc(var(--f) * 116 / 36) calc(var(--f) * 100 / 36) 0 calc(var(--f) * 100 / 36) / calc(var(--f) * 80 / 36) calc(var(--f) * 64 / 36) 0 calc(var(--f) * 64 / 36) stretch;
  transform: translateY(calc(100% - var(--peek))); padding-bottom: max(10px, env(safe-area-inset-bottom));
  transition: transform .38s cubic-bezier(.2, .7, .3, 1), opacity .3s ease, visibility 0s;
}
html.sheet .card::before { inset: -10px -10px 0; border-bottom: 0; }
html.sheet .card.open { transform: none; }
html.sheet body:not(.down) .card { opacity: 0; transform: translateY(100%); }
html.sheet .card.warm { transform: translateY(calc(100% - var(--peek))) !important; }
html.sheet .grab {
  display: flex; flex: none; align-items: center; justify-content: center; width: 100%; height: 22px; margin: -6px 0 0;
  padding: 0; border: 0; background: none; cursor: pointer; touch-action: none;
}
html.sheet .grab-bar { display: block; width: 46px; height: 5px; border-radius: 3px; background: rgba(27, 22, 19, .32); }
html.sheet .grab-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
html.sheet .grab:focus-visible { outline: 2px solid var(--ink); outline-offset: -2px; }
html.sheet .lamps { padding: 0 0 .35rem; touch-action: none; }
html.sheet .diya { width: 34px; height: 27.625px; }
html.sheet .lamp { font-size: .66rem; padding: .2rem 0 .1rem; }
html.sheet .pane { padding-top: .6rem; }
html.sheet .card:not(.open) .pane { overflow: hidden; }
html.sheet .lv-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 .7rem; margin-bottom: .6rem; }
html.sheet .lv-head h2 { font-size: 1.6em; }
html.sheet .role { margin: 0; font-size: .95em; }
/* the gauge, a slim strip on the left edge above the sheet: the marks only, and the float beside it saying the year */
html.sheet .gauge { --gx: 4px; bottom: var(--peek); width: 170px; }
html.sheet .g-float, html.sheet .g-float.painted { --fs: 20px; }
html.sheet .g-year { padding: 8px 0; font-size: 0; translate: 0 -50%; }
html.sheet .g-year.now { color: transparent; }
html.sheet .gauge.painted .g-face { font-size: 0; }
html.sheet .g-mark { left: 0; width: calc(var(--gw) + 3px); height: 3px; padding: 0; font-size: 0; clip-path: none; translate: 0 -50%; filter: none; }

@media (max-width: 640px) {
  .top { padding-left: 8px; padding-right: 8px; }
  .home { font-size: .92rem; padding: .26em .6em .14em; }
  .tools { font-size: .86rem; gap: .1em .7em; padding: 0 .5em; }
  .moods { gap: .55em; }
  .tools button { padding: .45em .06em .3em; }
  .slip { width: 196px; }
  .note { font-size: .92rem; }
  .card { font-size: 1rem; }
}
@media (max-width: 380px) {
  .tools { font-size: .8rem; gap: .1em .55em; }
  .moods { gap: .45em; }
}

/* ---- no scripts: the painting and a few plain lines ---- */
.nojs { max-width: 44rem; margin: 0 auto; padding: 1.4rem clamp(16px, 4vw, 48px) 2.4rem; color: var(--ink); background: var(--paper); }
.nojs-pic { display: block; width: 100%; height: auto; margin: 0 0 1rem; box-shadow: 0 0 0 1px rgba(27, 22, 19, .45), 0 0 0 4px var(--pale), 0 0 0 5.5px var(--gold); }
html:not(.js) body { background: var(--paper); }

@media (prefers-reduced-motion: reduce) {
  a, .tools button, .cue, .lamp, .diya, .mile, .blk, .part, .updown button, .tip, .thumb, .g-year { transition: none; }
  html.js .card, html.sheet .card, body:not(.down) .card { transition: none; }
  .cue .arrow, .blk.flash, .part.flash, .mile.flash, .hero-words, .g-rip, .g-line, .g-float { animation: none; }
  .g-art, .g-fart, .g-water { transition: none; }
}
