/* Yakut dictionary. Self-hosted, no remote assets. */
@font-face {
  font-family: "Noto Fallback";
  src: local("Times New Roman");
  size-adjust: 100%;
  ascent-override: 106.9%;
  descent-override: 29.3%;
  line-gap-override: 0%;
}

@font-face {
  font-family: "Noto Serif";
  font-style: normal;
  font-weight: 480;
  font-display: swap;
  src: url("fonts/noto-serif-yakut.woff2") format("woff2");
}

:root {
  color-scheme: light;
  --paper: #f3efe6;
  --paper-2: #fbf8f2;
  --ink: #241f1a;
  --muted: #5c5348;
  --line: #ddd4c6;
  --ember: #9e1c17;
  --key: #fffdf8;
  --gutter: clamp(1rem, 4vw, 2rem);
  --measure: 68rem;
  font-family: "Noto Serif", "Noto Fallback", Georgia, "Times New Roman", serif;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { font-size: 100%; line-height: 1.5; scroll-behavior: smooth; }

body { margin: 0; min-width: 0; }

::selection { color: var(--paper); background: var(--ember); }

img, svg { max-width: 100%; height: auto; }

a { color: inherit; text-underline-offset: 0.22em; }

a:hover { color: var(--ember); }

a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 2px solid var(--ember);
  outline-offset: 3px;
}

.skip {
  position: absolute;
  left: var(--gutter);
  top: -4rem;
  z-index: 8;
  background: var(--ink);
  color: var(--paper);
  padding: 0.45rem 0.75rem;
  text-decoration: none;
}

.skip:focus { top: 0.6rem; }

.wrap {
  width: min(var(--measure), calc(100% - (var(--gutter) * 2)));
  margin-inline: auto;
}

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 0 0.85rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  text-decoration: none;
  min-width: 48px;
  min-height: 48px;
}

.brand img { display: block; flex: none; }

.brand-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.15; }

.brand-mark { font-size: 1.25rem; letter-spacing: -0.02em; }

.brand-sub { color: var(--muted); font-size: 0.82rem; }

.nav { display: flex; flex-wrap: wrap; gap: 0.35rem 0.9rem; align-items: center; font-size: 0.95rem; }

.langs { display: inline-flex; flex-wrap: wrap; gap: 0.15rem 0.35rem; }

.langs a[aria-current="page"] { color: var(--ember); text-decoration: none; }

.post time, .post-list time {
  display: block;
  color: var(--muted);
  font-size: 0.92rem;
}

.post h1 { margin-top: 0.35rem; }

.post p { max-width: 40rem; }

.post-list { list-style: none; margin: 1.2rem 0 0; padding: 0; }

.post-list a {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 0.15rem;
  min-height: 48px;
  padding: 0.85rem 0;
  border-top: 1px solid var(--line);
  text-decoration: none;
}

.nav a,
.foot a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  min-width: 48px;
  padding: 0 0.3rem;
}

p a {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  padding-inline: 0.2rem;
}

.nav a[aria-current="page"] { text-decoration: none; color: var(--muted); }

.hero { padding: 0.4rem 0 0.2rem; }

.eyebrow {
  margin: 0 0 0.35rem;
  color: var(--ember);
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(2.05rem, 5vw, 3.35rem);
  font-weight: 560;
  letter-spacing: -0.03em;
  line-height: 1.08;
}

.lede {
  margin: 0.7rem 0 0;
  max-width: 40rem;
  color: var(--muted);
  font-size: 1.05rem;
}

.search-dock {
  position: sticky;
  top: 0;
  z-index: 4;
  background: var(--paper);
  padding: 0.85rem 0 0.7rem;
}

.search { margin: 0; }

.search-label {
  display: block;
  margin-bottom: 0.35rem;
  color: var(--muted);
  font-size: 0.82rem;
}

.search input[type="search"],
.waitlist input[type="email"] {
  width: 100%;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--key);
  color: var(--ink);
  font: inherit;
  font-size: 1.125rem;
  line-height: 1.3;
  padding: 0.8rem 0.95rem;
  appearance: none;
}

.search input::placeholder,
.waitlist input::placeholder { color: var(--muted); opacity: 1; }

input[type="search"]::-webkit-search-decoration,
input[type="search"]::-webkit-search-cancel-button { display: none; }

