/* Pose lab — a 3D stage with floating glass panels.
   Glass here is blur + tint + a lit rim + a light that follows the pointer.
   Real Liquid Glass refraction isn't available to a web page. */

:root {
  --accent: #FF453A;
  --page: #0b0b0d;
  --ink: #fff;
  --soft: rgba(255, 255, 255, .68);
  --faint: rgba(255, 255, 255, .42);
  --line: rgba(255, 255, 255, .14);
  --glass-bg: rgba(28, 28, 32, .5);
  --glass-edge: rgba(255, 255, 255, .22);
  --glass-hi: rgba(255, 255, 255, .5);
  --glass-light: rgba(255, 255, 255, .26);
  --fill: rgba(255, 255, 255, .09);
  --thumb: rgba(255, 255, 255, .16);
  --blob1: #4a1d8a; --blob2: #8a1d2c; --blob3: #1d4f8a;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  --spring: cubic-bezier(.3, 1.45, .5, 1);
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme]) {
    --accent: #E0241B; --page: #e9e9ee; --ink: #000; --soft: rgba(0, 0, 0, .64); --faint: rgba(0, 0, 0, .42);
    --line: rgba(0, 0, 0, .1); --glass-bg: rgba(250, 250, 252, .6); --glass-edge: rgba(255, 255, 255, .8);
    --glass-hi: rgba(255, 255, 255, .95); --glass-light: rgba(255, 255, 255, .75); --fill: rgba(0, 0, 0, .05);
    --thumb: rgba(255, 255, 255, .9); --blob1: #cdbcff; --blob2: #ffc4ba; --blob3: #b9e1ff; color-scheme: light;
  }
}
:root[data-theme="light"] {
  --accent: #E0241B; --page: #e9e9ee; --ink: #000; --soft: rgba(0, 0, 0, .64); --faint: rgba(0, 0, 0, .42);
  --line: rgba(0, 0, 0, .1); --glass-bg: rgba(250, 250, 252, .6); --glass-edge: rgba(255, 255, 255, .8);
  --glass-hi: rgba(255, 255, 255, .95); --glass-light: rgba(255, 255, 255, .75); --fill: rgba(0, 0, 0, .05);
  --thumb: rgba(255, 255, 255, .9); --blob1: #cdbcff; --blob2: #ffc4ba; --blob3: #b9e1ff; color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--page); }
body {
  font: 16px/1.5 var(--font); color: var(--ink);
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
  height: 100vh; height: 100dvh; overflow: hidden;
}
a { color: inherit; }
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; flex: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* ---------- backdrop ---------- */
.blobs { position: fixed; inset: 0; overflow: hidden; z-index: 0; }
.blobs i { position: absolute; width: 56vmax; height: 56vmax; border-radius: 50%; filter: blur(90px); opacity: .3; animation: drift 26s ease-in-out infinite alternate; }
.blobs i:nth-child(1) { background: var(--blob1); left: -18vmax; top: -22vmax; }
.blobs i:nth-child(2) { background: var(--blob2); right: -20vmax; top: 18vh; animation-duration: 32s; animation-delay: -8s; }
.blobs i:nth-child(3) { background: var(--blob3); left: 22vw; bottom: -34vmax; animation-duration: 38s; animation-delay: -15s; }
@keyframes drift { to { transform: translate3d(9vmax, 6vmax, 0) scale(1.15); } }

#stage { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 1; touch-action: pan-y; cursor: grab; }
#stage:active { cursor: grabbing; }

/* ---------- glass ---------- */
.glass {
  position: relative; background: var(--glass-bg); color: var(--ink);
  -webkit-backdrop-filter: blur(18px) saturate(170%); backdrop-filter: blur(18px) saturate(170%);
  box-shadow: inset 0 1px 0 var(--glass-hi), inset 0 0 0 .5px var(--glass-edge), inset 0 -1px 1px rgba(255, 255, 255, .06), 0 24px 60px -28px rgba(0, 0, 0, .55);
}
.glass::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; z-index: 0;
  background:
    radial-gradient(420px circle at var(--x, -200px) var(--y, -200px), var(--glass-light), transparent 60%),
    linear-gradient(135deg, rgba(255, 255, 255, .16), rgba(255, 255, 255, 0) 40%, rgba(255, 255, 255, 0) 72%, rgba(255, 255, 255, .07));
}
.glass > * { position: relative; z-index: 1; }
.lg { transition: transform .45s var(--spring); }
.lg:hover { transform: scale(1.04); }
.lg:active { transform: scale(.95); }

