/* React Bits: Stepper. Copyright (c) 2026 David Haz. See licenses. */
.stepper {
  --stepper-pad: 0px;
  --stepper-inset: 0px;
  --stepper-bleed: 8px;
  --stepper-well-radius: max(6px, calc(var(--stepper-radius) - 8px));
  --stepper-tile-radius: max(4px, calc(var(--stepper-well-radius) - 4px));
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(100%, var(--stepper-width));
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
  border-radius: var(--stepper-radius);
  color: var(--stepper-ink);
  -webkit-tap-highlight-color: transparent;
}

.stepper--framed {
  --stepper-pad: 8px;
  --stepper-inset: 12px;
  --stepper-bleed: 20px;
  padding: var(--stepper-pad);
  background: var(--stepper-frame);
  box-shadow: var(--stepper-frame-shadow);
  -webkit-backdrop-filter: blur(20px) saturate(1.6);
  backdrop-filter: blur(20px) saturate(1.6);
}

.stepper__rim {
  position: absolute;
  inset: 0;
  z-index: 2;
  border-radius: inherit;
  box-shadow:
    inset 0 0 0 1px var(--stepper-frame-edge),
    inset 0 1px 0 var(--stepper-frame-highlight);
  pointer-events: none;
}

.stepper__header--dots,
.stepper__header--bars {
  padding: var(--stepper-inset) var(--stepper-inset) 0;
}

.stepper__track {
  position: relative;
  display: flex;
  gap: 4px;
  padding: 4px;
  border-radius: var(--stepper-well-radius);
  background: var(--stepper-well);
}

.stepper__glider {
  position: absolute;
  top: 0;
  left: 0;
  border-radius: var(--stepper-tile-radius);
  background: var(--stepper-tile);
  box-shadow:
    inset 0 0 0 1px var(--stepper-tile-edge),
    inset 0 1px 0 var(--stepper-tile-highlight),
    var(--stepper-tile-shadow);
  opacity: 0;
  pointer-events: none;
}

.stepper__segment {
  position: relative;
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 0;
  height: 40px;
  padding: 0 10px;
  box-sizing: border-box;
  border: none;
  border-radius: var(--stepper-tile-radius);
  background: none;
  color: var(--stepper-muted);
  font-family: inherit;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.stepper__segment:disabled {
  cursor: default;
}

.stepper__badge {
  display: grid;
  flex: none;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px var(--stepper-faint);
  color: var(--stepper-muted);
  font-size: 11.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  transition:
    background-color 0.15s ease,
    box-shadow 0.15s ease,
    color 0.15s ease;
}

.stepper__badge[data-status='active'] {
  box-shadow: inset 0 0 0 1.5px var(--stepper-ink);
  color: var(--stepper-ink);
}

.stepper__badge[data-status='complete'] {
  background: var(--stepper-solid);
  box-shadow: none;
  color: var(--stepper-solid-ink);
}

.stepper__glyph,
.stepper__check {
  display: grid;
  place-items: center;
}

.stepper__text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  text-align: left;
}

.stepper__title {
  overflow: hidden;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  color: var(--stepper-muted);
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: color 0.2s ease;
}

.stepper__title:not([data-status='upcoming']) {
  color: var(--stepper-ink);
}

