:root {
  --bg: #f3f0e8;
  --card: #fffdf8;
  --ink: #1a1712;
  --soft: rgba(26, 23, 18, 0.52);
  --line: rgba(26, 23, 18, 0.1);
  --accent: #c2410c;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: "Mona Sans Variable", "Mona Sans", system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

.stage {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  place-items: center;
  padding: 10px 16px;
}

.wd {
  width: min(340px, 100%);
  padding: 14px 16px 12px;
  border-radius: 28px;
  background: var(--card);
  box-shadow:
    0 0 0 1px rgba(26, 23, 18, 0.06),
    0 1px 2px rgba(26, 23, 18, 0.05),
    0 16px 30px -14px rgba(26, 23, 18, 0.18),
    0 44px 70px -36px color-mix(in srgb, var(--accent) 30%, rgba(26, 23, 18, 0.25));
}
.wd__head { display: flex; align-items: center; justify-content: space-between; height: 24px; }
.wd__title { font-size: 12.5px; font-weight: 640; color: var(--soft); }
.wd__kind { height: 22px; padding: 0 9px; border-radius: 11px; overflow: hidden; background: rgba(26, 23, 18, 0.06); font-size: 11.5px; line-height: 22px; font-weight: 620; font-style: italic; }
.wd__kind span { display: block; }

/* the word: one box per syllable, the gap between them opens while it is said */
.wd__word {
  display: flex;
  align-items: baseline;
  gap: calc(var(--gap, 0) * 1px);
  height: clamp(46px, 14vh, 58px);
  margin-top: clamp(4px, 2vh, 10px);
  font-size: clamp(38px, 11.500vh, 48px);
  line-height: clamp(46px, 14vh, 58px);
  font-weight: 400;
  letter-spacing: -0.035em;
  white-space: nowrap;
}
.syl { display: inline-block; font-variation-settings: "wght" var(--w, 640), "wdth" var(--d, 96); color: color-mix(in srgb, var(--accent) calc(var(--hot, 0) * 100%), var(--ink)); }
.syl > span { display: inline-block; }
.wd__ipa { height: 20px; overflow: hidden; font-size: 13.5px; line-height: 20px; font-weight: 500; color: var(--soft); font-family: "Mona Sans Variable", "Segoe UI", "Helvetica Neue", "Noto Sans", sans-serif; }
.wd__ipa span { display: block; }
.wd__def { min-height: 42px; margin-top: clamp(6px, 2vh, 10px); font-size: 14.5px; line-height: 21px; font-weight: 520; text-wrap: balance; }
.wd__def span { display: inline-block; white-space: pre; }

.wd__foot { display: flex; align-items: center; justify-content: space-between; margin-top: clamp(8px, 2.600vh, 14px); padding-top: 10px; border-top: 1px solid var(--line); }
.wd__hear {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 15px 0 12px;
  border: 0;
  border-radius: 19px;
  background: var(--ink);
  color: #fffdf8;
  font: inherit;
  font-size: 13px;
  font-weight: 640;
  cursor: pointer;
  outline: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
/* four bars for the voice: they jump on each syllable */
.wd__bars { display: flex; align-items: center; gap: 2.5px; height: 16px; }
.wd__bars i { display: block; width: 3px; height: 16px; border-radius: 1.5px; background: currentColor; transform: scaleY(0.3); }
.wd__next {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 19px;
  background: rgba(26, 23, 18, 0.06);
  color: var(--ink);
  cursor: pointer;
  outline: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: background-color 0.25s ease;
}
.wd__next svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.800; stroke-linecap: round; stroke-linejoin: round; }
.wd__hear:focus-visible, .wd__next:focus-visible { box-shadow: 0 0 0 2px var(--card), 0 0 0 4px var(--ink); }

.ghost {
  position: fixed;
  left: 0;
  top: 0;
  width: 22px;
  height: 22px;
  pointer-events: none;
  fill: #1a1712;
  stroke: #ffffff;
  stroke-width: 1.4;
  stroke-linejoin: round;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
  opacity: 0;
  visibility: hidden;
  z-index: 5;
}

@media (hover: hover) {
  .wd__next:hover { background: rgba(26, 23, 18, 0.11); }
}
/* larger in a roomy window, so the preview is not a small card in a big page */
@media (min-width: 700px) and (min-height: 500px) { .wd { zoom: 1.5; } .ghost { width: 28px; height: 28px; } }
@media (min-width: 1100px) and (min-height: 760px) { .wd { zoom: 2.1; } .ghost { width: 34px; height: 34px; } }
