/* Page 09 only, desktop dark mode: feather the opening box edges, keeping its contents sharp. */
:root[data-theme="dark"]:has(.proj) .proj .fn-bg {
  --fn-edge: clamp(18px, 2.4vw, 42px);
  -webkit-mask-image: linear-gradient(to right, transparent 0, #000 var(--fn-edge), #000 calc(100% - var(--fn-edge)), transparent 100%), linear-gradient(to bottom, transparent 0, #000 var(--fn-edge), #000 calc(100% - var(--fn-edge)), transparent 100%);
  mask-image: linear-gradient(to right, transparent 0, #000 var(--fn-edge), #000 calc(100% - var(--fn-edge)), transparent 100%), linear-gradient(to bottom, transparent 0, #000 var(--fn-edge), #000 calc(100% - var(--fn-edge)), transparent 100%);
  -webkit-mask-composite: source-in;
  mask-composite: intersect;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
}

/* Clearer typography hierarchy on page 09: off-white headings, gray copy and quieter labels. */
:root[data-theme="dark"]:has(.proj) .proj .fn-h { color: #e2e0e6; }
:root[data-theme="dark"]:has(.proj) .proj .fn-head-r p { color: #c2c0ca; }
:root[data-theme="dark"]:has(.proj) .proj .fn-b { color: #a6a6b2; }
:root[data-theme="dark"]:has(.proj) .proj :is(.fn-top,.fn-tools,.fn-foot,.fn-proc figcaption) { color: #858591; }
:root[data-theme="dark"]:has(.proj) .proj .fn-ig { color: #aaaab6; }
:root[data-theme="dark"]:has(.proj) .pdock .ptitle:not(.sk-title) { color: #e2e0e6; }
:root[data-theme="dark"]:has(.proj) .pdock .ptext p { color: #a6a6b2; }

/* Field Notes cards, dark mode (20 Nov, Deja: "too plain, I need contrast in shades of gray and white"): four clear steps. Title pure white, the body text light grey, the tools line a cool mid grey, the note number and year the quietest, the link white. Change the colours here. To undo: delete this block. */
:root[data-theme="dark"]:has(.proj) .proj .fn-n .fn-top { color: #6f6f7b; }
:root[data-theme="dark"]:has(.proj) .proj .fn-n .fn-h { color: #ffffff; }
:root[data-theme="dark"]:has(.proj) .proj .fn-n .fn-tools { color: #9494a3; }
:root[data-theme="dark"]:has(.proj) .proj .fn-n .fn-b { color: #cfcfd8; }
:root[data-theme="dark"]:has(.proj) .proj .fn-n .fn-ig { color: #ffffff; border-bottom-color: rgba(255, 255, 255, 0.85); text-decoration-color: rgba(255, 255, 255, 0.85); }

/* Page 09, dark mode (20 Nov, Deja: "make the edges of the animation hit the right and left of the page"): the opening animation now runs the full width of the window. The side feather is gone (only the top and bottom edges keep their soft fade), the side margins cancel the 2vw padding of the page so it touches the left and right edges, and the corners are square. Light mode is not touched. To undo: delete this block. */
:root[data-theme="dark"]:has(.proj) .proj .fn-bg {
  margin-left: -2vw;
  margin-right: -2vw;
  border-radius: 0;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 var(--fn-edge), #000 calc(100% - var(--fn-edge)), transparent 100%);
  mask-image: linear-gradient(to bottom, transparent 0, #000 var(--fn-edge), #000 calc(100% - var(--fn-edge)), transparent 100%);
}

/* Page 09, dark mode (20 Nov, Deja: "this should be the end of the animation, not another part of the page"): the gradient is now INSIDE the animation, at its bottom, under the words, the pictures and the box (they stay sharp on top of it). The blurred blobs and the glass fade out into the dark page (#131316) in a smooth eased curve, so the animation ends dark, with no hard cut and no extra strip. The box keeps its full height. --fn-fade = how tall the gradient is (bigger = starts higher). Light mode is not touched. To undo: delete this block. */
:root[data-theme="dark"]:has(.proj) .proj .fn-bg {
  --fn-fade: clamp(140px, 17vw, 340px);
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 var(--fn-edge));
  mask-image: linear-gradient(to bottom, transparent 0, #000 var(--fn-edge));
}
:root[data-theme="dark"]:has(.proj) .proj .fn-bg::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: var(--fn-fade);
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(to bottom, rgba(19,19,22,0) 0%, rgba(19,19,22,.08) 12%, rgba(19,19,22,.24) 28%, rgba(19,19,22,.46) 46%, rgba(19,19,22,.7) 64%, rgba(19,19,22,.88) 80%, rgba(19,19,22,.97) 92%, #131316 100%);
}
