/* Career Compass: Apple-style liquid glass.
   Colours are the Apple system colours (light and dark values). Every state change has an
   in-between stage: views fade in from a blur and fade out to clear glass, buttons show a busy
   shimmer while a request runs, rows and dial dots enter and leave instead of popping.
   Glass note: an ancestor with opacity < 1 or a filter becomes a Backdrop Root, and glass inside it
   then blurs only that ancestor's paint. The background here is a soft colour mesh, so that
   difference is barely visible during a fade; keep it that way (no sharp content behind glass that
   sits inside an animating container). */

:root {
  color-scheme: light dark;

  /* Apple system colours, light appearance */
  --red: #ff3b30; --orange: #ff9500; --yellow: #ffcc00; --green: #34c759; --mint: #00c7be;
  --teal: #30b0c7; --cyan: #32ade6; --blue: #007aff; --indigo: #5856d6; --purple: #af52de;
  --pink: #ff2d55; --brown: #a2845e; --gray: #8e8e93;
  /* Not system colours: shades picked so text reaches 4.5:1 on the translucent glass (measured from
     screenshots, light and dark). --green-ink is green text on a card and on the green tag fill;
     --blue-muted is the fill under the white label of a disabled primary button. */
  --green-ink: #17622a; --blue-muted: #284e7a;

  --bg: #f2f2f7;
  --label: #000;
  --label-2: rgba(60, 60, 67, .62);
  --label-3: rgba(60, 60, 67, .32);
  --separator: rgba(60, 60, 67, .16);
  --fill: rgba(120, 120, 128, .16);

  --glass: rgba(255, 255, 255, .44);
  --glass-strong: rgba(255, 255, 255, .66);
  --glass-rim: rgba(255, 255, 255, .85);
  --glass-edge: rgba(255, 255, 255, .38);
  --glass-shadow: 0 12px 34px rgba(20, 20, 60, .14), 0 1px 3px rgba(0, 0, 0, .06);
  --glass-blur: blur(22px) saturate(185%);
  --mesh-alpha: 58%;

  --ease-out: cubic-bezier(.22, 1, .36, 1);
  --ease-in: cubic-bezier(.55, 0, .75, .2);
  --ease-spring: cubic-bezier(.34, 1.4, .64, 1);
  --t-in: .46s;
  --t-out: .22s;

  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", system-ui, sans-serif;
  color: var(--label);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

@media (prefers-color-scheme: dark) {
  :root {
    /* Apple system colours, dark appearance */
    --red: #ff453a; --orange: #ff9f0a; --yellow: #ffd60a; --green: #30d158; --mint: #66d4cf;
    --teal: #40c8e0; --cyan: #64d2ff; --blue: #0a84ff; --indigo: #5e5ce6; --purple: #bf5af2;
    --pink: #ff375f; --brown: #ac8e68; --gray: #8e8e93;
    --green-ink: #48e06e; --blue-muted: #305e92;

    --bg: #000;
    --label: #fff;
    --label-2: rgba(235, 235, 245, .62);
    --label-3: rgba(235, 235, 245, .3);
    --separator: rgba(84, 84, 88, .55);
    --fill: rgba(120, 120, 128, .32);

    --glass: rgba(38, 38, 44, .42);
    --glass-strong: rgba(44, 44, 52, .64);
    --glass-rim: rgba(255, 255, 255, .26);
    --glass-edge: rgba(255, 255, 255, .09);
    --glass-shadow: 0 14px 40px rgba(0, 0, 0, .5), 0 1px 2px rgba(0, 0, 0, .4);
    --mesh-alpha: 42%;
  }
}

* { box-sizing: border-box; }
/* pointer-events: the rules below that transition `display ... allow-discrete` keep a hidden element
   on screen while it fades out. It must not take a tap during that fade. */
[hidden] { display: none !important; pointer-events: none; }

/* ---------- background: a slow mesh of system colours for the glass to bend ---------- */

body {
  margin: 0;
  min-height: 100dvh;
  background: transparent; /* the canvas takes --bg from :root; the mesh sits between them */
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto 1fr;
  grid-template-areas: "bar" "view";
  overflow-x: hidden;
}
body::before {
  content: "";
  position: fixed;
  inset: -25%;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(32% 28% at 22% 18%, color-mix(in srgb, var(--blue) var(--mesh-alpha), transparent), transparent 70%),
    radial-gradient(30% 30% at 82% 22%, color-mix(in srgb, var(--purple) var(--mesh-alpha), transparent), transparent 70%),
    radial-gradient(34% 30% at 74% 78%, color-mix(in srgb, var(--pink) var(--mesh-alpha), transparent), transparent 70%),
    radial-gradient(30% 32% at 18% 80%, color-mix(in srgb, var(--teal) var(--mesh-alpha), transparent), transparent 70%),
    radial-gradient(26% 22% at 52% 50%, color-mix(in srgb, var(--orange) calc(var(--mesh-alpha) * .55), transparent), transparent 70%);
  animation: drift 48s var(--ease-out) infinite alternate;
}
@keyframes drift {
  from { transform: translate3d(0, 0, 0) rotate(0deg) scale(1); }
  50% { transform: translate3d(3%, -2%, 0) rotate(8deg) scale(1.05); }
  to { transform: translate3d(-2%, 3%, 0) rotate(-6deg) scale(1.02); }
}
body.is-leaving > * { opacity: 0; filter: blur(14px); transition: opacity .25s var(--ease-in), filter .25s var(--ease-in); }

/* ---------- the glass material ---------- */

.bar nav, .card, .row, .dial-wrap::before, input, button.ghost, .tool-row button, .tool-row a,
.chips span, .tools summary, .engine, .status {
  background: var(--glass);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  box-shadow: inset 0 1px 0 0 var(--glass-rim), inset 0 0 0 1px var(--glass-edge), var(--glass-shadow);
  border: 0;
}
.card, .row, .bar nav { background: var(--glass-strong); }
/* Specular sheen: light catches the top-left edge. */
.card::after, .row::after, .bar nav::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(140deg, rgba(255, 255, 255, .38), rgba(255, 255, 255, 0) 38%, rgba(255, 255, 255, 0) 70%, rgba(255, 255, 255, .1));
  mix-blend-mode: soft-light;
}

