@font-face { font-family: Panchang; src: url(fonts/panchang-400.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: Satoshi; src: url(fonts/satoshi-400.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: Satoshi; src: url(fonts/satoshi-500.woff2) format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: Panchang; src: url(fonts/panchang-500.woff2) format("woff2"); font-weight: 500; font-display: swap; }

:root {
  color-scheme: light dark; /* we handle dark mode ourselves; stops browsers force-darkening the page */
  --bg: #fdfdfc;
  --ink: #111111;
  --muted: #6e6e6c;
  --faint: #cfcfcc;
  --key: #ffffff;
  --key-down: #ececea;
  --key-edge: #d6d6d3;
  --black-key: #111111;
  --black-down: #333333;
  --hint-line: #111111;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #111111; --ink: #ededec; --muted: #8e8e8b; --faint: #444442;
    --key: #ededec; --key-down: #cbcbc8; --key-edge: #a6a6a3; --black-key: #0a0a0a; --black-down: #2c2c2c; --hint-line: #111111;
  }
}
:root[data-theme="dark"] {
  --bg: #111111; --ink: #ededec; --muted: #8e8e8b; --faint: #444442;
  --key: #ededec; --key-down: #cbcbc8; --key-edge: #a6a6a3; --black-key: #0a0a0a; --black-down: #2c2c2c; --hint-line: #111111;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 1.0625rem/1.6 Satoshi, system-ui, sans-serif;
  font-feature-settings: "kern", "liga";
  -webkit-font-smoothing: antialiased;
}

.page {
  width: min(40rem, 100% - 32px);
  margin: 0 auto;
  padding: 16vh 0 12vh;
}

a {
  color: inherit;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: .2em;
  text-decoration-color: var(--faint);
  transition: text-decoration-color .2s ease;
}
a:hover { text-decoration-color: var(--ink); }
:focus-visible { outline: 1px solid var(--muted); outline-offset: 4px; border-radius: 2px; }

/* ---------- name + piano ---------- */
.head { margin-bottom: 3.2rem; }
h1 { margin: 0; font-size: 1em; }
.name {
  font: 500 2.1rem/1.1 Panchang, system-ui, sans-serif;
  color: var(--ink);
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  letter-spacing: -0.01em;
}
.name:hover .hint .w { fill: var(--key-down); }

.hint { width: .8em; height: .51em; margin-left: .32em; vertical-align: .02em; overflow: visible; }
.hint .w { fill: var(--key); stroke: var(--hint-line); stroke-width: 1; transition: fill .2s ease; }
.hint .b { fill: var(--black-key); }
/* The hint: every few seconds the little keyboard plays a quick run. */
.hint rect { transform-box: fill-box; transform-origin: 50% 0; animation: tap 5s ease-in-out infinite; }
.hint .w { animation-name: tap-white; }
.hint rect:nth-of-type(2) { animation-delay: .16s; }
.hint rect:nth-of-type(3) { animation-delay: .32s; }
.hint rect:nth-of-type(4) { animation-delay: .48s; }
.hint rect:nth-of-type(5) { animation-delay: .08s; }
.hint rect:nth-of-type(6) { animation-delay: .24s; }
@keyframes tap { 0%, 100% { transform: none; } 2% { transform: scaleY(.86); } 5% { transform: none; } }
@keyframes tap-white { 0%, 100% { transform: none; fill: var(--key); } 2% { transform: translateY(1.5px); fill: var(--key-down); } 5% { transform: none; fill: var(--key); } }
.name[aria-expanded="true"] .hint rect { animation: none; }
.name[aria-expanded="true"] .hint { opacity: .35; }
@media (prefers-reduced-motion: reduce) { .hint rect { animation: none; } }
.name[aria-expanded="true"]:focus-visible { outline: none; }

.piano {
  --w: 26px;
  position: relative;
  display: flex;
  width: max-content;
  max-width: 100%;
  margin-top: 1.3rem;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}
.piano[hidden] { display: none; }
.key {
  position: relative;
  flex: 0 0 var(--w);
  height: 104px;
  margin-right: 2px;
  background: var(--key);
  border-radius: 0 0 4px 4px;
  box-shadow: inset 0 0 0 1px var(--key-edge), inset 0 -5px 0 var(--key-down);
  transform-origin: 50% 0;
  animation: pop .32s cubic-bezier(.2, 1.5, .4, 1) both;
  animation-delay: calc(var(--i) * 22ms);
}
.key.black {
  position: absolute;
  top: 0;
  z-index: 1;
  width: calc(var(--w) * .62);
  height: 64px;
  margin: 0;
  background: var(--black-key);
  box-shadow: inset 0 -4px 0 var(--black-down);
  border-radius: 0 0 3px 3px;
}
.key.down { background: var(--key-down); box-shadow: inset 0 0 0 1px var(--key-edge), inset 0 -2px 0 var(--key-edge); }
.key.black.down { background: var(--black-down); box-shadow: inset 0 -1px 0 var(--black-down); }
.key b {
  position: absolute;
  left: 0; right: 0; bottom: 9px;
  text-align: center;
  font: 400 10px/1 ui-monospace, "SF Mono", Menlo, monospace;
  color: var(--faint);
}
.key.black b { display: none; }
@media (hover: none) { .key b { display: none; } }
@keyframes pop { from { transform: scaleY(.15); } to { transform: scaleY(1); } }
@media (prefers-reduced-motion: reduce) { .key { animation: none; } }

/* ---------- rows ---------- */
.row { margin-bottom: 2.4rem; }
h2 {
  margin: 0;
  margin-bottom: .55rem;
  font: 500 .875rem/1.5 Satoshi, system-ui, sans-serif;
  color: var(--muted);
}
.row p { margin: 0; }
ul { list-style: none; margin: 0; padding: 0; }
li { position: relative; margin: 0 0 .9rem; padding-left: 1.1rem; }
li:last-child { margin-bottom: 0; }
li::before {
  content: "";
  position: absolute;
  left: .1rem;
  top: .72em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--muted);
}


.soon { color: var(--muted); }
.foot { margin-top: 4.5rem; color: var(--muted); font-size: .875rem; }

@media (max-width: 560px) {
  .name { font-size: 1.45rem; }
}


/* ---------- book suggestions ---------- */
.suggest { display: block; margin-top: .55rem; }
.suggest-field {
  display: flex;
  align-items: baseline;
  gap: .9rem;
  max-width: 26rem;
  border-bottom: 1px solid var(--faint);
  transition: border-color .2s ease;
}
.suggest-field:focus-within { border-bottom-color: var(--ink); }
.suggest input {
  flex: 1;
  min-width: 0;
  padding: .3rem 0 .35rem;
  border: 0;
  background: none;
  font: inherit;
  color: var(--ink);
  outline: none;
}
.suggest input::placeholder { color: var(--muted); opacity: .75; }
.suggest button {
  padding: .3rem 0;
  border: 0;
  background: none;
  font: 500 .875rem/1 Satoshi, system-ui, sans-serif;
  color: var(--muted);
  cursor: pointer;
  transition: color .2s ease;
}
.suggest button:hover, .suggest button:focus-visible { color: var(--ink); }
.suggest-done { display: block; margin-top: .4rem; font-size: .875rem; color: var(--muted); min-height: 1.3em; }
.suggest.sent .suggest-field { display: none; }
.suggest-done:empty { display: none; }
.suggest .trap { position: absolute; left: -10000px; width: 1px; height: 1px; opacity: 0; }