/* ---------- top bar ---------- */
.top { position: fixed; z-index: 6; top: max(16px, env(safe-area-inset-top)); left: 20px; right: 20px; display: flex; justify-content: space-between; align-items: center; pointer-events: none; }
.top > * { pointer-events: auto; }
.top-r { display: flex; gap: 8px; }
.mark, .pill { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: 99px; font-weight: 600; font-size: 14px; text-decoration: none; }
.mark svg circle { fill: currentColor; stroke: none; }
.pill.icon { width: 40px; padding: 0; justify-content: center; }

/* ---------- intro (left) ---------- */
/* The glass stays still; only .intro-scroll inside it scrolls. (Safari slides a scrolling element's blur and light along with its content.) */
.intro { position: fixed; z-index: 4; left: 28px; top: 50%; transform: translateY(-46%); width: min(380px, 30vw); max-height: calc(100vh - 110px); overflow: hidden; border-radius: 30px; display: flex; flex-direction: column; }
.intro-scroll { min-height: 0; overflow: hidden auto; padding: 26px 22px 18px 26px; scrollbar-width: none; border-radius: inherit; }
.intro-scroll::-webkit-scrollbar { display: none; }
.intro > * { pointer-events: auto; }
.eyebrow, .kicker { font: 500 12px/1.3 var(--mono); letter-spacing: .02em; color: var(--soft); margin: 0 0 10px; }
h1 { font: 700 clamp(26px, 2.5vw, 37px)/1.06 var(--display); letter-spacing: -.035em; margin: 0 0 16px; text-wrap: balance; }
h1 em { font-style: normal; color: var(--accent); }
.lede { color: var(--soft); margin: 0 0 22px; font-size: 15px; max-width: 34ch; }

.rail { display: grid; gap: 2px; position: relative; }
.rail button { display: flex; align-items: baseline; gap: 10px; width: 100%; text-align: left; padding: 9px 14px; border-radius: 14px; font-size: 15px; font-weight: 600; position: relative; z-index: 1; transition: color .2s; color: var(--soft); }
.rail button small { font: 400 11.5px var(--mono); color: var(--faint); margin-left: auto; white-space: nowrap; }
.rail button i { width: 7px; height: 7px; border-radius: 50%; background: var(--c, var(--faint)); flex: none; align-self: center; }
.rail button:hover, .rail button[aria-current="true"] { color: var(--ink); }
.rail .thumb, .dock .thumb { position: absolute; left: 0; top: 0; border-radius: 14px; background: var(--thumb); box-shadow: inset 0 1px 0 var(--glass-hi), inset 0 0 0 .5px var(--glass-edge); transition: transform .5s var(--spring), width .5s var(--spring), height .3s; pointer-events: none; z-index: 0; }

/* ---------- panel (right) ---------- */
.panel { position: fixed; z-index: 5; right: 28px; top: 76px; bottom: 28px; width: min(470px, 36vw); border-radius: 30px; overflow: hidden; display: flex; flex-direction: column; }
.panel-scroll { flex: 1; min-height: 0; overflow: hidden auto; overscroll-behavior: contain; padding: 30px 30px 22px; scrollbar-width: thin; scrollbar-color: var(--line) transparent; border-radius: inherit; } /* the glass stays still; only this scrolls (see .intro) */
.panel section { display: none; }
.panel section.on { display: block; }
.panel section.on > * { animation: rise .55s var(--spring) both; }
.panel section.on > :nth-child(2) { animation-delay: .04s; }
.panel section.on > :nth-child(3) { animation-delay: .08s; }
.panel section.on > :nth-child(4) { animation-delay: .12s; }
.panel section.on > :nth-child(n+5) { animation-delay: .16s; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }

