.identity-definitions {
  position: absolute;
  overflow: hidden;
  pointer-events: none;
}

.brand-gradient-start { stop-color: #0079a6; }
.brand-gradient-end { stop-color: #7053cc; }
.brand-violet { stroke: #7053cc; }
html[data-theme="dark"] .brand-gradient-start { stop-color: #65ceff; }
html[data-theme="dark"] .brand-gradient-end { stop-color: #b9a6ff; }
html[data-theme="dark"] .brand-violet { stroke: #b9a6ff; }

.identity-figure {
  --identity-bg: #181432;
  --identity-surface: #251f46;
  --identity-ink: #fbf9ff;
  --identity-muted: #c5bedf;
  --identity-line: #514675;
  --identity-grid: #b3a3fd1b;
  --identity-accent: #e2d6ff;
  --identity-selected: #372a69;
  --identity-selected-ink: #fff;
  --identity-blue: #72e2ff;
  --identity-violet: #bca6ff;
  --identity-lilac: #e1a8ff;
  --identity-glow: #6250cf85;
  --figure-light: #522eaa;
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  container: identity / inline-size;
  min-inline-size: 0;
  margin: 0;
  background: var(--identity-bg);
  color: var(--identity-ink);
  border: 1px solid var(--identity-line);
  border-radius: 1.75rem;
  padding: clamp(.95rem, 2.05vw, 1.7rem);
  box-shadow: 0 28px 55px -34px #3a238975, inset 0 1px #ffffff0d;
}

html[data-contrast="high"] .identity-figure {
  --identity-bg: var(--surface, Canvas);
  --identity-surface: var(--surface, Canvas);
  --identity-ink: var(--ink, CanvasText);
  --identity-muted: var(--ink, CanvasText);
  --identity-line: var(--ink, CanvasText);
  --identity-grid: transparent;
  --identity-accent: var(--ink, CanvasText);
  --identity-selected: var(--ink, CanvasText);
  --identity-selected-ink: var(--surface, Canvas);
  --identity-blue: var(--accent-ink, CanvasText);
  --identity-violet: var(--ink, CanvasText);
  --identity-lilac: var(--ink, CanvasText);
  --identity-glow: transparent;
}

html[data-contrast="high"] .identity-figure { box-shadow: none; }
html[data-contrast="high"] .identity-figure :is(.identity-light, .identity-guides, .identity-corner) { display: none; }

.identity-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .4rem .75rem;
}

.identity-kicker {
  margin: 0;
  color: var(--identity-accent);
  font-family: var(--mono, monospace);
  font-size: .8125rem;
  font-weight: 650;
  line-height: 1.3;
  letter-spacing: .055em;
  text-transform: uppercase;
}

.identity-play {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .35rem;
  min-block-size: 44px;
  max-inline-size: 100%;
  border: 1px solid var(--identity-line);
  border-radius: 100px;
  padding: .35rem .75rem;
  background: transparent;
  color: var(--identity-accent);
  font: inherit;
  font-size: .875rem;
  font-weight: 650;
  line-height: 1.25;
  cursor: pointer;
  transition: background-color .2s ease, border-color .2s ease;
}

.identity-play > svg {
  flex: none;
}

.identity-play:hover {
  border-color: var(--identity-line);
  background: var(--identity-surface);
}

.identity-play-icon,
.identity-pause-icon,
.identity-next-icon { display: none; }

.identity-play[data-control="play"] .identity-play-icon,
.identity-play[data-control="pause"] .identity-pause-icon,
.identity-play[data-control="next"] .identity-next-icon { display: inline; }

.identity-diagram {
  display: grid;
  position: relative;
  isolation: isolate;
  place-items: center;
  overflow: hidden;
  background-image:
    linear-gradient(var(--identity-grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--identity-grid) 1px, transparent 1px),
    radial-gradient(ellipse at center, var(--identity-glow), transparent 74%);
  background-size: 25px 25px, 25px 25px, 100% 100%;
  background-position: center;
}

.identity-diagram {
  flex: auto;
  min-block-size: clamp(13rem, 24vw, 21.75rem);
  margin: .55rem 0 .8rem;
  border-radius: .85rem;
}

.identity-light {
  position: absolute;
  z-index: -1;
  inset: -15%;
  opacity: .75;
  background:
    radial-gradient(ellipse at 61% 62%, var(--figure-light) 0, transparent 48%),
    radial-gradient(ellipse at 32% 52%, #286dc76b 0, transparent 41%);
  transform: translate(var(--light-x, 0px), var(--light-y, 0px));
  transition: transform .85s cubic-bezier(.22, .7, .23, 1), opacity .7s ease;
}

.identity-figure[data-phase="0"] .identity-light { opacity: .46; }
.identity-figure[data-phase="1"] .identity-light { opacity: .60; }
.identity-figure[data-phase="3"] .identity-light { opacity: .93; }

.identity-guides {
  position: absolute;
  z-index: -1;
  display: grid;
  place-items: center;
  inset: 0;
  pointer-events: none;
}

.identity-guides i {
  position: absolute;
  width: min(62%, 17.2rem);
  aspect-ratio: 1;
  border: 1px solid #a897fa35;
  border-radius: 50%;
}

.identity-guides i:nth-child(2) { transform: scale(.82); border-style: dashed; }
.identity-guides i:nth-child(3) { transform: scale(1.17); border-color: #a897fa20; }

.identity-corner {
  position: absolute;
  width: .9rem;
  height: .9rem;
  border: solid #a897fa70;
  pointer-events: none;
}
.identity-corner-start { inset: .7rem auto auto .7rem; border-width: 1px 0 0 1px; }
.identity-corner-end { inset: auto .7rem .7rem auto; border-width: 0 1px 1px 0; }

.identity-mark {
  display: block;
  inline-size: min(62%, 17rem);
  block-size: auto;
  overflow: visible;
  filter: drop-shadow(0 0 14px #aa8aff65);
  transform: translate(var(--mark-x, 0px), var(--mark-y, 0px));
  transition: transform .75s cubic-bezier(.22, .7, .23, 1);
}

html[data-contrast="high"] .identity-mark { filter: none; }

.identity-shadow { color: #cbbce8; opacity: .32; }
html[data-contrast="high"] .identity-shadow { color: var(--identity-ink); }
.identity-figure[data-phase="3"] .identity-shadow { opacity: 0; }

.identity-stop-start { stop-color: var(--identity-blue); }
.identity-stop-end { stop-color: var(--identity-violet); }
.identity-flask,
.identity-overlap { stroke: var(--identity-violet); }
.identity-code { stroke: var(--identity-blue); }
.identity-letter-l { --identity-letter-color: var(--identity-lilac); }
.identity-letter-b { --identity-letter-color: var(--identity-blue); }
.identity-letter-stroke { stroke: var(--identity-letter-color); }

.identity-letter-labels {
  visibility: hidden;
  font: 700 16px var(--display);
}

.identity-letter-labels text { fill: var(--identity-letter-color); }
.identity-figure[data-phase="1"] .identity-letter-labels { visibility: visible; }

.identity-mark [data-transition="draw"] {
  stroke-dasharray: 2 1.05;
  stroke-dashoffset: 2;
  opacity: 0;
}

.identity-figure[data-phase="0"] .identity-flask,
.identity-figure[data-phase="1"] .identity-letter-stroke,
.identity-figure[data-phase="2"] .identity-code,
.identity-figure[data-phase="3"] :is(.identity-flask, .identity-initials, .identity-overlap) {
  stroke-dashoffset: 0;
  opacity: 1;
}

.identity-figure:not([data-phase="3"]) .identity-cut { opacity: 0; }

.identity-caption {
  display: grid;
  align-content: start;
  gap: .65rem;
}

.identity-stage-copy { display: grid; }
.identity-stage-copy > [data-caption] { grid-area: 1 / 1; }
.identity-stage-copy > [aria-hidden="true"] { visibility: hidden; }

.identity-stage-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: .5rem;
}

.identity-stage-title > h3 {
  margin: 0;
  font-family: var(--display, var(--body, sans-serif));
  font-size: clamp(1.1rem, 2.1vw, 1.6rem);
  font-weight: 650;
  line-height: 1.12;
  letter-spacing: -.025em;
}

.identity-count {
  flex: none;
  color: var(--identity-accent);
  font-family: var(--mono, monospace);
  font-size: .8125rem;
  white-space: nowrap;
}

.identity-stage-copy > [data-caption] > p {
  margin: .45rem 0 0;
  min-block-size: 2.9em;
  color: var(--identity-muted);
  font-size: .9rem;
  line-height: 1.45;
}

.identity-progress {
  position: relative;
  height: 2px;
  overflow: hidden;
  border-radius: 1rem;
  background: var(--identity-line);
}
.identity-progress span {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, var(--identity-blue), var(--identity-violet));
  transform: scaleX(var(--progress, 1));
  transform-origin: left;
}

.identity-steps {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .3rem;
}

@container identity (min-width: 22rem) {
  .identity-steps { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

.identity-steps > button {
  border: 1px solid transparent;
  border-radius: 8px;
  min-inline-size: 0;
  min-block-size: 44px;
  padding: .25rem;
  background: transparent;
  color: var(--identity-accent);
  font: inherit;
  font-size: .87rem;
  font-weight: 620;
  line-height: 1.23;
  overflow-wrap: anywhere;
  cursor: pointer;
  transition: background-color .2s ease, border-color .2s ease, color .2s ease;
}

.identity-steps > button:hover { border-color: var(--identity-line); }
.identity-steps > button[aria-pressed="true"] {
  background: var(--identity-selected);
  color: var(--identity-selected-ink);
  border-color: var(--identity-line);
}

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

@media (max-width: 360px) {
  .identity-figure { border-radius: 18px; }
  .identity-diagram { min-block-size: 11.6rem; }
}

@media (forced-colors: active) {
  .identity-steps > button[aria-pressed="true"] {
    border-color: Highlight;
    color: Highlight;
  }
}
