/* The designer's profile with skills in a tray that tilts: the profile card of a product designer on a portfolio
   platform, on a warm light page. Under the name, the role and the availability sits a tray with her skills; the
   tray leans with the pointer and the pills inside move with hand-written physics (script.js). Every pill is one
   element for the script (position and turn) with a face inside for the squash, and a label inside the face for
   the CSS hover. */
:root {
  --page: #eeeae3;          /* the page */
  --page-light: #f8f6f1;    /* the soft light at the top of the page */
  --card: #fbfaf7;          /* the card */
  --ink: #16161b;           /* the words and the dark pills */
  --muted: #74737b;         /* the small words */
  --line: rgba(22, 22, 27, 0.08); /* hairlines */
  --tray: #efede8;          /* the floor of the tray */
  --accent: #5a4bff;        /* the one colour: the badge, the needle, one pill, the button light */
  --accent-deep: #3f31e0;   /* the darker side of the accent */
  --glass: rgba(255, 255, 255, 0.86); /* the glass of the light pills */
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  overflow-x: clip;
}

body {
  min-height: 100svh;
  background:
    radial-gradient(120% 70% at 50% 0%, var(--page-light) 0%, rgba(248, 246, 241, 0) 62%),
    var(--page);
  color: var(--ink);
  font-family: 'Mona Sans Variable', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* a grain on the page, barely there */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.35;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='140' height='140'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 .5 0 0 0 0 .48 0 0 0 0 .45 0 0 0 .09 0'/></filter><rect width='140' height='140' filter='url(%23n)'/></svg>");
}

.stage {
  position: relative;
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: clamp(10px, 3vh, 32px) clamp(10px, 3vw, 32px);
  overflow: hidden;
}