.stepper__description {
  overflow: hidden;
  font-size: 12px;
  line-height: 1.35;
  color: var(--stepper-muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stepper__track[data-layout='rail'] {
  flex: 1;
  flex-direction: column;
}

.stepper__track[data-layout='rail'] .stepper__segment {
  flex: none;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 10px;
  height: auto;
  padding: 10px;
}

.stepper__track[data-layout='rail'] .stepper__text {
  padding-top: 3px;
}

.stepper__dots {
  display: flex;
  justify-content: center;
  gap: 2px;
}

.stepper__dot {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: none;
  cursor: pointer;
}

.stepper__dot-mark {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--stepper-faint);
  transition:
    background-color 0.25s ease,
    transform 0.45s var(--stepper-spring);
}

.stepper__dot-mark[data-status='complete'] {
  background: var(--stepper-muted);
}

.stepper__dot-mark[data-status='active'] {
  background: var(--stepper-solid);
  transform: scale(1.3);
}

.stepper__bars {
  display: flex;
  gap: 6px;
}

.stepper__bar {
  display: flex;
  flex: 1;
  align-items: center;
  height: 18px;
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
}

.stepper__bar-track {
  position: relative;
  width: 100%;
  height: 4px;
  overflow: hidden;
  border-radius: 4px;
  background: var(--stepper-track);
}

.stepper__bar-fill {
  position: absolute;
  inset: 0;
  background: var(--stepper-solid);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 560ms var(--stepper-spring);
}

.stepper__bar-fill[data-filled] {
  transform: none;
}

.stepper__dot:disabled,
.stepper__bar:disabled {
  cursor: default;
}

.stepper__body {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 20px var(--stepper-inset) var(--stepper-inset);
}

.stepper__viewport {
  position: relative;
  margin: -6px calc(var(--stepper-bleed) * -1);
  overflow: hidden;
}

.stepper__pane {
  box-sizing: border-box;
  padding: 6px var(--stepper-bleed);
  outline: none;
}

.stepper__pane--leaving {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  pointer-events: none;
}

.stepper__step {
  min-width: 0;
}

.stepper__footer-wrap {
  display: grid;
  grid-template-rows: 1fr;
  transition:
    grid-template-rows 480ms var(--stepper-spring),
    opacity 0.2s ease;
}

.stepper__footer-wrap[data-hidden] {
  grid-template-rows: 0fr;
  opacity: 0;
  pointer-events: none;
}

.stepper__footer-clip {
  min-height: 0;
}

.stepper__footer-wrap[data-hidden] .stepper__footer-clip {
  overflow: hidden;
}

.stepper__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 20px;
}

.stepper__button {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 6px;
  height: 38px;
  padding: 0 14px;
  border: none;
  border-radius: max(8px, calc(var(--stepper-radius) * 0.5));
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  transition:
    filter 0.2s ease,
    transform 0.2s ease,
    opacity 0.2s ease;
}

.stepper__button--back {
  padding-left: 10px;
  background: var(--stepper-tile);
  box-shadow:
    inset 0 0 0 1px var(--stepper-tile-edge),
    inset 0 1px 0 var(--stepper-tile-highlight),
    var(--stepper-tile-shadow);
  color: var(--stepper-ink);
}

.stepper__button--back[data-hidden] {
  visibility: hidden;
  opacity: 0;
  transition:
    opacity 0.2s ease,
    visibility 0s 0.2s;
}

.stepper__button--next {
  margin-left: auto;
  padding-right: 11px;
  background: var(--stepper-solid);
  box-shadow: 0 4px 12px -6px rgba(0, 0, 0, 0.5);
  color: var(--stepper-solid-ink);
}

.stepper__button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.stepper__button:focus-visible,
.stepper__segment:focus-visible,
.stepper__dot:focus-visible,
.stepper__bar:focus-visible {
  outline: 2px solid var(--stepper-ink);
  outline-offset: 2px;
}

.stepper--vertical {
  flex-direction: row;
  align-items: stretch;
}

.stepper--vertical .stepper__header {
  display: flex;
  flex: none;
  width: 212px;
  max-width: 42%;
}

.stepper--vertical .stepper__body {
  flex: 1;
  padding: var(--stepper-inset) var(--stepper-inset) var(--stepper-inset) 20px;
}

@media (hover: hover) {
  .stepper__segment:not(:disabled):hover {
    background: var(--stepper-hover-fill);
  }

  .stepper__button--back:not(:disabled):hover {
    filter: var(--stepper-hover);
  }

  .stepper__button--next:not(:disabled):hover {
    filter: var(--stepper-solid-hover);
  }

  .stepper__dot:not(:disabled):hover .stepper__dot-mark {
    transform: scale(1.3);
  }

  .stepper__bar:not(:disabled):hover .stepper__bar-track {
    background: var(--stepper-faint);
  }
}

.stepper__button:not(:disabled):active {
  filter: var(--stepper-press);
  transform: scale(0.96);
  transition-duration: 0s;
}

@media (prefers-reduced-motion: reduce) {
  .stepper__bar-fill,
  .stepper__dot-mark,
  .stepper__footer-wrap {
    transition-duration: 0.01ms;
  }
}

/* React Bits: SpotlightCard. Copyright (c) 2026 David Haz. See licenses. */
.spotlight-card {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: 2rem;
  border-radius: 1.5rem;
  background-color: var(--spotlight-card-surface);
  box-shadow: var(--spotlight-card-shadow);
}

