@font-face {
  font-family: Zliten;
  src: url("./assets/Zliten-Light.woff2") format("woff2");
  font-weight: 300;
  font-display: swap;
}

@font-face {
  font-family: Zliten;
  src: url("./assets/Zliten-Regular.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: Zliten;
  src: url("./assets/Zliten-Medium.woff2") format("woff2");
  font-weight: 500;
  font-display: swap;
}

@font-face {
  font-family: Zliten;
  src: url("./assets/Zliten-Bold.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}

:root {
  color-scheme: light;
  font-family: Zliten, Arial, sans-serif;
  font-synthesis: none;
  --paper: #fbfcfc;
  --stone: #e3e8e8;
  --accent: #34c7a9;
  --secondary: #0e4b54;
  --ink: #07252b;
  --tint: color-mix(in srgb, var(--accent) 12%, var(--paper));
  --quiet: color-mix(in srgb, var(--stone) 42%, var(--paper));
  color: var(--ink);
  background: var(--paper);
  scroll-behavior: smooth;
}

* { box-sizing: border-box; }
body { margin: 0; }
h1, h2, h3, p, ul { margin: 0; }
a { color: inherit; text-decoration: none; }
button, input, textarea { color: inherit; font: inherit; }
button, input[type="range"] { cursor: pointer; }

svg {
  width: 20px;
  height: 20px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

:focus-visible { outline: 2px solid var(--secondary); outline-offset: 3px; }
[hidden] { display: none !important; }

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

.wrap { width: min(100% - 80px, 1080px); margin-inline: auto; }

.site-header { border-block-end: 1px solid var(--stone); }

.header-inner,
.footer-inner {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand { display: inline-flex; align-items: center; gap: 7px; min-width: 0; }
.brand img { display: block; flex: none; }
.brand-lines { display: grid; grid-template-columns: max-content; line-height: 1.15; }
.brand-lines > * { width: max-content; white-space: nowrap; }
.brand-lines strong { font-size: 19px; }
.brand-lines > span { margin-block-start: 3px; font-size: 11px; }

.language-link, .icon-button, .back-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-width: 44px;
  min-height: 44px;
  padding: 4px 10px;
  border: 1px solid var(--stone);
  border-radius: 12px;
  background: var(--paper);
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
  transition: background-color 150ms, border-color 150ms, transform 150ms, color 150ms;
}

.language-link:hover, .icon-button:not(:disabled):hover, .icon-button[aria-expanded="true"] {
  background: var(--tint);
  color: var(--secondary);
}

.language-link:active, .icon-button:not(:disabled):active, .back-button:active, .glyph-key:active {
  transform: scale(.96);
}

.language-link svg { width: 17px; height: 17px; color: var(--secondary); }

.intro {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding-block: 25px 23px;
}

.product-name { display: flex; align-items: flex-start; gap: 12px; }

.product-name h1 {
  font-size: clamp(76px, 11vw, 135px);
  line-height: .96;
  letter-spacing: -.012em;
}

.version {
  margin-block-start: 9px;
  padding: 5px 8px;
  border-radius: 999px;
  color: var(--secondary);
  background: var(--stone);
  font: 600 12px/1.2 ui-monospace, monospace;
}

.intro p { margin-block-end: 8px; font-size: clamp(17px, 2.15vw, 24px); color: var(--secondary); }
section[id] { scroll-margin-block-start: 16px; }

.composer {
  padding: 9px 14px 14px;
  border: 1px solid var(--stone);
  border-radius: 19px;
  background: var(--paper);
  box-shadow: 0 5px 18px #07252b09;
  transition: border-color 180ms, box-shadow 180ms;
}

.composer:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--tint); }

.composer-heading, .characters-heading, .purchase {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.composer-heading { padding-inline-start: 4px; margin-block-end: 5px; }

h2 { display: inline-flex; align-items: center; gap: 8px; font-size: 19px; line-height: 1.15; }
h2 svg { color: var(--secondary); }
.composer-actions { display: flex; gap: 4px; }
.icon-button { border-color: transparent; padding: 0; background: transparent; }
.icon-button:disabled { opacity: 0; visibility: hidden; cursor: default; }

#editor {
  display: block;
  width: 100%;
  min-height: 103px;
  max-height: 248px;
  field-sizing: content;
  resize: none;
  padding: 15px 17px;
  border: 0;
  border-radius: 12px;
  background: var(--quiet);
  caret-color: var(--secondary);
  font-size: clamp(21px, 3.3vw, 32px);
  line-height: 1.35;
  text-align: start;
  overflow-wrap: anywhere;
  transition: background-color 180ms;
}

#editor:focus { outline: none; background: var(--tint); }
#editor::placeholder { color: var(--secondary); opacity: .8; }
#editor:focus::placeholder { opacity: 0; }

.controls { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 20px; padding: 13px 4px 0; }

.control {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 0 5px;
}

.control label { color: var(--secondary); font-size: 14px; }
.control output { color: var(--secondary); white-space: nowrap; font: 500 12px/1 ui-monospace, monospace; }
.control input { grid-column: 1 / -1; width: 100%; min-width: 0; height: 42px; margin: 0; accent-color: var(--secondary); }

.previews { --preview-size: 40px; --preview-line: 1.25; margin-block-start: 17px; }
.previews h3 { margin-block-end: 7px; font-size: 15px; }
.preview-grid {
  padding: 0;
  overflow: hidden;
  list-style: none;
  border: 1px solid var(--stone);
  border-radius: 14px;
  background: var(--paper);
}

.preview-card {
  display: grid;
  gap: 6px;
  padding: 10px 16px;
}

.preview-card + .preview-card { border-block-start: 1px solid var(--stone); }

.weight-name { display: flex; justify-content: space-between; align-items: center; gap: 6px; color: var(--secondary); font-size: 14px; }
.weight-name > span { font: 11px ui-monospace, monospace; }

.preview-text {
  min-width: 0;
  font-size: var(--preview-size);
  font-weight: var(--weight);
  line-height: var(--preview-line);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.preview-card[data-weight="300"] { --weight: 300; }
.preview-card[data-weight="400"] { --weight: 400; }
.preview-card[data-weight="500"] { --weight: 500; }
.preview-card[data-weight="700"] { --weight: 700; }

.preview-text:empty { display: none; }
.empty-preview { margin-block-start: 8px; color: var(--secondary); font-size: 13px; }

.characters {
  margin-block: 22px 12px;
  padding: 13px 15px 11px;
  border: 1px solid var(--stone);
  border-radius: 17px;
  background: var(--paper);
}

.characters-heading { flex-wrap: wrap; margin-block-end: 12px; }

.tabs {
  display: inline-flex;
  gap: 3px;
  padding: 3px;
  border-radius: 11px;
  background: var(--stone);
}

.tabs button {
  min-height: 39px;
  border: 0;
  border-radius: 8px;
  padding: 4px 13px;
  background: transparent;
  font-size: 14px;
  transition: background-color 150ms, color 150ms;
}

.tabs button[aria-selected="true"] { color: var(--paper); background: var(--secondary); font-weight: 700; }

.glyph-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(52px, 1fr)); gap: 5px; }

.glyph-key {
  display: grid;
  place-items: center;
  min-width: 0;
  min-height: 46px;
  padding: 0 3px;
  border: 1px solid var(--stone);
  border-radius: 8px;
  background: var(--quiet);
  font-size: 25px;
  line-height: 1.05;
  transition: background-color 150ms, border-color 150ms, transform 150ms;
}

.glyph-key:hover, .glyph-key[data-copied] { background: var(--tint); border-color: var(--accent); }
.character-note { margin-block-start: 9px; color: var(--secondary); font-size: 13px; }

.purchase {
  min-height: 56px;
  padding: 8px 5px;
  margin-block-end: 15px;
}

.purchase h2 { font-size: 16px; }
.purchase p { display: flex; align-items: center; gap: 7px; font-size: 14px; color: var(--secondary); }
.purchase p span { width: 7px; height: 7px; background: var(--accent); border-radius: 50%; }

.site-footer { color: var(--paper); background: var(--ink); }
.footer-inner { min-height: 76px; padding-block: 9px; }

.footer-inner .brand { margin-inline-end: auto; }
.site-footer :focus-visible { outline-color: var(--accent); }
.social-links { display: flex; flex: none; align-items: center; gap: 2px; }

.back-button {
  color: var(--paper);
  background: transparent;
  border-color: color-mix(in srgb, var(--paper) 34%, var(--ink));
}

.social-links a {
  display: grid;
  place-items: center;
  width: 34px;
  height: 42px;
  border-radius: 8px;
  transition: background-color 150ms, color 150ms;
}

.social-links svg { width: 17px; height: 17px; }
.social-links a:hover { color: var(--accent); background: var(--secondary); }

.back-button:hover { background: var(--secondary); }
.mobile-dock { display: none; }

@media (max-width: 720px) {
  .wrap { width: calc(100% - 38px); }
}

@media (max-width: 590px) {
  :root { --dock-clearance: calc(79px + env(safe-area-inset-bottom)); scroll-padding-block-end: var(--dock-clearance); }
  body { padding-block-end: var(--dock-clearance); background: var(--ink); }
  main, .site-header { background: var(--paper); }
  main.wrap { width: 100%; padding-inline: 14px; display: flow-root; }
  .wrap { width: calc(100% - 28px); }
  .header-inner { min-height: 60px; }
  .brand { gap: 5px; }
  .brand img { width: 37px; height: 35px; }
  .brand-lines strong { font-size: clamp(15px, 4.4vw, 18px); }
  .brand-lines > span { font-size: 10px; }
  .language-link { padding-inline: 8px; gap: 5px; }
  .intro { display: grid; gap: 3px; padding-block: 12px 15px; }
  .product-name { gap: 8px; }
  .product-name h1 { font-size: clamp(64px, 17vw, 84px); }
  .version { margin-block-start: 7px; padding: 4px 7px; }
  .intro p { margin: 0; font-size: 16px; }
  h2 { font-size: 17px; }
  .composer { padding: 5px 8px 8px; border-radius: 15px; }
  #editor { min-height: 96px; padding: 12px; }
  .controls { gap: 9px; }
  .previews { --preview-size: 33px; margin-block-start: 12px; }
  .preview-card { padding: 9px 12px; }
  .characters { margin-block-start: 18px; padding: 11px 9px 9px; }
  .characters-heading { gap: 8px; margin-block-end: 8px; }
  .tabs button { padding-inline: 8px; min-height: 41px; font-size: 13px; }
  .glyph-grid { grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); }
  .glyph-key { min-height: 44px; }
  .purchase { margin-block-end: 5px; }
  .footer-inner { min-height: 63px; gap: 4px; }
  .footer-inner .brand img { width: 33px; height: 32px; }
  .social-links a { width: 30px; }
  .back-button { min-width: 29px; padding-inline: 3px; border-color: transparent; }
  .back-button svg { width: 17px; height: 17px; }

  .mobile-dock {
    z-index: 2;
    position: fixed;
    inset-inline: max(12px, env(safe-area-inset-left), env(safe-area-inset-right));
    inset-block-end: calc(9px + env(safe-area-inset-bottom));
    max-width: 410px;
    margin-inline: auto;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 3px;
    padding: 5px;
    border: 1px solid var(--stone);
    border-radius: 23px;
    color: var(--ink);
    background: var(--paper);
    box-shadow: 0 7px 25px #07252b29, inset 0 1px #fff;
  }

  @supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    .mobile-dock {
      border-color: #ffffffa6;
      background: #fbfcfcd1;
      -webkit-backdrop-filter: blur(18px) saturate(155%);
      backdrop-filter: blur(18px) saturate(155%);
    }
  }

  .mobile-dock a {
    display: grid;
    place-items: center;
    align-content: center;
    gap: 2px;
    min-height: 46px;
    border-radius: 17px;
    font-size: 12px;
    -webkit-tap-highlight-color: transparent;
    transition: background-color 150ms, color 150ms;
  }

  .mobile-dock a[aria-current="location"] { background: var(--tint); color: var(--secondary); font-weight: 700; }
  body[data-keyboard-open] .mobile-dock { visibility: hidden; }
}

@media (prefers-reduced-transparency: reduce) {
  .mobile-dock { background: var(--paper); -webkit-backdrop-filter: none; backdrop-filter: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}

body.error-page { padding: 0; background: var(--paper); }
.error-content { max-width: 540px; margin-inline: auto; padding: clamp(28px, 10vw, 94px) 24px; }
.error-content h1 { margin-block: 6px 12px; font-size: clamp(38px, 8vw, 68px); line-height: 1.1; }
.error-code { color: var(--secondary); font: 700 14px ui-monospace, monospace; }
.error-links { display: flex; flex-wrap: wrap; gap: 10px; margin-block-start: 22px; }
