/* The Holistic Sophist. One explicit theme, no dark mode switch (Magpie's standing rule). */
:root {
  color-scheme: dark;
  --night: #141027;
  --blush: #f6e3da;
  --foxglove: #d8508f;
  --gold: #c9a24b;
  --teal: #4fb3a9;
  --ink: #120a15;
}
* { box-sizing: border-box; }
@property --tilt { syntax: "<angle>"; inherits: true; initial-value: 64deg; }
html, body { margin: 0; min-height: 100vh; overflow-x: hidden; background: var(--night); color: var(--blush); }
body {
  font-family: Georgia, "Times New Roman", serif;
  background:
    radial-gradient(1px 1px at 12% 18%, #fff 50%, transparent 51%), radial-gradient(1px 1px at 71% 9%, #fff 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 33% 62%, #ffe9a8 50%, transparent 51%), radial-gradient(1px 1px at 88% 41%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 52% 83%, #fff 50%, transparent 51%), radial-gradient(1.5px 1.5px at 7% 77%, #cfe0f3 50%, transparent 51%),
    radial-gradient(ellipse at 50% 0%, #3a2a5c 0%, transparent 60%), var(--night);
}
main { max-width: 560px; margin: 0 auto; padding: 24px 16px 60px; display: grid; gap: 22px; justify-items: center; }
.quiet { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* THE VIEW: a kid at the table's edge. --tilt is how far the table is tipped back (90deg would be looking dead along it,
   0deg is straight down). Flat things lie in .tilt; standing things counter the tilt so they face you. */
.dish { position: relative; width: min(100%, 480px); aspect-ratio: 1 / .74; --tilt: 64deg; --h: 34px; perspective: 900px; perspective-origin: 50% 0%;
  transition: --tilt 1.4s cubic-bezier(.3, 1.1, .5, 1); clip-path: inset(-400px -100vw 0 -100vw); margin-top: 40px; }
.dish.opened { --tilt: 56deg; }                 /* on tiptoe, to see in */
.tilt { position: absolute; left: 0; top: 50%; width: 100%; aspect-ratio: 1; margin-top: -50%; transform-style: preserve-3d; transform: rotateX(var(--tilt)); }
.tilt > * { position: absolute; left: 0; top: 0; width: 100%; height: 100%; }
.tabletop { left: -75%; top: -55%; width: 250%; height: 230%; border-radius: 10px;
  background: repeating-linear-gradient(90deg, #5a3a22 0 58px, #4e3019 58px 61px, #63412a 61px 119px, #4e3019 119px 122px); box-shadow: inset 0 0 120px #000a; }
.dish svg { display: block; overflow: visible; }
.lifted { transform: translateZ(var(--h)); }
.wall { transform-style: preserve-3d; pointer-events: none; }
.slab { position: absolute; left: 17.3%; top: 17.3%; width: 65.4%; height: 65.4%; border-radius: 50%; background: #b9803c; box-shadow: inset 0 0 0 2px #8a5a2b; }
.slab:first-child { box-shadow: 0 0 26px 10px #0009; }
.standing { transform-style: preserve-3d; pointer-events: none; }
.stander { position: absolute; width: 0; height: 0; transform-style: preserve-3d; }
.stander .up { position: absolute; bottom: 0; transform-origin: 50% 100%; transform: rotateX(calc(var(--tilt) * -1)); }
.stander .up svg { display: block; width: 100%; height: auto; overflow: visible; }
.stander.flip .up svg { transform: scaleX(-1); }
.open { left: 20%; top: 20%; width: 60%; height: 60%; border-radius: 50%; border: 0; background: transparent; cursor: pointer; }
.tilt > .open { left: 20%; top: 20%; width: 60%; height: 60%; }
/* the near edge of the table, and whoever is holding on to it (stand in paper hands) */
.edge { position: absolute; left: 50%; bottom: 0; width: 100vw; margin-left: -50vw; height: 22px; background: linear-gradient(180deg, #7a5230, #3a2412); border-top: 2px solid #9a6a3e; }
.hand { position: absolute; bottom: 14px; display: flex; gap: 3px; }
.hand.l { left: calc(50% - 150px); } .hand.r { left: calc(50% + 62px); }
.hand i { display: block; width: 19px; height: 26px; border-radius: 10px 10px 4px 4px; background: #f3e6d3; border: 2px solid #120a15; border-bottom: 0; }
.hand i:nth-child(1), .hand i:nth-child(4) { height: 21px; align-self: flex-end; }
.open:focus-visible { outline: 3px dashed var(--teal); outline-offset: 4px; }
.opened .open { cursor: default; }

.sign { font: 17px/1 "Segoe UI Symbol", "Noto Sans Symbols 2", Georgia, serif; fill: #cfc6e6; text-anchor: middle; dominant-baseline: central; }
.sign.here { fill: #ffe9a8; }
.tick { stroke: #6f6796; stroke-width: 1.5; }
.tick.hour { stroke: #ffe9a8; stroke-width: 3; }
.vents { fill: none; stroke: #5e3a17; stroke-width: 4; stroke-linecap: round; }
.lid { transition: transform 1.1s cubic-bezier(.3, 1.3, .5, 1); transform-box: view-box; transform-origin: 0 0; }
.opened #lid-l { transform: translate(-46px, -8px) rotate(-24deg); }
.opened #lid-r { transform: translate(46px, -8px) rotate(24deg); }
.crimp { fill: #e2b06a; stroke: #5e3a17; stroke-width: 1.5; }

.bird .black { fill: #15101a; }
.bird .white { fill: #f6f1e4; }
.bird .sheen { fill: #2f6f8f; }
.bird .beak { fill: #2a2630; }
.bird.mine .sheen { fill: var(--foxglove); }
.crown { fill: url(#gold); stroke: #5e4210; stroke-width: 1; }

.song { width: min(100%, 470px); min-height: 1em; padding: 0; text-align: center; font-size: 18px; line-height: 1.5; opacity: 0; transition: opacity 1.2s ease .9s; }
.song.sung { opacity: 1; padding: 22px 22px 24px; color: var(--ink); background: #f3e6d3; border-radius: 3px; box-shadow: 0 14px 34px #000a; transform: rotate(-.5deg); }
.song p { margin: 0 0 12px; }
.song p:last-child { margin: 0; }
.song .bean { color: #7a2e55; font-weight: bold; }

.doors { display: flex; gap: 34px; }
.door { position: relative; display: block; width: 46px; height: 72px; border-radius: 23px 23px 3px 3px; border: 3px solid var(--gold);
  background: linear-gradient(180deg, #c4501f, #6a2509); transition: transform .3s ease, box-shadow .3s ease; }
.door.other { background: linear-gradient(180deg, #8d2353, #4e1230); }
.door.cloth { background: linear-gradient(180deg, #5a1f45, #220a1d); }
.door:hover, .door:focus-visible { transform: translateY(-4px) rotate(-1.5deg); box-shadow: 0 0 28px #c9a24b66; outline: none; }
.knob { position: absolute; right: 7px; top: 58%; width: 7px; height: 7px; border-radius: 50%; background: var(--gold); }

@media (prefers-reduced-motion: reduce) { .lid, .song, .door, .dish { transition: none !important; } }
