/* The Night Keeper: one wall of the glasshouse, seen from inside.
   The gutters are cast-iron glazing bars; every panel is a pane of old glass. */

@property --frost {
  syntax: '<number>';
  inherits: true;
  initial-value: 0;
}

/* A small extra reach of frost while a choice is weighed: a held breath. */
@property --nudge {
  syntax: '<number>';
  inherits: true;
  initial-value: 0;
}

:root {
  --iron: color-mix(in srgb, var(--ak-bg) 30%, #000);
  --iron-edge: color-mix(in srgb, var(--ak-outline) 70%, #000);
  --rivet: color-mix(in srgb, var(--ak-accent-2) 45%, var(--iron));
  --bar: 7px;
  --glass: color-mix(in srgb, var(--ak-bg) 38%, transparent);
  --paper-shadow: 0 6px 14px rgba(0, 0, 0, 0.55);
  --tack: radial-gradient(circle at 38% 35%, var(--ak-accent-2) 0 30%, color-mix(in srgb, var(--ak-accent-2) 55%, #000) 70%);
  --ice: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120' viewBox='0 0 120 120'%3E%3Cg fill='none' stroke='%23E6E2D3' stroke-width='1.3' stroke-linecap='round'%3E%3Cpath d='M4 116C30 90 52 70 70 40C80 24 92 14 112 6'/%3E%3Cpath d='M22 98l-10-14M22 98l14 4M38 84l-8-16M38 84l16 2M52 70l-4-16M52 70l16 0M64 52l-2-14M64 52l14-3M78 32l0-12M78 32l12-5M94 16l2-10M94 16l10-2'/%3E%3Cpath d='M8 40C20 44 30 52 36 64M14 44l-2-8M14 44l-4 6M24 50l0-8M24 50l-6 4M32 58l2-8M32 58l-7 2'/%3E%3Cpath d='M84 114C88 100 98 92 116 88M90 102l-8-4M90 102l2 8M100 94l-4-8M100 94l4 6'/%3E%3C/g%3E%3C/svg%3E");
  --ice-teal: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='76' height='76' viewBox='0 0 76 76'%3E%3Cg fill='none' stroke='%233FBFB0' stroke-width='1' stroke-linecap='round' opacity='.8'%3E%3Cpath d='M2 74C18 58 30 40 44 26C54 16 64 10 74 4'/%3E%3Cpath d='M16 60l-6-10M16 60l10 2M30 44l-4-10M30 44l10 0M44 26l-2-9M44 26l9-2M58 14l0-8M58 14l8-3'/%3E%3C/g%3E%3C/svg%3E");
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
}

body {
  min-height: 100dvh;
  padding:
    var(--ac-status-h, 72px)
    max(6px, env(safe-area-inset-right))
    max(6px, env(safe-area-inset-bottom))
    max(6px, env(safe-area-inset-left));
  background-color: var(--ak-bg);
  background-image: var(--ak-backdrop-layer, var(--ak-bg-art));
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  color: var(--ak-ink);
  font-family: var(--ak-font-body);
  overflow: hidden;
}

button { font: inherit; color: inherit; }

/* ---------- The wall: a grid of panes, iron between them ---------- */

.wall {
  --frost: 0;
  --wall-w: min(100%, 560px);
  --choice-h: min(calc((min(100dvw, 560px) - 3 * var(--bar) - 12px) / 2), 22dvh);
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr) auto var(--choice-h) auto;
  grid-template-areas:
    "scene scene"
    "cap cap"
    "a b"
    "led led";
  gap: var(--bar);
  width: var(--wall-w);
  height: calc(100dvh - var(--ac-status-h, 72px) - max(6px, env(safe-area-inset-bottom)));
  max-height: 940px;
  margin: 0 auto;
  padding: var(--bar);
  border: 2px solid var(--iron-edge);
  border-radius: var(--ak-radius);
  background-color: var(--iron);
  /* Rivets along the bars: the panes cover the dots, so only the gutters show them. */
  background-image: radial-gradient(circle, var(--rivet) 0 1.4px, transparent 1.9px);
  background-size: 16px 16px;
  background-position: 3px 3px;
  box-shadow: 0 0 0 1px #000, 0 18px 40px rgba(0, 0, 0, 0.6);
  touch-action: manipulation;
  --nudge: 0;
  transition: --frost 2.6s ease-in-out, --nudge 0.9s ease-in-out;
  -webkit-user-select: none;
  user-select: none;
}

.pane {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  border-radius: var(--ak-radius);
  background: var(--glass);
  /* Old glass: a faint wave of light across it, and the bar's own shadow on the inside edge. */
  background-image:
    linear-gradient(112deg, transparent 38%, color-mix(in srgb, var(--ak-ink) 5%, transparent) 47%, transparent 56%),
    linear-gradient(var(--glass), var(--glass));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ak-ink) 8%, transparent), inset 0 0 10px rgba(0, 0, 0, 0.55);
}

/* Frost ferns grow in from the bars. They sit under every paper card. */
.frost {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  --reach: calc((var(--frost) + var(--nudge)) * 33.4%);
  background-image: var(--ice), var(--ice-teal);
  background-size: 120px 120px, 76px 76px;
  background-position: 0 0, 34px 46px;
  box-shadow: inset 0 0 calc(var(--frost) * 46px) calc(var(--frost) * 12px) color-mix(in srgb, var(--ak-ink) 42%, transparent);
  -webkit-mask-image:
    linear-gradient(to right, #000, transparent var(--reach)),
    linear-gradient(to left, #000, transparent var(--reach)),
    linear-gradient(to bottom, #000, transparent var(--reach)),
    linear-gradient(to top, #000, transparent var(--reach));
  mask-image:
    linear-gradient(to right, #000, transparent var(--reach)),
    linear-gradient(to left, #000, transparent var(--reach)),
    linear-gradient(to bottom, #000, transparent var(--reach)),
    linear-gradient(to top, #000, transparent var(--reach));
  opacity: calc((var(--frost) + var(--nudge)) * 0.9);
}
:root.ac-lights-up .frost { opacity: calc((var(--frost) + var(--nudge)) * 0.45); }

/* ---------- Lights up: a toggle that lives in the chrome's status bar ---------- */

#activity-chrome-status .nk-lights {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 2px;
  border-bottom: 1px solid var(--ak-outline);
  font-style: normal;
  font-variant: small-caps;
  letter-spacing: 0.1em;
  white-space: nowrap;
}
.nk-lights .flame { fill: none; }
.nk-lights[aria-pressed="true"] { color: var(--ak-accent-2); border-bottom-color: var(--ak-accent-2); }
.nk-lights[aria-pressed="true"] .flame { fill: currentColor; }

/* ---------- The scene pane ---------- */

.pane-scene {
  grid-area: scene;
  container-type: size;
  background: #000;
}

/* Wraps the painting and its props at the painting's own shape, so props stay where they belong.
   It covers the pane like object-fit: cover, framed by --px and --py like object-position. */
.scene-art {
  --px: 50%;
  --py: 60%;
  position: absolute;
  left: var(--px);
  top: var(--py);
  width: max(100cqw, calc(100cqh * 896 / 1200));
  aspect-ratio: 896 / 1200;
  translate: calc(var(--px) * -1) calc(var(--py) * -1);
  transition: filter 0.6s ease;
}
.aisle {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  filter: brightness(0.9) contrast(1.05);
}
:root.ac-lights-up .aisle { filter: brightness(1.2) contrast(1); }

.props, .props > svg {
  position: absolute;
  inset: 0;
}
.props svg { width: 100%; height: 100%; display: block; overflow: visible; }
.props img { position: absolute; display: block; height: auto; }

/* The logo, pinned small in the scene pane's corner like a gate plate. */
.logo {
  position: absolute;
  top: 6px;
  left: 6px;
  z-index: 3;
  display: block;
  height: clamp(30px, 11cqh, 44px);
  width: auto;
  rotate: -2deg;
  filter: drop-shadow(0 3px 4px rgba(0, 0, 0, 0.6));
  pointer-events: none;
}

.prop-keys { right: 7%; top: 52%; width: 19%; rotate: -4deg; filter: drop-shadow(0 6px 6px rgba(0, 0, 0, 0.6)); }
.prop-keeper-far { left: 50%; bottom: 41%; width: 4.6%; translate: -50% 0; filter: drop-shadow(0 0 10px color-mix(in srgb, var(--ak-accent) 50%, transparent)); }
.prop-keeper-near { left: 50%; bottom: 7%; width: 16%; translate: -50% 0; filter: drop-shadow(0 10px 14px rgba(0, 0, 0, 0.7)); }
.prop-keeper-ghost { left: 50%; bottom: 41%; width: 4.6%; translate: -50% 0; opacity: 0.4; }
.prop-keys-held { left: 57.5%; top: 68%; width: 8%; rotate: -24deg; filter: drop-shadow(0 6px 6px rgba(0, 0, 0, 0.6)); }

.breath {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  opacity: 0;
  background:
    radial-gradient(ellipse 60% 45% at 50% 58%, color-mix(in srgb, var(--ak-ink) 80%, transparent), transparent 75%),
    radial-gradient(ellipse at 50% 50%, color-mix(in srgb, var(--ak-ink-muted) 75%, transparent), color-mix(in srgb, var(--ak-bg) 80%, transparent));
}

.ending-wash { opacity: 0; pointer-events: none; }
.pane-scene[data-scene="dawn"] .ending-wash,
.pane-scene[data-scene="dawn-together"] .ending-wash {
  opacity: 1;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--ak-accent-2) 55%, transparent), color-mix(in srgb, var(--ak-accent-2) 18%, transparent) 55%, transparent 80%);
  mix-blend-mode: screen;
}
.pane-scene[data-scene="haunted"] .ending-wash {
  opacity: 1;
  background: radial-gradient(ellipse at 50% 55%, transparent 25%, color-mix(in srgb, var(--ak-accent) 22%, transparent) 70%, rgba(0, 0, 0, 0.5));
}
.pane-scene[data-scene="twist"] .ending-wash {
  opacity: 1;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.35), transparent 40%, rgba(0, 0, 0, 0.4));
}

.drips { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.drips i {
  position: absolute;
  top: 0;
  width: 2px;
  height: 18%;
  border-radius: 2px;
  background: linear-gradient(180deg, transparent, color-mix(in srgb, var(--ak-ink) 70%, transparent));
  opacity: 0;
}
.drips i:nth-child(1) { left: 9%; }
.drips i:nth-child(2) { left: 27%; }
.drips i:nth-child(3) { left: 51%; }
.drips i:nth-child(4) { left: 73%; }
.drips i:nth-child(5) { left: 91%; }

/* ---------- The caption: a strip of paper pinned to the glass ---------- */

/* Above the choice panes, so the ledger strips can tuck under its paper. */
.pane-caption {
  grid-area: cap;
  z-index: 3;
  overflow: visible;
  padding: 10px 8px 8px;
}

.caption {
  position: relative;
  z-index: 2;
  padding: 19px 14px 10px;
  border: 1px solid var(--ak-outline);
  border-radius: var(--ak-radius);
  background-color: var(--ak-surface);
  /* Foxing: a few brown spots and a water stain on the paper. */
  background-image:
    radial-gradient(circle at 88% 22%, color-mix(in srgb, var(--ak-accent-2) 10%, transparent) 0 14px, transparent 15px),
    radial-gradient(circle at 6% 80%, color-mix(in srgb, var(--ak-accent-2) 8%, transparent) 0 6px, transparent 7px),
    radial-gradient(ellipse at 70% 110%, color-mix(in srgb, #000 22%, transparent), transparent 60%);
  box-shadow: var(--paper-shadow);
  rotate: -0.6deg;
  transform-origin: left center;
}
.caption::before {
  content: '';
  position: absolute;
  top: 5px;
  left: 50%;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--tack);
  box-shadow: 0 2px 3px rgba(0, 0, 0, 0.6);
  translate: -50% 0;
}

/* The hour, inked in the corner of the strip; the lines wrap around it. */
.hour {
  float: right;
  margin: 0 0 0 12px;
  padding: 0 2px;
  border-bottom: 1px solid var(--ak-outline);
  font-family: var(--ak-font-display);
  font-size: 15px;
  font-style: italic;
  line-height: 1.2;
  color: var(--ak-ink-muted);
  white-space: nowrap;
}
.lines p {
  margin: 0;
  font-size: 16px;
  line-height: 1.38;
  color: var(--ak-ink);
}
.lines p:last-child { margin-bottom: 0; }
/* A note in the margin, in the keeper's own hand: where tonight begins. Stays until the first choice. */
.note {
  margin: 0 0 4px;
  padding-left: 8px;
  border-left: 2px solid var(--ak-outline);
  font-family: var(--ak-font-display);
  font-size: 15px;
  font-style: italic;
  line-height: 1.3;
  color: var(--ak-ink-muted);
}

/* ---------- The choice panes: torn ledger strips tucked under the note ---------- */

.pane-choice {
  container-type: size;
  overflow: visible;
}
.pane-choice[data-slot="0"] { grid-area: a; }
.pane-choice[data-slot="1"] { grid-area: b; }

.choice {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.choice:focus-visible { outline: 3px solid var(--ak-focus); outline-offset: -4px; }
.choice:disabled { cursor: default; }

/* Each strip hangs from under the caption paper, across the iron bar, and is torn off at the foot. */
.strip {
  --tuck: calc(var(--bar) + 22px);
  position: absolute;
  top: calc(var(--tuck) * -1);
  left: 9%;
  right: 9%;
  bottom: 9%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(var(--tuck) + 6px) 12px 14px 22px;
  background-color: var(--ak-btn-fill);
  color: var(--ak-btn-ink);
  font-family: var(--ak-font-display);
  font-size: clamp(16px, min(12cqh, 10cqw), 23px);
  text-align: center;
  filter: drop-shadow(0 6px 6px rgba(0, 0, 0, 0.55));
  transform-origin: 50% 0;
  transition: opacity 0.6s ease, translate 0.3s ease, filter 0.3s ease;
}
.strip-ink {
  display: block;
  max-width: 100%;
  line-height: 1.45em;
  /* Ledger rules sized to the writing, so every line of ink sits on one. */
  background-image: repeating-linear-gradient(to bottom, transparent 0 calc(1.45em - 1px), color-mix(in srgb, var(--ak-ink-muted) 55%, transparent) calc(1.45em - 1px) 1.45em);
  overflow-wrap: break-word;
}

/* Two scraps, not one template: different tears, stains, margins and lean. */
.pane-choice[data-slot="0"] .strip {
  rotate: -2.2deg;
  background-image:
    linear-gradient(90deg, transparent 13px, color-mix(in srgb, var(--ak-accent) 55%, transparent) 13px 15px, transparent 15px),
    radial-gradient(circle at 82% 78%, color-mix(in srgb, var(--ak-accent-2) 70%, transparent) 0 7px, transparent 9px),
    radial-gradient(circle at 18% 30%, color-mix(in srgb, var(--ak-accent-2) 55%, transparent) 0 3px, transparent 5px),
    radial-gradient(ellipse at 100% 100%, color-mix(in srgb, var(--ak-accent-2) 80%, transparent), transparent 45%);
  clip-path: polygon(0 0, 100% 0, 100% 91%, 94% 96%, 87% 92%, 80% 99%, 71% 94%, 63% 97%, 55% 92%, 46% 98%, 38% 93%, 29% 99%, 21% 94%, 12% 97%, 5% 92%, 0 96%);
}
.pane-choice[data-slot="1"] .strip {
  rotate: 1.8deg;
  left: 10%;
  right: 7%;
  bottom: 6%;
  padding-left: 14px;
  padding-right: 22px;
  background-image:
    linear-gradient(90deg, transparent calc(100% - 15px), color-mix(in srgb, var(--ak-ink-muted) 70%, transparent) calc(100% - 15px) calc(100% - 14px), transparent calc(100% - 14px) calc(100% - 11px), color-mix(in srgb, var(--ak-ink-muted) 70%, transparent) calc(100% - 11px) calc(100% - 10px), transparent calc(100% - 10px)),
    radial-gradient(ellipse 30% 18% at 22% 84%, transparent 60%, color-mix(in srgb, var(--ak-accent-2) 90%, transparent) 64% 72%, transparent 76%),
    radial-gradient(circle at 70% 26%, color-mix(in srgb, var(--ak-accent-2) 50%, transparent) 0 4px, transparent 6px),
    linear-gradient(200deg, color-mix(in srgb, var(--ak-accent-2) 60%, transparent), transparent 40%);
  clip-path: polygon(0 0, 100% 0, 100% 78%, 96% 84%, 98% 90%, 90% 100%, 78% 95%, 66% 99%, 52% 90%, 40% 96%, 26% 88%, 14% 94%, 4% 86%, 0 90%);
}

.choice:not(:disabled):active .strip { translate: 0 3px; }
.choice.is-chosen .strip { translate: 0 5px; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.7)); }
.choice.is-passed .strip { opacity: 0.28; }

/* ---------- The last panel: one pinned card with the sealing choice ---------- */

.pane-seal {
  grid-area: a / a / a / b;
  container-type: size;
  display: none;
  place-items: center;
}
.wall.is-ended .pane-choice { display: none; }
.wall.is-ended .pane-seal { display: grid; }

.card {
  --ratio: 0.8;
  --card-h: min(100cqh - 12px, (100cqw - 12px) / var(--ratio), 300px);
  position: relative;
  z-index: 2;
  display: block;
  height: var(--card-h);
  aspect-ratio: var(--ratio);
  background: url("art/choice-card.png") center / 100% 100% no-repeat;
  color: var(--ak-btn-ink);
  font-family: var(--ak-font-display);
  font-size: clamp(15px, calc(var(--card-h) * 0.095), 24px);
  line-height: 1.12;
  text-align: center;
  filter: drop-shadow(0 7px 8px rgba(0, 0, 0, 0.6));
}
/* The hand-inked line sits on the card's printed rule, above it, never across it. */
.card-ink {
  position: absolute;
  left: 10%;
  right: 10%;
  top: 12%;
  bottom: 53%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  overflow-wrap: break-word;
}

/* ---------- The ledger: brass marks pressed into a ruled strip ---------- */

.pane-ledger {
  grid-area: led;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 4px 10px;
}
.ledger-label {
  position: relative;
  z-index: 2;
  flex: none;
  padding: 3px 8px;
  border: 1px solid var(--ak-outline);
  background: var(--ak-surface);
  color: var(--ak-ink-muted);
  font-family: var(--ak-font-display);
  font-size: 15px;
  rotate: -2deg;
}
.ticks {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 4px;
  flex: 1 1 auto;
  min-width: 0;
  height: 44px;
  overflow: hidden;
  /* The ruled ledger line the marks sit on. */
  background: linear-gradient(transparent calc(100% - 4px), color-mix(in srgb, var(--ak-accent-2) 40%, transparent) calc(100% - 4px), color-mix(in srgb, var(--ak-accent-2) 40%, transparent) calc(100% - 3px), transparent calc(100% - 3px));
}
.ticks.is-full { justify-content: flex-end; }
.tick {
  flex: none;
  width: 40px;
  height: 40px;
  display: block;
}

/* ---------- Landscape: the scene on one side, the reading on the other ---------- */

@media (orientation: landscape) {
  .wall {
    --wall-w: min(100%, 1180px);
    grid-template-columns: minmax(0, 32fr) minmax(0, 34fr) minmax(0, 34fr);
    grid-template-rows: auto minmax(0, 1fr) auto;
    grid-template-areas:
      "scene cap cap"
      "scene a b"
      "scene led led";
    max-height: 820px;
  }
  .pane-ledger { min-height: 48px; }
  .ticks { height: 40px; }
  .tick { width: 36px; height: 36px; }
  .strip { --tuck: calc(var(--bar) + 18px); font-size: clamp(16px, min(14cqh, 9cqw), 23px); padding-bottom: 10px; }
  .lines p { font-size: 15px; line-height: 1.32; }
  .caption { padding: 18px 12px 8px; }
  .pane-caption { padding: 8px 6px 6px; }
}

/* A desktop or tablet on its side: the same layout, with the scene given its due. */
@media (orientation: landscape) and (min-height: 600px) {
  .wall { grid-template-columns: minmax(0, 46fr) minmax(0, 27fr) minmax(0, 27fr); }
  .lines p { font-size: 17px; line-height: 1.4; }
  .hour { font-size: 16px; }
}

@media (orientation: portrait) and (max-height: 700px) {
  .lines p { font-size: 15px; line-height: 1.3; }
  .caption { padding: 18px 12px 8px; }
}

/* Calm fades when motion is not wanted: the swap is a plain slow fade. */
.pane-scene.is-fading .scene-art,
.caption.is-fading,
.choice.is-fading .strip { opacity: 0; }
.pane-seal .card { animation: none; }
.scene-art, .caption { transition-property: opacity, translate, filter; transition-duration: 0.6s; }

/* ---------- Motion, only when it is welcome ---------- */

@media (prefers-reduced-motion: no-preference) {
  :root:not(.ac-still) .pane-scene.is-fogging .breath { animation: nk-breath-in 0.55s ease-in forwards; }
  :root:not(.ac-still) .pane-scene.is-fogging .scene-art { filter: blur(7px); }
  :root:not(.ac-still) .pane-scene.is-clearing .breath { animation: nk-breath-out 0.75s ease-out forwards; }
  :root:not(.ac-still) .pane-scene.is-fading .scene-art { opacity: 1; }

  :root:not(.ac-still) .caption.is-turning { animation: nk-turn 0.9s ease-in-out; }
  :root:not(.ac-still) .tick.is-new { animation: nk-press 0.45s ease-out; }

  :root:not(.ac-still) .wall.is-thawing .drips i { animation: nk-drip 4.2s ease-in both; }
  :root:not(.ac-still) .wall.is-thawing .drips i:nth-child(2) { animation-delay: 0.6s; }
  :root:not(.ac-still) .wall.is-thawing .drips i:nth-child(3) { animation-delay: 1.3s; }
  :root:not(.ac-still) .wall.is-thawing .drips i:nth-child(4) { animation-delay: 0.3s; }
  :root:not(.ac-still) .wall.is-thawing .drips i:nth-child(5) { animation-delay: 1s; }

  :root:not(.ac-still) .frond { animation: nk-lean 7s ease-in-out infinite alternate; }
  :root:not(.ac-still) .lantern-glow { animation: nk-glow 5s ease-in-out infinite alternate; }
  :root:not(.ac-still) .wall.is-first .choice:not(:disabled) .strip { animation: nk-invite 3.2s ease-in-out infinite alternate; }

  /* Weighing a choice: the frost leans in a little. Pressing one: it draws a held breath. */
  :root:not(.ac-still) .wall.is-weighing { --nudge: 0.07; }
  :root:not(.ac-still) .wall.is-pressing { animation: nk-held 1.1s ease-in-out; }
  :root:not(.ac-still) .wall.is-ended .pane-seal .card { animation: nk-settle 0.9s ease-out both; }
  @keyframes nk-held { 0% { --nudge: 0.07; } 35% { --nudge: 0.16; } 100% { --nudge: 0; } }
  @keyframes nk-settle { from { opacity: 0; translate: 0 -8px; } to { opacity: 1; translate: 0 0; } }

  @keyframes nk-breath-in { from { opacity: 0; } to { opacity: 0.95; } }
  @keyframes nk-breath-out { from { opacity: 0.95; } to { opacity: 0; } }
  /* A flat page turn: the paper narrows to its left edge and opens again. No tilt. */
  @keyframes nk-turn {
    0% { transform: scaleX(1); }
    48% { transform: scaleX(0.02); }
    52% { transform: scaleX(0.02); }
    100% { transform: scaleX(1); }
  }
  @keyframes nk-press { from { opacity: 0; transform: translateY(-6px) scale(1.12); } to { opacity: 1; transform: none; } }
  @keyframes nk-drip {
    0% { opacity: 0; transform: translateY(-20%); }
    25% { opacity: 0.8; }
    100% { opacity: 0; transform: translateY(380%); }
  }
  @keyframes nk-lean { from { rotate: 0deg; } to { rotate: var(--lean, 4deg); } }
  @keyframes nk-glow { from { opacity: 0.55; } to { opacity: 0.9; } }
  @keyframes nk-invite {
    from { filter: drop-shadow(0 6px 6px rgba(0, 0, 0, 0.55)); }
    to { filter: drop-shadow(0 6px 6px rgba(0, 0, 0, 0.55)) drop-shadow(0 0 10px color-mix(in srgb, var(--ak-accent-2) 45%, transparent)); }
  }
}

/* The Lights up toggle flips the lamp setting through the chrome's own sheet; this keeps that sheet out of sight. */
:root.nk-quiet #activity-chrome-settings { visibility: hidden !important; }
