/* The photographer's profile card with skills that fall: a warm paper card on a soft grey page, the portrait on the
   left, the words on the right; over both, a layer for the physics (.world) where the glass skill tags fall in
   through the top edge and pile up on the card's floor. Each tag is three nested elements: .tag gets the position
   and rotation of its body every frame, .tag__face the squash of a hard landing (GSAP), .tag__skin the look and the
   hover (CSS). The tooltip lives in the card, outside the clipped world, and follows the tag it belongs to. */
:root {
  --page: #e8e5e0;          /* the page */
  --card: #fbfaf7;          /* the paper of the card */
  --ink: #17161b;           /* the words and the dark tags */
  --muted: #7b7781;         /* the small words */
  --accent: #c24d5c;        /* the tulip rose: the main skill, the tooltip's years */
  --glass: rgba(255, 255, 255, 0.7); /* the glass of the light tags */
  --tip: rgba(24, 23, 29, 0.78);     /* the glass of the tooltip */
}

* {
  box-sizing: border-box;
}

html {
  touch-action: manipulation;
}

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

body {
  min-height: 100svh;
  background:
    radial-gradient(120% 80% at 50% 0%, #f1efeb 0%, transparent 60%),
    var(--page);
  color: var(--ink);
  font-family: 'Mona Sans Variable', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.stage {
  position: relative;
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 12px;
  overflow: hidden;
}

/* ------------------------------------------------------------------ the card */
.card {
  --pad: clamp(7px, 1.6vh, 10px);
  position: relative;
  width: min(640px, 92vw);
  height: min(400px, 86vh);
  display: grid;
  grid-template-columns: 41% 1fr;
  border-radius: clamp(18px, 3vh, 24px);
  background: var(--card);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 0 0 1px rgba(23, 22, 27, 0.06),
    0 1px 2px rgba(23, 22, 27, 0.06),
    0 10px 24px -12px rgba(23, 22, 27, 0.18),
    0 40px 70px -40px rgba(23, 22, 27, 0.35);
  opacity: 0;
  user-select: none;
  -webkit-user-select: none;
}

/* a whisper of grain on the paper */
.card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0.35;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.1 0 0 0 0 0.09 0 0 0 0 0.1 0 0 0 0.06 0'/></filter><rect width='160' height='160' filter='url(%23n)'/></svg>");
}

.card__photo {
  position: relative;
  margin: var(--pad);
  margin-right: 0;
  border-radius: calc(clamp(18px, 3vh, 24px) - var(--pad));
  overflow: hidden;
  background: #d9dbe0;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.25);
}

.card__photo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 52% 34%;
  display: block;
}

/* the edge of the photo catches a little light from the top */
.card__photo::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45), inset 0 0 0 1px rgba(23, 22, 27, 0.06);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), transparent 30%, transparent 70%, rgba(23, 22, 27, 0.12));
  pointer-events: none;
}

.card__place {
  position: absolute;
  left: 10px;
  top: 10px;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 9px 4px 6px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 520;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.62);
  -webkit-backdrop-filter: blur(8px) saturate(1.4);
  backdrop-filter: blur(8px) saturate(1.4);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.7), 0 4px 10px -6px rgba(23, 22, 27, 0.35);
}

.card__place svg {
  width: 12px;
  height: 12px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.4;
}

.card__body {
  position: relative;
  padding: clamp(14px, 4vh, 26px) clamp(12px, 3.4vw, 26px) 0;
  min-width: 0;
}

.card__head {
  display: flex;
  align-items: center;
  gap: 6px;
}

.card__name {
  margin: 0;
  font-size: clamp(17px, min(3.6vw, 5.4vh), 25px);
  line-height: 1.05;
  font-weight: 640;
  font-variation-settings: 'wdth' 92;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.card__badge {
  flex: none;
  width: clamp(14px, 2.4vh, 17px);
  height: clamp(14px, 2.4vh, 17px);
}

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

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

.card__role {
  margin: clamp(3px, 0.8vh, 6px) 0 0;
  font-size: clamp(11.5px, min(2vw, 2.9vh), 13.5px);
  font-weight: 500;
  color: var(--muted);
}

.card__line {
  margin: clamp(8px, 2vh, 14px) 0 0;
  max-width: 30ch;
  font-size: 13px;
  line-height: 1.45;
  color: #45424b;
}

.card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: clamp(10px, 2.6vh, 18px);
}

