@font-face {
  font-family: "JetBrains Mono";
  src: url("/fonts/jetbrains-mono-latin.woff2") format("woff2");
  font-style: normal;
  font-weight: 100 800;
  font-display: swap;
}

@font-face {
  font-family: "JetBrains Mono";
  src: url("/fonts/jetbrains-mono-vietnamese.woff2") format("woff2");
  font-style: normal;
  font-weight: 100 800;
  font-display: swap;
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}

:root {
  color-scheme: dark;
  font-family: "JetBrains Mono", monospace;
  background: #1a1b26;
  color: #7aa2f7;
  font-synthesis: none;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  padding: 2rem 1.25rem;
  display: grid;
  place-items: center;
}

main {
  position: relative;
  width: 100%;
  max-width: 48rem;
  text-align: center;
}

h1 {
  max-width: 24ch;
  margin: 0 auto;
  font-size: clamp(1.4rem, 3.5vw, 2rem);
  font-weight: 300;
  line-height: 1.5;
  text-wrap: balance;
}

strong { font-weight: 700; }
.pronunciation { color: #7dcfff; white-space: nowrap; }
.spelling { white-space: nowrap; }
.spelling strong { color: #9ece6a; }
.dot { color: #7f88ad; font-weight: 300; }

#pronounce {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  margin-left: 0.08em;
  padding: 0.2em;
  border: 0;
  border-radius: 0.2em;
  background: transparent;
  color: #7f88ad;
  font: inherit;
  vertical-align: -0.3em;
  cursor: pointer;
  transition: color 150ms ease;
}

#pronounce svg { width: 0.95em; height: 0.95em; }
#pronounce:hover { color: #7dcfff; }
#pronounce.playing { color: #9ece6a; }
#pronounce:focus-visible { outline: 2px solid #7dcfff; outline-offset: 3px; }

.meaning {
  margin: 2rem 0 0;
  color: #7dcfff;
  font-size: clamp(0.8rem, 1.75vw, 1rem);
  font-weight: 300;
  line-height: 1.6;
  text-wrap: balance;
}

.status {
  position: absolute;
  top: 100%;
  width: 100%;
  margin: 1rem 0 0;
  color: #a9b1d6;
  font-size: 0.8rem;
  line-height: 1.5;
}

@media (prefers-reduced-motion: reduce) {
  #pronounce { transition: none; }
}
