/*
 * Zoey Made — the production discovery objects.
 *
 * What the five DISCOVERY-005 secrets look like: the pencil, the gear, the tiny key, the
 * paper airplane and the tiny door. One file, because they are one family — same drawing
 * grammar, same size, same hover grammar, same found mark — and because the thing that
 * differs between them is a handful of custom properties rather than a layout.
 *
 * The sixth secret is the homepage star, and it is deliberately not here. It has its own
 * artwork, its own five-sparkle celebration and its own accepted stylesheet:
 * components/easter-egg.css. DISCOVERY-005 §10 asks that it be preserved rather than
 * rebuilt.
 *
 *   components/discovery-trigger.css   the target, the control, the fallback panel
 *   components/discovery-reveal.css    the card that appears
 *   this file                          what the five objects are
 *   components/homepage.css            where the pencil, the plane and the door hide
 *   components/shop-archive.css        where the gear hides
 *   components/product-detail.css      where the key hides
 *
 * The markup is inc/discovery/objects.php:
 *
 *   <span class="zoey-discovery-object zoey-discovery-object--gear">
 *     <svg class="zoey-discovery-object__art">…</svg>
 *     <svg class="zoey-discovery-object__mark">…</svg>
 *   </span>
 *
 * The state selectors come in pairs throughout, because two controls wear the same drawing
 * and exactly one of them is ever in the page: a `<summary>` before this page's JavaScript
 * arrives and if it never does, and a `<button>` once there is a reveal for it to open.
 * `[open]` is the disclosure's; `.is-open`, `.is-celebrating` and `.is-found` are the
 * button's.
 */

/* --- The family ------------------------------------------------------------------- */

/*
 * One size for all five, and it is the star's.
 *
 * DISCOVERY-005 §50 is the reason it does not vary by difficulty: a deeper secret may not be
 * smaller, fainter or harder to hit than an easier one. Difficulty comes from where a thing
 * hides — which is each route's stylesheet, not this one. The 2.75rem target around the
 * drawing belongs to components/discovery-trigger.css and is the same for every secret on
 * the site.
 */
.zoey-discovery-object {
  --zoey-discovery-object-size: 1.5rem;

  position: relative;
  display: inline-flex;
}

/*
 * The block wrapper. It hugs its drawing so that a route placing a secret is positioning a
 * control rather than a full-width box.
 */
.zoey-discovery-object-slot {
  display: inline-block;
}

/*
 * Line, fill and accent, named once.
 *
 * Ink Soft rather than Ink for the linework, uniformly across the family. DISCOVERY-002
 * measures Ink, Ink Soft and Zoey Purple as the palette's entire supply of line colour that
 * clears the 3:1 WCAG asks of a non-text indicator, and Ink Soft is 5.38:1 on white — well
 * clear of it, and quiet enough that five small objects placed around the site read as
 * details somebody drew rather than as five buttons. Pastel fills; it never draws.
 *
 * This is a family choice and not a difficulty mechanic: all five use the same line at the
 * same weight, so §50 holds. The star keeps its own Lavender-to-Yellow language, which is
 * accepted work.
 */
.zoey-discovery-object__art {
  --zoey-discovery-object-line: var(--wp--preset--color--ink-soft);
  --zoey-discovery-object-fill: var(--wp--preset--color--zoey-lavender);
  --zoey-discovery-object-accent: var(--wp--preset--color--zoey-purple);

  /*
   * The three transform channels, composed in one place so a state can set one of them
   * without having to restate the other two. Lift and angle belong to particular objects —
   * a plane tilts, a gear turns — and the scale is the family's shared hover response.
   */
  --zoey-discovery-object-lift: 0;
  --zoey-discovery-object-angle: 0deg;
  --zoey-discovery-object-scale: 1;

  inline-size: var(--zoey-discovery-object-size);
  block-size: var(--zoey-discovery-object-size);
  transform: translateY(var(--zoey-discovery-object-lift)) rotate(var(--zoey-discovery-object-angle))
    scale(var(--zoey-discovery-object-scale));
  transition: transform 180ms ease;
}

/*
 * Every path is classed rather than coloured, so the whole family answers to four rules and
 * forced colors has one place to override. 1.6 and round joins are the grammar the theme's
 * existing marks are drawn in — see assets/svg/.
 */
