/* The Chladni sand card: the card of a bookshelf speaker on a black page, a dark anodised plate with pale sand,
   set in Geist. One electric blue accent: the frequency and the chosen sound profile. */
:root {
  --page: #000000;          /* the page */
  --card: #0e0e0f;          /* the card */
  --edge: #232326;          /* the card's hairline */
  --plate: #19191b;         /* the metal plate */
  --sand: #efe8da;          /* the sand */
  --ink: #f4f2ee;           /* the words */
  --muted: #8a8a90;         /* the small print */
  --accent: #5b82ff;        /* the frequency and the chosen profile */
}

* {
  box-sizing: border-box;
}

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

body {
  min-height: 100svh;
  background: var(--page);
  color: var(--ink);
  font-family: 'Geist Variable', 'Helvetica Neue', Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

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

.speaker {
  position: relative;
  width: min(340px, 100%);
  padding: 20px 20px 18px;
  border: 1px solid var(--edge);
  border-radius: 14px;
  background: var(--card);
}

/* ---------------------------------------------------------------- the plate: a button that plays the tone */
.plate {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 1;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background:
    radial-gradient(120% 90% at 30% 20%, rgba(255, 255, 255, 0.06), transparent 55%),
    var(--plate);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.07), inset 0 -10px 24px rgba(0, 0, 0, 0.35);
  color: inherit;
  font: inherit;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
  will-change: transform;
}

.plate:focus-visible {
  outline: 1.5px solid var(--ink);
  outline-offset: 4px;
}

.plate__sand {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
}

/* the bolt that holds the plate on the speaker, in the middle */
.plate__bolt {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 14px;
  height: 14px;
  margin: -7px 0 0 -7px;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, #4a4a4f, #1c1c1f 70%);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08), 0 1px 2px rgba(0, 0, 0, 0.6);
}

.meter {
  display: flex;
  justify-content: space-between;
  margin: 10px 2px 0;
  font-family: 'Geist Mono Variable', ui-monospace, monospace;
  font-size: 10.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.meter__hz {
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.meter__state {
  color: var(--muted);
  transition: color 0.3s ease;
}

.plate.is-playing + .meter .meter__state {
  color: var(--ink);
}

/* ---------------------------------------------------------------- the words */

.info {
  padding-top: 12px;
}

.info__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.info__name {
  margin: 0;
  font-size: 22px;
  line-height: 1.05;
  letter-spacing: -0.02em;
  font-weight: 560;
}

.info__kind {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 420;
}

.info__price {
  margin: 1px 0 0;
  font-size: 17px;
  font-weight: 520;
  font-variant-numeric: tabular-nums;
}

/* the three profiles: a row of words in a hairline track; the chosen one sits in a pill that slides */
.profiles {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin-top: 16px;
  padding: 3px;
  border: 1px solid var(--edge);
  border-radius: 999px;
}

.profiles__pill {
  position: absolute;
  top: 3px;
  bottom: 3px;
  left: 0;
  border-radius: 999px;
  background: rgba(91, 130, 255, 0.16);
  box-shadow: inset 0 0 0 1px rgba(91, 130, 255, 0.55);
  pointer-events: none;
}

.profile {
  position: relative;
  min-height: 36px;
  padding: 8px 6px;
  border: 0;
  border-radius: 999px;
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  font-weight: 480;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: color 0.25s ease, font-weight 0.35s cubic-bezier(0.3, 1.5, 0.5, 1);
}

.profile[aria-checked='true'] {
  color: var(--ink);
  font-weight: 620;
}

@media (hover: hover) and (pointer: fine) {
  .profile[aria-checked='false']:hover {
    color: #c5c5ca;
  }
}

.profile:focus-visible {
  outline: 1.5px solid var(--ink);
  outline-offset: -1px;
}

.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
