/* ——— The weekly thought on the wall ———
   When the lamp is lit, a verse is written on the wall beside it, as if by hand:
   the reference, then each line, then the marks (circle, underline, oval, box),
   each with its arrow and note, each at its own moment. Last, a quiet "share".
   Desktop: on the wall left of the lamp. Phone: the wall opens above the room. */
.wall-thought{--wt-ink:var(--frame-fg);--wt-mark:#C2A06A;position:absolute;z-index:3;container-type:inline-size;color:var(--wt-ink);pointer-events:none}
:root[data-mode="day"] .wall-thought{--wt-mark:#96773F}
.wall-thought.is-shown{pointer-events:none}  /* never in the way of the cord */
.wall-thought.is-shown :is(.wt-share,.wt-off,.wt-verse,.wt-note,.wt-ref){pointer-events:auto}
.wall-thought::before{/* the lamp's light on the wall */
  content:'';position:absolute;inset:-18% -12%;z-index:-1;border-radius:50%;
  background:radial-gradient(closest-side,color-mix(in srgb,var(--wt-mark) 13%,transparent),transparent);
  opacity:0;transition:opacity 1.6s ease}
:root[data-mode="day"] .wall-thought::before{background:radial-gradient(closest-side,color-mix(in srgb,#F2D27A 22%,transparent),transparent)}
.wall-thought.is-shown::before{opacity:1}

.wt-grid{display:grid;grid-template-columns:1fr 1fr;grid-template-areas:"ref ref" "tl tr" "verse verse" "bl br" "foot foot";align-items:end;row-gap:3.2cqw}
.wt-ref{grid-area:ref;justify-self:center;margin:0 0 1.5cqw;font:400 5.2cqw/1 'Literata',Georgia,serif;letter-spacing:.16em;text-transform:uppercase}
.wt-verse{grid-area:verse;margin:0;text-align:center;font:400 3.9cqw/2.15 'Literata',Georgia,serif;text-wrap:balance}
.wt-line{display:block}  /* each written line keeps its place; it wraps only if it must */
.wt-verse m{all:unset;white-space:nowrap}
.wt-note{margin:0;font:italic 400 3.3cqw/1.35 'Old Standard TT',Georgia,serif;opacity:.8;white-space:pre-line}
.wt-note[data-pos="tl"]{grid-area:tl;justify-self:start;padding-left:1cqw}
.wt-note[data-pos="tr"]{grid-area:tr;justify-self:end;text-align:center;padding-right:4cqw}
.wt-note[data-pos="bl"]{grid-area:bl;justify-self:start;align-self:start;text-align:center;padding-left:3cqw}
.wt-note[data-pos="br"]{grid-area:br;justify-self:end;align-self:start;text-align:center;padding-right:3cqw}
.wt-foot{grid-area:foot;display:flex;justify-content:center;flex-wrap:wrap;align-items:center;gap:6px 18px;margin-top:2cqw;font:400 11px/1.2 'Golos Text',system-ui,sans-serif;letter-spacing:.06em}
.wt-label{opacity:.6}
/* Hand-drawn controls: "share" sits in a sketched double frame, closing is a sketched
   circle with a cross at the top right of the thought. Both draw themselves in. */
.wt-share{all:unset;position:relative;cursor:pointer;display:inline-flex;align-items:center;gap:8px;min-height:40px;padding:0 18px;color:var(--wt-mark);font:italic 400 14px/1 'Old Standard TT',Georgia,serif;-webkit-tap-highlight-color:transparent}
.wt-share > svg:not(.wt-sketch){width:1.1em;height:1.1em}
.wt-sketch{position:absolute;inset:0;width:100%;height:100%;overflow:visible;fill:none;stroke:currentColor;stroke-linecap:round;pointer-events:none}
.wt-sketch path{vector-effect:non-scaling-stroke;stroke-width:1.1;stroke-dasharray:1;stroke-dashoffset:1;transition:stroke-dashoffset 1.1s cubic-bezier(.45,.05,.35,1) .1s}
.wt-sketch path + path{stroke-width:.8;opacity:.55;transition-delay:.45s}
.wt-share.in .wt-sketch path{stroke-dashoffset:0}
.wt-share:is(:hover,:focus-visible){background:color-mix(in srgb,var(--wt-mark) 9%,transparent);outline:none}
.wt-share:active{scale:.97}
.wt-off{all:unset;position:absolute;top:var(--off-top,-6px);right:0;z-index:2;cursor:pointer;width:40px;height:40px;display:grid;place-items:center;color:var(--wt-ink);opacity:.7;-webkit-tap-highlight-color:transparent}
.wt-off.wt-step.in{opacity:.7}
.wt-off:is(:hover,:focus-visible){opacity:1;outline:none}
.wt-cross{width:30px;height:30px;overflow:visible;fill:none;stroke:currentColor;stroke-linecap:round}
.wt-cross path{stroke-width:1.2;stroke-dasharray:1;stroke-dashoffset:1;transition:stroke-dashoffset .8s cubic-bezier(.45,.05,.35,1)}
.wt-cross path:nth-child(2){transition-delay:.55s}.wt-cross path:nth-child(3){transition-delay:.75s}
.wt-off.in .wt-cross path{stroke-dashoffset:0}
.wt-off:is(:hover,:focus-visible) .wt-cross{rotate:90deg;transition:rotate .45s cubic-bezier(.34,1.4,.64,1)}
.wt-off:active{scale:.92}
.wt-toast{position:absolute;right:0;bottom:-2.4em;font:italic 400 max(12px,2.6cqw)/1 'Old Standard TT',Georgia,serif;opacity:0;transition:opacity .4s}
.wt-toast.on{opacity:.8}

.wt-inner{position:relative}
.wt-ink{position:absolute;inset:0;width:100%;height:100%;overflow:visible;pointer-events:none;fill:none;stroke:var(--wt-mark);stroke-linecap:round;stroke-linejoin:round}
.wt-ink .wt-arrow{stroke:var(--wt-ink);opacity:.55}

/* Each piece starts hidden and is written in at its own time (wall-thought.js adds .in). */
.wt-step{opacity:0;filter:blur(3px);transform:translateY(3px);transition:opacity 1.1s ease,filter 1.1s ease,transform 1.1s ease}
.wt-step.in{opacity:1;filter:none;transform:none}
.wt-note.wt-step.in{opacity:.8}
.wt-label.wt-step.in{opacity:.6}
.wall-thought.is-hiding .wt-step,.wall-thought.is-hiding .wt-ink{opacity:0;transition:opacity .45s ease}

/* The lamp: lit, it is drawn up towards the ceiling with a small overshoot
   (the swing that follows is in wall-thought.js). It moves a wrapper, so the lamp's own
   sway is left alone. */
.wt-lift,.wt-swing{transform-box:view-box;transform-origin:768px 0px}
.wt-lift{transform:translateY(0);transition:transform 1.3s cubic-bezier(.3,1.25,.45,1)}
.wt-lift.up{transform:translateY(-175px)}  /* only while the thought is shown */

/* Desktop and tablet: centred under the raised lamp, over the desk. The verse is in
   the middle, the notes beside it: the top ones level with its first line, the bottom
   ones level with its last, so the whole thought stays low between lamp and desk. */
.wall-thought.is-under .wt-grid{grid-template-columns:auto auto auto;justify-content:center;grid-template-areas:"ref ref ref" "tl verse tr" "bl verse br" "foot foot foot";column-gap:3.4cqw;row-gap:0}
.wall-thought.is-under .wt-ref{font-size:clamp(10.5px,1.6cqw,13px);margin-bottom:1.6cqw}
.wall-thought.is-under .wt-verse{grid-row:2 / span 2;align-self:center;font-size:clamp(11.5px,1.85cqw,14px);line-height:1.9}
.wall-thought.is-under .wt-line{display:block;white-space:nowrap}
.wall-thought.is-under .wt-note{font-size:clamp(10px,1.45cqw,11.5px);padding:0}
.wall-thought.is-under .wt-note:is([data-pos="tl"],[data-pos="bl"]){justify-self:end;text-align:right}
.wall-thought.is-under .wt-note:is([data-pos="tr"],[data-pos="br"]){justify-self:start;text-align:left}
.wall-thought.is-under .wt-note:is([data-pos="tl"],[data-pos="tr"]){align-self:start;margin-top:-2.4cqw}
.wall-thought.is-under .wt-note:is([data-pos="bl"],[data-pos="br"]){align-self:end;margin-bottom:-2.4cqw}
.wall-thought.is-under .wt-foot{margin-top:3.4cqw}
.wall-thought.is-under .wt-share,.wall-thought.is-over .wt-share{min-height:30px;padding:0 12px;font-size:12.5px;gap:7px}


/* Phone: the thought takes the whole wall under the lamp, and the room fades back. */
.wall-thought.is-over{display:flex;align-items:flex-start;padding-top:8px}
.wall-thought.is-over .wt-off{right:max(0px,calc(50% - 220px))}
.wall-thought.is-over .wt-body{width:100%;max-width:400px;margin:0 auto}
.wall-thought.is-over .wt-inner{padding:0 10px}
.wall-thought.is-over .wt-ref{font-size:12px;margin-bottom:6px}
.wall-thought.is-over .wt-verse{font-size:13.5px;line-height:1.95}
.wall-thought.is-over .wt-note{font-size:11px}
.wall-thought.is-over .wt-grid{row-gap:10px}
.wall-thought.is-over .wt-foot{margin-top:18px;gap:6px 14px}
.wall-thought.is-over .wt-label{font-size:10px}
.wall-thought.is-over .wt-cross{width:26px;height:26px}
.study-room .study-architecture,.study-room .p1-desk-ready > :not(.wt-lift){transition:opacity 1s ease}
.study-room.wt-reading:has(.wall-thought.is-over) .study-architecture,
.study-room.wt-reading:has(.wall-thought.is-over) .p1-desk-ready > :not(.wt-lift){opacity:.1}

@media (prefers-reduced-motion:reduce){
  .wt-step,.wall-thought::before,.wt-lift{transition:none}
}
/* Hidden writing: the wall holds the text all along; the lamp's light spreads down
   from the shade and reveals it, and each piece glints gold for a moment as it appears. */
@property --wt-r{syntax:'<percentage>';inherits:false;initial-value:0%}
.wall-thought .wt-inner{--wt-r:0%;-webkit-mask:radial-gradient(farthest-side at 50% 0%,#000 calc(var(--wt-r) - 18%),transparent var(--wt-r));mask:radial-gradient(farthest-side at 50% 0%,#000 calc(var(--wt-r) - 18%),transparent var(--wt-r));transition:--wt-r 2.8s cubic-bezier(.3,0,.2,1) 1.2s}
.wall-thought.is-shown .wt-inner{--wt-r:190%}
.wall-thought.is-hiding .wt-inner{--wt-r:0%;transition:--wt-r .6s ease}
@keyframes wt-glint{0%{color:var(--wt-mark);text-shadow:0 0 14px color-mix(in srgb,var(--wt-mark) 70%,transparent)}100%{color:inherit;text-shadow:0 0 0 transparent}}
.wt-ref.in,.wt-line.in,.wt-note.in{animation:wt-glint 2.4s ease-out both}
@media (prefers-reduced-motion:reduce){.wall-thought .wt-inner{transition:none}.wt-ref.in,.wt-line.in,.wt-note.in{animation:none}}

/* The cord's hint, in the drawing's ink (see wall-thought.js).
   Short hatch strokes flick out from the bead and fade, in three small beats. */
.wt-ticks{fill:none;stroke:currentColor;stroke-width:.7;stroke-linecap:round;pointer-events:none}
.wt-ticks path{stroke-dasharray:1;stroke-dashoffset:1;opacity:0}
.study-lamp-switch.wt-hinting .wt-ticks path{animation:wt-tick 3.4s cubic-bezier(.3,.6,.3,1) infinite;animation-delay:calc(var(--i) * .12s)}
@keyframes wt-tick{0%{stroke-dashoffset:1;opacity:0}8%{opacity:.9}22%{stroke-dashoffset:0;opacity:.9}42%{opacity:0;stroke-dashoffset:0}100%{opacity:0;stroke-dashoffset:0}}
@media (prefers-reduced-motion:reduce){.study-lamp-switch.wt-hinting .wt-ticks path{animation:none;stroke-dashoffset:0;opacity:.6}}

/* The dashed ring around the bead shows only while the thought is on (a quiet "switch
   off here"); with the thought off it stays hidden, even after a click leaves focus on it. */
.study-lamp-switch:focus-visible .lamp-pull-focus{opacity:0}
.wt-lift.up .lamp-pull-focus{opacity:.8}