.zoey-discovery-object__fill {
  fill: var(--zoey-discovery-object-fill);
  stroke: var(--zoey-discovery-object-line);
  stroke-width: 1.6;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.zoey-discovery-object__line {
  fill: none;
  stroke: var(--zoey-discovery-object-line);
  stroke-width: 1.6;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.zoey-discovery-object__accent,
.zoey-discovery-object__tip,
.zoey-discovery-object__hub {
  fill: var(--zoey-discovery-object-accent);
  stroke: none;
}

/*
 * The hole in the key's bow, painted in the colour of the band the key sits on rather than
 * punched out of the path: a real hole would be stroked on both edges, and at 24 px that
 * closes it up. The default is Surface, which is the ground of the band it is placed in;
 * a route that puts a key on a different ground sets the property.
 */
.zoey-discovery-object__hole {
  fill: var(--zoey-discovery-object-hole, var(--wp--preset--color--surface));
  stroke: none;
}

/* --- Hover ------------------------------------------------------------------------ */

/*
 * A small lift and nothing else, which is DISCOVERY-002's rule: hover suggests *there may be
 * more here*, never *this is the main button*. No pulse, no bounce, no loop, and nothing
 * that repeats on its own.
 *
 * Hover is not the discovery mechanism either — it does not exist on touch, and every one of
 * these is found by activating it.
 */
.zoey-discovery-trigger:hover .zoey-discovery-object__art {
  --zoey-discovery-object-scale: 1.12;
  --zoey-discovery-object-angle: var(--zoey-discovery-object-hover-angle, 0deg);
  --zoey-discovery-object-lift: var(--zoey-discovery-object-hover-lift, 0);
}

/* --- The moment ------------------------------------------------------------------- */

/*
 * The moment of discovery as opposed to the fact of it: a third of a second, over long
 * before the card dismisses itself, and played on *every* activation because it is the
 * control acknowledging that it was pressed. The star does the same thing with the same
 * curve — one family, one press.
 *
 * It plays on the box rather than on the drawing inside it, so that the pop and whatever
 * resting angle a found object has settled at are two transforms on two elements instead of
 * one property fighting itself. A found gear pressed again pops from where it is standing.
 */
.zoey-discovery-fallback[open] .zoey-discovery-object,
.zoey-discovery-trigger.is-open .zoey-discovery-object {
  animation: zoey-discovery-object-pop 320ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes zoey-discovery-object-pop {
  0% {
    transform: scale(1);
  }

  35% {
    transform: scale(1.3) rotate(-6deg);
  }

  100% {
    transform: scale(1);
  }
}

/* --- Found ------------------------------------------------------------------------ */

/*
 * §61 asks that all six discoveries feel like one system once they have been found, and §62
 * allows small per-object customisation on top of that. The shared half is a small drawn
 * tick that was not there before, plus a hover that stops responding as eagerly because
 * there is less left to find. The per-object half is two settle transforms, below.
 *
 * A *shape* rather than a hue, for the arithmetic DISCOVERY-002 §2 records: two pastels can
 * be 1.16:1 against each other, so a state told in colour alone reads for someone who sees
 * both and reads as nothing at all for someone who does not.
 *
 * `display` rather than `opacity`, because a mark that is only transparent is still a mark —
 * and in forced colors it would be a solid one.
 *
 * What found state is still not: greyed out, a giant checkmark, the word FOUND written over
 * the object, or anything that turns the page into a checklist. The object stays an object,
 * stays visible and stays activatable (§63).
 */
.zoey-discovery-object__mark {
  position: absolute;
  display: none;
  inline-size: 0.7rem;
  block-size: 0.7rem;
  overflow: visible;
  fill: none;
  stroke: var(--wp--preset--color--zoey-purple);
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.zoey-discovery-fallback[open] .zoey-discovery-object__mark,
.zoey-discovery-trigger.is-found .zoey-discovery-object__mark {
  display: block;
}

.zoey-discovery-fallback[open] .zoey-discovery-object__art,
.zoey-discovery-trigger.is-found .zoey-discovery-object__art {
  --zoey-discovery-object-angle: var(--zoey-discovery-object-found-angle, 0deg);
}

.zoey-discovery-trigger.is-found:hover .zoey-discovery-object__art {
  --zoey-discovery-object-scale: 1.05;
  --zoey-discovery-object-angle: var(--zoey-discovery-object-found-angle, 0deg);
  --zoey-discovery-object-lift: 0;
}

/* --- The pencil ------------------------------------------------------------------- */

/*
 * Bubble's canonical yellow pencil (§16), and the only object in the family whose accent is
 * its own linework: the graphite point is drawn in the line colour rather than a brand hue,
 * because a yellow pencil with a purple tip is a different pencil.
 *
 * Its found mark sits at the point, where it reads as the short line the pencil has just
 * finished drawing — §62's "tiny finished pencil line", got for the price of two offsets.
 */
.zoey-discovery-object--pencil .zoey-discovery-object__art {
  --zoey-discovery-object-fill: var(--wp--preset--color--zoey-yellow);
  --zoey-discovery-object-accent: var(--wp--preset--color--ink-soft);
}

.zoey-discovery-object--pencil .zoey-discovery-object__mark {
  inset-block-end: -0.1rem;
  inset-inline-start: -0.2rem;
}

/* --- The gear --------------------------------------------------------------------- */

/*
 * §21: soft purple structure, an aqua hub, slight dimensionality, and no continuous
 * rotation. The one-time nudge the story allows is the hover angle — a gear that turns a
 * little when a cursor reaches it and stops there. Nothing idles.
 *
 * Found settles it by 22.5 degrees, which is half a tooth: the gear ends up aligned the
 * other way round, so the change reads as a mechanism that has moved rather than as an icon
 * that has been rotated at random (§23).
 */
.zoey-discovery-object--gear .zoey-discovery-object__art {
  --zoey-discovery-object-fill: var(--wp--preset--color--zoey-lavender);
  --zoey-discovery-object-accent: var(--wp--preset--color--zoey-aqua);
  --zoey-discovery-object-hover-angle: 14deg;
  --zoey-discovery-object-found-angle: 22.5deg;
}

.zoey-discovery-object--gear .zoey-discovery-object__mark {
  inset-block-start: -0.2rem;
  inset-inline-end: -0.25rem;
}

/* --- The tiny key ----------------------------------------------------------------- */

/*
 * §27: small, legible, Ink-family outline, a warm accent, and not ornate fantasy jewellery.
 * The mark lands beside the teeth, which is §62's "small drawn notch/check nearby".
 *
 * No cue and no resting angle. The absence of a cue is inc/discovery/cue.php's — a Deep secret
 * that advertises itself is not Deep — and the turn WORLD-005 gives it is a press response,
 * further down this file.
 */
.zoey-discovery-object--key .zoey-discovery-object__art {
  --zoey-discovery-object-fill: var(--wp--preset--color--zoey-yellow);
}

.zoey-discovery-object--key .zoey-discovery-object__mark {
  inset-block-end: 0.05rem;
  inset-inline-end: -0.3rem;
}

/* --- The paper airplane ----------------------------------------------------------- */

/*
 * §31: handmade first and animated second. The fill is paper rather than a brand colour, the
 * interior line is the centre fold, and the single spot of colour is the maker mark somebody
 * drew on the wing. §32 rules out anything that reads as plastic or as a toy.
 *
 * The shadow is what stops white paper on a white band from being only an outline. It is
 * written out rather than taken from the `soft` shadow preset because that preset is a 12 px
 * blur meant for a card, and a 24 px object under it has no shadow at all — it has a haze.
 *
 * §34 allows exactly this much motion before DISCOVERY-007: a static tilted object, a hover
 * lift, and a working trigger. Found settles it into a slightly flatter angle, which is
 * §62's "lands into a slightly more settled angle" — and the whole placement is chosen so
 * that a later story can turn this into a flight without moving the secret (§36).
 */
.zoey-discovery-object--plane .zoey-discovery-object__art {
  --zoey-discovery-object-fill: var(--wp--preset--color--surface);
  --zoey-discovery-object-accent: var(--wp--preset--color--zoey-pink);
  --zoey-discovery-object-hover-angle: -6deg;
  --zoey-discovery-object-hover-lift: -0.1rem;
  --zoey-discovery-object-found-angle: -4deg;

  filter: drop-shadow(0 1px 1px rgba(51, 47, 61, 0.22));
}

.zoey-discovery-object--plane .zoey-discovery-object__mark {
  inset-block-end: -0.05rem;
  inset-inline-end: -0.25rem;
}

/* --- The tiny door ---------------------------------------------------------------- */

/*
 * §42: hand-drawn rather than architectural, rounded, a tiny knob, a restrained accent and a
 * small shadow. The threshold runs past the frame on both sides so the door reads as built
 * into something rather than floating — which is also §41, and is why the homepage puts it
 * on a section boundary rather than in open space.
 *
 * No opening or closing loop (§43). The hover response is the family's small lift and
 * nothing more; the door stays shut, and §45 keeps it from going anywhere at all in this
 * story.
 *
 * Its found mark sits beside the knob (§62).
 */
.zoey-discovery-object--door .zoey-discovery-object__art {
  --zoey-discovery-object-fill: var(--wp--preset--color--zoey-lavender);
  --zoey-discovery-object-accent: var(--wp--preset--color--zoey-purple);

  filter: drop-shadow(0 1px 1px rgba(51, 47, 61, 0.16));
}

.zoey-discovery-object--door .zoey-discovery-object__mark {
  inset-block-start: 0.5rem;
  inset-inline-end: -0.3rem;
}

/* --- Forced colors ---------------------------------------------------------------- */

/*
 * The system's colours replace ours, and every silhouette has to survive that on its own.
 *
 * Each object becomes an outline: the fill goes to the canvas colour and the stroke to the
 * text colour, so the shape is drawn rather than flattened into a solid blob that has lost
 * its interior detail — a gear with no hub and a plane with no fold are not a gear and a
 * plane. The star takes the opposite decision in components/easter-egg.css, and correctly:
 * it is a silhouette with nothing inside it.
 *
 * The found mark is a stroke and survives untouched, which is exactly why found state was
 * built as a shape. Both drop shadows go: a shadow is a colour effect and forced colors has
 * no use for one.
 */
@media (forced-colors: active) {
  /*
   * The cog and the seam are hidden rather than recoloured.
   *
   * Both are atmosphere: the cog implies a mechanism and the seam implies a room, and neither
   * carries a word of what a discovery means — the reveal does. At nine pixels, a second
   * outlined shape behind an outlined gear is noise rather than a mechanism, and light drawn in
   * CanvasText is not light. Hiding them keeps every object legible, which is what this media
   * query is for.
   *
   * **What this costs WORLD-008, and what it does not.** The cog is where the gear's
   * acknowledgement lives, so in forced colors the gear answers a repeat press with the family's
   * nudge alone. That is the same trade WORLD-004 already made for its first find — the
   * mechanism is hidden here too — and it is consistent rather than new: a shape too small to
   * outline does not survive a palette it was not drawn in.
   *
   * The seam costs nothing any more. The door's acknowledgement is a swing rather than a light
   * (see WORLD-008's section above, and WORLD-004's two rejected light-only builds), and a
   * transform is something forced colors has no opinion about — so the door keeps its own
   * gesture here, which the light-only version could not. The same is true of the key's turn and
   * the plane's dip, and the pencil's graphite is recoloured below rather than hidden. The star
   * is components/easter-egg.css's, and it does lose its glint for the same reason the seam was
   * never going to work: light is not a thing this palette can draw.
   *
   * No object loses its acknowledgement. Every one of the six still moves, and every one of the
   * six still announces.
   */
  .zoey-discovery-object__cog,
  .zoey-discovery-object__seam {
    display: none;
  }

  .zoey-discovery-object__fill {
    fill: Canvas;
    stroke: CanvasText;
  }

  .zoey-discovery-object__line {
    stroke: CanvasText;
  }

  /*
   * The graphite is recoloured rather than hidden, which is the opposite of what happened to
   * the cog and the seam above, and the difference is worth naming: those two are atmosphere —
   * a hint of a mechanism, a hint of a room — and this is the interaction itself. A pencil that
   * draws nothing when the colours are the system's has lost its press, not its polish. A line
   * in CanvasText is still a line, which is more than could be said for light in CanvasText.
   */
  .zoey-discovery-object__graphite {
    stroke: CanvasText;
  }

  .zoey-discovery-object__accent,
  .zoey-discovery-object__tip,
  .zoey-discovery-object__hub {
    fill: CanvasText;
  }

  .zoey-discovery-object__hole {
    fill: Canvas;
  }

  .zoey-discovery-object__mark {
    stroke: CanvasText;
  }

  .zoey-discovery-object--plane .zoey-discovery-object__art,
  .zoey-discovery-object--door .zoey-discovery-object__art {
    filter: none;
  }
}

/* --- WORLD-004: the gear's mechanism, and the door's light ------------------------ */

/*
 * The second cog, at rest.
 *
 * Behind the gear, dimmer than it, and doing nothing. It exists to be *noticed second* — the
 * eye finds the gear, and then finds that there is something behind the gear.
 */
.zoey-discovery-object__cog {
  fill: var(--zoey-discovery-object-accent);
  opacity: 0.5;
  transform-box: view-box;
  transform-origin: 19.4px 19.4px;
  transition: transform 320ms cubic-bezier(0.22, 0.61, 0.36, 1);
}

/*
 * The light under the door, at rest: none.
 *
 * `opacity: 0` rather than absent markup, so the cue and the press are a change of state on
 * something already there — nothing to build, nothing to clean up, and a repeat press restarts
 * an animation on an element that was always in the document.
 */
.zoey-discovery-object__seam {
  fill: var(--wp--preset--color--zoey-yellow);
  opacity: 0;
}

/*
 * The door leaf, hinged on its leading edge.
 *
 * `rotateY` rather than a flat rotation, because a door that tips is a falling door. The
 * perspective is short — 40 units against a 24-unit box — so a small angle reads as a panel
 * turning in space rather than one being squashed horizontally.
 */
.zoey-discovery-object__leaf {
  transform-box: view-box;
  transform-origin: 6px 15.4px;
}

/*
 * Pressing the gear: it steps a quarter tooth, and the cog behind it turns the other way.
 *
 * The step is expressed as the family's own `--zoey-discovery-object-angle`, so it inherits the
 * transition already declared on `__art` instead of introducing a second way to move an object.
 * 11.25deg is a quarter of the 45deg the eight-tooth ring repeats on.
 *
 * The cog turns -33.75deg — three times as far and the other way, which is what a smaller gear
 * driven by a larger one does. It is the only part of this that anybody is meant to feel rather
 * than see: the gear is not spinning, something is *driving* something.
 *
 * Paired with the no-JavaScript `[open]` state throughout, because a visitor without this
 * page's JavaScript gets the same mechanism from the same markup.
 */
.zoey-discovery-fallback[open] .zoey-discovery-object--gear .zoey-discovery-object__art,
.zoey-discovery-trigger.is-open .zoey-discovery-object--gear .zoey-discovery-object__art {
  --zoey-discovery-object-angle: 11.25deg;
}

.zoey-discovery-fallback[open] .zoey-discovery-object--gear .zoey-discovery-object__cog,
.zoey-discovery-trigger.is-open .zoey-discovery-object--gear .zoey-discovery-object__cog {
  transform: rotate(-33.75deg);
}

/*
 * Pressing the door: light spills from under it, and then it is a closed door again.
 *
 * It never opens. The animation returns to nothing rather than settling at a glow, because a
 * door that stays lit is a door that is going to have to lead somewhere.
 */
.zoey-discovery-fallback[open] .zoey-discovery-object--door .zoey-discovery-object__seam,
.zoey-discovery-trigger.is-open .zoey-discovery-object--door .zoey-discovery-object__seam {
  animation: zoey-discovery-door-spill 900ms cubic-bezier(0.22, 0.61, 0.36, 1);
}

/*
 * The 22-degree, 900ms swing that used to live here is **superseded** by the hinged peek at the
 * end of this file (SL-013, amended 2026-10-19). It is deleted rather than left to be overridden,
 * because a rule that can never win is a rule somebody will one day spend an afternoon on.
 */

@keyframes zoey-discovery-door-spill {
  0% {
    opacity: 0;
  }

  25% {
    opacity: 0.95;
  }

  100% {
    opacity: 0;
  }
}

/* --- WORLD-005: the pencil's mark, and the key's turn ----------------------------- */

/*
 * Bubble's graphite, at rest: held back.
 *
 * The same line the sketch in components/discovery-draws.css is drawn in — Ink Soft, 1.6, round
 * cap — because that is what makes this read as the same pencil rather than as a second one.
 * It is stated here rather than inherited from `__line`, since a mark the pencil *makes* is not
 * part of the pencil, and the day the family's linework changes colour the graphite should not
 * follow it.
 *
 * Hidden by `stroke-dashoffset` rather than by `display` or `opacity`, because the press is a
 * drawing and a drawing has a direction. An opacity fade would put the whole mark there at once
 * and take it away again, which is a mark appearing; this uncovers it from the point outwards,
 * which is a mark being drawn.
 *
 * 100 is `pathLength`, set in the markup, so these numbers are percentages of the curve rather
 * than measurements of it.
 *
 * **`100 200` and `101`, and neither number is a rounding margin.** A round cap on a dash
 * boundary is drawn as a half-dot, so a pencil that had drawn nothing had a stray graphite speck
 * under its point — at rest, on the homepage. `stroke-dasharray: 100` alone repeats every 200
 * units, which means hiding the near end of the mark by one unit of overshoot only walked the
 * speck round to the far end: the *next* dash in the pattern arrived on the path from the other
 * side. A 200-unit gap is longer than the 100-unit path, so there is no next dash to arrive, and
 * the one unit of offset keeps the cap of the one that matters off the end where nothing renders
 * it.
 *
 * Both were found by rendering the object rather than by reading the rule, which is this epic's
 * standing lesson about 24-pixel geometry (WORLD-004, defect 3).
 */
.zoey-discovery-object__graphite {
  fill: none;
  stroke: var(--wp--preset--color--ink-soft);
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 100 200;
  stroke-dashoffset: 101;
}

/*
 * Pressing the pencil: it draws, once.
 *
 * **The stroke is finished in 250ms**, which is the acceptance criterion rather than a taste:
 * a thumb on a phone is down for roughly a quarter of a second, and a mark still being drawn
 * when the thumb lifts is a mark the visitor never saw made. The rest of the 900ms is the mark
 * simply being there, and then going.
 *
 * It goes the way the door's light goes, and for the same reason: the object returns to its
 * resting state, because every one of these may be pressed again and none of them may
 * accumulate. A mark that stayed would also be a found state, and found state belongs to
 * WORLD-008.
 *
 * One stroke and no more. There is no second mark, no flourish after it, and nothing that
 * repeats — the stroke is the whole of the interaction, and the reveal is what it was for.
 */
.zoey-discovery-fallback[open] .zoey-discovery-object--pencil .zoey-discovery-object__graphite,
.zoey-discovery-trigger.is-open .zoey-discovery-object--pencil .zoey-discovery-object__graphite {
  animation: zoey-discovery-pencil-mark 900ms linear;
}

@keyframes zoey-discovery-pencil-mark {
  0% {
    stroke-dashoffset: 101;
    opacity: 1;
    animation-timing-function: cubic-bezier(0.3, 0.7, 0.4, 1);
  }

  28% {
    stroke-dashoffset: 0;
    opacity: 1;
  }

  72% {
    stroke-dashoffset: 0;
    opacity: 1;
  }

  100% {
    stroke-dashoffset: 0;
    opacity: 0;
  }
}

/*
 * Pressing the key: it turns, and nothing happens.
 *
 * 45 degrees about the middle of the drawing, expressed as the family's own
 * `--zoey-discovery-object-angle` so it composes with the hover scale and inherits a transition
 * that already exists — the same way WORLD-004 moved the gear, rather than a second mechanism
 * for the same verb.
 *
 * **Half of the quarter-turn a lock would take, and that is the design.** A key that went the
 * whole way would have thrown a bolt somewhere, and there is no bolt: it turns until it meets
 * the nothing it is turning against, and stops. It holds the angle while the card is open and
 * comes back when the card closes, which is the honest record of a key that opened nothing.
 *
 * About the centre rather than about the bit, which is where a real key pivots, because the
 * drawing is 24 units wide and a key swung about its own tip leaves the box — the bow crosses
 * the edge before 25 degrees and is clipped. Around the centre the whole key stays inside its
 * own circle at any angle.
 *
 * 320ms and the mechanism curve, not the family's 180ms: the gear and the cog turn on this
 * timing, and a key is the same kind of object. The return is the family's 180ms, because
 * coming back is not a mechanism.
 *
 * Nothing here says what the key is *for*. The door is on another page and the relationship
 * between them is a map moment that belongs to WORLD-006 — this page must not anticipate it,
 * so the key turns toward nothing and the nothing is the point.
 */
.zoey-discovery-fallback[open] .zoey-discovery-object--key .zoey-discovery-object__art,
.zoey-discovery-trigger.is-open .zoey-discovery-object--key .zoey-discovery-object__art {
  --zoey-discovery-object-angle: 45deg;

  transition: transform 320ms cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* --- WORLD-008: the second encounter ----------------------------------------------- */

/*
 * Pressing a secret that has already been found.
 *
 * `.is-acknowledging` on the scope, put there by assets/js/discovery-reveal.js for as long as
 * the acknowledgement stands. On the *scope* and not on the control, because three of these
 * five move something that is not the object — the cog behind the gear, the light under the
 * door, the graphite the pencil puts on the page — and the scope is the one element that is an
 * ancestor of all of them. `is-cueing` in components/discovery-cue.css sits at the same level
 * for the same reason, and the two can never be on at once: WORLD-003 locked the rule that a
 * found object never cues, and nothing here is reachable until an object is found.
 *
 * ## What makes a repeat a repeat
 *
 * Not these rules. Every first-find interaction in this file is keyed on `.is-open` — the card
 * being on screen — and a repeat opens no card, so WORLD-004's mechanisms and WORLD-005's mark
 * and turn are out of reach before a single declaration below is read. The design question
 * WORLD-008 actually poses is what to put in the space that leaves, and the answer is *less of
 * the same object*: each acknowledgement is the quieter relative of that object's own
 * interaction rather than a new gesture it has never made.
 *
 *     star      it catches the light, and does not sparkle          easter-egg.css
 *     pencil    it leaves a tick, not the whole mark
 *     gear      the cog answers, and the gear itself holds still
 *     door      it cracks, less far
 *     key       it turns a little way and comes back
 *     plane     it dips a wing, and does not fly
 *
 * The gear is the one that says something by *not* moving, and it is deliberate: it holds its
 * found angle because that angle is where the mechanism got to, and stepping it again on every
 * press would be progress — the one thing a repeat may never look like. Only the cog answers.
 *
 * Nothing here accumulates and nothing here settles. Every animation returns the object to
 * exactly the rest it was at, because a repeat leaves no trace — not on the page and not in
 * storage.
 *
 * Written after the found and hover rules above rather than folded into them, so the cascade
 * decides this on source order: `.zoey-discovery.is-acknowledging` and
 * `.zoey-discovery-trigger.is-found:hover` are the same specificity, and a found object pressed
 * under a cursor must acknowledge rather than sit at its hover state.
 */

/*
 * The family's half: the press response every object shares, at lower volume.
 *
 * The same curve and the same gesture as the pop a first find plays — 1.12 against 1.3, three
 * degrees against six, 260ms against 320 — because it has to read as the same object answering
 * rather than as a different one. It plays on the box, so an object that has settled at a found
 * angle answers from where it is standing rather than snapping back to square first.
 */
.zoey-discovery.is-acknowledging .zoey-discovery-object {
  animation: zoey-discovery-object-nudge 260ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes zoey-discovery-object-nudge {
  0%,
  100% {
    transform: scale(1);
  }

  40% {
    transform: scale(1.12) rotate(-3deg);
  }
}

/*
 * The pencil: a tick rather than the mark.
 *
 * The same graphite along the same curve, stopped a quarter of the way along — 26 of the
 * `pathLength="100"` units the stroke is measured in. A first find draws the whole sweep and
 * the visitor watches it arrive; this is the pencil putting down the amount of graphite a tap
 * is worth, and then lifting.
 *
 * It fades out the way the full mark does, and for the reason WORLD-005 gave: nothing the
 * pencil draws may still be there on the next press, because six presses would otherwise be six
 * marks and a found object would slowly become a scribble.
 *
 * 74 rather than 75 carries WORLD-005's one-unit overshoot forward for the same reason it was
 * introduced — a round cap landing exactly on a dash boundary renders as a half-dot, and this
 * keeps the near cap off the end where nothing draws it.
 */
.zoey-discovery.is-acknowledging .zoey-discovery-object--pencil .zoey-discovery-object__graphite {
  animation: zoey-discovery-pencil-tick 520ms linear;
}

@keyframes zoey-discovery-pencil-tick {
  0% {
    stroke-dashoffset: 101;
    opacity: 1;
    animation-timing-function: cubic-bezier(0.3, 0.7, 0.4, 1);
  }

  32% {
    stroke-dashoffset: 74;
    opacity: 1;
  }

  70% {
    stroke-dashoffset: 74;
    opacity: 1;
  }

  100% {
    stroke-dashoffset: 74;
    opacity: 0;
  }
}

/*
 * The gear: the cog answers, and the gear does not.
 *
 * WORLD-004 made the point of this object that *something is driving something*. A first find
 * steps the gear a quarter tooth and turns the cog three times as far the other way; a repeat
 * keeps only the second half of that sentence. The mechanism is still connected — press the
 * gear and something behind it moves — but the gear itself has already arrived where it was
 * going, and a gear that stepped again on every press would be counting.
 *
 * Nine degrees and back, on the mechanism curve the cog already transitions with. It returns to
 * zero rather than settling, because the cog's resting position is part of the found state the
 * first find left.
 */
.zoey-discovery.is-acknowledging .zoey-discovery-object--gear .zoey-discovery-object__cog {
  animation: zoey-discovery-gear-twitch 420ms cubic-bezier(0.22, 0.61, 0.36, 1);
}

@keyframes zoey-discovery-gear-twitch {
  0%,
  100% {
    transform: rotate(0deg);
  }

  45% {
    transform: rotate(-9deg);
  }
}

/*
 * The door: it cracks, less far.
 *
 * Ten degrees against the first find's twenty-two, on the same hinge, returning to closed the
 * way everything else here returns to rest.
 *
 * **The light was tried here first and was the wrong answer, for a reason already on record.**
 * WORLD-004 built the door light-only — twice — and both builds were rejected on a real phone
 * because *light alone could not be read at normal viewing distance at this size*. The swing is
 * what made the door legible, and it is therefore the door's vocabulary; a repeat has to be a
 * quieter version of the thing that works rather than a revival of the thing that did not. The
 * seam stays where WORLD-004 left it, on the cue and on the first find, and takes no part in the
 * second encounter.
 *
 * The rule the swing has to keep is the amended one from the WORLD-004 physical review, and a
 * ten-degree crack keeps it comfortably: the door may crack open as atmosphere, and never
 * reveals a destination, becomes navigable, remains open, or implies that pressing it leads
 * somewhere. **It always returns closed** — both keyframes below are `rotateY(0deg)`, and
 * nothing behind the door is ever drawn.
 *
 * It also fixes something the light-only version had quietly got wrong: a transform survives
 * forced colors, and the seam does not. The door used to fall back to the family nudge alone
 * there. Now it keeps its own gesture in every colour scheme.
 */
/* The ten-degree crack is superseded too; the quieter peek at the end of this file replaces it. */

/*
 * The key: a shorter turn against the same nothing.
 *
 * WORLD-005 gave the key 45 degrees — half a lock's quarter-turn, stopping where it meets the
 * nothing it is turning against. A repeat is **22.5 degrees**, half of that, and it comes
 * straight back. The key has already learned what it opens, so it does not go looking as far.
 *
 * It was twelve degrees first, and twelve degrees could not be seen on a phone (2026-09-24
 * device review). The animation was running — that was checked rather than assumed — but a
 * quarter-turn of a quarter-turn on a 24-pixel object at arm's length is not a gesture, it is a
 * rounding error. Half is the proportion the rest of this file already uses for a repeat: the
 * family nudge is 1.12 against the pop's 1.3, and the door cracks ten against twenty-two. The
 * key was the one object where *quieter* had been taken far enough to mean *absent*.
 *
 * Folded into one animation on the box rather than added beside the family's nudge, because
 * only one animation may own an element's `transform` and the box is where the nudge lives. The
 * turn is therefore written including the nudge's scale, which also lets the key answer with a
 * single gesture instead of two that happen to overlap. `__art` and its `--angle` channel are
 * left completely alone, so the object's found state is untouched by being pressed.
 */
.zoey-discovery.is-acknowledging .zoey-discovery-object--key {
  animation: zoey-discovery-key-turn 420ms cubic-bezier(0.22, 0.61, 0.36, 1);
}

@keyframes zoey-discovery-key-turn {
  0%,
  100% {
    transform: scale(1) rotate(0deg);
  }

  45% {
    transform: scale(1.06) rotate(22.5deg);
  }
}

/*
 * The paper airplane: a wing dips, and nothing flies.
 *
 * This is the one object in the set whose first find is a performance rather than a gesture —
 * Bubble draws it, and it flies the route she drew (assets/js/discovery-draws.js). None of that
 * may happen twice, and none of it is reachable: the flight belongs to the drawing runtime,
 * which stands down for a secret that has been found. What is left is the smallest possible
 * relative of a flight — paper catching air for a moment without going anywhere.
 *
 * On the box and folded together with the nudge, for the same single-`transform` reason as the
 * key. The lift is what separates this from a rotation: a plane that only turns is an icon
 * being rotated, and a plane that rises a hair while it turns is paper.
 */
.zoey-discovery.is-acknowledging .zoey-discovery-object--plane {
  animation: zoey-discovery-plane-dip 420ms cubic-bezier(0.22, 0.61, 0.36, 1);
}

@keyframes zoey-discovery-plane-dip {
  0%,
  100% {
    transform: translateY(0) rotate(0deg) scale(1);
  }

  40% {
    transform: translateY(-0.08rem) rotate(-8deg) scale(1.06);
  }
}

/* --- Reduced motion --------------------------------------------------------------- */

/*
 * base.css already collapses every duration site-wide, so this is not what makes the
 * preference work — it is what makes the result deliberate. §79 is the requirement: no
 * discovery may need movement to be found or understood. What is left when the movement goes
 * is the whole of the meaning — the object, the card, the words, the mark, and the fact that
 * it is now found.
 *
 * The two settle angles stay, because they are a resting state rather than a motion; they
 * simply arrive without being travelled to.
 *
 * Each selector repeats the one it is switching off so the cascade decides this on source
 * order rather than on which rule happened to be written with an attribute in it. A
 * reduced-motion rule that loses on specificity is worse than none: it reads as handled.
 */
@media (prefers-reduced-motion: reduce) {
  .zoey-discovery-object__art {
    transition: none;
  }

  /*
   * WORLD-004's two mechanisms, as designed still states rather than paused ones.
   *
   * The gear still steps its quarter tooth and the cog still ends up turned — they simply
   * arrive there, the way the found angles above already do, because the *position* is the
   * meaning and the travel was only ever the pleasure. The door's spill is different: a light
   * that comes and goes is nothing but travel, so it does not happen at all, and the door is
   * found without it.
   */
  .zoey-discovery-object__cog {
    transition: none;
  }

  /*
   * The seam is light and goes; the **leaf stays**, and that is a change from this block's first
   * version. A transform is geometry, which a forced palette does not take away, and the door
   * visibly opening is the whole of what this gesture says. Switching the leaf off here left the
   * door answering with nothing in the one scheme where its light cannot speak for it.
   */
  .zoey-discovery-fallback[open] .zoey-discovery-object--door .zoey-discovery-object__seam,
  .zoey-discovery-trigger.is-open .zoey-discovery-object--door .zoey-discovery-object__seam {
    animation: none;
  }

  /*
   * WORLD-005's two, on the same principle: what is a position keeps its position, and what is
   * only travel does not happen.
   *
   * The pencil's mark is the interesting one, because it is *both*. The drawing is travel; the
   * mark is a position. So the mark is there — whole, from the moment the pencil is pressed —
   * and nobody watches it arrive, which is WORLD-002 §9.2's "present from the start rather than
   * drawn" said in two declarations. The opacity tail goes with the animation, so the mark
   * stays for as long as the press does instead of fading on a timer.
   *
   * The key keeps its 45 degrees and simply is at them. Both selectors repeat the press rules
   * they are switching off in full: the press rules carry a modifier and two class levels, and
   * `.zoey-discovery-object__art { transition: none }` at the top of this block does not reach
   * the key's 320ms on its own. A reduced-motion rule that loses on specificity is worse than
   * none, because it reads as handled.
   */
  .zoey-discovery-fallback[open] .zoey-discovery-object--pencil .zoey-discovery-object__graphite,
  .zoey-discovery-trigger.is-open .zoey-discovery-object--pencil .zoey-discovery-object__graphite {
    stroke-dashoffset: 0;
    opacity: 1;
    animation: none;
  }

  .zoey-discovery-fallback[open] .zoey-discovery-object--key .zoey-discovery-object__art,
  .zoey-discovery-trigger.is-open .zoey-discovery-object--key .zoey-discovery-object__art {
    transition: none;
  }

  .zoey-discovery-fallback[open] .zoey-discovery-object,
  .zoey-discovery-trigger.is-open .zoey-discovery-object {
    animation: none;
  }

  .zoey-discovery-trigger:hover .zoey-discovery-object__art,
  .zoey-discovery-trigger.is-found:hover .zoey-discovery-object__art {
    --zoey-discovery-object-scale: 1;
    --zoey-discovery-object-lift: 0;
    --zoey-discovery-object-angle: 0deg;
  }

  /*
   * Restated after the hover rules above, and not folded into them: a found object keeps its
   * settled angle whether or not a cursor is on it, and an unfound one must not borrow that
   * angle on hover just because the property exists on the same element.
   */
  .zoey-discovery-fallback[open] .zoey-discovery-object__art,
  .zoey-discovery-trigger.is-found .zoey-discovery-object__art,
  .zoey-discovery-trigger.is-found:hover .zoey-discovery-object__art {
    --zoey-discovery-object-angle: var(--zoey-discovery-object-found-angle, 0deg);
  }

  /*
   * WORLD-008's acknowledgements: none of them happen, and that is the design rather than a
   * gap in it.
   *
   * The rule this file has applied twice already is *what is a position keeps its position, and
   * what is only travel does not happen*. A repeat is travel and nothing but travel: it exists
   * precisely so that nothing is left behind, so every one of these returns the object to the
   * rest it started at, and there is no position at the end for anybody to arrive at instead.
   * Collapsing them to a single frame the way base.css does would be six objects flinching, not
   * six objects answering.
   *
   * Which is the reason WORLD-008 §2 makes the nonvisual half *required* rather than a courtesy.
   * For a visitor who has asked for less motion the announcement in the discovery's status
   * region is not a fallback for the acknowledgement — it is the whole acknowledgement, and it
   * is the same one every other visitor gets. Nothing about a repeat is withheld here; only the
   * motion is, and the motion was never where the meaning was.
   *
   * Each selector is repeated in full rather than relying on the block above, for this file's
   * standing reason: a reduced-motion rule that loses on specificity is worse than none, because
   * it reads as handled.
   */
  .zoey-discovery.is-acknowledging .zoey-discovery-object,
  .zoey-discovery.is-acknowledging .zoey-discovery-object--key,
  .zoey-discovery.is-acknowledging .zoey-discovery-object--plane,
  .zoey-discovery.is-acknowledging .zoey-discovery-object--pencil .zoey-discovery-object__graphite,
  .zoey-discovery.is-acknowledging .zoey-discovery-object--gear .zoey-discovery-object__cog,
  .zoey-discovery.is-acknowledging .zoey-discovery-object--door .zoey-discovery-object__leaf {
    animation: none;
  }
}

/* --- The painted artwork (SL-013) -------------------------------------------------- */

/*
 * Three of the six secrets have artwork of their own: the star, the tiny door and the paper
 * plane. It is painted, it arrives as an `<image>` inside the same 24-unit box the family has
 * always drawn in, and it is the **resting representation** — what a visitor sees.
 *
 * The drawn version is not replaced. It is layered underneath and hidden, and it comes back in
 * the two modes where a painting cannot do the job:
 *
 *   forced colours      a raster carries no meaning the OS can repaint, and the third SVG rule
 *                       in docs/CSS-AND-ASSETS.md exists for exactly this: a shape whose
 *                       meaning depends on being recognised has to be real fill and stroke.
 *   no derivative       answered in PHP, where the file's existence is knowable. No `<image>`
 *                       is emitted, `--painted` is absent, and these rules never apply.
 *
 * The pencil, the gear and the key have no artwork and are untouched by any of this — their
 * drawing *is* the thing, and `--painted` is never on them.
 */
.zoey-discovery-object--painted .zoey-discovery-object__native,
.zoey-easter-egg__star--painted .zoey-easter-egg__native {
  display: none;
}

/*
 * The painted leaf swings on the hinge the artwork actually has, not the one the drawing had.
 *
 * (7.23, 13.13) is the leading edge at the panel's vertical middle, measured out of the master
 * by scripts/dev/sl-013-artwork.py. The drawn door's 6px 15.4px is left in place above for the
 * drawn door, because the two silhouettes are not the same shape and one origin cannot be
 * right for both.
 */
.zoey-discovery-object__raster--leaf {
  transform-origin: 7.23px 13.13px;
}

/*
 * ## The light behind the door
 *
 * Confined by geometry rather than by trust. The rect is clipped to the opening's own arch, so
 * it cannot reach the frame, the vines or the threshold; and it is scaled from its free edge,
 * so at rest it has no width at all and can only appear in the strip the leaf has vacated.
 *
 * This is the second of two independent guards. The first is that the leaf is solid — the
 * derivation script refuses to write a leaf with transparent interior pixels — and the reason
 * for having both is that the first one failing is precisely the defect Product caught at
 * ~280ms, where warm light came through the plank gaps and the knob ring as holes in the
 * artwork. A guard that depends on the artwork being opaque is not a guard; the master is
 * feathered and its leaf edge is genuinely translucent.
 *
 * Deliberately not here: a recolour, a blur, or a glow over the top. Each hides the symptom.
 */
.zoey-discovery-object__glow {
  fill: var(--wp--preset--color--zoey-yellow);
  transform-box: fill-box;
  transform-origin: right center;
  transform: scaleX(0);
  opacity: 0;
}

/*
 * The threshold gap — the sliver under the leaf, across the opening and no further. A door with
 * light behind it has this whether or not it is open, which is why it fades rather than scales.
 */
.zoey-discovery-object__threshold {
  fill: var(--wp--preset--color--zoey-yellow);
  opacity: 0;
}

@media (forced-colors: active) {
  /*
   * The painting goes and the drawing returns, which is the whole point of keeping it. The
   * synthesised light goes with it: it is atmosphere, and atmosphere in a forced palette is
   * just a block of Highlight sitting over the shape a visitor needs to recognise.
   */
  .zoey-discovery-object__raster,
  .zoey-discovery-object__glow,
  .zoey-discovery-object__threshold {
    display: none;
  }

  .zoey-discovery-object--painted .zoey-discovery-object__native,
  .zoey-easter-egg__star--painted .zoey-easter-egg__native {
    display: block;
  }
}

/* --- The door's hinged peek (SL-013, amended 2026-10-19) --------------------------- */

/*
 * ## Why the door stopped sharing the family's gesture
 *
 * Every secret in this file answers a press with the same two movements: `object-pop` on a first
 * find and `object-nudge` on a repeat, both of them a scale and a small rotation of the **whole
 * object**. That is exactly right for the star — it is a thing lying in the scenery, and a thing
 * can be picked up and turned.
 *
 * A doorway cannot. Its frame, its vines and its threshold are built into the workshop, and a
 * door whose frame scales is a sticker of a door. The amendment's word is that the family gesture
 * "feels wrong for the door", and the reason it feels wrong is that it is describing the wrong
 * kind of object.
 *
 * So the door opts out of both, and answers with the one movement a door has.
 */
.zoey-discovery-trigger.is-open .zoey-discovery-object--door,
.zoey-discovery-fallback[open] .zoey-discovery-object--door,
.zoey-discovery.is-acknowledging .zoey-discovery-object--door {
  animation: none;
}

/*
 * ## The peek
 *
 * Open, hold, ease shut, over 1150ms. The three parts are deliberately uneven: the opening is
 * quick because a door that opens slowly is being opened *by* something, the hold is the part
 * that is actually being looked at, and the close is the longest because the swing has to die
 * away rather than snap.
 *
 * **35 degrees**, the top of the amendment's 25-35 band, chosen against the painted result at
 * phone size rather than off a protractor. Measured on the 86px phone door, whose leaf is 40.8
 * CSS px wide, by hiding the leaf and differencing to find exactly where it paints:
 *
 *     25 deg   leaf narrows to 34.2px   vacating  6.5px   16.0% of the leaf
 *     30 deg   leaf narrows to 32.2px   vacating  8.5px   20.9%
 *     35 deg   leaf narrows to 29.8px   vacating 11.0px   27.0%
 *
 * The amendment's instruction is to increase the opening before adding any other effect if it
 * reads too subtly, and 30 did: 8.5px of warm light on an 86px door is present without being the
 * point. At 35 the leaf visibly loses a quarter of its width and the opening is unmistakable.
 * The hinge edge does not move at any of them — measured at x 31.5 in all four frames, which is
 * what "opening from the left hinge" has to mean.
 *
 * The previous first-find swing was 22 degrees over 900ms, which read as a twitch at this size.
 *
 * Only `__leaf` is named, and `__leaf` is only ever the purple panel and its knob — the raster
 * leaf layer and the drawn leaf group both carry it, and neither contains any part of the frame.
 */
.zoey-discovery-trigger.is-open .zoey-discovery-object--door .zoey-discovery-object__leaf,
.zoey-discovery-fallback[open] .zoey-discovery-object--door .zoey-discovery-object__leaf {
  animation: zoey-discovery-door-peek 1150ms cubic-bezier(0.33, 0.9, 0.3, 1);
}

@keyframes zoey-discovery-door-peek {
  0% {
    transform: perspective(40px) rotateY(0deg);
  }

  26% {
    transform: perspective(40px) rotateY(-35deg);
  }

  62% {
    transform: perspective(40px) rotateY(-35deg);
  }

  100% {
    transform: perspective(40px) rotateY(0deg);
  }
}

/*
 * The light rides the identical timeline, so the two are one event rather than two that agree.
 *
 * `scaleX` from the free edge and clipped to the opening's arch — the same two guards the cue
 * uses, and for the same reason: at rest the light has no width at all, so it can only ever
 * appear in the strip the leaf has actually vacated.
 *
 * `0.26` is that strip and not a guess. The glow spans the opening's 9.09 units, which at the
 * phone door is 40.6 CSS px — the leaf's own width — so the scale factor and the vacated fraction
 * are the same number. 35 degrees vacates 27.0%, and the light is set a little under it so that
 * antialiasing at the leaf's edge cannot put a warm pixel on top of a plank.
 *
 * The first draft used `0.34`, which was **wider than the opening**: light over the leaf, which
 * is the exact defect this whole arrangement exists to prevent. It was wrong by eye and obvious
 * by measurement, which is the argument for measuring.
 */
.zoey-discovery-trigger.is-open .zoey-discovery-object--door .zoey-discovery-object__glow,
.zoey-discovery-fallback[open] .zoey-discovery-object--door .zoey-discovery-object__glow {
  animation: zoey-discovery-door-peek-light 1150ms cubic-bezier(0.33, 0.9, 0.3, 1);
}

.zoey-discovery-trigger.is-open .zoey-discovery-object--door .zoey-discovery-object__threshold,
.zoey-discovery-fallback[open] .zoey-discovery-object--door .zoey-discovery-object__threshold {
  animation: zoey-discovery-door-peek-sill 1150ms cubic-bezier(0.33, 0.9, 0.3, 1);
}

@keyframes zoey-discovery-door-peek-light {
  0% {
    transform: scaleX(0);
    opacity: 0;
  }

  26% {
    transform: scaleX(0.26);
    opacity: 0.95;
  }

  62% {
    transform: scaleX(0.26);
    opacity: 0.95;
  }

  100% {
    transform: scaleX(0);
    opacity: 0;
  }
}

@keyframes zoey-discovery-door-peek-sill {
  0%,
  100% {
    opacity: 0;
  }

  26%,
  62% {
    opacity: 0.8;
  }
}

/*
 * ## The repeat: the same gesture, quieter
 *
 * Half the opening and two thirds the time. Half is the proportion the rest of this file already
 * uses for a repeat — the family nudge is 1.12 against the pop's 1.3, the key turns 22.5 against
 * 45 — and it keeps the repeat recognisably the *same* door rather than a different one.
 *
 * The hold goes with it. A repeat is an acknowledgement, not a reveal; there is nothing new
 * behind the door to look at.
 */
.zoey-discovery.is-acknowledging .zoey-discovery-object--door .zoey-discovery-object__leaf {
  animation: zoey-discovery-door-peek-again 760ms cubic-bezier(0.33, 0.9, 0.3, 1);
}

.zoey-discovery.is-acknowledging .zoey-discovery-object--door .zoey-discovery-object__glow {
  animation: zoey-discovery-door-peek-again-light 760ms cubic-bezier(0.33, 0.9, 0.3, 1);
}

.zoey-discovery.is-acknowledging .zoey-discovery-object--door .zoey-discovery-object__threshold {
  animation: zoey-discovery-door-peek-again-sill 760ms cubic-bezier(0.33, 0.9, 0.3, 1);
}

@keyframes zoey-discovery-door-peek-again {
  0%,
  100% {
    transform: perspective(40px) rotateY(0deg);
  }

  34%,
  52% {
    transform: perspective(40px) rotateY(-18deg);
  }
}

@keyframes zoey-discovery-door-peek-again-light {
  0%,
  100% {
    transform: scaleX(0);
    opacity: 0;
  }

  34%,
  52% {
    transform: scaleX(0.11);
    opacity: 0.85;
  }
}

@keyframes zoey-discovery-door-peek-again-sill {
  0%,
  100% {
    opacity: 0;
  }

  34%,
  52% {
    opacity: 0.6;
  }
}

/*
 * ## The check settles with the door
 *
 * It arrives as the swing dies away rather than the instant the state changes, so the two read as
 * one moment. **This is appearance only** — `.is-found` lands when it always did, and nothing
 * about when a discovery is recorded, stored or sent anywhere is touched by a delay on an
 * `opacity` here.
 */
.zoey-discovery-trigger.is-open .zoey-discovery-object--door .zoey-discovery-object__cue::before,
.zoey-discovery-trigger.is-found .zoey-discovery-object--door .zoey-discovery-object__cue::before {
  animation: zoey-discovery-door-check-settle 420ms cubic-bezier(0.34, 1.56, 0.64, 1) 700ms backwards;
}

@keyframes zoey-discovery-door-check-settle {
  0% {
    opacity: 0;
    transform: rotate(-45deg) scale(0.4);
  }

  100% {
    opacity: 1;
    transform: rotate(-45deg) scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  /*
   * No swing, and no scale: a perspective rotation is the one thing this gesture is made of that
   * a visitor asking for less motion has asked not to see.
   *
   * What is left is the light — the doorway warming briefly and going out again. That is a
   * luminance change in a fixed box, with nothing travelling and nothing changing size, and it is
   * the "clear, brief acknowledgement without the perspective swing" the amendment asks for.
   * Without it the door is the only secret whose answer, under this preference, is nothing at all
   * that can be seen.
   *
   * The duration is restated because base.css clamps every animation site-wide to 1ms, which is
   * the right default and would otherwise collapse this to a single frame.
   */
  .zoey-discovery-trigger.is-open .zoey-discovery-object--door .zoey-discovery-object__leaf,
  .zoey-discovery-fallback[open] .zoey-discovery-object--door .zoey-discovery-object__leaf,
  .zoey-discovery.is-acknowledging .zoey-discovery-object--door .zoey-discovery-object__leaf,
  .zoey-discovery-trigger.is-open .zoey-discovery-object--door .zoey-discovery-object__cue::before,
  .zoey-discovery-trigger.is-found .zoey-discovery-object--door .zoey-discovery-object__cue::before {
    animation: none;
  }

  .zoey-discovery-trigger.is-open .zoey-discovery-object--door .zoey-discovery-object__glow,
  .zoey-discovery-fallback[open] .zoey-discovery-object--door .zoey-discovery-object__glow,
  .zoey-discovery.is-acknowledging .zoey-discovery-object--door .zoey-discovery-object__glow {
    animation: zoey-discovery-door-lamp 420ms ease-in-out !important;
    animation-duration: 420ms !important;
  }

  @keyframes zoey-discovery-door-lamp {
    0%,
    100% {
      transform: scaleX(0.34);
      opacity: 0;
    }

    40% {
      transform: scaleX(0.34);
      opacity: 0.9;
    }
  }
}

@media (forced-colors: active) {
  /*
   * The swing survives — a transform is geometry and a forced palette does not take it away — and
   * the light does not, for the same reason the cue's light does not: there is no warm in this
   * palette to be warm with, and a rectangle of `Highlight` in the doorway is a block, not a
   * glimmer. The door still visibly opens.
   */
  .zoey-discovery-trigger.is-open .zoey-discovery-object--door .zoey-discovery-object__glow,
  .zoey-discovery-fallback[open] .zoey-discovery-object--door .zoey-discovery-object__glow,
  .zoey-discovery.is-acknowledging .zoey-discovery-object--door .zoey-discovery-object__glow,
  .zoey-discovery-trigger.is-open .zoey-discovery-object--door .zoey-discovery-object__threshold,
  .zoey-discovery-fallback[open] .zoey-discovery-object--door .zoey-discovery-object__threshold,
  .zoey-discovery.is-acknowledging .zoey-discovery-object--door .zoey-discovery-object__threshold {
    animation: none;
  }
}
