/* The Run sequencing button with the DNA helix that assembles. A dark lab (a cold mint light behind, a violet glow from
   below, a fine grain), and in the middle one pill of smoked glass with a 1px edge. Inside, layered in one rounded box
   (.sq__body, moved only by GSAP): the glass fill, the mint light of the reading, the light under the pointer, the
   reflection that crosses at the end and the edges on top. Then the row: the recessed well with the helix (a canvas),
   two lines of words, and the chip with the arrow, the progress ring and the check. */
:root {
  --page: #06080b;            /* the lab */
  --haze: #12232a;            /* the cold light behind the button */
  --violet-deep: #3a2a7a;     /* the glow from below */
  --mint: #5ef0c4;            /* base A, the reading light */
  --aqua: #46b6ff;            /* base T */
  --violet: #a493ff;          /* base C */
  --orchid: #ef8cff;          /* base G */
  --glass: #0d1216;           /* the smoked glass of the button */
  --edge: #d6f5ec;            /* the 1px edge that takes the light */
  --ink: #eef6f3;             /* the words */
  --muted: rgba(238, 246, 243, 0.54); /* the small line under the words */
}

* {
  box-sizing: border-box;
}

html {
  touch-action: manipulation;
}

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

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

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

/* the lab: a cold light behind, a violet glow from below and a fine grain */
.stage {
  position: relative;
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 16px;
  overflow: hidden;
  background:
    radial-gradient(min(74vw, 560px) min(44vh, 300px) at 50% 44%, color-mix(in srgb, var(--haze) 92%, transparent), transparent 72%),
    radial-gradient(min(110vw, 860px) min(70vh, 520px) at 50% 128%, color-mix(in srgb, var(--violet-deep) 30%, transparent), transparent 70%),
    var(--page);
}

.stage::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.5;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.85 0 0 0 0 1 0 0 0 0 0.95 0 0 0 0.07 0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 160px 160px;
}

.sq {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
}

/* the light the button throws on the bench under it */
.sq__spill {
  position: absolute;
  left: 50%;
  top: 100%;
  width: 100%;
  height: 40px;
  margin: -15px 0 0 -50%;
  border-radius: 50%;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--mint) 42%, transparent), color-mix(in srgb, var(--violet) 16%, transparent) 55%, transparent);
  filter: blur(14px);
  opacity: 0.12;
  pointer-events: none;
}

.sq__btn {
  appearance: none;
  border: 0;
  padding: 0;
  margin: 0;
  background: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
  border-radius: 999px;
  -webkit-tap-highlight-color: transparent;
}

.sq__btn:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--mint) 80%, white);
  outline-offset: 5px;
}

.sq__body {
  --mx: 30%;
  --my: 50%;
  position: relative;
  display: block;
  width: min(88vw, 352px);
  height: 60px;
  border-radius: 999px;
  isolation: isolate;
  box-shadow:
    0 1px 1px rgba(0, 0, 0, 0.85),
    0 8px 18px -10px rgba(0, 0, 0, 0.9),
    0 26px 50px -24px rgba(0, 0, 0, 1),
    0 14px 30px -22px color-mix(in srgb, var(--mint) 30%, transparent);
}

.sq__fill,
.sq__glow,
.sq__shine,
.sq__sweep,
.sq__edge {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  overflow: hidden;
  pointer-events: none;
}

/* smoked glass: lighter at the top, a faint vertical streak, a cool tint */
.sq__fill {
  background:
    radial-gradient(140% 120% at 50% -30%, rgba(214, 245, 236, 0.1), transparent 60%),
    linear-gradient(180deg, rgba(214, 245, 236, 0.06), rgba(214, 245, 236, 0.012) 52%, rgba(0, 0, 0, 0.3)),
    var(--glass);
}

/* the mint light of the reading, anchored to the well (GSAP scales it) */
.sq__glow-light {
  position: absolute;
  left: -40px;
  top: -50%;
  width: 190px;
  height: 200%;
  border-radius: 50%;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--mint) 26%, transparent), color-mix(in srgb, var(--violet) 9%, transparent) 58%, transparent);
  transform-origin: 70px 50%;
  opacity: 0;
}

/* the light under the pointer */
.sq__shine {
  background: radial-gradient(110px 66px at var(--mx) var(--my), rgba(214, 245, 236, 0.14), rgba(214, 245, 236, 0.035) 50%, transparent 72%);
  opacity: 0;
}

/* the reflection that crosses the glass when the sequence is ready */
.sq__sweep-band {
  position: absolute;
  top: -30%;
  left: 0;
  width: 34%;
  height: 160%;
  background: linear-gradient(100deg, transparent 0%, rgba(230, 255, 248, 0.05) 30%, rgba(230, 255, 248, 0.26) 50%, rgba(230, 255, 248, 0.05) 70%, transparent 100%);
  transform: translateX(-140%) skewX(-16deg);
}