@media (prefers-reduced-transparency: reduce) {
  :root { --glass: color-mix(in srgb, var(--bg) 92%, var(--label)); --glass-strong: var(--glass); }
  .bar nav, .card, .row, .dial-wrap::before, input, button.ghost, .tool-row button, .tool-row a, .chips span,
  .tools summary, .engine, .status { -webkit-backdrop-filter: none; backdrop-filter: none; }
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  /* --bg at 88% and 94%, written as plain colours. Every engine without backdrop-filter also lacks
     color-mix(), and a custom property holding it would leave all glass with no background at all. */
  :root { --glass: rgba(242, 242, 247, .88); --glass-strong: rgba(242, 242, 247, .94); }
  @media (prefers-color-scheme: dark) {
    :root { --glass: rgba(0, 0, 0, .88); --glass-strong: rgba(0, 0, 0, .94); }
  }
}

/* ---------- header and the floating tab bar ---------- */

.bar {
  grid-area: bar;
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(14px, env(safe-area-inset-top)) 16px 6px;
}
@keyframes bar-in { from { opacity: 0; transform: translateY(-10px); filter: blur(8px); } }
.bar h1 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 650;
  letter-spacing: -.01em;
  color: var(--label);
  /* On the title, never on .bar: a transform or filter on .bar, even one that is only being
     animated, makes .bar the containing block of the fixed tab bar inside it, and the tab bar is
     then drawn at the top of the page until the animation ends. */
  animation: bar-in .7s var(--ease-out) backwards;
}

.bar nav {
  position: fixed;
  z-index: 6;
  left: 50%;
  bottom: max(16px, calc(env(safe-area-inset-bottom) + 6px));
  translate: -50% 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  width: min(280px, calc(100% - 32px));
  padding: 5px;
  border-radius: 999px;
  transition: opacity var(--t-in) var(--ease-out), translate var(--t-in) var(--ease-spring), filter var(--t-in) var(--ease-out), display var(--t-in) allow-discrete;
}
.bar nav[hidden] { opacity: 0; translate: -50% 24px; filter: blur(8px); transition-duration: var(--t-out); transition-timing-function: var(--ease-in); }
@starting-style { .bar nav:not([hidden]) { opacity: 0; translate: -50% 24px; filter: blur(8px); } }
/* The sliding pill behind the active tab. */
.bar nav::before {
  content: "";
  position: absolute;
  top: 5px; bottom: 5px; left: 5px;
  width: calc(50% - 5px);
  border-radius: 999px;
  background: color-mix(in srgb, var(--blue) 16%, var(--glass-strong));
  box-shadow: inset 0 1px 0 var(--glass-rim), inset 0 0 0 1px color-mix(in srgb, var(--blue) 30%, transparent);
  transition: transform .5s var(--ease-spring);
}
.bar nav:has(#tab-people.is-on)::before { transform: translateX(100%); }
.tab {
  position: relative;
  z-index: 1;
  border: 0;
  background: transparent;
  color: var(--label-2);
  padding: 10px 12px;
  border-radius: 999px;
  font: inherit;
  font-size: .92rem;
  font-weight: 600;
  transition: color .3s var(--ease-out), transform .2s var(--ease-out);
}
.tab.is-on { color: var(--blue); }
.tab:active { transform: scale(.94); }

.badge {
  display: inline-block;
  min-width: 1.35em;
  margin-left: 2px;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--red);
  color: #fff;
  font-size: .72rem;
  font-weight: 700;
  text-align: center;
  vertical-align: 1px;
  transition: scale .4s var(--ease-spring), opacity .3s var(--ease-out), display .3s allow-discrete;
}
.badge[hidden] { scale: 0; opacity: 0; }
@starting-style { .badge:not([hidden]) { scale: 0; opacity: 0; } }
.badge.is-bumped { animation: bump .5s var(--ease-spring); }
@keyframes bump { 40% { scale: 1.45; } }

