/* The AI chat dropdown with the spec card that follows the item. Two panes of frosted glass on a near black page with
   two faint lights and a fine grain: the menu with its rows and the spec card beside it. The glass pill under the
   pointer (.menu__pill), the hairline that joins it to the card (.menu__bridge) and the card's frame (.spec-wrap) are
   moved only by the script; their children only by CSS. Under 600px the card sits under the menu. */
:root {
  --page: #0a0b0f;            /* the page */
  --glass: rgba(24, 25, 33, 0.72); /* the frosted panes */
  --edge: rgba(255, 255, 255, 0.08); /* their 1px edge */
  --ink: #eeeef3;             /* the words */
  --muted: #8b8c99;           /* the small words */
  --violet: #8f7bff;          /* the first colour */
  --cyan: #5fd8ff;            /* the second colour */
  --check: #f4f4f7;           /* the check of the chosen model */
}

* {
  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;
}

.stage {
  --row: clamp(42px, 8.6vh, 56px);
  position: relative;
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 16px;
  overflow: hidden;
  isolation: isolate;
}

/* the page is never flat: two faint lights and a grain */
.stage::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(42vmax 34vmax at 22% 18%, color-mix(in srgb, var(--violet) 16%, transparent), transparent 70%),
    radial-gradient(40vmax 30vmax at 82% 86%, color-mix(in srgb, var(--cyan) 9%, transparent), transparent 70%);
}

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

.ui {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 300px) 252px;
  gap: 16px;
  align-items: start;
  width: min(100%, 568px);
}

/* ------------------------------------------------------------ the two panes */
.menu,
.spec {
  position: relative;
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0) 40%),
    var(--glass);
  -webkit-backdrop-filter: blur(18px) saturate(1.3);
  backdrop-filter: blur(18px) saturate(1.3);
  box-shadow:
    inset 0 0 0 1px var(--edge),
    inset 0 1px 0 rgba(255, 255, 255, 0.09),
    0 1px 1px rgba(0, 0, 0, 0.6),
    0 14px 30px -14px rgba(0, 0, 0, 0.9),
    0 40px 80px -36px rgba(0, 0, 0, 1);
}

/* the edge lights up only near the pointer */
.menu__light,
.spec__light {
  --lx: 50%;
  --ly: -40%;
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: radial-gradient(180px circle at var(--lx) var(--ly), rgba(255, 255, 255, 0.5), color-mix(in srgb, var(--violet) 40%, transparent) 40%, transparent 72%);
  -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);
  pointer-events: none;
  opacity: 0;
}

.menu {
  padding: 6px;
  z-index: 1;
}

.menu__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  height: 32px;
  padding: 0 10px 2px;
  font-size: 11.5px;
  letter-spacing: 0.02em;
}

.menu__title {
  color: var(--muted);
  font-weight: 520;
}

.menu__current {
  position: relative;
  display: block;
  overflow: hidden;
  height: 16px;
  color: color-mix(in srgb, var(--ink) 82%, transparent);
  font-weight: 560;
  font-variant-numeric: tabular-nums;
}

.menu__current-in {
  display: block;
  line-height: 16px;
  white-space: nowrap;
}

.menu__list {
  position: relative;
  display: grid;
  touch-action: none;
}

/* the glass pill under the pointer */
.menu__pill {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: var(--row);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.085), rgba(255, 255, 255, 0.035));
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.07),
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 6px 14px -8px rgba(0, 0, 0, 0.9);
  overflow: hidden;
  pointer-events: none;
}

.menu__pill-glow {
  position: absolute;
  left: -20%;
  top: -60%;
  width: 70%;
  height: 220%;
  border-radius: 50%;
  background: var(--violet);
  filter: blur(22px);
  opacity: 0.22;
}

/* the hairline from the pill to the card */
.menu__bridge {
  position: absolute;
  top: 0;
  left: 100%;
  width: 16px;
  height: 1px;
  margin-left: 6px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.35), color-mix(in srgb, var(--violet) 60%, transparent));
  pointer-events: none;
  opacity: 0;
}

.row {
  appearance: none;
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) 20px;
  align-items: center;
  gap: 11px;
  height: var(--row);
  margin: 0;
  padding: 0 10px 0 8px;
  border: 0;
  border-radius: 12px;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.row:focus-visible {
  outline: 1.5px solid color-mix(in srgb, var(--cyan) 70%, white);
  outline-offset: -1.5px;
}

.row__tile {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 4px 10px -4px rgba(0, 0, 0, 0.8);
}

.row__tile svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: #fff;
  stroke-width: 1.6;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.row__tile--auto { background: linear-gradient(140deg, var(--violet), var(--cyan)); }
