/* The hair stylist's card: a white card on a white page. The portrait sits on a sea-green backdrop, the hair is
   copper, and the card's ink and button take the deep green of the backdrop's shadow. */
:root {
  --page: #ffffff;          /* the page */
  --card: #ffffff;          /* the card */
  --ink: #1b2523;           /* the words */
  --muted: #5f6b67;
  --line: rgba(27, 37, 35, 0.12);
  --accent: #1d5b56;        /* the Follow button */
  --accent-soft: #e2efec;   /* the Follow button once she is followed */
  --backdrop: #a9d3c9;      /* the portrait's backdrop */
  --backdrop-light: #dcefe9;
  --skin: #f0c19f;          /* her skin */
  --skin-shade: #d99a77;
  --lips: #c4554a;
  --top: #f5ece0;           /* her sweater */
  --top-shade: #dfcfba;
  --hair-deep: #5e2310;     /* her hair, from the shadows to the shine */
  --hair: #9c3f1b;
  --hair-mid: #bd5a29;
  --hair-light: #d77d45;
  --hair-shine: #f6bd8c;
  --gold: #d9a441;          /* the earring */
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
}

body {
  min-height: 100svh;
  background: var(--page);
  color: var(--ink);
  font-family: 'Mona Sans Variable', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.stage {
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 32px 16px;
}

/* ---------------------------------------------------------------- the card */
.profile {
  width: min(340px, 100%);
  padding: 8px;
  border-radius: 28px;
  background: var(--card);
  box-shadow:
    0 0 0 1px rgba(27, 37, 35, 0.07),
    0 2px 6px -2px rgba(27, 37, 35, 0.08),
    0 30px 50px -26px rgba(27, 37, 35, 0.34);
}

/* until the script starts, the card waits unseen: it comes in with its own entrance, and its portrait is drawn by
   the script (if the script never comes, the card shows after a moment anyway) */
.js .profile {
  opacity: 0;
  animation: arrive 0.01s linear 2.5s forwards;
}

@keyframes arrive {
  to {
    opacity: 1;
  }
}

/* the portrait: a canvas the script draws */
.profile__portrait {
  position: relative;
  aspect-ratio: 324 / 300;
  overflow: hidden;
  border-radius: 20px;
  background: var(--backdrop);
  isolation: isolate;
}

.profile__portrait::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px rgba(27, 37, 35, 0.06);
  pointer-events: none;
}

/* a finger on the portrait runs through her hair: the page does not scroll under it */
.profile__canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}

.profile__body {
  padding: 18px 14px 14px;
}

.profile__name {
  margin: 0;
  font-family: 'Bodoni Moda Variable', 'Didot', serif;
  font-size: 31px;
  font-weight: 540;
  font-variation-settings: 'opsz' 40;
  line-height: 1.04;
  letter-spacing: -0.01em;
}

.profile__role {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.35;
}

/* ---------------------------------------------------------------- the facts */
.facts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin: 16px 0 0;
  padding: 12px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.facts__item {
  display: flex;
  flex-direction: column-reverse;
  justify-content: flex-end;
  gap: 2px;
  padding: 0 0 0 12px;
  border-left: 1px solid var(--line);
}

.facts__item:first-child {
  padding-left: 0;
  border-left: 0;
}

.facts dt {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.facts dd {
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 0;
  font-size: 18px;
  font-weight: 620;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
}

.facts__star {
  width: 14px;
  height: 14px;
  fill: var(--hair-mid);
}

/* ---------------------------------------------------------------- the buttons: elastic pills */
.actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 16px;
}

.act {
  --bg: var(--accent);
  --fg: #ffffff;
  --edge: 0 0 0 0 transparent;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 0;
  height: 50px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  background: none;
  color: var(--fg);
  font: 600 15.5px/1 'Mona Sans Variable', system-ui, sans-serif;
  font-stretch: 100%;
  white-space: nowrap;
  cursor: pointer;
  isolation: isolate;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: color 0.25s ease;
}

/* the pill itself is a layer of its own: it swells past its edges and springs back, so nothing round it moves */
.act::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background: var(--bg);
  box-shadow: var(--edge);
  transition: inset 0.6s cubic-bezier(0.34, 1.9, 0.45, 1), transform 0.2s cubic-bezier(0.23, 1, 0.32, 1), background-color 0.25s ease, box-shadow 0.25s ease;
}

.act--message,
.act--follow.is-on {
  --bg: var(--card);
  --fg: var(--ink);
  --edge: inset 0 0 0 1.5px var(--line);
}

.act--follow.is-on {
  --bg: var(--accent-soft);
  --fg: var(--accent);
  --edge: inset 0 0 0 1.5px color-mix(in srgb, var(--accent) 16%, transparent);
}

.act--message.is-sent {
  --fg: var(--accent);
}

.act__icon {
  position: relative;
  flex: none;
  width: 18px;
  height: 18px;
  transition: transform 0.6s cubic-bezier(0.34, 1.9, 0.45, 1);
}

.act__glyph {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.1;
  stroke-linecap: round;
  stroke-linejoin: round;
}

[data-glyph='bubble'] {
  stroke-width: 1.8;
}

/* the word grows wider on the font's width axis: it has the room for its widest form already */
.act__label {
  position: relative;
  transition: font-stretch 0.6s cubic-bezier(0.34, 1.9, 0.45, 1);
}

/* pointed at, the pill swells past its edges and springs back, and the word grows wider on its axis */
@media (hover: hover) and (pointer: fine) {
  .act--follow:not(.is-on):hover {
    --bg: color-mix(in srgb, var(--accent) 88%, #ffffff);
  }

  .act--message:hover,
  .act--follow.is-on:hover {
    --edge: inset 0 0 0 1.5px rgba(27, 37, 35, 0.26);
  }
}

@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  .act:hover::before {
    inset: -2px -4px;
  }

  .act:hover .act__label {
    font-stretch: 112%;
  }

  .act:hover .act__icon {
    transform: rotate(-12deg) scale(1.08);
  }
}

@media (prefers-reduced-motion: no-preference) {
  .act:active::before {
    transform: scale(1.03, 0.9);
  }
}

.act:focus-visible {
  outline: none;
}

.act:focus-visible::before {
  box-shadow: var(--edge), 0 0 0 2px var(--card), 0 0 0 4.5px var(--accent);
}

/* on the narrowest phones the two pills keep their words inside */
@media (max-width: 359px) {
  .act {
    gap: 6px;
    padding: 0 8px;
    font-size: 14.5px;
  }

  .facts__item {
    padding-left: 8px;
  }

  .facts dd {
    font-size: 17px;
  }

  .facts dt {
    font-size: 11.5px;
  }
}

.act[aria-disabled='true'] {
  cursor: default;
}

.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* ---------------------------------------------------------------- less motion */
@media (prefers-reduced-motion: reduce) {
  .act::before {
    transition: background-color 0.2s ease, box-shadow 0.2s ease;
  }

  .act__icon,
  .act__label {
    transition: none;
  }
}

/* the second icon of each button waits, hidden, for its state */
[data-glyph='check'] {
  opacity: 0;
}
