/* PENDULUM — the swinging hero. Everything is scoped to .pd; colours arrive as --pd-* from the engine.
   Set the headline font with --pd-font on .pd (or any parent). */
.pd {
  --pd-font: "Archivo", system-ui, sans-serif;
  position: relative; display: block; overflow: hidden; isolation: isolate;
  height: 100vh; height: 100svh; min-height: 460px;
  background: var(--pd-bg, #ff6a2b); color: var(--pd-paper, #fff8f1);
}
/* a soft lift in the middle and a whisper of grain, so the flat colour feels printed */
.pd-glow { position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: radial-gradient(120% 80% at 50% 50%, rgba(255,255,255,.14), rgba(255,255,255,0) 55%, rgba(0,0,0,.1) 100%); }
.pd-glow::after { content: ""; position: absolute; inset: 0; opacity: .08; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }
.pd-wipe { position: absolute; inset: 0; z-index: 0; background: var(--pd-bg2); display: none; }
.pd-wipe-on .pd-wipe { display: block; }

.pd-lines { position: absolute; inset: 0; z-index: 2; }
.pd-line { position: absolute; inset: 0; margin: 0; display: grid; place-items: center; text-align: center;
  padding: 0 6% 12vh; /* lifted with padding, not a transform, so the swap sits exactly on the cord */
  font-family: var(--pd-font); font-weight: 900; line-height: .9; letter-spacing: var(--pd-track, -.035em); /* --pd-track: each font has its own (see fonts) */
  font-size: calc(clamp(44px, 9.6vw, 168px) * var(--pd-shrink, 1)); will-change: clip-path; }
.pd-upper .pd-line { text-transform: uppercase; }
.pd-line > span { display: block; max-width: 11ch; }
.pd-q { color: var(--pd-ink); }
.pd-a { color: var(--pd-paper); }
/* until the engine starts, only the question shows (no stacked words on a slow connection) */
.pd:not(.pd-on) .pd-a { visibility: hidden; }
.pd-wipe-on .pd-q { color: var(--pd-qink, var(--pd-paper)); }
.pd-hit { position: absolute; inset: 22% 8% 34%; z-index: 3; }

.pd-cord { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 4; pointer-events: none; overflow: visible; }
.pd-cord line { stroke: var(--pd-cord, #1d0802); stroke-width: 2.4; stroke-linecap: round; }
.pd-cord circle { fill: var(--pd-cord, #1d0802); }
.pd-gl { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 5; display: block; pointer-events: none; }
.pd-grab { position: absolute; left: 0; top: 0; z-index: 6; width: 1px; height: 1px; border-radius: 30%; cursor: grab; touch-action: none; }
.pd-grab:active { cursor: grabbing; }
.pd-shadow { position: absolute; left: 0; top: 0; z-index: 2; width: 1px; height: 1px; pointer-events: none;
  border-radius: 30%; background: rgba(40, 10, 0, .36); filter: blur(22px); will-change: transform; }
.pd-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
/* without WebGL the answer simply shows */
.pd-still .pd-q { display: none; }
.pd-still .pd-a { visibility: visible; }

/* whatever sits at the bottom of the hero: the tile always hangs clear of it */
.pd-foot { position: absolute; inset: auto 0 0; z-index: 6; display: grid; justify-items: center; gap: 10px;
  padding: 0 20px clamp(22px, 5vh, 46px); text-align: center; }

@media (max-width: 700px) {
  .pd-line { font-size: calc(clamp(38px, 12vw, 72px) * var(--pd-shrink, 1)); padding-bottom: 20vh; }
}