/* ---------------------------------------------------------------- the card */
.card {
  position: relative;
  width: min(400px, 92vw);
  display: flex;
  flex-direction: column;
  gap: clamp(6px, 1.8vh, 13px);
  padding: clamp(13px, 3.4vh, 22px) clamp(13px, 4vw, 22px) clamp(12px, 2.6vh, 18px);
  border-radius: clamp(20px, 5vh, 28px);
  background: linear-gradient(180deg, #ffffff 0%, var(--card) 46%, #f7f5f0 100%);
  box-shadow:
    0 0 0 1px rgba(22, 22, 27, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 1),
    0 1px 2px rgba(40, 32, 20, 0.05),
    0 8px 18px -6px rgba(40, 32, 20, 0.1),
    0 32px 60px -22px rgba(40, 32, 20, 0.22);
  isolation: isolate;
}

/* a soft light that follows the pointer over the card */
.card__sheen {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  z-index: -1;
  background: radial-gradient(240px 180px at var(--mx, 70%) var(--my, 0%), rgba(90, 75, 255, 0.07), rgba(90, 75, 255, 0) 70%);
}

.card__head {
  display: flex;
  align-items: center;
  gap: clamp(9px, 2.6vw, 12px);
}

.avatar {
  position: relative;
  flex: none;
  width: clamp(36px, 10vh, 46px);
  aspect-ratio: 1;
  border-radius: 50%;
  padding: 2px;
  background: conic-gradient(from 210deg, var(--accent), #b9b2ff, #ffffff, var(--accent));
  box-shadow: 0 4px 10px -4px rgba(63, 49, 224, 0.45);
}

.avatar__face {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 2px solid #ffffff;
  background:
    radial-gradient(80% 80% at 30% 22%, #ffffff 0%, rgba(255, 255, 255, 0) 60%),
    linear-gradient(150deg, #e9e6ff 0%, #c9c2ff 100%);
  color: var(--accent-deep);
  font-size: clamp(11px, 3vh, 14px);
  font-weight: 640;
  font-stretch: 112%;
  letter-spacing: 0.02em;
}

.card__who {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 2px;
}

.card__name-row {
  display: flex;
  align-items: center;
  gap: 5px;
}

.card__name {
  margin: 0;
  font-size: clamp(14px, 4vh, 17px);
  font-weight: 620;
  font-stretch: 104%;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.card__badge {
  flex: none;
  width: 15px;
  height: 15px;
}

.card__badge-seal {
  fill: var(--accent);
}

.card__badge-tick {
  fill: none;
  stroke: #ffffff;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.card__role {
  font-size: clamp(11px, 3vh, 12.5px);
  color: var(--muted);
  white-space: nowrap;
}

/* on a narrow card the studio gives way to the availability */
@media (max-width: 420px) {
  .card__at {
    display: none;
  }
}

.chip {
  position: relative;
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex: none;
  height: clamp(24px, 6.6vh, 28px);
  padding: 0 10px 0 8px;
  border-radius: 999px;
  overflow: hidden;
  font-size: clamp(10.5px, 2.8vh, 11.5px);
  font-weight: 540;
  white-space: nowrap;
  color: #2e2a66;
  background: linear-gradient(180deg, #f3f1ff, #e9e6ff);
  box-shadow: inset 0 0 0 1px rgba(90, 75, 255, 0.18), inset 0 1px 0 #ffffff;
}

.chip svg {
  width: 13px;
  height: 13px;
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.4;
  stroke-linecap: round;
}

/* the light that crosses the chip once, on arrival and on hover */
.chip__shine {
  position: absolute;
  inset: -2px auto -2px 0;
  width: 40%;
  background: linear-gradient(100deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0));
  transform: translateX(-120%) skewX(-18deg);
  pointer-events: none;
}

.facts {
  display: flex;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: clamp(11px, 3vh, 12.5px);
  color: var(--muted);
}

.facts li {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0 clamp(8px, 2.6vw, 12px);
  white-space: nowrap;
}

.facts li:first-child {
  padding-left: 0;
}

.facts li + li {
  border-left: 1px solid var(--line);
}

.facts b {
  color: var(--ink);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.facts svg {
  width: 12px;
  height: 12px;
  fill: var(--ink);
}

/* ---------------------------------------------------------------- the buttons */
.actions {
  display: flex;
  gap: 8px;
}

.btn {
  position: relative;
  flex: 1;
  height: clamp(32px, 9vh, 40px);
  padding: 0;
  border: 0;
  border-radius: 999px;
  font: inherit;
  font-size: clamp(12px, 3.2vh, 13.5px);
  font-weight: 560;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.5s cubic-bezier(0.34, 1.7, 0.5, 1);
}

.btn__face {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 100%;
  font-stretch: 100%;
  transition: font-stretch 0.45s cubic-bezier(0.34, 1.6, 0.5, 1);
}

.btn--main {
  flex: 1.25;
  overflow: hidden;
  color: #ffffff;
  background: linear-gradient(180deg, #2a2a33 0%, var(--ink) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.16),
    0 1px 1px rgba(0, 0, 0, 0.2),
    0 8px 16px -8px rgba(22, 22, 27, 0.6);
}

/* the accent light under the dark button, that rises on hover */
.btn__fill {
  position: absolute;
  inset: 0;
  background: radial-gradient(80% 120% at 50% 130%, rgba(122, 108, 255, 0.85), rgba(90, 75, 255, 0) 70%);
  opacity: 0.35;
  transform: translateY(30%);
  transition: opacity 0.4s ease, transform 0.6s cubic-bezier(0.34, 1.5, 0.5, 1);
}

.btn__arrow,
.btn__icon {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.45s cubic-bezier(0.34, 1.7, 0.5, 1);
}

.btn--ghost {
  color: var(--ink);
  background: linear-gradient(180deg, #ffffff, #f5f3ee);
  box-shadow: inset 0 0 0 1px rgba(22, 22, 27, 0.1), 0 1px 2px rgba(40, 32, 20, 0.06);
}

.btn:active {
  transform: scale(0.965);
  transition-duration: 0.12s;
}

.btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

@media (hover: hover) {
  .btn:hover .btn__face {
    font-stretch: 112%;
  }
  .btn--main:hover .btn__fill {
    opacity: 1;
    transform: translateY(0);
  }
  .btn--main:hover .btn__arrow {
    transform: translateX(2px);
  }
  .btn--ghost:hover .btn__icon {
    transform: rotate(-8deg) translateY(-1px);
  }
  .chip:hover .chip__shine {
    transform: translateX(320%) skewX(-18deg);
    transition: transform 0.9s cubic-bezier(0.3, 0.7, 0.2, 1);
  }
}

/* ---------------------------------------------------------------- the skills */
.skills-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: clamp(0px, 0.6vh, 4px);
  font-size: clamp(11px, 3vh, 12.5px);
  font-weight: 580;
}

.level {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
}

.level__ruler {
  position: relative;
  width: 64px;
  height: 10px;
  overflow: hidden;
}

/* fine ticks, a longer one in the middle */
.level__ticks {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, transparent calc(50% - 0.5px), rgba(22, 22, 27, 0.35) calc(50% - 0.5px), rgba(22, 22, 27, 0.35) calc(50% + 0.5px), transparent calc(50% + 0.5px)) center / 100% 100% no-repeat,
    repeating-linear-gradient(90deg, rgba(22, 22, 27, 0.18) 0 1px, transparent 1px 6px) 2px 6px / 100% 4px no-repeat;
}

.level__needle {
  position: absolute;
  left: calc(50% - 1px);
  top: 0;
  width: 2px;
  height: 10px;
  border-radius: 2px;
  background: var(--accent);
}

.level__deg {
  min-width: 4.2ch;
  font-family: 'Geist Mono Variable', ui-monospace, monospace;
  font-size: 10.5px;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.well {
  position: relative;
  height: clamp(104px, 31vh, 210px);
  margin: clamp(2px, 0.8vh, 6px) 0;
}

.tray {
  position: absolute;
  inset: 0;
  border-radius: clamp(14px, 4vh, 18px);
  overflow: hidden;
  background:
    repeating-linear-gradient(0deg, rgba(22, 22, 27, 0.028) 0 1px, transparent 1px 18px),
    linear-gradient(180deg, #e9e6df 0%, var(--tray) 40%, #f3f1ec 100%);
  box-shadow:
    inset 0 2px 5px rgba(40, 32, 20, 0.12),
    inset 0 0 0 1px rgba(22, 22, 27, 0.07),
    0 1px 0 rgba(255, 255, 255, 1);
  touch-action: none;
  will-change: transform;
}

/* the lip of the tray: a light line along the bottom that catches the lean */
.tray::after {
  content: '';
  position: absolute;
  left: 10%;
  right: 10%;
  bottom: 0;
  height: 1px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0));
  pointer-events: none;
}

.pill {
  position: absolute;
  left: 0;
  top: 0;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  will-change: transform;
}

.pill.is-held {
  cursor: grabbing;
  z-index: 5;
}

/* the soft shadow under the pill: the script lifts and widens it with the speed */
.pill__shadow {
  position: absolute;
  inset: 18% 8% -8%;
  border-radius: 999px;
  background: rgba(40, 32, 20, 0.32);
  filter: blur(5px);
  pointer-events: none;
}

.pill__face {
  position: relative;
  display: block;
  border-radius: 999px;
  will-change: transform;
}

.pill__label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  height: var(--ph, 30px);
  padding: 0 0.95em;
  border-radius: 999px;
  font-size: var(--pf, 12.5px);
  font-weight: 540;
  font-stretch: 100%;
  white-space: nowrap;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.95) 0%, rgba(255, 255, 255, 0) 52%),
    var(--glass);
  box-shadow:
    inset 0 0 0 1px rgba(22, 22, 27, 0.09),
    inset 0 -1px 0 rgba(22, 22, 27, 0.05),
    0 1px 1px rgba(40, 32, 20, 0.06);
  transition: font-stretch 0.4s cubic-bezier(0.34, 1.6, 0.5, 1), box-shadow 0.3s ease;
}

.pill__label svg {
  width: 1.05em;
  height: 1.05em;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.pill--ink .pill__label {
  color: #ffffff;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.16) 0%, rgba(255, 255, 255, 0) 50%),
    linear-gradient(180deg, #2a2a33, var(--ink));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14), 0 1px 1px rgba(0, 0, 0, 0.2);
}

.pill--accent .pill__label {
  color: #ffffff;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.28) 0%, rgba(255, 255, 255, 0) 52%),
    linear-gradient(180deg, #7466ff, var(--accent-deep));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), inset 0 0 0 1px rgba(40, 28, 190, 0.4), 0 2px 6px -2px rgba(63, 49, 224, 0.5);
}

.pill.is-held .pill__label {
  font-stretch: 110%;
  box-shadow: inset 0 0 0 1px rgba(90, 75, 255, 0.5), 0 1px 1px rgba(40, 32, 20, 0.06);
}

.pill--ink.is-held .pill__label,
.pill--accent.is-held .pill__label {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), 0 0 0 1.5px rgba(90, 75, 255, 0.35);
}

@media (hover: hover) {
  .pill:hover .pill__label {
    font-stretch: 108%;
  }
}

.hint {
  margin: 0;
  text-align: center;
  font-size: clamp(10px, 2.7vh, 11px);
  color: var(--muted);
}

/* ---------------------------------------------------------------- the drawn pointer */
.ghost {
  position: absolute;
  left: 0;
  top: 0;
  width: 22px;
  height: 22px;
  margin: -3px 0 0 -4px;
  pointer-events: none;
  opacity: 0;
  z-index: 20;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.25));
}

.ghost path {
  fill: var(--ink);
  stroke: #ffffff;
  stroke-width: 1.4;
  stroke-linejoin: round;
}

@media (prefers-reduced-motion: reduce) {
  .btn,
  .btn__face,
  .btn__fill,
  .btn__arrow,
  .btn__icon,
  .pill__label {
    transition: none;
  }
}
