:root {
  --paper: #F6F7F9;
  --card: #FFFFFF;
  --ink: #1B3A5C;
  --text: #1E2733;
  --muted: #5B6676;
  --line: #D8DEE6;
  --alpha: #0F766E;
  --alpha-soft: #E3F2EF;
  --vocab: #A2560F;
  --vocab-soft: #F7ECDF;
  --serif: "Literata", Georgia, "Noto Serif", "Songti SC", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
          "Hiragino Sans GB", "Noto Sans", "Microsoft YaHei", sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0F1A26;
    --card: #162433;
    --ink: #D6E2F0;
    --text: #E4E9F0;
    --muted: #9AA7B8;
    --line: #2A3B4E;
    --alpha: #4FC2B2;
    --alpha-soft: #143430;
    --vocab: #E3A15B;
    --vocab-soft: #33261A;
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0; background: var(--paper); color: var(--text);
  font: 17px/1.6 var(--sans);
}
a { color: inherit; }
a:focus-visible { outline: 3px solid var(--alpha); outline-offset: 3px; border-radius: 4px; }
img { display: block; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; color: var(--ink); line-height: 1.2; }
h2 { font-size: clamp(1.7rem, 3.4vw, 2.3rem); margin: 0 0 .4rem; }
h3 { font-size: 1.2rem; margin: 0 0 .35rem; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 24px; }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* header */
.top { border-bottom: 1px solid var(--line); background: var(--paper); position: sticky; top: 0; z-index: 5; }
.top-in { display: flex; align-items: center; justify-content: space-between; height: 60px; gap: 16px; }
.brand { font-family: var(--sans); font-weight: 700; font-size: 1.2rem; letter-spacing: -.02em; color: var(--ink); text-decoration: none; }
.top nav { display: flex; gap: 22px; font-size: .95rem; }
.top nav a { text-decoration: none; color: var(--muted); }
.top nav a:hover { color: var(--ink); }
.top nav .lang { color: var(--ink); font-weight: 600; }

/* hero: the specimen of scripts is the one loud thing on the page */
.hero { display: grid; grid-template-columns: 1fr 1.1fr; gap: 56px; align-items: center; padding-top: 72px; padding-bottom: 64px; }
.hero h1 { font-size: clamp(2.1rem, 4.6vw, 3.4rem); margin: 0 0 20px; letter-spacing: -.01em; }
.lede { font-size: 1.15rem; color: var(--muted); max-width: 34em; margin: 0; }
.glyphs { display: grid; grid-template-columns: repeat(6, 1fr); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.glyph {
  aspect-ratio: 1; display: flex; align-items: center; justify-content: center;
  border-right: 1px solid var(--line); border-bottom: 1px solid var(--line);
  font-family: var(--serif); font-size: clamp(1.6rem, 3.3vw, 2.5rem); color: var(--ink);
  text-decoration: none; background: var(--card);
  animation: ink .5s both; animation-delay: calc(var(--i, 0) * 35ms);
}
.glyph:hover, .glyph:focus-visible { background: var(--alpha); color: #fff; outline: none; }
.hint { color: var(--muted); font-size: .9rem; margin: 12px 0 0; }
@keyframes ink { from { opacity: 0; transform: translateY(6px); } }
@media (prefers-reduced-motion: reduce) { .glyph { animation: none; } }

/* the two steps: a real sequence, so it is numbered */
.path ol { list-style: none; margin: 0 0 72px; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.path li a { display: block; height: 100%; padding: 28px; text-decoration: none; border: 1px solid var(--line); border-radius: 6px; background: var(--card); }
.path li:first-child a { border-top: 4px solid var(--alpha); }
.path li:last-child a { border-top: 4px solid var(--vocab); }
.path li a:hover h3 { text-decoration: underline; }
.path p { color: var(--muted); margin: 0 0 14px; max-width: 38em; }
.step-n { font-family: var(--serif); font-size: 2.6rem; line-height: 1; color: var(--line); float: right; }
.step-c { font-weight: 600; font-size: .95rem; }
.path li:first-child .step-c { color: var(--alpha); }
.path li:last-child .step-c { color: var(--vocab); }

/* families */
.family { padding: 64px 0; }
.fam-alpha { background: var(--alpha-soft); }
.fam-vocab { background: var(--vocab-soft); }
.fam-p { color: var(--muted); max-width: 40em; margin: 0 0 28px; }
.tiles { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.tile { background: var(--card); border-radius: 6px; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.tile-main { display: grid; grid-template-columns: 56px 1fr; column-gap: 12px; align-items: center; text-decoration: none; }
.tile-main img, .feature img { border-radius: 22%; border: 1px solid var(--line); }
.tile-main img { grid-row: span 2; }
.tile-name { font-weight: 600; color: var(--ink); line-height: 1.3; }
.tile-main:hover .tile-name { text-decoration: underline; }
.tile-meta { font-size: .85rem; color: var(--muted); }
.tile-stores { display: flex; flex-wrap: wrap; gap: 6px; }
.st { font-size: .78rem; padding: 3px 9px; border: 1px solid var(--line); border-radius: 99px; text-decoration: none; color: var(--text); white-space: nowrap; }
a.st:hover { border-color: var(--ink); }
.st-off { color: var(--muted); border-style: dashed; }
.feature { display: flex; gap: 20px; align-items: flex-start; background: var(--card); border-radius: 6px; padding: 22px; margin-top: 12px; }
.feature h3 a { text-decoration: none; }
.feature h3 a:hover { text-decoration: underline; }
.feature p { margin: 0 0 10px; color: var(--muted); }
.feature .feature-tag { color: var(--text); font-weight: 600; margin-bottom: 4px; }
.features { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px; }
.features .feature { margin-top: 0; }
.fam-vocab .feature { border-left: 4px solid var(--vocab); }
.fam-alpha .feature { border-left: 4px solid var(--alpha); }

/* language index */
.index { padding-top: 72px; padding-bottom: 24px; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .95rem; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); }
thead th { font-weight: 600; color: var(--muted); font-size: .85rem; }
thead th:nth-child(2) { color: var(--alpha); }
thead th:nth-child(3) { color: var(--vocab); }
tbody th { font-weight: 600; color: var(--ink); }
td a { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; }
td a:hover span { text-decoration: underline; }
td img { border-radius: 22%; }
td.none { color: var(--muted); }

.about { padding-top: 48px; padding-bottom: 72px; }
.about p { max-width: 40em; color: var(--muted); margin: 0; }

/* footer */
.foot { border-top: 1px solid var(--line); padding: 32px 0 40px; font-size: .92rem; }
.foot-in { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 20px; align-items: flex-start; }
.foot p { margin: 0; }
.foot p span { color: var(--muted); }
.foot nav { display: flex; flex-wrap: wrap; gap: 18px; }
.foot nav a, .foot p a { color: var(--ink); }
.cr { color: var(--muted); width: 100%; }

@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; gap: 36px; padding-top: 40px; }
  .path ol, .features { grid-template-columns: 1fr; }
  .top nav a:not(.lang) { display: none; }
}
@media (max-width: 520px) {
  .wrap { padding-left: 16px; padding-right: 16px; }
  .glyphs { grid-template-columns: repeat(5, 1fr); }
  .tiles { grid-template-columns: 1fr; }
  .feature { flex-direction: column; gap: 14px; }
  .feature img { width: 64px; height: 64px; }
}
.st-web { border-color: var(--alpha); color: var(--alpha); font-weight: 600; }