/* ---------- views: fade in from a blur, fade out to clear glass ---------- */

main {
  grid-area: view;
  width: 100%;
  max-width: 460px;
  margin: 0 auto;
  padding: 8px 16px calc(96px + env(safe-area-inset-bottom));
  transition: display var(--t-in) allow-discrete;
}
main[hidden] { transition-duration: var(--t-out); }
main > *, main > form > * {
  transition: opacity var(--t-in) var(--ease-out), transform calc(var(--t-in) + .1s) var(--ease-spring), filter var(--t-in) var(--ease-out);
}
main[hidden] > *, main[hidden] > form > * {
  opacity: 0;
  transform: scale(.97);
  filter: blur(10px);
  transition-duration: var(--t-out);
  transition-timing-function: var(--ease-in);
  transition-delay: 0s !important;
}
@starting-style {
  main:not([hidden]) > *, main:not([hidden]) > form > * { opacity: 0; transform: translateY(16px) scale(.97); filter: blur(12px); }
}
/* Stagger: each block arrives a moment after the one above it. */
main > :nth-child(2), main > form > :nth-child(2) { transition-delay: .05s; }
main > :nth-child(3), main > form > :nth-child(3) { transition-delay: .1s; }
main > :nth-child(4), main > form > :nth-child(4) { transition-delay: .15s; }
main > form > :nth-child(5) { transition-delay: .2s; }
main > form > :nth-child(6) { transition-delay: .24s; }
main > form > :nth-child(7) { transition-delay: .28s; }
main > form > :nth-child(n+8) { transition-delay: .32s; }

.lede {
  font-size: 1.55rem;
  font-weight: 700;
  letter-spacing: -.022em;
  line-height: 1.18;
  margin: 18px 0 22px;
}
.fine { color: var(--label-2); font-size: .8rem; line-height: 1.45; margin: 0; }
.error {
  margin: 0;
  padding: 10px 14px;
  border-radius: 14px;
  color: var(--red);
  background: color-mix(in srgb, var(--red) 12%, transparent);
  font-size: .9rem;
  animation: shake .45s var(--ease-out);
}
.error.is-shaken { animation-name: shake-again; }
@keyframes shake-again {
  0% { transform: translateX(0); }
  20% { transform: translateX(-7px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(2px); }
}
@keyframes shake {
  0% { opacity: 0; transform: translateX(0); filter: blur(4px); }
  20% { opacity: 1; transform: translateX(-7px); filter: none; }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(2px); }
}

/* ---------- forms ---------- */

form, .stack { display: grid; gap: 16px; }
label { display: grid; gap: 7px; font-size: .82rem; font-weight: 600; color: var(--label-2); }
input {
  font: inherit;
  font-size: 1.02rem;
  font-weight: 400;
  color: var(--label);
  padding: 13px 15px;
  border-radius: 14px;
  outline: none;
  transition: box-shadow .3s var(--ease-out), background-color .3s var(--ease-out), transform .3s var(--ease-spring);
}
input::placeholder { color: var(--label-3); }
input:focus {
  background: var(--glass-strong);
  box-shadow: inset 0 1px 0 var(--glass-rim), inset 0 0 0 1px var(--glass-edge), 0 0 0 4px color-mix(in srgb, var(--blue) 30%, transparent), var(--glass-shadow);
  transform: translateY(-1px);
}
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
legend { font-size: .82rem; font-weight: 600; color: var(--label-2); margin-bottom: 9px; padding: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips label { display: inline-flex; font-weight: 500; }
.chips input { position: absolute; opacity: 0; pointer-events: none; }
.chips span {
  display: inline-block;
  padding: 8px 14px;
  border-radius: 999px;
  color: var(--label);
  font-size: .88rem;
  cursor: pointer;
  user-select: none;
  transition: background-color .3s var(--ease-out), color .3s var(--ease-out), box-shadow .3s var(--ease-out), transform .25s var(--ease-spring);
}
.chips label:active span { transform: scale(.93); }
.chips input:checked + span {
  background: var(--blue);
  color: #fff;
  font-weight: 600;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .45), 0 6px 16px color-mix(in srgb, var(--blue) 35%, transparent);
  animation: pop .38s var(--ease-spring);
}
.chips input:focus-visible + span { outline: 2px solid var(--blue); outline-offset: 2px; }
@keyframes pop { 45% { transform: scale(1.1); } }