h2 { font: 700 28px/1.1 var(--display); letter-spacing: -.025em; margin: 0 0 8px; text-wrap: balance; }
h3 { font: 600 12px/1.3 var(--mono); color: var(--soft); margin: 26px 0 6px; }
.panel p, .panel li { font-size: 15px; }
.panel p { margin: 0 0 12px; }
.tag { color: var(--soft); font-size: 16px !important; }
.note { color: var(--soft); font-size: 13.5px !important; border-top: .5px solid var(--line); padding-top: 12px; margin-top: 18px !important; }
.panel ul, .steps { margin: 0 0 12px; padding-left: 20px; }
.panel li { margin-bottom: 8px; }
.steps { list-style: none; padding: 0; counter-reset: s; display: grid; gap: 8px; margin: 16px 0; }
.steps li { counter-increment: s; background: var(--fill); border-radius: 16px; padding: 12px 14px 12px 46px; position: relative; margin: 0; }
.steps li::before { content: "0" counter(s); position: absolute; left: 14px; top: 13px; font: 500 12px var(--mono); color: var(--accent); }

/* Same idea as the README buttons: one flat color, bold caps, an icon. */
.badges { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 18px !important; }
.badge { display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 13px; background: var(--b); color: #fff; font: 700 11.5px/1 var(--font); letter-spacing: .07em; text-transform: uppercase; text-decoration: none; border-radius: 4px; transition: transform .35s var(--spring), filter .2s; box-shadow: inset 0 0 0 .5px rgba(255, 255, 255, .22); }
.badge svg { width: 15px; height: 15px; stroke-width: 2.4; }
.badge:hover { transform: translateY(-2px); filter: brightness(1.12); }

.meta { margin: 0 0 6px; border-radius: 16px; background: var(--fill); overflow: hidden; }
.meta div { display: grid; grid-template-columns: 96px 1fr; gap: 12px; padding: 10px 14px; }
.meta div + div { border-top: .5px solid var(--line); }
.meta dt { font: 500 11.5px/1.6 var(--mono); color: var(--soft); }
.meta dd { margin: 0; font-size: 13.5px; }
.foot { margin-top: 26px; padding-top: 14px; border-top: .5px solid var(--line); font-size: 12px; color: var(--faint); }

/* ---------- HUD on the stage ---------- */
.hud { position: fixed; inset: 0; z-index: 3; pointer-events: none; }
.chip { position: absolute; left: 0; top: 0; border-radius: 99px; padding: 6px 12px; display: flex; align-items: baseline; gap: 7px; white-space: nowrap; font-size: 14px; opacity: 0; transition: opacity .35s; will-change: transform; }
.chip.show { opacity: 1; }
.chip small { font: 500 11px var(--mono); color: var(--soft); }
.chip b { font: 700 15px var(--display); font-variant-numeric: tabular-nums; }
#hud-reps { border-radius: 20px; padding: 8px 16px 10px; flex-direction: column; align-items: flex-start; gap: 0; }
#hud-reps b { font-size: 40px; line-height: 1; letter-spacing: -.03em; }
#hud-reps.tick b { animation: tick .4s var(--spring); }
@keyframes tick { from { transform: scale(1.35); color: var(--accent); } }
#hud-angle b { color: var(--accent); }
.hint { position: absolute; left: 0; top: 0; font: 500 11px var(--mono); color: var(--faint); white-space: nowrap; transition: opacity .6s; }
.hint.gone { opacity: 0; }

.zoom { position: fixed; z-index: 4; bottom: 22px; left: 50%; transform: translateX(-50%); display: flex; border-radius: 99px; padding: 3px; gap: 2px; }
.zoom button { width: 34px; height: 30px; border: 0; border-radius: 99px; background: transparent; color: var(--ink, inherit); font: 500 19px/1 var(--display); cursor: pointer; }
.zoom button:hover { background: rgba(128, 128, 128, .22); }
body.plain .zoom { display: none; }

/* ---------- dock (phones) ---------- */
.dock { display: none; }

/* ---------- quick view: everything as one plain page ---------- */
body.plain { overflow: auto; height: auto; }
body.plain #stage, body.plain .hud, body.plain .dock, body.plain .rail { display: none; }
body.plain .intro { position: static; transform: none; max-height: none; width: auto; max-width: 720px; margin: 96px auto 0; }
body.plain .intro-scroll { padding: 24px 26px; }
body.plain .panel { position: static; width: auto; max-width: 720px; margin: 20px auto 60px; overflow: visible; display: block; }
body.plain .panel-scroll { overflow: visible; }
body.plain .panel section { display: block; padding-bottom: 26px; margin-bottom: 26px; border-bottom: .5px solid var(--line); }
body.plain .panel section > * { animation: none; }

/* ---------- mid widths ---------- */
@media (max-height: 700px) and (min-width: 821px) { .lede { display: none; } .rail button { padding: 6px 14px; } }
@media (max-width: 1180px) and (min-width: 821px) {
  .intro { left: 18px; width: 290px; }
  .intro-scroll { padding: 20px 14px 12px 18px; }
  .panel { width: min(410px, 42vw); right: 18px; }
  .panel-scroll { padding: 24px 22px 18px; }
  .rail button small { display: none; }
}

/* ---------- phones ---------- */
@media (max-width: 820px) {
  body { overflow: hidden auto; height: auto; min-height: 100dvh; }
  #stage { height: 52svh; bottom: auto; }
  .hint { display: none; }
  .zoom { position: absolute; left: auto; right: 12px; top: calc(46svh - 50px); bottom: auto; transform: none; }
  .zoom button { width: 40px; height: 34px; }
  .top { left: 12px; right: 12px; top: max(10px, env(safe-area-inset-top)); }
  .mark, .pill { height: 36px; padding: 0 13px; font-size: 13px; }
  .pill.icon { width: 36px; }
  .intro { position: relative; top: auto; left: auto; transform: none; max-height: none; width: auto; margin: 46svh 12px 0; border-radius: 28px; display: none; }
  .intro-scroll { padding: 20px 20px 10px; }
  body[data-s="about"] .intro { display: block; }
  .intro .rail { display: none; }
  h1 { font-size: 29px; }
  .lede { max-width: none; margin-bottom: 10px; }
  .panel { position: relative; inset: auto; width: auto; margin: 46svh 12px 0; border-radius: 28px; overflow: visible; display: block; margin-bottom: calc(96px + env(safe-area-inset-bottom)); }
  .panel-scroll { overflow: visible; padding: 24px 20px 18px; }
  body[data-s="about"] .panel { margin-top: 8px; }
  h2 { font-size: 25px; }
  .meta div { grid-template-columns: 82px 1fr; }

  /* The glass stays still; only the row of tabs inside it scrolls. (Safari slides a scrolling element's blur along with its content.) */
  .dock { display: block; position: fixed; z-index: 7; left: 10px; right: 10px; bottom: max(10px, env(safe-area-inset-bottom)); height: 56px; border-radius: 99px; overflow: hidden; }
  .dock-scroll { display: flex; height: 100%; padding: 6px; gap: 2px; overflow-x: auto; scrollbar-width: none; border-radius: inherit; }
  .dock-scroll::-webkit-scrollbar { display: none; }
  .dock button { position: relative; z-index: 2; flex: none; padding: 0 15px; border-radius: 99px; font-size: 13.5px; font-weight: 600; color: var(--soft); white-space: nowrap; }
  .dock button[aria-current="true"] { color: var(--ink); }
  .dock .thumb { border-radius: 99px; z-index: 1; }
  body.plain .intro { margin-top: 70px; display: block; }
  body.plain .panel { margin: 14px 12px 40px; }
}

@media (prefers-reduced-motion: reduce) {
  .blobs i, .panel section.on > *, #hud-reps.tick b { animation: none; }
  .lg, .badge, .thumb { transition: none !important; }
}