.row__tile--swift { background: linear-gradient(140deg, color-mix(in srgb, var(--cyan) 85%, white), color-mix(in srgb, var(--cyan) 60%, #0a2a40)); }
.row__tile--core { background: linear-gradient(140deg, color-mix(in srgb, var(--violet) 70%, var(--cyan)), color-mix(in srgb, var(--violet) 70%, #120c40)); }
.row__tile--deep { background: linear-gradient(140deg, color-mix(in srgb, var(--violet) 80%, white), color-mix(in srgb, var(--violet) 55%, #0c0820)); }

.row__text {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.row__name {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 14px;
  font-weight: 560;
  font-variation-settings: 'wdth' var(--w, 100);
  white-space: nowrap;
}

.row__tag {
  padding: 1px 6px 2px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: color-mix(in srgb, var(--violet) 55%, white);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--violet) 55%, transparent);
  background: color-mix(in srgb, var(--violet) 14%, transparent);
}

.row__sub {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.row__end {
  display: grid;
  place-items: center;
}

.row__check {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: var(--check);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.row__check path {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
}

/* ------------------------------------------------------------ the spec card */
.spec-wrap {
  position: relative;
  will-change: transform;
}

.spec {
  padding: 16px 16px 14px;
  overflow: hidden;
}

.spec__orb {
  position: absolute;
  right: -40px;
  top: -50px;
  width: 170px;
  height: 140px;
  pointer-events: none;
}

.spec__orb-a,
.spec__orb-b {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  filter: blur(34px);
  opacity: 0.42;
  background: var(--violet);
}

.spec__orb-b {
  inset: 30px 50px 10px 0;
  background: var(--cyan);
  opacity: 0.18;
}

.spec__sweep {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: inherit;
  pointer-events: none;
}

.spec__sweep-band {
  position: absolute;
  top: -20%;
  left: 0;
  width: 40%;
  height: 140%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.09), transparent);
}

.spec__head {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.spec__name {
  font-size: 17px;
  font-weight: 620;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.spec__badge {
  padding: 3px 8px 4px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 560;
  color: color-mix(in srgb, var(--ink) 80%, transparent);
  background: rgba(255, 255, 255, 0.06);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1);
  white-space: nowrap;
}

.spec__line {
  position: relative;
  margin: 6px 0 14px;
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--muted);
  min-height: 2.9em;
}

.spec__bars {
  position: relative;
  display: grid;
  gap: 9px;
}

.bar {
  display: grid;
  grid-template-columns: 70px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  font-size: 11.5px;
  color: color-mix(in srgb, var(--ink) 70%, transparent);
}

.bar__track {
  position: relative;
  height: 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.5);
}

.bar__fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, color-mix(in srgb, var(--cyan) 75%, transparent), var(--violet));
}

.bar__tip {
  position: absolute;
  right: -1px;
  top: 50%;
  width: 7px;
  height: 7px;
  margin-top: -3.5px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--violet) 45%, transparent), 0 0 10px 1px color-mix(in srgb, var(--violet) 80%, transparent);
}

.spec__stats {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 15px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.stat {
  display: grid;
  gap: 2px;
}

.stat__label {
  font-size: 10.5px;
  color: var(--muted);
  letter-spacing: 0.02em;
}

.stat__value {
  font-size: 17px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}

/* ------------------------------------------------------------ the pointer of the preview */
.cursor {
  position: fixed;
  left: 0;
  top: 0;
  width: 22px;
  height: 22px;
  margin: -3px 0 0 -5px;
  fill: #ffffff;
  stroke: #0a0b0f;
  stroke-width: 1.3;
  stroke-linejoin: round;
  filter: drop-shadow(0 3px 5px rgba(0, 0, 0, 0.5));
  pointer-events: none;
  opacity: 0;
  z-index: 10;
}

/* ------------------------------------------------------------ the phone: the card under the menu */
@media (max-width: 599px) {
  .ui {
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
    width: min(100%, 360px);
  }
  .menu__bridge {
    display: none;
  }
  .spec {
    padding: 12px 14px 12px;
  }
  .spec__line {
    margin: 4px 0 10px;
    min-height: 0;
  }
  .spec__stats {
    margin-top: 10px;
    padding-top: 9px;
  }
}

@media (max-width: 599px) and (max-height: 640px) {
  .stage {
    --row: clamp(38px, 9.4vh, 50px);
    padding: 10px 12px;
  }
  .menu__head {
    height: 26px;
  }
  .spec__line {
    display: none;
  }
  .spec__head {
    margin-bottom: 9px;
  }
  .spec__bars {
    gap: 6px;
  }
  .spec__name,
  .stat__value {
    font-size: 15px;
  }
  .row__sub {
    font-size: 11.5px;
  }
}
