/* शब्दिका homepage · same print-shop world as the game (tokens.css). */

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (pointer: fine) { html { overscroll-behavior: none; } }
body {
  margin: 0;
  background: var(--press);
  color: var(--on-press);
  font-family: var(--f-ui);
  font-size: 17px;
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}
::selection { background: var(--rani); color: var(--on-rani); }
:focus-visible { outline: 2px solid var(--rani); outline-offset: 3px; }
h1, h2, h3 { text-wrap: balance; }
p { text-wrap: pretty; }
a { color: inherit; }
.num { font-variant-numeric: tabular-nums; }
[id] { scroll-margin-top: 84px; }

.skip { position: absolute; left: 12px; top: -60px; z-index: 50; padding: 10px 14px; background: var(--paper); color: var(--ink); font-weight: 700; border-radius: 6px; text-decoration: none; }
.skip:focus { top: 12px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-grid; place-items: center;
  min-height: 52px; padding: 10px 24px;
  border-radius: 8px; border: 1.5px solid transparent;
  font: 700 17px/1.2 var(--f-ui);
  text-decoration: none; cursor: pointer;
  transition: background-color .15s, border-color .15s, color .15s, transform .1s;
}
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--rani); color: var(--on-rani); }
.btn.primary:hover { background: #bd1d61; }
.btn.ghost { border-color: #57514a; color: var(--on-press); background: transparent; }
.btn.ghost:hover { border-color: var(--on-press-2); background: var(--press-2); }
.btn.small { min-height: 42px; padding: 8px 16px; font-size: 15px; }

/* ---------- nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 20;
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 20px;
  padding: 10px clamp(16px, 4vw, 48px);
  padding-top: max(10px, env(safe-area-inset-top));
  background: rgba(27, 25, 23, .88);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid #2c2925;
}
.brand { font-family: var(--f-mast); font-size: 30px; line-height: 1; text-decoration: none; color: var(--on-press); padding-top: 4px; }
.brand b { font-weight: 400; color: var(--rani); }
.nav nav { display: flex; gap: 4px; justify-content: center; }
.nav nav a { padding: 8px 12px; border-radius: 6px; text-decoration: none; color: var(--on-press-2); font-weight: 700; font-size: 15px; transition: color .15s, background-color .15s; }
.nav nav a:hover { color: var(--on-press); background: var(--press-2); }
.nav-r { display: flex; align-items: center; gap: 8px; }
.lang { min-height: 42px; padding: 6px 12px; border: 1.5px solid #57514a; border-radius: 8px; background: transparent; color: var(--on-press); font: 700 14px var(--f-ui); cursor: pointer; transition: border-color .15s, background-color .15s; }
.lang:hover { border-color: var(--on-press-2); background: var(--press-2); }
@media (max-width: 760px) { .nav nav { display: none; } .nav { grid-template-columns: auto 1fr auto; } .nav-r { grid-column: 3; } }

/* ---------- shared tile look (matches the game) ---------- */
.t {
  --s: 64px;
  width: var(--s); height: var(--s);
  display: inline-grid; place-items: center;
  border-radius: 4px;
  font: 700 calc(var(--s) * .44)/1 var(--f-type);
  padding-top: .12em;
  color: var(--ink);
  background: transparent;
  box-shadow: inset 0 0 0 1px var(--rule);
}
.t.mini { --s: 46px; }
.t[data-state="sort"] { background: var(--metal-lo); box-shadow: inset 0 0 0 1px rgba(26, 24, 21, .28), 0 1px 2px rgba(26, 24, 21, .25); }
.t[data-state="active"] { background: #f0eee8; box-shadow: inset 0 0 0 1px rgba(26, 24, 21, .28); outline: 2px solid var(--rani); outline-offset: 3px; }
.t[data-state="correct"] { background: var(--correct); color: var(--on-correct); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .2), inset 0 0 7px rgba(0, 0, 0, .22); }
.t[data-state="present"] { background: var(--present); color: var(--on-present); box-shadow: inset 0 0 0 4px var(--present), inset 0 0 0 5.5px var(--paper), inset 0 0 0 1px rgba(0, 0, 0, .2); }
.t[data-state="partial"] { background: radial-gradient(circle, var(--partial) 1.25px, transparent 1.55px) 0 0 / 6px 6px, var(--paper); box-shadow: inset 0 0 0 2px var(--partial); text-shadow: 0 0 2px var(--paper), 0 0 4px var(--paper), 0 0 6px var(--paper); }
.t[data-state="absent"] { background: var(--paper-2); color: var(--blind-ink); box-shadow: inset 0 1px 2px rgba(26, 24, 21, .16); }

/* ---------- hero ---------- */
.hero {
  position: relative;
  display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); align-items: center; gap: clamp(20px, 4vw, 56px);
  min-height: min(88svh, 820px);
  padding: clamp(28px, 6vw, 72px) clamp(16px, 5vw, 64px) clamp(36px, 6vw, 72px);
  max-width: 1280px; margin: 0 auto;
}
.hero h1 {
  margin: 0 0 18px;
  font-family: var(--f-mast); font-weight: 400;
  font-size: clamp(44px, 7.2vw, 92px); line-height: 1.08;
  letter-spacing: -0.01em;
}
.lede { margin: 0 0 28px; font-size: clamp(18px, 1.7vw, 21px); color: #d8d0c3; max-width: 34em; }
.cta { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 22px; }
.facts { margin: 0 0 6px; color: var(--on-press-2); font-weight: 700; font-size: 15px; display: flex; flex-wrap: wrap; gap: 4px 10px; }
.facts i { font-style: normal; color: #5f584f; }
.today { margin: 0; color: var(--on-press-2); font-size: 15px; }
.today b { color: var(--on-press); }
.today .sep { margin: 0 4px; color: #5f584f; }

.hero-art { position: relative; aspect-ratio: 1 / 1; width: 100%; max-width: 600px; justify-self: center; }
.hero-art canvas { position: absolute; inset: 0; width: 100% !important; height: 100% !important; opacity: 0; transition: opacity .8s ease-out; }
.hero-art.live canvas { opacity: 1; }
.hero-art.live .still { opacity: 0; }
.still {
  position: absolute; inset: 8%;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 4%;
  padding: 8%;
  background: var(--paper); border-radius: 3px;
  box-shadow: 0 30px 60px -30px rgba(0, 0, 0, .9);
  transform: rotate(-4deg);
  transition: opacity .6s ease-out;
}
.still .t { --s: 100%; width: 100%; height: auto; aspect-ratio: 1; font-size: clamp(22px, 4.4vw, 52px); }
@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; min-height: 0; text-align: left; }
  .hero-art { max-width: 420px; order: -1; margin-top: -8px; }
}

/* ---------- sections ---------- */
section { position: relative; }
.sec-head { max-width: 720px; margin: 0 auto 36px; text-align: center; padding: 0 16px; }
.sec-head h2 { margin: 0 0 10px; font-family: var(--f-mast); font-weight: 400; font-size: clamp(34px, 4.6vw, 56px); line-height: 1.12; }
.sec-head p { margin: 0; color: var(--on-press-2); font-size: 18px; }

/* the demo and the index sit on paper, like proof sheets */
.how, .features { padding: clamp(56px, 8vw, 110px) clamp(12px, 4vw, 48px); }
.how { background: var(--press-2); border-top: 1px solid #2c2925; border-bottom: 1px solid #2c2925; }

.demo {
  max-width: 1040px; margin: 0 auto;
  display: grid; grid-template-columns: minmax(0, 380px) minmax(0, 1fr); gap: clamp(20px, 4vw, 56px); align-items: center;
}
@media (max-width: 820px) { .demo { grid-template-columns: 1fr; justify-items: center; } .demo-side { width: 100%; max-width: 460px; } }
.demo-phone {
  width: 100%; max-width: 380px;
  background: var(--press); border-radius: 26px; padding: 14px 10px 12px;
  box-shadow: 0 0 0 1px #3a352f, 0 30px 70px -30px rgba(0, 0, 0, .95);
}
.demo-sheet { position: relative; background: var(--paper); color: var(--ink); border-radius: 3px; padding: 10px 14px 14px; }
.demo-sheet::before { content: ""; position: absolute; inset: 5px; border: 1px solid var(--rule); pointer-events: none; }
.demo-slug { display: flex; justify-content: space-between; font-size: 13px; font-weight: 700; color: var(--ink); padding: 0 4px 6px; position: relative; }
.demo-slug span + span { font-weight: 400; color: var(--ink-2); }
.demo-board { display: grid; gap: 7px; justify-content: center; position: relative; }
.demo-row { display: grid; grid-template-columns: repeat(3, 54px); gap: 7px; }
.demo-row .t { --s: 54px; }
.demo-row .t.pop { animation: pop .18s var(--ease-out); }
.demo-row .t.ink { animation: impress .34s var(--ease-out); }
.demo-row .t.lift { animation: lift .55s var(--ease-out) both; }
@keyframes pop { from { transform: translateY(-5px) scale(1.07); } }
@keyframes impress { 0% { transform: scale(.88); filter: brightness(1.2); } 60% { transform: scale(1.03); } }
@keyframes lift { 35% { transform: translateY(-9px); } }
.demo-toast {
  position: absolute; left: 50%; top: 34px; transform: translate(-50%, -6px);
  padding: 7px 14px; background: var(--ink); color: var(--paper); border-radius: 3px;
  font-weight: 700; font-size: 14px; white-space: nowrap; opacity: 0; pointer-events: none;
  transition: opacity .2s, transform .25s var(--ease-out);
}
.demo-toast.show { opacity: 1; transform: translate(-50%, 0); }

.demo-kb { margin-top: 10px; display: grid; gap: 6px; }
.demo-strip { display: grid; grid-template-columns: repeat(11, minmax(0, 1fr)); gap: 3px; padding: 4px; border: 1.5px solid var(--rani); border-radius: 7px; }
.demo-keys { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 4px; }
.k {
  position: relative; display: grid; place-items: center; height: 40px; border-radius: 5px;
  font: 700 17px/1 var(--f-type); padding-top: .12em;
  background: linear-gradient(180deg, var(--key-hi), var(--key-lo)); color: var(--ink);
  box-shadow: 0 2px 1.5px rgba(0, 0, 0, .55);
  transition: transform .08s, background-color .2s, box-shadow .12s;
}
.demo-strip .k { height: 36px; font-size: 14px; background: var(--press-3); color: var(--on-press); box-shadow: 0 1.5px 1px rgba(0, 0, 0, .6); }
.demo-strip .k.half { box-shadow: inset 0 0 0 1.5px var(--rani); }
.k .cap { position: absolute; bottom: 2px; font: 700 8.5px/1 var(--f-ui); color: #ffb3d1; }
.k.enter { background: var(--rani); color: var(--on-rani); font: 700 14px var(--f-ui); }
.k.press { transform: translateY(2px) scale(.96); box-shadow: 0 0 0 3px var(--rani); }
.k[data-state="correct"] { background: var(--correct); color: var(--on-correct); }
.k[data-state="present"] { background: var(--present); color: var(--on-present); }
.k[data-state="absent"] { background: var(--press-3); color: #a09789; }

.steps { list-style: none; counter-reset: st; margin: 0 0 22px; padding: 0; display: grid; gap: 6px; }
.steps li {
  counter-increment: st;
  display: grid; grid-template-columns: 36px 1fr; column-gap: 14px;
  padding: 14px 16px; border-radius: 10px;
  color: var(--on-press-2);
  transition: background-color .3s, color .3s;
}
.steps li::before {
  content: counter(st); grid-row: span 2;
  width: 32px; height: 32px; display: grid; place-items: center;
  border: 1.5px solid #57514a; border-radius: 50%; font-weight: 700; font-size: 15px;
  transition: border-color .3s, background-color .3s, color .3s;
}
.steps b { color: var(--on-press); font-size: 18px; line-height: 1.35; }
.steps span { font-size: 15.5px; line-height: 1.5; }
.steps li.on { background: var(--press); color: #d8d0c3; }
.steps li.on::before { border-color: var(--rani); background: var(--rani); color: var(--on-rani); }
.steps li.done::before { border-color: var(--correct); color: #7fd3a6; }
.demo-ctl { display: flex; flex-wrap: wrap; gap: 10px; }

.legend { max-width: 1040px; margin: clamp(40px, 6vw, 72px) auto 0; padding: 0 4px; }
.legend h3 { margin: 0 0 14px; font-size: 20px; text-align: center; }
.legend ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px 24px; }
.legend li { display: flex; align-items: center; gap: 14px; padding: 12px; background: var(--paper); color: var(--ink); border-radius: 3px; }
.legend li b { display: block; font-size: 16px; }
.legend li span span { font-size: 14.5px; color: var(--ink-2); }

/* features: a printed index on paper */
.index {
  list-style: none; margin: 0 auto; padding: clamp(10px, 2vw, 18px) clamp(18px, 4vw, 48px);
  max-width: 1040px;
  background: var(--paper); color: var(--ink); border-radius: 3px;
  display: grid; grid-template-columns: 1fr 1fr; column-gap: clamp(24px, 4vw, 56px);
  box-shadow: 0 30px 60px -36px rgba(0, 0, 0, .9);
  position: relative;
}
.index::before { content: ""; position: absolute; inset: 7px; border: 1px solid var(--rule); pointer-events: none; }
.index li { display: grid; grid-template-columns: 148px 1fr; gap: 18px; align-items: start; padding: 22px 0; border-bottom: 1px solid var(--rule); }
.index li:nth-last-child(-n+2) { border-bottom: 0; }
.index h3 { margin: 2px 0 4px; font-size: 20px; line-height: 1.3; }
.index p { margin: 0; color: #4d473f; font-size: 16px; }
.ix-art { display: flex; flex-wrap: wrap; gap: 5px; }
.ix-art .t.mini { --s: 40px; font-size: 15px; }
.kx { display: inline-grid; place-items: center; width: 30px; height: 34px; border-radius: 5px; background: var(--press-3); color: var(--on-press); font: 700 15px/1 var(--f-type); padding-top: .12em; }
@media (max-width: 760px) {
  .index { grid-template-columns: 1fr; }
  .index li { grid-template-columns: 1fr; gap: 10px; }
  .index li:nth-last-child(2) { border-bottom: 1px solid var(--rule); }
}

/* faq */
.faq { padding: clamp(56px, 8vw, 110px) clamp(16px, 4vw, 48px); }
.qa { max-width: 820px; margin: 0 auto; border-top: 1px solid #34302b; }
.qa details { border-bottom: 1px solid #34302b; }
.qa summary {
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  padding: 18px 4px; cursor: pointer; list-style: none;
  font-weight: 700; font-size: 18px; color: var(--on-press);
}
.qa summary::-webkit-details-marker { display: none; }
.qa summary::after { content: "+"; flex: none; font: 400 26px/1 var(--f-ui); color: var(--rani); transition: transform .2s var(--ease-out); }
.qa details[open] summary::after { transform: rotate(45deg); }
.qa summary:hover { color: #fff; }
.qa p { margin: 0 4px 20px; color: #cfc6b8; max-width: 62ch; }

.band { text-align: center; padding: clamp(56px, 8vw, 96px) 16px; background: var(--paper); color: var(--ink); }
.band h2 { margin: 0 0 22px; font-family: var(--f-mast); font-weight: 400; font-size: clamp(30px, 4.4vw, 52px); line-height: 1.15; }

.foot { padding: 32px clamp(16px, 4vw, 48px) calc(32px + env(safe-area-inset-bottom)); text-align: center; color: var(--on-press-2); font-size: 15px; }
.foot p { margin: 0 0 6px; }
.foot .small { font-size: 13.5px; }
.foot a { color: var(--on-press); text-underline-offset: 3px; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0s !important; transition-duration: .01ms !important; }
}

/* announcement from the admin console */
.announce { position: relative; z-index: 25; display: flex; align-items: center; gap: 10px; padding: 8px 10px 8px 16px; background: var(--rani); color: var(--on-rani); font-weight: 700; font-size: 15px; }
.announce[hidden] { display: none; }
.announce a, .announce span { flex: 1; color: inherit; text-align: center; }
.announce button { flex: none; width: 36px; height: 36px; border: 0; border-radius: 6px; background: rgba(0, 0, 0, .18); color: inherit; font-size: 20px; cursor: pointer; }

/* ---------- dictionary ---------- */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.dict { max-width: 860px; margin: 0 auto; padding: 0 clamp(14px, 4vw, 32px) 64px; }
.dict-hero { padding: clamp(32px, 6vw, 64px) 0 8px; }
.dict-hero h1 { margin: 0 0 8px; font-family: var(--f-mast); font-weight: 400; font-size: clamp(40px, 6vw, 68px); line-height: 1.1; }
.dict-search { display: flex; gap: 10px; margin-top: 18px; }
.dict-search input { flex: 1; min-width: 0; min-height: 56px; padding: 10px 16px; border: 1.5px solid #57514a; border-radius: 10px; background: var(--press-2); color: var(--on-press); font: 20px var(--f-ui); }
.dict-search input::placeholder { color: #8f877a; }
.dict-search input:focus-visible { border-color: var(--rani); outline: none; box-shadow: 0 0 0 3px rgba(214, 36, 111, .35); }
.dict-status { min-height: 26px; margin: 12px 2px 0; color: var(--on-press-2); font-size: 15px; }
.results { list-style: none; margin: 8px 0 0; padding: 0; border-top: 1px solid #34302b; }
.results a { display: grid; grid-template-columns: minmax(120px, auto) minmax(0, 1fr) auto; grid-template-areas: "w r d" "w g d"; column-gap: 16px; padding: 12px 6px; border-bottom: 1px solid #34302b; text-decoration: none; transition: background-color .15s; }
.results a:hover { background: var(--press-2); }
.results b { grid-area: w; font: 700 24px/1.3 var(--f-type); padding-top: .1em; }
.rr { grid-area: r; color: var(--on-press-2); font-size: 14px; }
.rg { grid-area: g; color: #d8d0c3; overflow-wrap: anywhere; }
.results .dot { grid-area: d; align-self: center; width: 10px; height: 10px; border-radius: 50%; background: #3fa877; }
.entry { margin-top: 18px; padding: clamp(18px, 4vw, 36px); background: var(--paper); color: var(--ink); border-radius: 4px; position: relative; }
.entry::before { content: ""; position: absolute; inset: 7px; border: 1px solid var(--rule); pointer-events: none; }
.entry-head { position: relative; padding-bottom: 14px; border-bottom: 1px solid var(--rule); margin-bottom: 8px; }
.hw { margin: 0; font: 800 clamp(48px, 9vw, 80px)/1.15 var(--f-type); padding-top: .1em; }
.rom { margin: 2px 0 6px; font-size: 18px; color: var(--ink-2); }
.gloss { margin: 0; font-size: 20px; font-weight: 700; }
.gloss span { font-weight: 400; color: var(--ink-2); font-size: 15px; }
.tag { position: absolute; top: 0; right: 0; padding: 3px 10px; border-radius: 99px; background: var(--correct); color: var(--on-correct); font-size: 13px; font-weight: 700; }
.sense { position: relative; padding: 14px 0 6px; }
.sense h3 { margin: 0 0 8px; font-size: 14px; letter-spacing: .02em; color: var(--ink-2); font-weight: 700; }
.sense ol { margin: 0; padding-left: 22px; }
.sense li { margin: 0 0 10px; }
.gl { font-size: 17px; }
.ex { list-style: none; margin: 8px 0 0; padding: 0 0 0 12px; border-left: 2px solid var(--rani); display: grid; gap: 10px; }
.ex.big { padding-left: 14px; }
.ex li { display: grid; gap: 1px; margin: 0; }
.exh { font: 600 18px/1.5 var(--f-type); }
.ext { font-size: 14px; color: var(--ink-2); font-style: italic; }
.exe { font-size: 15.5px; color: #3b362f; }
.aks { display: flex; flex-wrap: wrap; gap: 10px; }
.ak { display: grid; justify-items: center; min-width: 64px; padding: 8px 10px; border: 1px solid var(--rule); border-radius: 6px; background: #fbf8f2; }
.ak b { font: 700 28px/1.2 var(--f-type); padding-top: .1em; }
.ak span { font: 600 14px var(--f-type); color: var(--ink-2); }
.ety { margin: 0; color: #4d473f; font-size: 15px; }
.entry-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; position: relative; }
.entry .btn.ghost { color: var(--ink); border-color: var(--ink); }
.entry .btn.ghost:hover { background: var(--paper-2); }
.link-back { position: relative; margin-bottom: 10px; padding: 6px 0; border: 0; background: none; color: var(--rani-ink); font: 700 15px var(--f-ui); cursor: pointer; }
.dict-home { display: grid; gap: 28px; margin-top: 18px; }
.dict-home h2 { margin: 0 0 12px; font-family: var(--f-mast); font-weight: 400; font-size: 30px; }
.wotd .entry-head { border: 0; }
#wotdBody { padding: 22px; background: var(--paper); color: var(--ink); border-radius: 4px; }
#wotdBody .btn.ghost { color: var(--ink); border-color: var(--ink); margin-top: 12px; }
.chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.chips a { display: inline-block; padding: 6px 14px; border-radius: 99px; background: var(--press-2); border: 1px solid #3a352f; text-decoration: none; font: 700 18px var(--f-type); }
.chips a:hover { border-color: var(--rani); }
.muted { color: var(--on-press-2); }
@media (max-width: 560px) { .results a { grid-template-columns: 1fr auto; grid-template-areas: "w d" "r d" "g d"; } }
.prose { padding-top: 40px; max-width: 720px; }
.prose h1 { font-family: var(--f-mast); font-weight: 400; font-size: 48px; margin: 0 0 12px; }
.prose h2 { font-size: 22px; margin: 28px 0 8px; }
.prose p, .prose li { color: #d8d0c3; }
.prose a { color: #ff7fb2; }