.spotlight-card__light,
.spotlight-card__grain,
.spotlight-card__border,
.spotlight-card__edge {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
}

.spotlight-card__light,
.spotlight-card__grain {
  z-index: -1;
  opacity: 0;
}

.spotlight-card__grain {
  background-size: 160px 160px;
  mix-blend-mode: overlay;
}

.spotlight-card__border,
.spotlight-card__edge {
  z-index: 1;
  padding: 1px;
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask:
    linear-gradient(#000 0 0) content-box exclude,
    linear-gradient(#000 0 0);
}

.spotlight-card__border {
  background: var(--spotlight-card-border);
}

.spotlight-card__edge {
  opacity: 0;
}

/* Transitions.dev — Tabs sliding */

/*
  Usage:
    <div class="t-tabs" role="tablist">
      <span class="t-tabs-pill" aria-hidden="true"></span>
      <button class="t-tab" role="tab" aria-selected="true">Plan</button>
      <button class="t-tab" role="tab" aria-selected="false">Debug</button>
      <button class="t-tab" role="tab" aria-selected="false">Ask</button>
    </div>

  Wire-up:
    On click, flip aria-selected on each tab and write the
    active tab's offsetLeft / offsetWidth onto the pill:
      pill.style.transform = `translateX(${tab.offsetLeft}px)`;
      pill.style.width     = `${tab.offsetWidth}px`;
    On first paint and resize, write the same values WITHOUT
    a transition (suspend with `transition: none`, force a
    reflow, restore) so the pill snaps to position before any
    animation can run.
*/

:root {
  --tabs-dur: 250ms;
  --tabs-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --tabs-text-muted: rgba(15, 15, 15, 0.8);
  --tabs-text-active: #0f0f0f;
  --tabs-bar-bg: #f1f1f1;
  --tabs-pill-bg: #ffffff;
}

/* The bar is just a flex container with padding for the pill
   to sit inside. Tabs sit on z-index: 1, the pill on z-index: 0,
   so labels read above the pill background. */
.t-tabs {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px;
  border-radius: 48px;
  background: var(--tabs-bar-bg);
}
.t-tab {
  position: relative;
  appearance: none;
  border: 0;
  background: transparent;
  height: 30px;
  padding: 4px 12px;
  color: var(--tabs-text-muted);
  cursor: pointer;
  border-radius: 48px;
  z-index: 1;
  transition: color var(--tabs-dur) var(--tabs-ease);
}
.t-tab:not([aria-selected="true"]):hover,
.t-tab[aria-selected="true"] {
  color: var(--tabs-text-active);
}

/* The pill: width + transform are written inline by JS so
   the transition tweens between the previous and next
   measured positions. */
.t-tabs-pill {
  position: absolute;
  top: 3px;
  left: 0;
  height: 30px;
  width: 0;
  background: var(--tabs-pill-bg);
  border-radius: 48px;
  transform: translateX(0);
  transition:
    transform var(--tabs-dur) var(--tabs-ease),
    width     var(--tabs-dur) var(--tabs-ease);
  will-change: transform, width;
  z-index: 0;
  pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
  .t-tabs-pill, .t-tab { transition: none !important; }
}
/* Transitions.dev — Accordion expand */

/*
  Usage:
    <div class="t-acc" data-open="false">
      <button class="t-acc-head" aria-expanded="false">
        Title
        <span class="t-acc-chevron">
          <svg viewBox="0 0 16 16"><path d="M4 6.5L8 10.5L12 6.5"/></svg>
        </span>
      </button>
      <div class="t-acc-panel"><div class="t-acc-panel-inner"> … </div></div>
    </div>

  Toggle `data-open` on the item. The panel animates via
  grid-template-rows 0fr ↔ 1fr (no JS height measuring) and
  the chevron flips vertically (scaleY) from a "v" to a "^".
*/

:root {
  --acc-expand: 250ms;
  --acc-collapse: 250ms;
  --acc-chevron: 250ms;
  --acc-ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* grid-template-rows 0fr → 1fr gives a clean height animation
   with no JS measurement; the inner element clips overflow. */
.t-acc-panel {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows var(--acc-collapse) var(--acc-ease);
}
.t-acc[data-open="true"] .t-acc-panel {
  grid-template-rows: 1fr;
  transition: grid-template-rows var(--acc-expand) var(--acc-ease);
}
.t-acc-panel-inner {
  overflow: hidden;
  opacity: 0;
  filter: blur(2px);
  transition:
    opacity var(--acc-collapse) var(--acc-ease),
    filter var(--acc-collapse) var(--acc-ease);
}
.t-acc[data-open="true"] .t-acc-panel-inner {
  opacity: 1;
  filter: blur(0);
  transition:
    opacity var(--acc-expand) var(--acc-ease),
    filter var(--acc-expand) var(--acc-ease);
}
/* Flip the chevron vertically to turn the "v" into a "^".
   scaleY(-1) about the centre passes through a flat line at
   the midpoint (same look as a `d:` path morph) but animates
   in every browser, unlike CSS `d:` morphing (Chromium only).
   The chevron path is symmetric about the 16x16 viewBox
   centre, so the flip lands exactly on the "^"; non-scaling
   -stroke keeps the stroke width constant through the flip. */
.t-acc-chevron {
  display: inline-flex;
  transform: scaleY(1);
  transform-origin: center;
  transition: transform var(--acc-chevron) var(--acc-ease);
}
.t-acc-chevron path { vector-effect: non-scaling-stroke; }
.t-acc[data-open="true"] .t-acc-chevron {
  transform: scaleY(-1);
}

@media (prefers-reduced-motion: reduce) {
  .t-acc-panel, .t-acc-panel-inner, .t-acc-chevron {
    transition: none !important;
  }
}
/* Transitions.dev — Error state shake */

/*
  Usage:
    <!-- Apply .t-input-wrap to your wrapper, .t-input to the
         element that should shake (your input field, its
         bordered wrapper — whatever owns the visible border),
         and .t-error-msg to the message you want to reveal.
         Bring your own sizing, padding, border colors, and
         typography. -->
    <div class="t-input-wrap">
      <div class="t-input">
        <input type="text">
      </div>
      <p class="t-error-msg">Please enter a valid email.</p>
    </div>

  Trigger:
    - Add `.is-error` to .t-input-wrap and .t-input. Your
      own border-color rules drive the visible color; this
      stylesheet only owns the tween.
    - Restart the shake by removing `.is-shaking` from
      .t-input, forcing a reflow, then re-adding it.
    - Optional: after --revert-hold ms, drop both
      `.is-error` classes so border + message fade back
      to neutral over --revert-dur.

  Per-segment ease: each keyframe stop carries its own
  animation-timing-function so each leg follows the Figma
  cubic-bezier curve independently.
*/

:root {
  --shake-distance: 6px;
  --shake-overshoot: 4px;
  --shake-dur-a: 80ms;
  --shake-dur-b: 60ms;
  --shake-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --revert-hold: 3000ms;
  --revert-dur: 280ms;
}

/* Border-color tween. Define your input's default / focused
   / error border-color in your own component CSS — this rule
   only owns the interpolation. Use a constant border-width
   across states so the tween never shifts inner content. */
.t-input {
  transition: border-color 150ms ease-out;
  will-change: transform;
}
.t-input.is-error {
  /* Error border auto-reverts on the hold timer, so the
     fade-out uses the slower revert duration (matches the
     message fade). */
  transition: border-color var(--revert-dur, 280ms) ease-out;
}

/* Error message reveal. Visibility is delayed by --revert-dur
   on hide so the message stays painted for the full opacity
   fade-out. Entering .is-error drops the delay to 0 so the
   message becomes visible immediately. */
.t-error-msg {
  opacity: 0;
  visibility: hidden;
  transition:
    opacity    var(--revert-dur, 280ms) ease-out,
    visibility 0s linear var(--revert-dur, 280ms);
}
.t-input-wrap.is-error .t-error-msg {
  opacity: 1;
  visibility: visible;
  transition:
    opacity    var(--revert-dur, 280ms) ease-out,
    visibility 0s linear 0s;
}

/* Multi-segment keyframe with per-stop easing so each leg
   of the shake follows its own cubic-bezier independently.
   %-stops are cumulative durations as a fraction of the
   total (80, 60, 80, 60 = 280ms): 28.57%, 57.14%, 78.57%,
   100%. Recompute if any segment duration changes. */
.t-input.is-shaking {
  animation: t-input-shake calc(
      var(--shake-dur-a) * 2 + var(--shake-dur-b) * 2
    ) linear;
}
@keyframes t-input-shake {
  0%      { transform: translateX(0);                                 animation-timing-function: var(--shake-ease); }
  28.57%  { transform: translateX(var(--shake-distance));             animation-timing-function: var(--shake-ease); }
  57.14%  { transform: translateX(calc(var(--shake-distance) * -1)); animation-timing-function: var(--shake-ease); }
  78.57%  { transform: translateX(var(--shake-overshoot));            animation-timing-function: var(--shake-ease); }
  100%    { transform: translateX(0); }
}

@media (prefers-reduced-motion: reduce) {
  .t-input { animation: none !important; transform: none !important; }
}
/* Transitions.dev — Success check */

/*
  Usage:
    <!-- Wrap your icon (SVG, image, anything) in .t-success-check.
         The wrapper drives fade + rotate + blur + Y-bob; if your
         icon is an SVG <path>, it gets the stroke-draw animation.
         Bring your own icon size / colors. -->
    <span class="t-success-check" data-state="out" aria-hidden="true">
      <svg viewBox="0 0 48 48" fill="none">
        <!-- your icon path(s) here -->
      </svg>
    </span>

  Trigger:
    - Cold load is data-state="out" (opacity 0; no animation).
    - Show: set data-state="in" (fade + rotate + blur + Y-bob
      + path draw run in parallel).

  Snippet covers the appear transition only — bring your own
  hide behavior (e.g. unmount, opacity:0, or a custom exit).
*/

:root {
  --check-opacity-dur: 500ms;
  --check-rotate-dur: 500ms;
  --check-rotate-from: 80deg;
  --check-bob-dur: 500ms;
  --check-y-amount: 40px;
  --check-blur-dur: 500ms;
  --check-blur-from: 10px;
  --check-path-dur: 500ms;
  --check-path-delay: 80ms;
  --check-ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --check-ease-opacity: cubic-bezier(0.22, 1, 0.36, 1);
  --check-ease-rotate: cubic-bezier(0.22, 1, 0.36, 1);
  --check-ease-bob: cubic-bezier(0.34, 1.35, 0.64, 1);
  --check-ease-path: cubic-bezier(0.22, 1, 0.36, 1);
}

/* Wrapper drives the appear animation; it doesn't own any
   sizing or color so you can drop in any icon. */
.t-success-check {
  display: inline-block;
  transform-origin: center;
  opacity: 0;
  will-change: transform, opacity, filter;
}
/* overflow: visible keeps the stroke from clipping while it
   draws; display: block kills the inline whitespace under SVGs. */
.t-success-check svg { display: block; overflow: visible; }
/* Stroke-draw setup. Replace 20 with the result of
   path.getTotalLength() for your path; round caps mean any
   sub-pixel overshoot is invisible. */
.t-success-check svg path {
  stroke-dasharray: 20;
  stroke-dashoffset: 20;
}

.t-success-check[data-state="in"] {
  animation:
    t-check-fade   var(--check-opacity-dur) var(--check-ease-opacity) forwards,
    t-check-rotate var(--check-rotate-dur)  var(--check-ease-rotate)  forwards,
    t-check-blur   var(--check-blur-dur)    var(--check-ease-out)     forwards,
    t-check-bob    var(--check-bob-dur)     var(--check-ease-bob)     forwards;
}
.t-success-check[data-state="in"] svg path {
  animation: t-check-draw var(--check-path-dur) var(--check-ease-path) var(--check-path-delay, 0ms) forwards;
}

@keyframes t-check-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes t-check-rotate {
  from { transform: rotate(var(--check-rotate-from)); }
  to   { transform: rotate(0deg); }
}
@keyframes t-check-blur {
  from { filter: blur(var(--check-blur-from)); }
  to   { filter: blur(0); }
}
@keyframes t-check-bob {
  from { translate: 0 var(--check-y-amount); }
  to   { translate: 0 0; }
}
@keyframes t-check-draw { to { stroke-dashoffset: 0; } }

@media (prefers-reduced-motion: reduce) {
  .t-success-check { animation: none !important; opacity: 1; }
  .t-success-check svg path { animation: none !important; stroke-dashoffset: 0 !important; }
}