/* ---------- buttons ---------- */

button { font: inherit; cursor: pointer; }
button.primary, .btn {
  position: relative;
  overflow: hidden;
  display: inline-block;
  text-align: center;
  text-decoration: none;
  padding: 14px 20px;
  border: 0;
  border-radius: 999px;
  /* Two properties, not the `background` shorthand: where color-mix() is unsupported the gradient is
     dropped and the solid blue stays. In one declaration the whole background would be lost and the
     white label left on a near-white page. */
  background-color: var(--blue);
  background-image: linear-gradient(180deg, color-mix(in srgb, var(--blue) 82%, #fff), var(--blue));
  color: #fff;
  font-weight: 650;
  font-size: 1rem;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5), inset 0 -1px 0 rgba(0, 0, 0, .08), 0 8px 22px color-mix(in srgb, var(--blue) 38%, transparent);
  transition: transform .35s var(--ease-spring), box-shadow .3s var(--ease-out), opacity .3s var(--ease-out), filter .3s var(--ease-out), background-color .3s var(--ease-out);
}
button.ghost {
  position: relative;
  overflow: hidden;
  padding: 13px 18px;
  border-radius: 999px;
  color: var(--label);
  font-size: 1rem;
  font-weight: 600;
  transition: transform .35s var(--ease-spring), background-color .3s var(--ease-out);
}
button.primary:active:not(:disabled), .btn:active, button.ghost:active:not(:disabled), .tool-row button:active {
  transform: scale(.96);
  transition-duration: .12s;
}
button:disabled { cursor: default; }
button.ghost:disabled { opacity: .45; }
/* Disabled: a deeper, muted fill, not a faded button. Fading (opacity, or a paler blue) takes the
   white label below 4.5:1; it has to stay readable at the low point of `breathe` below as well. */
button.primary:disabled { background-color: var(--blue-muted); background-image: none; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35); }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }

/* Busy: a request is running. A light sweep crosses the button until the answer arrives. */
button.is-busy { pointer-events: none; }
button.is-busy::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 20%, rgba(255, 255, 255, .55) 50%, transparent 80%);
  transform: translateX(-100%);
  animation: sweep 1.1s var(--ease-out) infinite;
}
@keyframes sweep { to { transform: translateX(100%); } }
/* Waiting on the other person: a slow breath, not a spinner. */
.actions button.primary:disabled:not(.is-busy) { animation: breathe 2.4s ease-in-out infinite; }
@keyframes breathe { 50% { opacity: .8; } }

/* ---------- compass ---------- */

