/* ==========================================================================
   game.css — 02 "Create. Refine. Plan." as a pinned canvas (v2, 2026-11-11)
   --------------------------------------------------------------------------
   Loaded by index.html only, with game.js and planny-orb.js. The section is
   tall and its stage sticks: one wide canvas for the game Ember Gambit
   glides through a window as you scroll, Create to Refine to Plan, the ring
   of Planny's light wraps each block as it is reached, tasks tick to
   Completed, and Planny's dock (the app's own face) says what it is doing.
   The game's art is the ground. Dark in both themes.
   ========================================================================== */

/* The shared wrappers hide sideways overflow with overflow-x: hidden, which
   makes each a scroll container, and a sticky stage inside one never sticks.
   clip hides the same overflow without creating one. Home only. */
html:has(#game.hp-scene), html:has(#game.hp-scene) body, .pf-root:has(#game.hp-scene) { overflow-x: clip !important; overflow-y: visible !important; }

.hp-scene--game {
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --head-h: 96px;
  --sig: hsl(18 92% 60%);
  --sig-soft: hsl(18 92% 60% / 0.16);
  --sig-rgb: 245 104 33;
  --d-pop: 0 16px 40px -8px rgba(0, 0, 0, 0.6), 0 2px 6px rgba(0, 0, 0, 0.3);
  --d-hover: rgba(255, 255, 255, 0.045);
}
.hp-scene--game svg { flex: none; }

.hp-idx {
  display: flex; align-items: center; gap: 14px; margin: 0 0 28px;
  font-family: var(--sw-mono); font-size: 11px; line-height: 1; letter-spacing: 0.07em; text-transform: uppercase;
  color: var(--sw-muted);
}
.hp-idx span:first-child { display: inline-flex; align-items: center; gap: 10px; color: var(--sw-ink); font-variant-numeric: tabular-nums; }
.hp-idx span:first-child::before {
  content: ""; width: 7px; height: 7px; background: rgb(var(--tint-rgb) / 0.22);
  transition: background-color 500ms var(--ease), box-shadow 500ms var(--ease);
}
.hp-idx.lit span:first-child::before { background: var(--sig); box-shadow: 0 0 0 3px var(--sig-soft), 0 0 14px rgb(var(--sig-rgb) / 0.6); }
.hp-idx--plain span:first-child::before { background: var(--sig); }
.sw .hp-h { font-size: clamp(42px, 5.4vw, 88px); line-height: 0.98; letter-spacing: -0.055em; }
.sw .hp-h--m { font-size: clamp(30px, 3.1vw, 50px); line-height: 1.04; letter-spacing: -0.045em; }
.sw .hp-lede { margin-top: 28px; font-size: 19px; line-height: 1.5; color: var(--d-text2); max-width: 44ch; }
.sw .hp-lede--s { font-size: 17px; margin-top: 16px; }
.sw .hp-note-s { margin-top: auto; padding-top: 24px; font-size: 14px; line-height: 1.5; color: var(--d-text3); max-width: 30ch; }


/* ---------- 4. Pinned scenes ------------------------------------------------------------- */
.hp-scene { position: relative; height: calc(var(--len, 3) * 100svh); }
.hp-stage { position: sticky; top: 0; height: 100svh; overflow: hidden; }
.hp-stage-in {
  display: grid; grid-template-columns: minmax(260px, 3.2fr) minmax(0, 8.8fr); gap: clamp(32px, 3.6vw, 64px);
  height: 100%; padding-top: var(--head-h); padding-bottom: clamp(20px, 3vh, 36px);
}
.hp-side { display: flex; flex-direction: column; min-height: 0; padding-top: 8px; }
.hp-side .hp-h { font-size: clamp(38px, 4.1vw, 68px); }

.hp-steps { list-style: none; margin: 36px 0 0; padding: 0; display: grid; }
.hp-steps li {
  display: grid; grid-template-columns: 34px 1fr; column-gap: 4px; padding: 14px 0; border-top: 1px solid var(--sw-line);
  opacity: 0.34; transition: opacity 500ms var(--ease);
}
.hp-steps li:last-child { border-bottom: 1px solid var(--sw-line); }
.hp-steps li span { grid-row: span 2; padding-top: 4px; font: 400 11px/1 var(--sw-mono); color: var(--d-text3); transition: color 400ms; }
.hp-steps li b { font-size: 21px; font-weight: 400; letter-spacing: -0.02em; color: var(--sw-ink); }
.hp-steps li em { font-style: normal; font-size: 15px; line-height: 1.45; color: var(--d-text2); margin-top: 3px; }
.hp-steps li.on { opacity: 1; }
.hp-steps li.on span { color: var(--sig); }
.hp-steps--caps { margin-top: 28px; }
.hp-steps--caps li { padding: 9px 0; }
.hp-steps--caps li b { font-size: 18px; }
.hp-steps--caps li em { font-size: 13.5px; }
.hp-scene--planny .hp-side .hp-lede--s { margin-top: 18px; }

.hp-win {
  position: relative; display: flex; flex-direction: column; min-height: 0; border-radius: 16px; overflow: hidden;
  border: 1px solid var(--d-line2); box-shadow: var(--d-shadow);
  background-color: var(--d-page);
  background-image: radial-gradient(circle at center, var(--d-dot) 0.9px, transparent 1.2px);
  background-size: 20px 20px; background-position: 10px 10px;
}
.hp-win--plain { border-color: var(--d-line); box-shadow: none; }
.hp-win-bar { display: flex; align-items: center; justify-content: space-between; height: 44px; padding: 0 16px; border-bottom: 1px solid var(--d-line); background: color-mix(in srgb, var(--d-surface) 72%, transparent); }
.hp-crumb { font-size: 13px; color: var(--d-text3); }
.hp-crumb i { font-style: normal; margin: 0 6px; opacity: 0.6; }
.hp-crumb b { font-weight: 500; color: var(--d-ink); }
.hp-win-zoom { font: 400 11px/1 var(--sw-mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--d-text3); }
.hp-view { position: relative; flex: 1; min-height: 0; overflow: hidden; }
.hp-board { position: absolute; left: 0; top: 0; transform-origin: 0 0; will-change: transform; }

/* blocks: sized in board units */
.hp-b {
  position: absolute; margin: 0; padding: 22px 24px 20px; will-change: transform, opacity;
  background: var(--d-surface); border: 1px solid var(--d-line); border-radius: 14px; box-shadow: var(--d-shadow);
  font-size: 20px; line-height: 1.45; color: var(--d-text); transform-origin: 50% 50%;
}
.sw .hp-b p { max-width: none; font-size: inherit; line-height: inherit; margin: 0 0 12px; }
.sw .hp-b p:last-child { margin-bottom: 0; }
.sw .hp-b h3 { font-size: 31px; line-height: 1.12; letter-spacing: -0.03em; margin: 0 0 12px; color: var(--d-ink); }
.sw .hp-b h4 { font-size: 23px; line-height: 1.2; letter-spacing: -0.02em; margin: 0 0 10px; color: var(--d-ink); font-weight: 400; }
.sw .hp-bl { font: 400 13px/1 var(--sw-mono) !important; letter-spacing: 0.07em; text-transform: uppercase; color: var(--d-text3); margin-bottom: 14px !important; }
.sw .hp-small { font-size: 16px; color: var(--d-text2); }

/* the ring: the light wraps whatever has just arrived */
.hp-ring {
  position: absolute; left: 0; top: 0; z-index: 0; pointer-events: none; opacity: 0;
  border-radius: 6px;
  border: calc(1.6px / max(var(--z, 1), 0.7)) solid var(--sig);
  box-shadow: 0 0 calc(18px / max(var(--z, 1), 0.7)) rgb(var(--sig-rgb) / 0.3);
  will-change: transform, width, height, opacity;
}
.hp-ring--soft { border-radius: 8px; }
.hp-board > .hp-b, .hp-board > .hp-fi, .hp-board > .hp-tree, .hp-board > .hp-folder { z-index: 1; }

/* Planny at work on the canvas, as its dock sits in the app */
.hp-dock { position: absolute; right: 16px; bottom: 16px; z-index: 8; display: flex; align-items: center; gap: 12px; padding: 6px 16px 6px 6px; border-radius: 99px; background: color-mix(in srgb, var(--d-surface) 92%, transparent); border: 1px solid var(--d-line2); box-shadow: var(--d-pop); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.hp-orb--dock { width: 44px; height: 44px; }
.sw .hp-dock-t { position: relative; margin: 0; min-width: 300px; height: 20px; font-size: 14px; color: var(--d-ink); }
.hp-dock-t span { position: absolute; inset: 0; white-space: nowrap; opacity: 0; transform: translateY(6px); transition: opacity 400ms var(--ease), transform 500ms var(--ease); }
.hp-dock-t span.on { opacity: 1; transform: none; }
.hp-win { position: relative; }

/* 02 Game: the art is the ground, the canvas glides through the frame */
.hp-scene--game .hp-stage { background: #08090B; color: #F4F3F1; --sw-ink: #F4F3F1; --sw-muted: #8B8783; --sw-line: rgba(255, 255, 255, 0.12); --tint-rgb: 255 255 255;
  --d-page: #0E0F11; --d-surface: #16181B; --d-well: #1A1D21; --d-line: rgba(255, 255, 255, 0.08); --d-line2: rgba(255, 255, 255, 0.16); --d-ink: #F4F3F1; --d-text: #DBD9D5; --d-text2: #A6A39E; --d-text3: #8B8783; --d-dot: rgba(255, 255, 255, 0.06);
  --d-shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.35); --sig: hsl(18 92% 60%); }
.hp-gart { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.hp-gart img { position: absolute; left: -6%; top: -4%; width: 112%; height: 108%; object-fit: cover; opacity: 0.34; transform: translate3d(calc(var(--p, 0) * -4%), 0, 0); filter: saturate(0.9); }
.hp-gart::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to bottom, #08090B 0%, rgb(8 9 11 / 0.55) 30%, rgb(8 9 11 / 0.5) 70%, #08090B 100%), radial-gradient(80% 60% at 50% 50%, rgb(8 9 11 / 0), rgb(8 9 11 / 0.6)); }
.hp-game-in { position: relative; display: grid; grid-template-rows: auto minmax(0, 1fr); gap: 24px; height: 100%; padding-top: var(--head-h); padding-bottom: clamp(20px, 3vh, 36px); }
.hp-game-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 32px; }
.hp-game-head .hp-idx { margin-bottom: 18px; }
.hp-game-head .hp-h { font-size: clamp(38px, 4.4vw, 72px); }
.hp-game-meta { display: grid; justify-items: end; gap: 14px; }
.sw .hp-game-meta .hp-lede { margin: 0; color: #A6A39E; }
.hp-gtabs { display: flex; gap: 4px; margin: 0; padding: 4px; list-style: none; border-radius: 99px; border: 1px solid rgba(255, 255, 255, 0.14); background: rgb(14 15 17 / 0.6); }
.hp-gtabs li { display: flex; align-items: center; gap: 8px; height: 34px; padding: 0 16px; border-radius: 99px; font-size: 14px; color: #A6A39E; transition: background-color 400ms, color 400ms; }
.hp-gtabs li span { font: 400 10.5px/1 var(--sw-mono); color: #6B665C; }
.hp-gtabs li.on { background: #F4F3F1; color: #17140F; }
.hp-gtabs li.on span { color: hsl(18 92% 50%); }
.hp-win--game { border-color: rgba(255, 255, 255, 0.12); background-color: rgb(14 15 17 / 0.82); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.hp-win--game .hp-win-bar { background: rgb(22 24 27 / 0.7); }
.sw .hp-rt { position: absolute; margin: 0; font-size: 15px; color: var(--d-text3); white-space: nowrap; max-width: none; }
.hp-rt b { font-weight: 500; color: var(--d-ink); margin-right: 6px; }
.sw .hp-mh { position: absolute; margin: 0; font-size: 22px; font-weight: 500; letter-spacing: -0.02em; color: var(--d-ink); }
.hp-mn { padding: 14px 16px; font-size: 13.5px; line-height: 1.5; color: var(--d-text2); }
.sw .hp-mn p { margin: 0 0 6px; }
.sw .hp-mn-l { font-size: 15px !important; font-weight: 500; line-height: 1.35 !important; color: var(--d-ink); }
.sw .hp-mn-k { font: 400 10.5px/1 var(--sw-mono) !important; letter-spacing: 0.07em; text-transform: uppercase; color: var(--d-text3); margin-bottom: 9px !important; }
.hp-mn--q .hp-mn-k { color: #7FB4FF; } .hp-mn--i .hp-mn-k { color: #5CC98A; } .hp-mn--c .hp-mn-k { color: #F2B53C; }
.hp-mi { padding: 0; overflow: hidden; border-radius: 10px; }
.hp-mi img { display: block; width: 100%; height: auto; }
.hp-mi--clear { background: none; border-color: transparent; box-shadow: none; }
.hp-md { padding: 0; overflow: hidden; }
.sw .hp-md-h { display: flex; align-items: center; gap: 8px; margin: 0; padding: 11px 14px; border-bottom: 1px solid var(--d-line); font: 400 12.5px/1 var(--sw-mono) !important; color: var(--d-text2); }
.hp-md-h svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.hp-md pre { margin: 0; padding: 14px 16px 16px; font: 400 12.5px/1.65 var(--sw-mono); color: var(--d-text); white-space: pre; overflow: hidden; }
.hp-md pre span { color: var(--d-text3); }
.hp-ml { display: flex; align-items: center; gap: 12px; padding: 12px 14px; }
.hp-ml-f { flex: none; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; background: var(--d-well); }
.hp-ml-f svg { width: 16px; height: 16px; fill: var(--d-ink); }
.sw .hp-ml p { margin: 0; display: grid; gap: 3px; font-size: 13px; line-height: 1.3; }
.hp-ml b { font-weight: 500; color: var(--d-ink); }
.hp-ml small { font: 400 11px/1.3 var(--sw-mono); color: var(--d-text3); }
.hp-mt { display: flex; gap: 11px; padding: 13px 14px; font-size: 13.5px; line-height: 1.35; }
.hp-mt > i { flex: none; width: 17px; height: 17px; margin-top: 1px; border: 1.5px solid var(--d-line2); border-radius: 50%; transition: background-color 400ms, border-color 400ms; }
.sw .hp-mt p { margin: 0; display: grid; gap: 4px; }
.hp-mt b { font-weight: 400; color: var(--d-ink); transition: color 400ms; }
.hp-mt small { font: 400 11px/1 var(--sw-mono); color: var(--d-text3); }
.hp-mt--prog > i { border-color: #F2B53C; border-right-color: transparent; }
.hp-mt--prog small { color: #F2B53C; }
.hp-tick small { opacity: 0; height: 0; transition: opacity 400ms; }
.hp-tick small.on { opacity: 1; height: auto; color: #5CC98A; }
.hp-tick s { display: none; }
.hp-tick:has(s.on) > i { background: #5CC98A; border-color: #5CC98A; box-shadow: inset 0 0 0 3px #16181B; }
.hp-tick:has(s.on) b { color: var(--d-text3); }

.hp-orb-row { display: flex; align-items: center; gap: 20px; }
.hp-orb { position: relative; flex: none; width: 112px; height: 112px; }
.hp-orb canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.hp-orb--s { width: 64px; height: 64px; }
.hp-orb-still { position: absolute; inset: 22%; border-radius: 50%; border: 3px solid var(--sig); box-shadow: 0 0 18px rgb(var(--sig-rgb) / 0.5); }
.hp-orb:has(canvas.is-live) .hp-orb-still { display: none; }

@media (max-width: 760px) {
  .hp-scene--game { --head-h: 76px; }
  .hp-idx { margin-bottom: 18px; }
  .hp-scene { height: calc(var(--len, 3) * 82svh); }
  .hp-stage-in { grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr); gap: 14px; padding-bottom: 14px; }
  .hp-win-bar { height: 38px; }
  .hp-dock { left: 10px; right: 10px; bottom: 10px; padding-right: 12px; }
  .sw .hp-dock-t { min-width: 0; flex: 1; font-size: 12.5px; }
  .hp-dock-t span { white-space: normal; line-height: 1.3; }
  .hp-orb--dock, .hp-orb--dock canvas { width: 36px; height: 36px; flex: none; }
  .hp-game-head { flex-direction: column; align-items: flex-start; gap: 12px; }
  .hp-game-head .hp-h { font-size: 32px; }
  .hp-game-meta { justify-items: start; }
  .hp-game-meta .hp-lede { display: none; }
  .hp-gtabs li { height: 30px; padding: 0 12px; font-size: 13px; }
}
@media (prefers-reduced-motion: reduce) {
  .hp-scene { height: auto; }
  .hp-stage { position: relative; height: 100svh; min-height: 640px; }
}
