/* ===== Home: the wall ===== */
:root { --wall: #e6dccb; --bg: #e6dccb; }
html, body { height: 100%; }
body { overflow: hidden; background: var(--wall); }

.viewport {
  position: fixed; inset: 0; overflow: hidden;
  cursor: grab; touch-action: none;
  background:
    radial-gradient(120% 90% at 50% 40%, transparent 50%, rgba(60,40,20,.22)),
    var(--wall);
}
.viewport.panning { cursor: grabbing; }
.lamp-light {
  position: absolute; inset: 0; pointer-events: none; z-index: 2;
  background: radial-gradient(520px circle at var(--lx, 50%) var(--ly, 40%), rgba(255,236,190,.38), transparent 70%);
  mix-blend-mode: soft-light;
}
.wall {
  position: absolute; left: 0; top: 0;
  width: 2600px; height: 1700px;
  transform-origin: 0 0;
  will-change: transform;
  background-image: var(--fibres), var(--fibres);
  background-size: 400px 400px, 620px 620px;
  background-position: 0 0, 130px 90px;
}
/* faint pencil grid, like a studio wall someone measured once */
.wall::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: linear-gradient(rgba(60,40,20,.05) 1px, transparent 1px), linear-gradient(90deg, rgba(60,40,20,.05) 1px, transparent 1px);
  background-size: 200px 200px;
}

/* ---------- generic object ---------- */
.obj {
  position: absolute; left: var(--x); top: var(--y);
  transform: translate(var(--px, 0px), var(--py, 0px)) rotate(var(--r));
  transition: transform .5s var(--ease), filter .4s;
  text-decoration: none; color: var(--ink);
  user-select: none; -webkit-user-drag: none;
  z-index: 5;
}
.obj img { -webkit-user-drag: none; pointer-events: none; }
.obj.dragging { transition: none; z-index: 60 !important; cursor: grabbing; filter: drop-shadow(0 24px 22px rgba(30,20,10,.28)); }
.nav-obj:hover, .nav-obj:focus-visible { transform: translate(var(--px, 0px), calc(var(--py, 0px) - 8px)) rotate(calc(var(--r) * .35)) scale(1.03); z-index: 40; }
.obj-label { position: absolute; left: 0; top: calc(100% + 12px); white-space: nowrap; color: var(--ink-soft); }

/* intro: objects get pinned up one by one */
.wall:not(.ready) .obj { opacity: 0; transform: translate(0, -30px) rotate(calc(var(--r) + 8deg)) scale(1.12); }
.wall.ready .obj { animation: none; }
.wall .obj { transition: transform .9s var(--ease-out), opacity .7s var(--ease), filter .4s; transition-delay: var(--d, 0s); }
.wall.settled .obj { transition-delay: 0s; transition-duration: .5s, .3s, .4s; }