.stage {
  height: 22rem;
  overflow: auto;
  margin-top: 0.35rem;
}

.keys {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.45rem;
  margin-top: 0.65rem;
}

.key {
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--key);
  color: var(--ink);
  font: inherit;
  font-size: 1.45rem;
  line-height: 1;
  cursor: pointer;
}

.key:hover,
.key:active { border-color: var(--ember); color: var(--ember); }

.count { margin: 0.35rem 0 0; color: var(--muted); font-size: 0.92rem; min-height: 1.4em; }

.results { margin: 0.2rem 0 0; }

.result {
  display: grid;
  grid-template-columns: minmax(6.5rem, 32%) 1fr;
  gap: 0.25rem 1rem;
  align-items: center;
  min-height: 48px;
  padding: 0.85rem 0.2rem;
  border-top: 1px solid var(--line);
  text-decoration: none;
}

.result:hover { background: rgba(158, 28, 23, 0.04); }

.result b { font-size: 1.28rem; font-weight: 560; letter-spacing: -0.02em; }

.result i { color: var(--muted); font-style: normal; font-size: 0.95rem; }

.chips, .letters { display: flex; flex-wrap: wrap; gap: 0.45rem; padding: 0; margin: 0.8rem 0 0; list-style: none; }

.chips a, .letters a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  min-width: 48px;
  padding: 0.2rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper-2);
  text-decoration: none;
}

.letters a { font-size: 1.15rem; border-radius: 12px; }

.section-title {
  margin: 2.2rem 0 0.4rem;
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 560;
}

.about {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 1.25rem;
  margin-top: 2.4rem;
  padding-top: 1.6rem;
  border-top: 1px solid var(--line);
}

.about h2, .entry h2, .doc h2 {
  margin: 0 0 0.45rem;
  font-size: 1.45rem;
  font-weight: 560;
  letter-spacing: -0.02em;
}

.about p, .doc p, .doc li { color: var(--ink); }

.muted, .doc .note { color: var(--muted); }

.waitlist {
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1rem 1rem 1.05rem;
}

.waitlist h2 { font-size: 1.2rem; }

.waitlist .row { display: flex; gap: 0.5rem; margin-top: 0.75rem; }

.waitlist input { flex: 1; min-width: 0; }

.btn {
  flex: none;
  border: 0;
  border-radius: 12px;
  background: var(--ink);
  color: var(--paper);
  font: inherit;
  font-size: 0.98rem;
  min-height: 3rem;
  padding: 0.55rem 0.9rem;
  cursor: pointer;
}

.btn:disabled { cursor: not-allowed; opacity: 0.55; }

.foot {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 1rem;
  justify-content: space-between;
  margin: 2.4rem 0 1.4rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.92rem;
}

.entry { padding-bottom: 1rem; }

.pos { margin: 0.45rem 0 1rem; color: var(--muted); }

.gloss { margin: 0; padding: 0; list-style: none; }

.gloss li {
  padding: 0.45rem 0;
  border-top: 1px solid var(--line);
  font-size: 1.12rem;
}

.back { margin-top: 1.4rem; }

.word-list { margin: 0.6rem 0 0; padding: 0; list-style: none; }

.word-list a {
  display: grid;
  grid-template-columns: minmax(6.5rem, 32%) 1fr;
  gap: 0.25rem 1rem;
  align-items: center;
  min-height: 48px;
  padding: 0.7rem 0;
  border-top: 1px solid var(--line);
  text-decoration: none;
}

.word-list b { font-weight: 560; font-size: 1.15rem; }

.word-list span { color: var(--muted); }

.doc { padding-bottom: 1.5rem; }

.doc h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); margin-bottom: 0.8rem; }

.doc ul { padding-left: 1.15rem; }

.doc li { margin: 0.35rem 0; }

.missing { font-size: clamp(3rem, 10vw, 5rem); margin: 0; letter-spacing: -0.04em; color: var(--ember); }

@media (max-width: 700px) {
  .about { grid-template-columns: 1fr; }
  .result, .word-list a { grid-template-columns: 1fr; gap: 0.1rem; }
  .waitlist .row { flex-direction: column; }
  .btn { width: 100%; }
  .nav { gap: 0.7rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