.btn {
  appearance: none;
  border: 0;
  padding: 0;
  background: none;
  font: inherit;
  color: inherit;
  cursor: pointer;
  border-radius: 999px;
}

.btn__face {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: clamp(28px, 5.4vh, 34px);
  padding: 0 clamp(11px, 1.8vw, 14px);
  border-radius: inherit;
  font-size: clamp(11.5px, min(1.9vw, 2.9vh), 13px);
  font-weight: 560;
  white-space: nowrap;
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), background-color 0.25s, box-shadow 0.25s;
}

.btn--main .btn__face {
  color: #fff;
  background: linear-gradient(180deg, #2a2830, var(--ink));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16), 0 0 0 1px var(--ink), 0 6px 14px -8px rgba(23, 22, 27, 0.7);
}

.btn--ghost .btn__face {
  background: #fff;
  box-shadow: inset 0 0 0 1px rgba(23, 22, 27, 0.12), 0 1px 2px rgba(23, 22, 27, 0.06);
}

.btn--ghost[aria-pressed='true'] .btn__face {
  color: var(--accent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 45%, transparent), 0 1px 2px rgba(23, 22, 27, 0.06);
}

.btn__arrow,
.btn__plus {
  width: 13px;
  height: 13px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.btn--ghost[aria-pressed='true'] .btn__plus {
  transform: rotate(45deg);
}

.btn:active .btn__face {
  transform: scale(0.96);
}

@media (hover: hover) {
  .btn:hover .btn__face {
    transform: translateY(-1px);
  }
  .btn--main:hover .btn__arrow {
    transform: translateX(2px);
  }
  .btn:active .btn__face {
    transform: scale(0.96);
  }
}

.card__skills {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin: clamp(12px, 3vh, 20px) 0 0;
  padding-top: clamp(8px, 1.6vh, 11px);
  border-top: 1px solid rgba(23, 22, 27, 0.07);
  font-size: 11px;
  font-weight: 560;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.card__hint {
  font-weight: 460;
  letter-spacing: 0;
  text-transform: none;
  color: #a19ca6;
}

/* the description goes when the card is low (the phone's box) */
@media (max-height: 520px), (max-width: 520px) {
  .card__line {
    display: none;
  }
}

@media (max-width: 420px) {
  .card {
    grid-template-columns: 38% 1fr;
  }
  .card__hint {
    display: none;
  }
  .card__actions {
    gap: 5px;
  }
}

/* ------------------------------------------------------------------ the world and the tags */
.world {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  overflow: hidden;
  pointer-events: none;
  z-index: 3;
}

.tag {
  position: absolute;
  left: 0;
  top: 0;
  visibility: hidden;
  pointer-events: auto;
  cursor: grab;
  touch-action: none;
  will-change: transform;
}

.tag.is-held {
  cursor: grabbing;
}

.tag__face {
  display: block;
}

.tag__skin {
  --lift: 0;
  display: flex;
  align-items: center;
  gap: 0.45em;
  height: 2.36em;
  padding: 0 1em;
  border-radius: 999px;
  font-size: clamp(10.5px, min(2.05vw, 3.1vh), 13.5px);
  font-weight: 560;
  font-variation-settings: 'wdth' 100;
  white-space: nowrap;
  color: var(--ink);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.86), var(--glass));
  -webkit-backdrop-filter: blur(6px) saturate(1.5);
  backdrop-filter: blur(6px) saturate(1.5);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.95),
    inset 0 0 0 1px rgba(23, 22, 27, 0.08),
    0 1px 1px rgba(23, 22, 27, 0.08),
    0 calc(4px + var(--lift) * 10px) calc(10px + var(--lift) * 18px) calc(-6px - var(--lift) * 4px) rgba(23, 22, 27, calc(0.32 + var(--lift) * 0.12));
  transition: background-color 0.25s, color 0.25s, font-variation-settings 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.tag--ink .tag__skin {
  color: #f6f4f1;
  background: linear-gradient(180deg, #2c2a32, var(--ink));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    inset 0 0 0 1px rgba(0, 0, 0, 0.4),
    0 1px 1px rgba(23, 22, 27, 0.12),
    0 calc(4px + var(--lift) * 10px) calc(10px + var(--lift) * 18px) calc(-6px - var(--lift) * 4px) rgba(23, 22, 27, calc(0.4 + var(--lift) * 0.12));
}

.tag--accent .tag__skin {
  color: #fff;
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 82%, #fff), var(--accent));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.35),
    inset 0 0 0 1px color-mix(in srgb, var(--accent) 70%, #000),
    0 1px 1px rgba(23, 22, 27, 0.12),
    0 calc(4px + var(--lift) * 10px) calc(10px + var(--lift) * 18px) calc(-6px - var(--lift) * 4px) color-mix(in srgb, var(--accent) calc(55% + var(--lift) * 20%), transparent);
}

.tag.is-open .tag__skin {
  font-variation-settings: 'wdth' 112;
  outline: 1.5px solid color-mix(in srgb, var(--accent) 70%, transparent);
  outline-offset: 2px;
}

@media (hover: hover) {
  .tag:hover .tag__skin {
    font-variation-settings: 'wdth' 112;
  }
}

/* ------------------------------------------------------------------ the tooltip */
.tip {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 6;
  pointer-events: none;
  visibility: hidden;
}

.tip__pop {
  opacity: 0;
}

.tip__glass {
  display: grid;
  grid-template-columns: auto auto;
  align-items: baseline;
  column-gap: 14px;
  row-gap: 5px;
  min-width: 148px;
  padding: 10px 12px 10px;
  border-radius: 14px;
  color: #f6f4f1;
  background: linear-gradient(180deg, rgba(48, 46, 56, 0.82), var(--tip));
  -webkit-backdrop-filter: blur(12px) saturate(1.6);
  backdrop-filter: blur(12px) saturate(1.6);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.16),
    inset 0 0 0 1px rgba(255, 255, 255, 0.07),
    0 12px 28px -12px rgba(23, 22, 27, 0.55),
    0 2px 6px rgba(23, 22, 27, 0.18);
}

.tip__skill {
  font-size: 11px;
  font-weight: 560;
  color: #c9c5cf;
}

.tip__years {
  justify-self: end;
  display: inline-flex;
  align-items: baseline;
  gap: 3px;
}

.tip__num {
  font-size: 22px;
  line-height: 1;
  font-weight: 650;
  font-variation-settings: 'wdth' 88;
  letter-spacing: -0.02em;
  color: #fff;
}

.tip__unit {
  font-size: 11px;
  color: #c9c5cf;
}

.tip__ticks {
  grid-column: 1 / -1;
  display: flex;
  gap: 2px;
  height: 12px;
  align-items: flex-end;
}

.tip__tick {
  flex: 1;
  height: 100%;
  border-radius: 1px;
  background: rgba(255, 255, 255, 0.13);
  transform-origin: 50% 100%;
}

.tip__tick.is-on {
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 60%, #fff), var(--accent));
}

.tip__since {
  grid-column: 1 / -1;
  font-size: 10.5px;
  color: #9e9aa6;
}

.tip__notch {
  display: block;
  width: 20px;
  height: 9px;
  margin: -1px auto 0;
  fill: var(--tip);
  transform: translateX(var(--nx, 0px));
}

/* ------------------------------------------------------------------ the drawn pointer of the autopilot */
.ghost {
  position: absolute;
  left: 0;
  top: 0;
  width: 22px;
  height: 22px;
  fill: #fff;
  stroke: var(--ink);
  stroke-width: 1.3;
  stroke-linejoin: round;
  filter: drop-shadow(0 2px 3px rgba(23, 22, 27, 0.35));
  pointer-events: none;
  opacity: 0;
  z-index: 10;
}

/* ------------------------------------------------------------------ reduced motion: the tags laid out on the floor */
.ferma .world {
  display: flex;
  flex-wrap: wrap-reverse;
  align-content: flex-start;
  justify-content: flex-end;
  gap: 6px;
  padding: 0 12px 12px;
}

.ferma .tag {
  position: relative;
  visibility: visible;
  cursor: pointer;
}