.dial-wrap {
  position: relative;
  width: min(100%, 400px);
  margin: 6px auto 0;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
.dial-wrap::before {
  content: "";
  position: absolute;
  inset: 1.4%;
  border-radius: 50%;
  box-shadow: inset 0 2px 0 var(--glass-rim), inset 0 0 0 1px var(--glass-edge), inset 0 -18px 40px rgba(255, 255, 255, .06), var(--glass-shadow);
}
#dial { position: relative; display: block; width: 100%; height: auto; transition: opacity .6s var(--ease-out), filter .6s var(--ease-out); }
.dial-wrap.is-live #dial { animation: wake .9s var(--ease-out); }
@keyframes wake { from { opacity: .4; filter: blur(6px); transform: rotate(-12deg) scale(.96); } }
.dial-wrap.is-invisible #dial { opacity: .35; filter: grayscale(1) blur(1px); }

/* button.primary.start, not .start: `button.primary` sets position: relative and would win.
   nowrap: with left: 50% the button may only be half the dial wide, and on a 320 px wide phone
   that is less than its label, which then breaks into two lines. */
button.primary.start {
  position: absolute;
  left: 50%;
  top: 50%;
  translate: -50% -50%;
  white-space: nowrap;
  transition: opacity .35s var(--ease-out), scale .45s var(--ease-spring), filter .35s var(--ease-out), display .35s allow-discrete !important;
}
.start[hidden] { opacity: 0; scale: 1.25; filter: blur(10px); }

.status {
  text-align: center;
  color: var(--label-2);
  font-size: .86rem;
  line-height: 1.4;
  min-height: 2.6em;
  margin: 14px 0;
  padding: 10px 16px;
  border-radius: 18px;
}
.status.is-changed { animation: settle .5s var(--ease-out); }
@keyframes settle { from { opacity: .2; filter: blur(5px); transform: translateY(4px); } }

/* Dial parts (drawn by compass.js) */
.cc-face { fill: url(#cc-face); }
.cc-rim { fill: none; stroke: var(--glass-rim); stroke-width: 1.2; }
.cc-ring { fill: none; stroke: var(--label-3); stroke-opacity: .6; stroke-dasharray: 1.5 5; }
.cc-tick { stroke: var(--label-3); stroke-width: 1; stroke-linecap: round; }
.cc-tick-mid { stroke: var(--label-2); stroke-width: 1.4; }
.cc-tick-major { stroke: var(--label); stroke-width: 2.4; }
.cc-cardinal {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", system-ui, sans-serif;
  font-size: 18px;
  font-weight: 700;
  fill: var(--label);
  text-anchor: middle;
  dominant-baseline: central;
}
.cc-north { fill: var(--red); }
.cc-spread { fill: var(--red); fill-opacity: .14; transition: opacity .5s var(--ease-out); }
.cc-spread.is-off { opacity: 0; }
.cc-needle-head { fill: url(#cc-needle); }
.cc-needle-tail { fill: var(--label-3); }
.cc-needle-head, .cc-needle-tail { transition: fill-opacity .5s var(--ease-out), opacity .5s var(--ease-out); }
.cc-needle.is-north .cc-needle-head { opacity: .35; }
.cc-pin { fill: var(--glass-strong); stroke: var(--label-2); stroke-width: 1; }
.cc-lubber { fill: var(--label); }

.cc-person { cursor: pointer; outline: none; transition: transform .9s var(--ease-out); }
.cc-pop { transform-box: fill-box; transform-origin: center; animation: dot-in .6s var(--ease-spring) both; }
.cc-person.is-leaving { pointer-events: none; }
.cc-person.is-leaving .cc-pop { animation: dot-out .32s var(--ease-in) forwards; }
@keyframes dot-in { from { transform: scale(0); opacity: 0; } }
@keyframes dot-out { to { transform: scale(.2); opacity: 0; } }
.cc-dot {
  fill: color-mix(in srgb, var(--gray) 70%, transparent);
  stroke: rgba(255, 255, 255, .9);
  stroke-width: 1.5;
  transition: fill .4s var(--ease-out), stroke .4s var(--ease-out), stroke-width .4s var(--ease-spring);
}
.cc-person[data-match] .cc-dot { fill: var(--blue); }
.cc-person[data-relation="connected"] .cc-dot { fill: var(--green); }
.cc-person.is-target .cc-dot { stroke: var(--red); stroke-width: 3; }
.cc-person.is-aimed .cc-dot { fill: var(--red); stroke: #fff; }
.cc-halo { fill: none; stroke: var(--red); stroke-width: 2; opacity: 0; transform-box: fill-box; transform-origin: center; }
.cc-person.is-aimed .cc-halo { animation: halo 1.5s var(--ease-out) infinite; }
@keyframes halo { from { opacity: .7; transform: scale(1); } to { opacity: 0; transform: scale(2.3); } }
.cc-initials { font-size: 10px; font-weight: 700; fill: #fff; text-anchor: middle; dominant-baseline: central; pointer-events: none; }
.cc-person:focus-visible .cc-dot { stroke: var(--blue); stroke-width: 3.5; }
/* The needle lies over the person it points at: let taps fall through to them. */
.cc-needle, .cc-pin, .cc-lubber, .cc-spread { pointer-events: none; }

/* ---------- compass physics, lock-on and the reveal ----------
   Everything the moving compass adds is in this one block, so it can be read and changed without
   touching the rules above.

   The reveal: when the compass has found someone, the markings (rose, ticks, needle, dots) sink
   back into a blur and that person's picture comes forward out of one, inside the same glass disc.
   The disc itself (.dial-wrap::before) never moves, so nothing on the page shifts. reveal.js fills
   the button and sets its `hidden` attribute; lockon.js decides when. .dial-wrap.is-revealed is on
   exactly while the picture is on show. Away from that state the button takes no taps, and once
   it has faded out it is `hidden`, so it can never sit unseen over the dial. */

.dial-wrap #dial { transition: opacity .6s var(--ease-out), filter .6s var(--ease-out), transform .7s var(--ease-out); }
/* Turning by hand: the dial can be taken hold of. */
.dial-wrap.is-by-hand { cursor: grab; }
.dial-wrap.is-grabbed, .dial-wrap.is-grabbed * { cursor: grabbing !important; }

.dial-wrap.is-revealed #dial {
  opacity: 0;
  filter: blur(10px);
  transform: scale(.92);
  pointer-events: none;
  transition-duration: .36s;
  transition-timing-function: var(--ease-in);
}
.reveal {
  position: absolute;
  inset: 17%; /* smaller than the dial: a wide band of glass frames the picture */
  /* No z-index on purpose: it sits above the dial by coming after it, and so can never rise
     above the card, the tab bar or a dialog. */
  display: block;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  overflow: hidden;
  clip-path: circle(50%);
  background: none;
  color: #fff;
  font: inherit;
  -webkit-tap-highlight-color: transparent;
  opacity: 0;
  pointer-events: none;
  transform: scale(.45); /* it pops up out of the centre of the dial */
  filter: blur(16px);
  transition: opacity .3s var(--ease-in), transform .3s var(--ease-in), filter .3s var(--ease-in);
}
.dial-wrap.is-revealed .reveal {
  opacity: 1;
  pointer-events: auto;
  transform: none;
  filter: none;
  transition: opacity .55s var(--ease-out) .1s, transform .8s var(--ease-spring) .1s, filter .55s var(--ease-out) .1s;
}
/* Found: one soft ring goes out from the picture as it pops up. */
.dial-wrap.is-revealed::after {
  content: "";
  position: absolute;
  inset: 17%;
  border-radius: 50%;
  pointer-events: none;
  box-shadow: 0 0 0 3px var(--blue);
  animation: reveal-ring .9s var(--ease-out) .15s both;
}
@keyframes reveal-ring {
  from { opacity: .75; transform: scale(.85); }
  to { opacity: 0; transform: scale(1.38); }
}
@media (prefers-reduced-motion: reduce) {
  .dial-wrap.is-revealed::after { animation: none; opacity: 0; }
  .reveal { transform: none; }
}
/* The glass edge over the picture: light catches the top, shade gathers at the bottom. */
.reveal::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  pointer-events: none;
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, .55), inset 0 0 0 1px rgba(255, 255, 255, .3), inset 0 -16px 34px rgba(0, 0, 0, .16);
}
.reveal:focus-visible { outline: none; }
.reveal:focus-visible::after { box-shadow: inset 0 0 0 4px var(--blue); }
/* No picture, a slow one or a failed one: large initials on the person's own colour.
   Colour and gradient are two properties: where color-mix() is missing the plain colour stays. */
.reveal-face {
  --tint: var(--blue);
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background-color: var(--tint);
  background-image:
    radial-gradient(110% 80% at 28% 12%, rgba(255, 255, 255, .42), transparent 62%),
    linear-gradient(160deg, color-mix(in srgb, var(--tint) 74%, #fff), var(--tint) 52%, color-mix(in srgb, var(--tint) 66%, #000));
}
.reveal-initials {
  font-size: min(19vw, 76px);
  font-weight: 700;
  letter-spacing: -.02em;
  line-height: 1;
  text-shadow: 0 2px 14px rgba(0, 0, 0, .2);
  transform: translate3d(calc(var(--aim, 0) * -.1em), -.12em, 0);
}
.reveal-photo-slot { position: absolute; inset: 0; }
.reveal-photo {
  position: absolute;
  left: -6%;
  top: -6%;
  width: 112%; /* a little larger than the disc: room to slide as the aim drifts */
  height: 112%;
  max-width: none;
  object-fit: cover;
  opacity: 0;
  transition: opacity .5s var(--ease-out);
  transform: translate3d(calc(var(--aim, 0) * -4.5%), 0, 0);
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}
.reveal-photo.is-in { opacity: 1; }
.reveal-shade {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(to top, rgba(0, 0, 0, .64), rgba(0, 0, 0, .3) 24%, transparent 48%),
    radial-gradient(circle, transparent 62%, rgba(0, 0, 0, .14));
}
.reveal-caption {
  position: absolute;
  left: 15%;
  right: 15%;
  bottom: 10.5%;
  display: grid;
  gap: 2px;
  justify-items: center;
  text-align: center;
  text-shadow: 0 1px 10px rgba(0, 0, 0, .5);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity .25s var(--ease-in), transform .25s var(--ease-in);
}
.dial-wrap.is-revealed .reveal-caption {
  opacity: 1;
  transform: none;
  transition: opacity .45s var(--ease-out) .3s, transform .65s var(--ease-spring) .3s;
}
.reveal-name {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -.02em;
}
.reveal-where { font-size: .8rem; font-weight: 600; opacity: .88; font-variant-numeric: tabular-nums; }
/* The way back: a small compass mark where the lubber line was. The whole picture is the button. */
.reveal-back {
  position: absolute;
  top: 5.5%;
  left: 50%;
  translate: -50% 0;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .24);
  -webkit-backdrop-filter: blur(10px) saturate(170%);
  backdrop-filter: blur(10px) saturate(170%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .55), 0 2px 10px rgba(0, 0, 0, .2);
  opacity: 0;
  scale: .6;
  transition: opacity .25s var(--ease-in), scale .25s var(--ease-in);
}
.dial-wrap.is-revealed .reveal-back { opacity: 1; scale: 1; transition: opacity .4s var(--ease-out) .4s, scale .55s var(--ease-spring) .4s; }
.reveal-back svg { display: block; width: 18px; height: 18px; }
/* Another person while the picture is showing: the content cross-fades. */
.reveal.is-swapping > * { animation: reveal-swap .45s var(--ease-out) both; }
@keyframes reveal-swap { from { opacity: 0; filter: blur(10px); } }

/* Lock ring: closes while the aim holds steady on someone (compass.js sets the dash offset). */
.cc-lock {
  fill: none;
  stroke: var(--red);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s var(--ease-out);
}
.cc-lock.is-on { opacity: .9; }

/* The phone says its compass is unsure: figure of eight. Glass like .status, tinted orange. */
.hint {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 14px 0 0;
  padding: 10px 16px;
  border: 0;
  border-radius: 18px;
  background-color: var(--glass);
  background-image: linear-gradient(rgba(255, 149, 0, .15), rgba(255, 149, 0, .15));
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  box-shadow: inset 0 1px 0 0 var(--glass-rim), inset 0 0 0 1px var(--glass-edge), var(--glass-shadow);
  color: var(--label);
  font-size: .84rem;
  line-height: 1.38;
}
.hint-eight { flex: none; width: 46px; height: 23px; overflow: visible; }
.hint-eight path { fill: none; stroke: var(--orange); stroke-width: 2; stroke-linecap: round; opacity: .5; }
.hint-dot { fill: var(--orange); }

/* Demo tools: the live heading readout sits above the store readout. */
.engine.sensor { margin-bottom: 8px; }
.engine.sensor:empty { display: none; }

@media (prefers-reduced-transparency: reduce) {
  .hint, .reveal-back { -webkit-backdrop-filter: none; backdrop-filter: none; }
}
/* Reduced motion: the reveal keeps its cross-fade and loses the scale, the blur and the slide. */
@media (prefers-reduced-motion: reduce) {
  .dial-wrap #dial, .reveal, .reveal-caption, .reveal-photo, .reveal-initials { transform: none !important; filter: none !important; }
  .reveal-back { scale: 1 !important; }
  .hint-dot { display: none; }
}

/* ---------- profile card: a glass sheet that floats above the tab bar ---------- */

.card, .row { position: relative; color: var(--label); }
.card {
  position: fixed;
  z-index: 4;
  left: 50%;
  bottom: calc(max(16px, calc(env(safe-area-inset-bottom) + 6px)) + 62px);
  width: min(440px, calc(100% - 24px));
  max-height: 58dvh;
  overflow: auto;
  padding: 18px 18px 16px;
  border-radius: 28px;
  translate: -50% 0;
  transition: opacity .4s var(--ease-out), transform .55s var(--ease-spring), filter .4s var(--ease-out), display .4s allow-discrete !important;
}
.card[hidden] { opacity: 0; transform: translateY(40px) scale(.94); filter: blur(12px); transition-duration: var(--t-out); transition-timing-function: var(--ease-in); }
@starting-style { .card:not([hidden]) { opacity: 0; transform: translateY(48px) scale(.92); filter: blur(14px); } }
.card.is-swapping > * { animation: swap .45s var(--ease-out) both; }
@keyframes swap { from { opacity: 0; filter: blur(8px); transform: translateX(14px); } }
.card.is-celebrating, .row.is-celebrating { animation: celebrate 1.2s var(--ease-out); }
@keyframes celebrate {
  0% { box-shadow: inset 0 1px 0 var(--glass-rim), 0 0 0 0 color-mix(in srgb, var(--green) 60%, transparent), var(--glass-shadow); }
  100% { box-shadow: inset 0 1px 0 var(--glass-rim), 0 0 0 22px transparent, var(--glass-shadow); }
}
.is-arriving { animation: arrive .45s var(--ease-spring) both; }
@keyframes arrive { from { opacity: 0; transform: translateY(8px) scale(.96); filter: blur(6px); } }
.where.is-changed { animation: settle .45s var(--ease-out); }

.row { padding: 16px; border-radius: 22px; }
.row.is-new { animation: arrive .5s var(--ease-spring) both; }
.ghost-row { position: absolute !important; margin: 0 !important; pointer-events: none; z-index: 1; }

/* The head starts with the person's picture (.row-head: picture and name), so the distance is centred
   on it. On the baseline it would hang from the bottom edge of the picture. A long name wraps inside
   .row-head instead of pushing the distance out of the card. */
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.card-head .row-head { min-width: 0; }
.card-head h2 { overflow-wrap: anywhere; }
.card h2, .row h3 { margin: 0; font-size: 1.28rem; font-weight: 700; letter-spacing: -.02em; }
.card .where, .row .where { color: var(--label-2); font-size: .82rem; white-space: nowrap; font-variant-numeric: tabular-nums; }
.card p, .row p { margin: 6px 0 0; line-height: 1.4; }
.why { color: var(--green-ink); font-weight: 600; font-size: .9rem; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.tag {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--fill);
  color: var(--label-2);
  font-size: .78rem;
  font-weight: 500;
}
.tag.hit { background: color-mix(in srgb, var(--green) 20%, transparent); color: var(--green-ink); font-weight: 650; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.actions .btn, .actions button { flex: 1 1 auto; }
.card a.link, .row a.link { color: var(--blue); font-weight: 600; text-decoration: none; }
.card a.link:active, .row a.link:active { opacity: .6; }
.note { color: var(--label-2); font-size: .82rem; flex-basis: 100%; }

/* ---------- people tab ---------- */

#view-people section { margin-bottom: 8px; }
#view-people h2 { font-size: 1.35rem; font-weight: 700; letter-spacing: -.02em; margin: 22px 4px 12px; }
.list { position: relative; display: grid; gap: 12px; }
.empty { color: var(--label-2); font-size: .9rem; margin: 0 4px; }

/* ---------- demo tools ---------- */

.tools { margin-top: 18px; font-size: .88rem; color: var(--label-2); interpolate-size: allow-keywords; }
.tools summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 16px;
  border-radius: 16px;
  cursor: pointer;
  list-style: none;
  font-weight: 600;
  transition: border-radius .3s var(--ease-out);
}
.tools summary::-webkit-details-marker { display: none; }
.tools summary::after { content: "›"; font-size: 1.2rem; line-height: 1; transition: transform .4s var(--ease-spring); }
.tools[open] summary::after { transform: rotate(90deg); }
.tools::details-content { block-size: 0; overflow: clip; transition: block-size .45s var(--ease-out), content-visibility .45s allow-discrete; }
.tools[open]::details-content { block-size: auto; }
.tools[open] .tool-row, .tools[open] .engine { animation: arrive .45s var(--ease-out) both; }
.tools[open] .engine { animation-delay: .06s; }
.tool-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.tool-row button, .tool-row a {
  padding: 9px 14px;
  border-radius: 999px;
  color: var(--label);
  font-size: .86rem;
  font-weight: 500;
  position: relative;
  overflow: hidden;
  transition: transform .35s var(--ease-spring);
}
.tool-row button.is-changed { animation: settle .4s var(--ease-out); }
.engine {
  margin: 0;
  padding: 14px;
  border-radius: 16px;
  color: var(--label-2);
  font: .72rem/1.5 ui-monospace, "SF Mono", Menlo, monospace;
  overflow-x: auto;
  white-space: pre-wrap;
}

/* ---------- reduced motion: keep the fades, drop movement and blur ---------- */

@media (prefers-reduced-motion: reduce) {
  body::before { animation: none; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
  main > *, main > form > *, .card, .bar nav, .start { transform: none !important; filter: none !important; }
  .cc-person { transition: none; }
}

/* ---------- pictures, the photo picker and the "no position" notice (LinkedIn and location work) ---------- */

.avatar { width: 44px; height: 44px; flex: none; border-radius: 50%; object-fit: cover; background: var(--fill); }
.row-head { display: flex; align-items: center; gap: 12px; }
.photo-pick { display: flex; align-items: flex-end; gap: 12px; }
.photo-pick label { flex: 1; min-width: 0; }
.photo-pick label span { font-weight: 400; }
.photo-pick .avatar { width: 52px; height: 52px; }
input[type="file"] { width: 100%; font-size: .88rem; padding: 10px 12px; }
/* The notice reuses the glass .row; these only space it under the status line. */
.locate { margin: 0 0 14px; }
.locate p { margin: 0; font-size: .92rem; }

/* Signed in with LinkedIn: the profile form asks only for the share link. */
#signup.linkedin-only > :not(.keep) { display: none; }
.linkedin-help { margin: -4px 0 0; }
.tool-row a { text-decoration: none; display: inline-block; }