/* ---------- title ---------- */
.title-cluster { z-index: 10; text-align: center; cursor: grab; }
.ransom { margin: 0; display: flex; align-items: flex-end; gap: 6px; font-weight: 400; line-height: 1; }
.ransom .l {
  display: inline-grid; place-items: center;
  padding: 10px 14px 4px;
  font-size: 150px; line-height: .9;
  box-shadow: 0 6px 12px -6px rgba(40,25,10,.4);
  position: relative;
}
.ransom .l::after { content: ""; position: absolute; inset: 0; background-image: var(--fibres); pointer-events: none; }
.l1 { background: var(--ivory); font-family: var(--f-display); font-style: italic; font-weight: 300; font-variation-settings: "SOFT" 100, "WONK" 1, "opsz" 144; transform: rotate(-4deg); clip-path: polygon(2% 4%, 96% 0, 100% 96%, 4% 100%); }
.l2 { background: var(--cobalt); color: var(--ivory); font-family: var(--f-display); font-weight: 600; width: 78px; height: 78px; padding: 0 !important; font-size: 150px !important; line-height: 1 !important; border-radius: 50%; place-items: start center !important; overflow: hidden; transform: translateY(-96px) rotate(10deg); }
.l2::before { content: ""; }
.l3 { background: var(--ink); color: var(--ivory); font-family: var(--f-sans); font-weight: 700; font-size: 132px !important; transform: rotate(3deg) translateY(10px); clip-path: polygon(0 3%, 100% 0, 97% 100%, 3% 96%); }
.l4 { background: var(--kraft); font-family: var(--f-display); font-weight: 800; font-variation-settings: "SOFT" 0, "WONK" 0, "opsz" 144; transform: rotate(-2deg) translateY(-14px); clip-path: polygon(5% 0, 100% 5%, 94% 100%, 0 94%); }
.l5 { background: var(--rose); font-family: var(--f-mono); font-weight: 400; font-size: 120px !important; transform: rotate(5deg); clip-path: polygon(0 0, 98% 6%, 100% 100%, 6% 97%); }
.l6 { background: #f4efe2; color: var(--brick); font-family: var(--f-display); font-style: italic; font-weight: 600; font-variation-settings: "SOFT" 100, "WONK" 1, "opsz" 144; transform: rotate(-6deg) translateY(-4px); clip-path: polygon(4% 2%, 100% 0, 96% 98%, 0 100%); background-image: repeating-linear-gradient(transparent 0 7px, rgba(0,0,0,.05) 7px 8px); }
.l7 { background: var(--moss); color: var(--ivory); font-family: var(--f-display); font-weight: 300; font-variation-settings: "SOFT" 100, "WONK" 0, "opsz" 144; transform: rotate(2deg) translateY(6px); clip-path: polygon(0 5%, 95% 0, 100% 93%, 5% 100%); }
.tagline { position: relative; margin: 30px 0 0; font-size: 46px; color: var(--ink); }
.tagline svg { position: absolute; left: 50%; bottom: -16px; width: 420px; transform: translateX(-50%); overflow: visible; }
.tagline path { fill: none; stroke: var(--brick); stroke-width: 2.5; stroke-linecap: round; stroke-dasharray: 460; stroke-dashoffset: 460; transition: stroke-dashoffset 1.6s var(--ease) 1.4s; }
.wall.ready .tagline path { stroke-dashoffset: 0; }
.sub { margin: 30px 0 0; color: var(--ink-soft); }

/* ---------- polaroids & prints ---------- */
.polaroid.big { width: 340px; }
.polaroid.big img { aspect-ratio: 4 / 5; }
.polaroid.big .cap { font-size: 34px; }
.polaroid-obj { z-index: 8; }
.print-obj { display: block; width: 300px; background: var(--ivory); padding: 8px; box-shadow: 0 10px 24px -10px rgba(40,25,10,.4); }
.print-obj img { width: 100%; aspect-ratio: 3/2; object-fit: cover; filter: saturate(.85) sepia(.06); }
.print-obj.tall { width: 220px; }
.print-obj.tall img { aspect-ratio: 4/5; }
.big-label { font-size: 30px; color: var(--ink); top: calc(100% + 6px); }
.big-label em { font-style: normal; color: var(--ink-soft); margin-left: 8px; font-size: 10px; }

.secret { position: absolute; left: var(--x); top: var(--y); transform: rotate(var(--r)); width: 260px; font-size: 26px; color: var(--brick); z-index: 1; padding: 30px; background: rgba(250,246,238,.6); }
.secret .mono { color: var(--ink-soft); font-size: 10px; }

/* ---------- notebook ---------- */
.notebook { width: 250px; height: 330px; perspective: 900px; display: block; }
.nb-cover, .nb-page { position: absolute; inset: 0; border-radius: 4px 12px 12px 4px; }
.nb-page {
  background: var(--ivory);
  background-image: repeating-linear-gradient(transparent 0 25px, rgba(44,68,232,.15) 25px 26px);
  padding: 34px 22px 20px 30px; font-size: 24px; color: var(--ink);
  box-shadow: 0 12px 28px -10px rgba(40,25,10,.45);
}
.nb-page u { text-decoration-color: var(--brick); }
.nb-cover {
  background: #3d4a34;
  background-image: var(--fibres), radial-gradient(circle at 30% 20%, rgba(255,255,255,.08), transparent 60%);
  transform-origin: left center;
  transition: transform .9s var(--ease-out);
  box-shadow: inset -2px 0 0 rgba(0,0,0,.25), inset 6px 0 10px -6px rgba(0,0,0,.4), 0 12px 28px -10px rgba(40,25,10,.5);
  z-index: 2;
}
.notebook:hover .nb-cover, .notebook:focus-visible .nb-cover { transform: rotateY(-58deg); }
.nb-sticker { position: absolute; left: 50%; top: 70px; transform: translateX(-50%) rotate(-2deg); background: var(--ivory); padding: 8px 18px 2px; text-align: center; display: grid; }
.nb-sticker .hand { font-size: 30px; }
.nb-band { position: absolute; right: 26px; top: 0; bottom: 0; width: 10px; background: #1c1712; box-shadow: 1px 0 2px rgba(0,0,0,.4); }
.notebook .obj-label { top: calc(100% + 14px); }

/* ---------- print stack ---------- */
.stack { width: 290px; height: 220px; display: block; }
.sheet { position: absolute; inset: 0; background: var(--ivory); padding: 12px; box-shadow: 0 2px 4px rgba(40,25,10,.18); transition: transform .6s var(--ease-out); }
.sheet img { width: 100%; height: 100%; object-fit: cover; filter: saturate(.8) sepia(.08); }
.s3 { transform: rotate(6deg) translate(10px, 6px); background: #ece4d4; }
.s2 { transform: rotate(-3deg) translate(-8px, 4px); }
.s1 { box-shadow: 0 10px 26px -10px rgba(40,25,10,.5); }
.stack:hover .s1 { transform: translate(40px, -36px) rotate(5deg); }
.stack:hover .s2 { transform: rotate(-7deg) translate(-26px, 8px); }
.string { position: absolute; inset: 0; pointer-events: none; z-index: 3;
  background: linear-gradient(90deg, transparent calc(50% - 1px), #c6a679 calc(50% - 1px) calc(50% + 1px), transparent 0),
              linear-gradient(transparent calc(55% - 1px), #c6a679 calc(55% - 1px) calc(55% + 1px), transparent 0);
  transition: opacity .3s; }
.stack:hover .string { opacity: 0; }
.tag { position: absolute; right: -36px; top: 58%; z-index: 4; background: #e9d9b8; padding: 6px 12px 6px 24px; display: grid; transform: rotate(14deg); transform-origin: left center;
  clip-path: polygon(14px 0, 100% 0, 100% 100%, 14px 100%, 0 50%); transition: transform .8s cubic-bezier(.3, 1.8, .4, 1); }
.tag::before { content: ""; position: absolute; left: 8px; top: 50%; width: 6px; height: 6px; border-radius: 50%; background: var(--wall); transform: translateY(-50%); }
.tag .hand { font-size: 26px; }
.tag .mono { font-size: 10px; }
.stack:hover .tag { transform: rotate(-8deg); }
.stack .obj-label { top: calc(100% + 26px); }

/* ---------- contact sheet ---------- */
.contact { display: block; width: 330px; background: #141210; padding: 22px 14px 26px; box-shadow: 0 14px 28px -12px rgba(0,0,0,.5); }
.cs-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.cs-grid img { aspect-ratio: 3/2; object-fit: cover; width: 100%; filter: grayscale(.25) contrast(1.05); transition: filter .4s; }
.contact:hover .cs-grid img { filter: none; }
.cs-edge { position: absolute; left: 14px; bottom: 6px; color: #e7a245; font-size: 9px; }
.grease { position: absolute; left: 112px; top: 8px; width: 122px; overflow: visible; }
.grease path { fill: none; stroke: var(--safelight); stroke-width: 3.5; stroke-linecap: round; opacity: .9; stroke-dasharray: 420; stroke-dashoffset: 420; transition: stroke-dashoffset 1s var(--ease); }
.contact:hover .grease path, .contact:focus-visible .grease path { stroke-dashoffset: 0; }
.contact .obj-label { display: grid; gap: 0; }
.contact .obj-label .hand { font-size: 28px; color: var(--ink); }

/* ---------- library card ---------- */
.card { display: block; width: 330px; background: #f3e7c9; padding: 16px 18px 18px; box-shadow: 0 10px 22px -10px rgba(40,25,10,.45);
  background-image: var(--fibres), repeating-linear-gradient(transparent 0 33px, rgba(169,64,45,.28) 33px 34px); background-position: 0 0, 0 24px; }
.card-head { display: flex; justify-content: space-between; border-bottom: 2px solid var(--brick); padding-bottom: 6px; margin-bottom: 4px; color: var(--brick); }
.card-row { display: grid; grid-template-columns: 90px 1fr; align-items: baseline; height: 34px; }
.card-row .mono { font-size: 9px; color: var(--ink-soft); }
.card-row .hand { font-size: 26px; color: #23306e; }
.card-stamp { position: absolute; right: 14px; bottom: -14px; transform: rotate(-8deg); background: rgba(243,231,201,.5); }

/* ---------- envelope ---------- */
.envelope { display: block; width: 240px; height: 150px; background: #efe6d4; box-shadow: 0 10px 22px -10px rgba(40,25,10,.45); overflow: hidden; }
.env-flap { position: absolute; inset: 0; background: #e5dac4; clip-path: polygon(0 0, 100% 0, 50% 58%); transform-origin: top; transition: transform .6s var(--ease-out); }
.envelope:hover .env-flap { transform: scaleY(-.4); }
.env-addr { position: absolute; left: 28px; bottom: 18px; font-size: 30px; }
.env-addr .mono { font-size: 10px; color: var(--ink-soft); }
.env-stamp { position: absolute; right: 14px; top: 14px; width: 46px; height: 56px; background: #fff; padding: 3px;
  mask: radial-gradient(circle at 3px 3px, transparent 2px, #000 2.5px) -3px -3px / 7px 7px; }
.env-stamp img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- cord (day / night switch) ---------- */
.cord { width: 40px; height: 240px; display: block; z-index: 30; }
.cord-line { position: absolute; left: 19px; top: 0; height: 200px; width: 1.5px; background: #6b5a48; transform-origin: top; transition: height .3s var(--ease); }
.cord-bead { position: absolute; left: 12px; top: 196px; width: 16px; height: 22px; border-radius: 40% 40% 50% 50%; background: radial-gradient(circle at 35% 30%, #fff6 0 2px, transparent 4px), #8a6a4a; transition: top .3s var(--ease); }
.cord:active .cord-line { height: 230px; }
.cord:active .cord-bead { top: 226px; }
.cord-label { position: absolute; left: 36px; top: 200px; white-space: nowrap; font-size: 22px; color: var(--ink-soft); }
.cord.pulled { animation: swing 1.4s var(--ease-out); transform-origin: 20px 0; }
@keyframes swing { 0% { rotate: 14deg; } 30% { rotate: -9deg; } 55% { rotate: 5deg; } 80% { rotate: -2deg; } 100% { rotate: 0; } }

/* ---------- rubber stamp ---------- */
.rubber-stamp { width: 90px; height: 120px; display: block; }
.rs-handle { position: absolute; left: 28px; top: 0; width: 34px; height: 70px; border-radius: 18px 18px 6px 6px; background: linear-gradient(90deg, #6e4a2c, #a6774b 40%, #6e4a2c); }
.rs-base { position: absolute; left: 6px; top: 66px; width: 78px; height: 30px; border-radius: 4px; background: linear-gradient(#b88a5a, #8b5f37); box-shadow: 0 6px 0 var(--cobalt), 0 12px 14px -6px rgba(0,0,0,.4); }
.rs-label { position: absolute; left: 90px; top: 40px; white-space: nowrap; font-size: 22px; color: var(--ink-soft); }
body.stamping .viewport, body.stamping .viewport * { cursor: crosshair !important; }
body.stamping .rubber-stamp { opacity: .25; }
.stamp-mark { position: absolute; z-index: 4; pointer-events: none; font-size: 15px; padding: 8px 12px 6px; transform: translate(-50%, -50%) rotate(var(--r)); animation: thunk .25s var(--ease-out); }
@keyframes thunk { from { transform: translate(-50%, -50%) rotate(var(--r)) scale(1.4); opacity: 0; } }
.stamp-hint { position: fixed; left: 50%; top: 70px; transform: translateX(-50%); background: var(--cobalt); color: var(--ivory); padding: 8px 14px; border-radius: 999px; z-index: 700; opacity: 0; transition: opacity .3s; pointer-events: none; }
.stamp-hint.show { opacity: 1; }

/* ---------- decor ---------- */
.sticky { width: 170px; height: 160px; padding: 26px 16px; background: #f4d66b; font-size: 27px; box-shadow: 0 14px 14px -12px rgba(40,25,10,.45); clip-path: polygon(0 0, 100% 0, 100% 88%, 86% 100%, 0 100%); }
.ticket { display: grid; gap: 4px; width: 180px; padding: 16px 20px; background: var(--rose); text-align: center; color: #4a1e18;
  mask: radial-gradient(circle at 0 50%, transparent 12px, #000 12.5px) left / 51% 100% no-repeat, radial-gradient(circle at 100% 50%, transparent 12px, #000 12.5px) right / 51% 100% no-repeat; }
.ticket .serif { font-size: 26px; font-style: italic; line-height: 1; }
.swatches { display: flex; gap: 6px; padding: 10px; background: var(--ivory); box-shadow: 0 8px 16px -10px rgba(40,25,10,.4); }
.swatches span { width: 40px; height: 74px; background: var(--c); position: relative; }
.swatches i { position: absolute; left: 0; bottom: -18px; font-style: normal; font-size: 8px; color: var(--ink-soft); }
.swatches { padding-bottom: 26px; }
.leaf { width: 110px; }
.leaf svg { width: 110px; overflow: visible; }
.leaf .lf { fill: #7c8a58; opacity: .82; }
.leaf .vein { fill: none; stroke: #4c5832; stroke-width: 1.4; opacity: .7; }
.cutout { padding: 4px 12px 2px; box-shadow: 0 4px 8px -4px rgba(40,25,10,.4); }
.c-slow { background: #111; color: #f4d66b; font: 700 64px/1 var(--f-sans); letter-spacing: -.04em; clip-path: polygon(0 6%, 98% 0, 100% 92%, 3% 100%); }
.c-look { background: #f7f2e7; font-family: var(--f-display); font-size: 46px; font-variation-settings: "SOFT" 100, "WONK" 1; }
.c-look em { color: var(--cobalt); }
.c-home { background: var(--ivory); font-family: var(--f-mono); font-size: 14px; text-transform: uppercase; letter-spacing: .14em; padding: 6px 10px; }
.sketch { width: 240px; }
.sketch svg { width: 220px; overflow: visible; }
.sketch path { fill: none; stroke: #5b5045; stroke-width: 1.3; stroke-linecap: round; stroke-linejoin: round; opacity: .7; stroke-dasharray: 1200; stroke-dashoffset: 1200; transition: stroke-dashoffset 3s var(--ease) 1.6s; }
.wall.ready .sketch path { stroke-dashoffset: 0; }
.sketch .hand { font-size: 22px; color: var(--ink-soft); display: block; margin-top: 4px; }
.booth { display: grid; gap: 6px; width: 120px; padding: 8px; background: #f9f7f2; box-shadow: 0 10px 20px -10px rgba(40,25,10,.4); }
.booth img { aspect-ratio: 1; object-fit: cover; filter: grayscale(1) contrast(1.15); transition: filter .5s; }
.booth:hover img { filter: grayscale(0); }

/* ---------- HUD ---------- */
.wall-hud { position: fixed; left: var(--gutter); right: var(--gutter); bottom: 18px; display: flex; justify-content: space-between; align-items: flex-end; z-index: 600; pointer-events: none; }
.hint { margin: 0; color: var(--ink-soft); background: rgba(241,233,219,.8); padding: 6px 10px; border-radius: 4px; }
.key { border: 1px solid currentColor; border-radius: 3px; padding: 1px 5px; }
.minimap { position: relative; width: 130px; height: 85px; border: 1px solid rgba(30,26,22,.4); background: rgba(241,233,219,.6); pointer-events: auto; cursor: pointer; }
.mm-view { position: absolute; border: 1.5px solid var(--cobalt); background: rgba(44,68,232,.08); }

/* ---------- small screens: the wall becomes a falling collage ---------- */
@media (max-width: 760px) {
  body { overflow: auto; height: auto; }
  html { height: auto; }
  .viewport { position: relative; inset: auto; overflow: visible; overflow-x: clip; cursor: auto; touch-action: auto; padding: 90px 16px 60px; }
  .lamp-light, .wall-hud, .secret, .cord, .rubber-stamp, .sketch, .c-home { display: none; }
  .wall { position: relative; width: auto; height: auto; transform: none !important; display: grid; grid-template-columns: 1fr 1fr; gap: 54px 12px; align-items: start; }
  .wall::before { display: none; }
  .obj { position: relative; left: auto !important; top: auto !important; justify-self: center; }
  .title-cluster { grid-column: 1 / -1; order: -2; }
  .ransom { justify-content: center; flex-wrap: nowrap; gap: 3px; }
  .ransom .l { font-size: 15.5vw; padding: 6px 6px 2px; }
  .l2 { font-size: 13vw !important; transform: translateY(-9vw) rotate(10deg); padding: 0 8px 10px !important; }
  .l3 { font-size: 14vw !important; } .l5 { font-size: 13vw !important; }
  .tagline { font-size: 34px; }
  .tagline svg { width: 280px; }
  .polaroid-obj { grid-column: 1 / -1; order: -1; }
  .polaroid.big { width: min(280px, 76vw); }
  .print-obj { width: 100%; max-width: 300px; }
  .print-obj.tall { width: 100%; }
  .notebook { width: 100%; max-width: 170px; height: 230px; }
  .nb-page { font-size: 18px; padding: 22px 14px; }
  .notebook .nb-cover { transform: rotateY(-24deg); }
  .stack { width: 100%; max-width: 170px; height: 140px; }
  .tag { right: -14px; }
  .contact { grid-column: 1 / -1; width: 100%; max-width: 330px; }
  .card { grid-column: 1 / -1; width: 100%; max-width: 330px; }
  .envelope { width: 100%; max-width: 170px; height: 120px; }
  .env-addr { left: 14px; font-size: 24px; }
  .sticky { width: 140px; height: 130px; font-size: 22px; }
  .ticket { width: 150px; }
  .swatches span { width: 22px; height: 54px; }
  .swatches i { display: none; }
  .swatches { padding-bottom: 10px; }
  .obj-label { position: static; display: block; margin-top: 12px; white-space: normal; }
  .big-label { font-size: 24px; }
  .leaf { width: 70px; } .leaf svg { width: 70px; }
  .c-slow { font-size: 44px; } .c-look { font-size: 32px; }
  .booth { width: 100px; }
}
.print-obj img, .polaroid img { height: auto; }
@media (max-width: 760px) {
  .ransom { gap: 2px; }
  .ransom .l { font-size: 12.4vw; padding: 5px 4px 1px; }
  .l2 { width: 9vw; height: 9vw; font-size: 15vw !important; transform: translateY(-11vw) rotate(10deg); }
  .l3 { font-size: 11.4vw !important; } .l5 { font-size: 10.6vw !important; }
  .contact .obj-label, .contact .obj-label .hand { color: #efe7d8; }
  .contact .cs-edge { position: static; display: block; margin-top: 8px; }
  .print-obj .tape { display: none; }
}
.card-row { height: auto; min-height: 34px; }
.card-row .hand { line-height: 34px; }

/* ===== night on the wall (8pm–6am) ===== */
.night-only { display: none !important; }
html.night .night-only { display: block !important; }
html.night .day-only { display: none; }
html.night body, html.night .viewport { background-color: #2b241d; }
html.night .lamp-light {
  mix-blend-mode: normal; z-index: 50;
  background: radial-gradient(circle at var(--lx, 50%) var(--ly, 45%), rgba(255,190,110,.12) 0, rgba(255,170,90,.05) 170px, rgba(14,10,8,.55) 380px, rgba(8,6,5,.86) 680px);
}
html.night .wall-hud .hint, html.night .minimap { background: rgba(30,24,18,.8); color: #d9c9b2; border-color: #6b5a48; }
html.night .wall-hud .hint .key { border-color: #6b5a48; }
html.night .chrome .wordmark { color: #efe2cc; }
html.night .stamp-hint { background: #c7712f; }
.candle { width: 60px; height: 150px; }
.candle .wax { position: absolute; left: 14px; bottom: 16px; width: 32px; height: 90px; border-radius: 3px 3px 0 0;
  background: linear-gradient(90deg, #e9dcc4, #fbf3e3 45%, #d9c8aa); box-shadow: inset 0 6px 6px -4px rgba(0,0,0,.15); }
.candle .dish { position: absolute; left: 0; bottom: 6px; width: 60px; height: 14px; border-radius: 50%; background: #8a6a4a; box-shadow: 0 6px 10px rgba(0,0,0,.4); }
.candle .wick { position: absolute; left: 29px; bottom: 104px; width: 2px; height: 9px; background: #2a1d14; }
.candle .flame { position: absolute; left: 21px; bottom: 110px; width: 18px; height: 34px; border-radius: 50% 50% 45% 45% / 65% 65% 35% 35%;
  background: radial-gradient(ellipse at 50% 75%, #fff8e0 0 20%, #ffd27a 45%, #ff8a2b 80%, transparent 100%);
  box-shadow: 0 0 40px 18px rgba(255,170,70,.35), 0 0 120px 60px rgba(255,150,60,.18);
  transform-origin: 50% 90%; animation: flicker 2.6s ease-in-out infinite; }
@keyframes flicker { 0%, 100% { transform: scale(1) rotate(-1deg); } 20% { transform: scale(1.05, .95) rotate(2deg); } 45% { transform: scale(.95, 1.06) rotate(-2deg); } 70% { transform: scale(1.02) rotate(1deg); } }
.night-note { width: 260px; margin: 0; font-size: 26px; color: #f1d8b0; text-shadow: 0 1px 8px rgba(0,0,0,.5); }
@media (max-width: 760px) {
  html.night .lamp-light { display: block; position: fixed; inset: 0; background: radial-gradient(circle at 50% 40%, rgba(255,190,110,.08), rgba(10,8,6,.5) 70%); }
  .candle, .night-note { grid-column: span 1; }
}

/* light-switch blink when the cord is pulled */
.viewport::after { content: ""; position: absolute; inset: 0; z-index: 60; pointer-events: none; background: #0b0806; opacity: 0; transition: opacity .45s var(--ease); }
.viewport.switching::after { opacity: .85; transition-duration: .15s; }
html.night .cord-label { color: #e6d3b3; }
html.night .cord-line { background: #b49a7c; }
html.night .cord { z-index: 70; }
