/* NOT NOT PHILO: the poster world. Grey paper, charcoal ink, one red; a
   red label bar with a charcoal plate printed a few pixels off register
   (the posters' own device); the impossible triangle engraved in lines.
   Loaded after nts.css. One token set, the poster; before the bleed-in
   (arrived from home) the page reads the NTS tokens from nts.css, and the
   rule below prints the triangle on that paper.
   Contrast: ink on ground 12.5:1, muted 6.5:1, red-text 5.2:1; white on the
   red bar at 13px bold 4.6:1. */
[data-world="philo"], :root:where(:has(> body[data-world="philo"])) {
  --w-bg: #e6e6e8;
  --w-bg-2: #dcdce0;
  --w-fg: #2b2d3e;
  --w-muted: #53566b;
  --w-accent: #e5174a;
  --w-accent-text: #c0103a;
  --w-link: #2b2d3e;
  --w-line: rgba(43, 45, 62, 0.2);
  --w-line-strong: rgba(43, 45, 62, 0.5);
  --w-selection: #e5174a;
  --w-selection-fg: #fff;
  --w-bar-bg: rgba(230, 230, 232, 0.86);
  --w-bar-fg: #2b2d3e;
  --w-sigil: "philo";
  --w-rim: rgba(255, 255, 255, 0.6);
  --w-cast: rgba(43, 45, 62, 0.24);
  --w-deep: #a6a7b2;
  --philo-shadow: #2b2d3e;
  --philo-off: 4px;
  --penrose-top: #f5f5f7;
  --penrose-side: #a6a7b2;
  --penrose-dark: #53566b;
  --penrose-ground: #e6e6e8;
  --plate: .16;
  color-scheme: light;
}
html[data-bleed-state="before"] [data-world="philo"], html[data-bleed-state="in"] .nts-bleed-old {
  --penrose-top: #f7f1e4;
  --penrose-side: #b9b1a3;
  --penrose-dark: #67625a;
  --penrose-ground: var(--pal-beige);
}

/* the poster's red label bar, misregistered */
.philo-bar {
  position: relative; display: inline-block;
  padding: .32em .62em .36em;
  background: var(--philo-red); color: #fff;
  font-family: var(--font-flyer); font-weight: 700; font-size: .9rem; letter-spacing: .02em; line-height: 1.2;
  text-decoration: none; white-space: nowrap;
}
.philo-bar::before { content: ""; position: absolute; inset: 0; background: var(--philo-shadow); transform: translate(calc(-1 * var(--philo-off)), calc(-1 * var(--philo-off))); z-index: -1; transition: transform var(--dur-lift) var(--ease-lift); }
a.philo-bar:hover::before, a.philo-bar:focus-visible::before { transform: translate(calc(-1 * var(--philo-off) - 2px), calc(-1 * var(--philo-off) - 2px)); }
.philo-bar.caps { text-transform: uppercase; letter-spacing: .06em; }
.philo-bar.wrap-ok { white-space: normal; }

/* the key word: extra-bold red with a crisp charcoal misregistration */
.philo-key {
  font-family: var(--font-flyer); font-weight: 900; text-transform: uppercase;
  letter-spacing: -.03em; line-height: .9;
  color: var(--philo-red-key);
  text-shadow: calc(-1 * var(--philo-off)) calc(-1 * var(--philo-off)) 0 var(--philo-shadow);
}
/* the logotype's exponent: the key's two inks swapped, raised above the caps */
.philo-exp { position: relative; top: -.5em; font-size: .78em; line-height: 0; margin-left: .06em; letter-spacing: 0; color: var(--philo-ink); text-shadow: calc(-1 * var(--philo-off)) calc(-1 * var(--philo-off)) 0 var(--philo-red-key); }

/* the entity. touch-action stays pan-y, the page scrolls from anywhere in the box; philo.js
   cancels the touch (touchstart) when it starts on the figure, which the wheel turns instead */
.nts-penrose { position: relative; width: 100%; aspect-ratio: 1; touch-action: pan-y; }
.nts-penrose.is-grab { cursor: grab; }
.nts-penrose.is-grabbing { cursor: grabbing; }
.nts-penrose img, .nts-penrose > svg { position: absolute; inset: 0; width: 100%; height: 100%; }
/* The turned screw's lower turns dissolve into the page before the canvas's
   edge: a smoothstep mask that starts just beyond the rest figure's reach.
   It is on only while the figure is turned (philo.js sets .is-turned): masking
   costs compositing time, and at rest it would mask nothing, so the rest pose
   is drawn unmasked. */
