/* THE CARNIVAL'S SKIN: the automaton (her pick, 2026-10-24, night; brief in foundry/private/briefs/skin-automaton.md).
   ONE STRUCTURE, MANY SKINS: backroom.css and crank.js are the structure (the box, the gear train, the doll, the crank,
   the doors) and never change for a look. This file is loaded after them on a page whose <html> carries
   data-skin="automaton", and it only recolours and decorates. Her pictures still go under the parts by file drop.
   This skin: brass, enamel and clockwork. The page is a tin wall painted in carnival stripes; the machine sits in an
   enamelled tin panel with a chipped corner, held by riveted brass rails; a row of bulbs burns along its top; the gear
   train shows as brass; a gear turns behind a round cut out in the panel's corner; what is written stands on painted
   boards. Every colour here is Claude's stand in until she paints. The bedroom is the quiet room; this is the loud one. */

/* the wall: tin painted in carnival stripes, a warm light from above */
html[data-skin="automaton"] { background: #5e121b; }
[data-skin="automaton"] body { background-color: #5e121b;
  background-image: radial-gradient(ellipse at 50% 0%, #ffd97738 0%, transparent 55%), repeating-linear-gradient(90deg, #7d1a24 0 38px, #5e121b 38px 76px); }

/* riveted brass rails along the top and bottom edges of the screen; nothing under them is touched */
[data-skin="automaton"] body::before { content: ""; position: fixed; inset: 0; z-index: 30; pointer-events: none;
  background:
    radial-gradient(circle, #fff3c4 0 1.4px, #5a3f0e 1.8px, transparent 2.6px) 10px 0 / 34px 8px repeat-x,
    radial-gradient(circle, #fff3c4 0 1.4px, #5a3f0e 1.8px, transparent 2.6px) 10px 100% / 34px 8px repeat-x,
    linear-gradient(#3a2a0c, #3a2a0c) 0 8px / 100% 1.5px no-repeat,
    linear-gradient(#3a2a0c, #3a2a0c) 0 calc(100% - 8px) / 100% 1.5px no-repeat,
    linear-gradient(180deg, #ffe9a8, #c9a24b 45%, #6d5119) 0 0 / 100% 8px no-repeat,
    linear-gradient(0deg, #ffe9a8, #c9a24b 45%, #6d5119) 0 100% / 100% 8px no-repeat; }

/* the panel the machine sits in: enamelled tin, green, a sheen across it, the enamel chipped at two corners down to
   the grey tin, held by a brass rail with a dark seam outside it */
[data-skin="automaton"] .works { position: relative; border-radius: 6px; background-color: #1f4d44;
  background-image:
    radial-gradient(26px 14px at 9px 10px, #8d8794 0 58%, #3a3540 60% 70%, transparent 74%),
    radial-gradient(18px 9px at calc(100% - 14px) calc(100% - 8px), #8d8794 0 58%, #3a3540 60% 72%, transparent 76%),
    linear-gradient(135deg, #ffffff1f, transparent 45%, #00000033);
  box-shadow: 0 0 0 5px #c9a24b, 0 0 0 7px #3a2a0c, 0 18px 40px #000a; }
/* rivets along the rail, all four sides */
[data-skin="automaton"] .works::before { content: ""; position: absolute; inset: -5px; border-radius: 10px; pointer-events: none;
  background:
    radial-gradient(circle, #fff3c4 0 1.4px, #5a3f0e 1.8px, transparent 2.6px) 14px 0 / 28px 5px repeat-x,
    radial-gradient(circle, #fff3c4 0 1.4px, #5a3f0e 1.8px, transparent 2.6px) 14px 100% / 28px 5px repeat-x,
    radial-gradient(circle, #fff3c4 0 1.4px, #5a3f0e 1.8px, transparent 2.6px) 0 14px / 5px 28px repeat-y,
    radial-gradient(circle, #fff3c4 0 1.4px, #5a3f0e 1.8px, transparent 2.6px) 100% 14px / 5px 28px repeat-y; }
/* a row of bulbs on a brass bar over the panel, every other one lit, the lit ones chasing */
[data-skin="automaton"] .works::after { content: ""; position: absolute; left: 10px; right: 10px; top: -17px; height: 12px; pointer-events: none;
  background:
    radial-gradient(circle, #fff8dc 0 2.6px, #ffd977 3.4px, #ffb84a66 5.5px, transparent 7px) 0 0 / 30px 12px repeat-x,
    radial-gradient(circle, #e0b35a 0 2.4px, #7a5a17 3px, transparent 3.8px) 15px 0 / 30px 12px repeat-x,
    linear-gradient(#6d5119, #6d5119) 0 100% / 100% 2px no-repeat;
  animation: auto-chase 1.4s steps(1) infinite; }
@keyframes auto-chase { 50% { background-position: 15px 0, 0 0, 0 100%; } }

/* a round cut out in the panel's corner, brass rimmed, with a gear turning behind it */
[data-skin="automaton"] main { position: relative; }
[data-skin="automaton"] main::before, [data-skin="automaton"] main::after { content: ""; position: absolute; border-radius: 50%; pointer-events: none; }
[data-skin="automaton"] main::before { right: 6px; top: 22px; width: 64px; height: 64px; z-index: 2;
  background: radial-gradient(circle, transparent 0 68%, #0009 69% 72%, #c9a24b 73% 87%, #3a2a0c 88% 93%, transparent 94%); }
[data-skin="automaton"] main::after { right: 13px; top: 29px; width: 50px; height: 50px; z-index: 1; background-color: #160c19;
  background-image: radial-gradient(circle, #1a0d10 0 11%, #ffe9a8 12% 18%, #c9a24b 19% 34%, #6d5119 35% 38%, #c9a24b 39% 64%, transparent 65%), repeating-conic-gradient(from 0deg, #c9a24b 0 13deg, transparent 13deg 30deg);
  animation: auto-turn 14s linear infinite; }
@keyframes auto-turn { to { transform: rotate(360deg); } }

/* inside the box: the gear train is brass, the rods brass, the cams enamelled, the crank brass with a red enamel knob */
[data-skin="automaton"] .gear { fill: url(#brass); stroke: #3a2a0c; }
[data-skin="automaton"] .cam { fill: #e3dfe8; }
[data-skin="automaton"] .cam.b { fill: #1f8a7a; }
[data-skin="automaton"] .cam.c { fill: #b3123f; }
[data-skin="automaton"] .rod-core { stroke: #e0c070; }
[data-skin="automaton"] .shoe { fill: #3a2a0c; stroke: #1a0d10; }
[data-skin="automaton"] .pulley { fill: #5a3f0e; stroke: #1a0d10; }
[data-skin="automaton"] .crank-bar { fill: url(#brass); stroke: #3a2a0c; }
[data-skin="automaton"] .crank-knob { fill: #b3123f; stroke: #1a0d10; }
/* the box itself: red enamel over its tin frame (the grain layer stays and reads as wear), a green enamel top, brass feet */
[data-skin="automaton"] #box > path:nth-of-type(1) { fill: #8e1b2a; }
[data-skin="automaton"] #box > rect:nth-of-type(1) { fill: #1f5c4f; }
[data-skin="automaton"] #box > rect:nth-of-type(4), [data-skin="automaton"] #box > rect:nth-of-type(5) { fill: #5a3f0e; }

/* what the machine says stands on a painted board with a brass edge; it has no size until there are words */
[data-skin="automaton"] #purse:not(:empty) { background: #efe2c8; color: #2a0a14; border-radius: 1px;
  box-shadow: 0 0 0 6px #efe2c8, 0 0 0 8px #5a3f0e, 0 0 0 10px #c9a24b, 0 8px 16px #000a; }
[data-skin="automaton"] #purse a { color: #0f5a50; }
/* the prototype tag is a painted board too */
[data-skin="automaton"] #proto-tag { background: linear-gradient(180deg, #fff6dc, #efe2c8); border-left-color: #b3123f; box-shadow: 0 0 0 2px #c9a24b, 0 3px 8px #0009; }

/* the doors: enamelled cabinet doors in brass frames; the flickering one keeps its own light */
[data-skin="automaton"] .door.small { border-color: #c9a24b; box-shadow: 0 0 0 2px #3a2a0c, inset 0 0 0 2px #ffe9a833, 0 8px 18px #0009; }
[data-skin="automaton"] .door.small:not(.snowy):not(.other) { background: linear-gradient(180deg, #b3123f, #6e0d26); }
[data-skin="automaton"] .door.small.other { background: linear-gradient(180deg, #1f8a7a, #0f3a30); }
[data-skin="automaton"] .door.small:not(.snowy):hover, [data-skin="automaton"] .door.small:not(.snowy):focus-visible { box-shadow: 0 0 0 2px #3a2a0c, 0 0 28px #ffd977aa; }

/* THE GIFT SHOP. It has no page of its own: it is the bell on the counter inside the purse and the counter the bell opens
   (purse.js), carried onto every page. On a page wearing this skin the bell glows and the counter is an enamelled tin
   panel in a riveted brass rail with its own row of bulbs, and the things on it hang on little tin tags. */
[data-skin="automaton"] .cp-bell { filter: drop-shadow(0 3px 3px #000a) drop-shadow(0 0 7px #ffd977aa); }
[data-skin="automaton"] .cp-shopbox { background-color: #1f4d44; border: 3px solid #5a3f0e;
  background-image: radial-gradient(22px 12px at calc(100% - 18px) calc(100% - 10px), #8d8794 0 58%, #3a3540 60% 70%, transparent 74%), linear-gradient(135deg, #ffffff1f, transparent 45%, #00000033);
  box-shadow: 0 0 0 3px #c9a24b, 0 0 0 5px #3a2a0c, 0 18px 40px #000c; }
[data-skin="automaton"] .cp-shopbox::before { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background:
    radial-gradient(circle, #fff3c4 0 1.4px, #5a3f0e 1.8px, transparent 2.6px) 14px 0 / 28px 6px repeat-x,
    radial-gradient(circle, #fff3c4 0 1.4px, #5a3f0e 1.8px, transparent 2.6px) 14px 100% / 28px 6px repeat-x,
    radial-gradient(circle, #fff3c4 0 1.4px, #5a3f0e 1.8px, transparent 2.6px) 0 14px / 6px 28px repeat-y,
    radial-gradient(circle, #fff3c4 0 1.4px, #5a3f0e 1.8px, transparent 2.6px) 100% 14px / 6px 28px repeat-y; }
[data-skin="automaton"] .cp-shopbox::after { content: ""; position: absolute; left: 16px; right: 52px; top: 16px; height: 12px; pointer-events: none;
  background:
    radial-gradient(circle, #fff8dc 0 2.6px, #ffd977 3.4px, #ffb84a66 5.5px, transparent 7px) 0 0 / 30px 12px repeat-x,
    radial-gradient(circle, #e0b35a 0 2.4px, #7a5a17 3px, transparent 3.8px) 15px 0 / 30px 12px repeat-x,
    linear-gradient(#6d5119, #6d5119) 0 100% / 100% 2px no-repeat;
  animation: auto-chase 1.4s steps(1) infinite; }
[data-skin="automaton"] .cp-ware { background: linear-gradient(180deg, #fff6dc, #efe2c8); border: 2px solid #5a3f0e; box-shadow: 0 0 0 1.5px #c9a24b, inset 0 0 0 2px #ffffff66, 0 4px 8px #0008; }
[data-skin="automaton"] .cp-ware::before { content: ""; position: absolute; left: 5px; top: 5px; width: 4px; height: 4px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff3c4, #6d5119); box-shadow: 54px 0 0 #a07f2c; pointer-events: none; }
[data-skin="automaton"] .cp-ware i { color: #8e1b2a; }
[data-skin="automaton"] .cp-shopbox .cp-x { background: radial-gradient(circle at 35% 30%, #ffe9a8, #c9a24b 60%, #7c5f1f); border-color: #3a2a0c; color: #2a1a02; }

@media (prefers-reduced-motion: reduce) {
  [data-skin="automaton"] .works::after, [data-skin="automaton"] .cp-shopbox::after, [data-skin="automaton"] main::after { animation: none; }
}