/* the 1px edge: catches the light at the top, goes dark at the bottom, and a wet highlight */
.sq__edge {
  z-index: 3;
  box-shadow:
    inset 0 0 0 1px color-mix(in srgb, var(--edge) 13%, transparent),
    inset 0 1px 0 color-mix(in srgb, var(--edge) 48%, transparent),
    inset 0 -1px 0 rgba(0, 0, 0, 0.6),
    inset 0 -12px 18px -12px rgba(0, 0, 0, 0.7);
}

.sq__edge::after {
  content: '';
  position: absolute;
  left: 10%;
  right: 10%;
  top: 1px;
  height: 42%;
  border-radius: 999px 999px 40% 40%;
  background: linear-gradient(180deg, rgba(225, 255, 246, 0.07), rgba(225, 255, 246, 0));
}

.sq__row {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  height: 100%;
  padding: 0 12px 0 10px;
  gap: 12px;
}

/* the recessed glass well with the helix */
.sq__well {
  position: relative;
  flex: none;
  width: clamp(78px, 27vw, 112px);
  height: 40px;
  border-radius: 20px;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.18)),
    #05080a;
  box-shadow:
    inset 0 1px 3px rgba(0, 0, 0, 0.8),
    inset 0 0 0 1px rgba(214, 245, 236, 0.06),
    0 1px 0 rgba(214, 245, 236, 0.07);
}

.sq__helix {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 13%, #000 87%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 13%, #000 87%, transparent);
}

/* a ruler of tiny ticks along the bottom of the well, like the scale of a read */
.sq__ticks {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 4px;
  height: 3px;
  background: repeating-linear-gradient(90deg, rgba(214, 245, 236, 0.09) 0 1px, transparent 1px 6px);
  pointer-events: none;
}

.sq__text {
  flex: 1;
  display: grid;
  min-width: 0;
  text-align: left;
}

.sq__state {
  grid-area: 1 / 1;
  display: grid;
  gap: 3px;
  min-width: 0;
}

.sq__state + .sq__state {
  opacity: 0;
}

.sq__title {
  font-size: 15.5px;
  font-weight: 580;
  font-variation-settings: 'wdth' 102;
  letter-spacing: 0.002em;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.4);
}

/* Sequencing shimmers: a mint band runs through the letters (GSAP moves background-position) */
.sq__title--busy {
  background: linear-gradient(90deg, var(--ink) 0%, var(--ink) 38%, #ffffff 46%, var(--mint) 50%, #ffffff 54%, var(--ink) 62%, var(--ink) 100%);
  background-size: 260% 100%;
  background-position: 100% 0;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: none;
}

.sq__sub {
  display: flex;
  align-items: center;
  min-width: 0;
}

.sq__sub-text {
  font-size: 11.5px;
  font-weight: 460;
  font-variation-settings: 'wdth' 96;
  letter-spacing: 0.01em;
  line-height: 1.2;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.sq__num {
  font-variant-numeric: tabular-nums;
}

/* the chip on the right: arrow at rest, progress ring while reading, check when ready */
.sq__chip {
  position: relative;
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, rgba(214, 245, 236, 0.09), rgba(214, 245, 236, 0.02));
  box-shadow:
    inset 0 0 0 1px rgba(214, 245, 236, 0.12),
    inset 0 1px 0 rgba(214, 245, 236, 0.16),
    0 1px 2px rgba(0, 0, 0, 0.5);
}

.sq__chip > * {
  grid-area: 1 / 1;
}

.sq__arrow {
  width: 18px;
  height: 18px;
  overflow: visible;
}

.sq__arrow path,
.sq__check path {
  fill: none;
  stroke: var(--ink);
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sq__ring {
  width: 34px;
  height: 34px;
  overflow: visible;
  opacity: 0;
}

.sq__ring circle {
  fill: none;
  stroke-width: 1.5;
}

.sq__ring-track {
  stroke: rgba(214, 245, 236, 0.1);
}

.sq__ring-arc {
  stroke: var(--mint);
  stroke-linecap: round;
  stroke-dasharray: 1 1;
  stroke-dashoffset: 1;
  filter: drop-shadow(0 0 2px color-mix(in srgb, var(--mint) 60%, transparent));
}

.sq__pct {
  font-size: 10px;
  font-weight: 600;
  font-variation-settings: 'wdth' 92;
  letter-spacing: 0.01em;
  color: var(--ink);
  opacity: 0;
}

.sq__check {
  width: 18px;
  height: 18px;
  overflow: visible;
  opacity: 0;
}

.sq__check path {
  stroke: var(--mint);
  stroke-width: 2;
  stroke-dasharray: 1 1;
  stroke-dashoffset: 1;
}

@media (max-width: 380px) {
  .sq__row {
    gap: 10px;
    padding: 0 10px 0 10px;
  }

  .sq__title {
    font-size: 14.5px;
  }

  .sq__sub-text {
    font-size: 11px;
  }
}