.nts-penrose canvas { position: absolute; inset: -35%; width: 170%; max-width: none; height: 170%; pointer-events: none; --screw-mask: radial-gradient(closest-side, #000 58%, rgba(0,0,0,0.957) 60.75%, rgba(0,0,0,0.844) 63.5%, rgba(0,0,0,0.684) 66.25%, rgba(0,0,0,0.5) 69%, rgba(0,0,0,0.316) 71.75%, rgba(0,0,0,0.156) 74.5%, rgba(0,0,0,0.043) 77.25%, transparent 80%); }
.nts-penrose.is-turned canvas { -webkit-mask-image: var(--screw-mask); mask-image: var(--screw-mask); }
/* The rest pose is drawn as large as the other worlds' figures, so turned,
   the screw's turns below outgrow the host: the canvas is bigger than the
   host on every side (1.7x across), the mask above fades the deeper turns
   out before that edge, and the hero keeps text above it and clips what would
   scroll sideways. */
.philo-hero .hero-text, .philo-hero .fig { position: relative; z-index: 1; }
.philo-hero .fig { position: absolute; }
.nts-penrose.is-live img, .nts-penrose.is-live > svg { display: none; }
/* the caption hangs a line under the cubes' drawn bottom, inside the figure box, so the ring still centres on the
   figure; the orbit may cross it. --cubes-bottom is that bottom's share of the box (the still's lowest path, 477.84
   of 600). Checked by the L2 caption test. A halo in the ground's colour clears the rings right around the
   glyphs: they run under the caption, mostly on a phone, where it sits on the orb */
.fig { --cubes-bottom: 79.6%; position: absolute; top: calc(var(--cubes-bottom) + 1.5rem); left: 0; right: 0; text-align: center; font-family: var(--font-display); font-style: italic; font-variation-settings: var(--fraunces-voice); font-size: .95rem; color: var(--w-muted); margin: 0; text-shadow: 1px 0 0 var(--w-bg), -1px 0 0 var(--w-bg), 0 1px 0 var(--w-bg), 0 -1px 0 var(--w-bg), 2px 2px 0 var(--w-bg), -2px 2px 0 var(--w-bg), 2px -2px 0 var(--w-bg), -2px -2px 0 var(--w-bg), 0 0 4px var(--w-bg), 0 0 4px var(--w-bg), 0 0 10px var(--w-bg), 0 0 10px var(--w-bg); }
.fig b { font-style: normal; font-weight: 400; }

/* the fragment */
/* the hero's engraved rings, at the hero's pitch, centred on the figure (the canvas's centre) and over the whole window: the way EMBERS' lines run under its hearth */
[data-nts-fragment="philo"] { position: relative; aspect-ratio: 1; width: 100%; background: repeating-radial-gradient(circle at 50% 50%, color-mix(in srgb, var(--w-fg) calc(var(--plate) * 100%), transparent) 0 1px, transparent 1px 9px), var(--frag-bg, #e6e6e8); overflow: hidden; border-radius: inherit; }
[data-nts-fragment="philo"] .still { position: absolute; inset: 0; display: grid; place-items: center; }
[data-nts-fragment="philo"] .still svg { width: 100%; height: 100%; }
[data-nts-fragment="philo"] canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
[data-nts-fragment="philo"].is-live .still { display: none; }

/* A plate of engraved rings behind the hero (pure CSS), centred on the orbit.
   The hero is full-bleed so the plate spans the screen; its content box stays
   the .wrap one. The orbit's centre (--cx, --cy) is worked out from the hero
   grid in pages.css (its padding, column gap and the 1.1fr/1fr columns, or the
   stacked entity of width min(100%, var(--entity-w)), measured in cqw: the hero is an
   inline-size container whose content width is the entity's, free of the
   scrollbar that vw includes, where a vertical percentage would be of the
   hero's height): keep them in step; the layout tests L2 and L2b check the
   plate is centred on the orbit and its rings' phase, pitch and cut-out
   against the trace. A short landscape screen sets --pt, --ew, --cx and --cy
   for its own square (orrery.css). */
.philo-rings { position: relative; isolation: isolate; container-type: inline-size; --pt: clamp(var(--hero-top), 4vw, 3rem); --pb: clamp(2rem, 5vw, 3.5rem); --gap: clamp(2rem, 5vw, 5rem); --pad: max(var(--gutter), (100% - var(--wrap)) / 2); --col: calc((100cqw - var(--gap)) / 2.1); --cx: 50%; --cy: calc(var(--pt) + min(100cqw, var(--entity-w)) / 2); --ew: min(100cqw, var(--entity-w)); --tr: calc((min(var(--ew), 92svh) - var(--ring-inset)) / 2); }
@supports (width: mod(1px, 1px)) { .philo-rings { --ph: mod(calc(var(--tr) - 1px), 9px); } }
.hero.philo-rings { width: auto; margin-inline: 0; padding-inline: var(--pad); overflow: clip; }
@media (min-width: 900px) { .philo-rings { --cx: calc(100% - var(--pad) - var(--col) / 2); --cy: calc(var(--pt) + (100% - var(--pt) - var(--pb)) / 2); --ew: min(var(--col), var(--entity-w)); } }
/* The rings are 1px lines on a 9px pitch, the first at --ph (a repeating
   gradient's period is its last stop less its first, so the stops run from
   --ph to --ph + 9px and the pitch is 9px whatever --ph is). --ph puts one
   ring on the trace, whose outer radius is --tr; the second mask layer cuts
   that ring out, so the dashed orbit runs over clear ground, a pitch either
   side. Without mod(), --ph is 0 and the rings are just unaligned. --tr is
   worked out as the trace's size is in orrery.css and pages.css (--ew is the
   entity's width, in cqw: a % in a gradient stop is of the gradient's length),
   and --col is the entity column the grid gives: keep them in step with
   those, and with --cx (checked as above). */
.philo-rings::before { content: ""; position: absolute; inset: 0; z-index: -4; pointer-events: none; opacity: var(--plate); --plate-mask: radial-gradient(circle 115vw at var(--cx) var(--cy), #000 30%, transparent 72%), radial-gradient(circle at var(--cx) var(--cy), #000 calc(var(--tr) - 5px), transparent calc(var(--tr) - 5px) calc(var(--tr) + 4px), #000 calc(var(--tr) + 4px)); background: repeating-radial-gradient(circle at var(--cx) var(--cy), var(--w-fg) var(--ph, 0px), var(--w-fg) calc(var(--ph, 0px) + 1px), transparent calc(var(--ph, 0px) + 1px), transparent calc(var(--ph, 0px) + 9px)); mask-image: var(--plate-mask); mask-composite: intersect; -webkit-mask-image: var(--plate-mask); -webkit-mask-composite: source-in; }
/* Circles can't end on a straight edge: the hero's ground fades back over them
   toward its top and bottom. The top is short because the header already
   covers most of it; the bottom is long because the next section's open ground
   starts there. */
.philo-rings::after { content: ""; position: absolute; inset: 0; z-index: -3; pointer-events: none; background: linear-gradient(to bottom, var(--w-bg), transparent 5rem, transparent calc(100% - 12rem), var(--w-bg)); }

/* the volumes */
.volumes { list-style: none; margin: 0; padding: 0; display: grid; gap: 1rem; }
@media (min-width: 760px) { .volumes { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.25rem; } }
.volume { position: relative; padding: 1.25rem 1.25rem 1.4rem; background: #fff; color: var(--philo-ink); box-shadow: calc(-1 * var(--philo-off)) calc(-1 * var(--philo-off)) 0 var(--philo-shadow); margin: var(--philo-off) 0 0 var(--philo-off); }
.volume .num { font-family: var(--font-display); font-variation-settings: var(--fraunces-display); font-size: 2.4rem; line-height: 1; color: var(--w-muted); margin: 0 0 .6rem; }
.volume .num small { font-family: var(--font-text); font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; vertical-align: .9em; margin-left: .4em; }
.volume h3 { font-family: var(--font-flyer); font-variation-settings: normal; font-weight: 900; text-transform: uppercase; letter-spacing: -.01em; line-height: .95; font-size: clamp(1.7rem, 5vw, 2.1rem); color: var(--philo-red-key); text-shadow: -2px -2px 0 var(--philo-shadow); margin: 0 0 .7rem; }
.volume .q { font-family: var(--font-display); font-style: italic; font-variation-settings: var(--fraunces-voice); font-size: 1.2rem; line-height: 1.3; margin: 0 0 .5rem; }
.volume .l { font-size: .95rem; color: var(--w-muted); margin: 0 0 .8rem; }
.volume .when { font-family: var(--font-mono); font-size: .78rem; letter-spacing: .06em; text-transform: uppercase; color: var(--w-muted); margin: 0; }
