/* currents.to — the page is a painting; the chrome is its margin.
   Ink on unbleached washi; colour belongs to the water, the blossom,
   and the seal (drawn on canvas, not here). */

:root {
  --washi: #e9e5da;
  --ink: #211e19;
  --ink-faint: rgba(33, 30, 25, 0.55);
  --ink-whisper: rgba(33, 30, 25, 0.34);
  --seal: #b03a2e;
  --display: "Iowan Old Style", "Palatino Linotype", "Hiragino Mincho ProN", "Yu Mincho", serif;
  --utility: "Avenir Next", "Hiragino Sans", system-ui, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --washi: #171511;
    --ink: #d8d2c4;
    --ink-faint: rgba(216, 210, 196, 0.6);
    --ink-whisper: rgba(216, 210, 196, 0.34);
    --seal: #a83a2e;
  }
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  display: flex;
  flex-direction: column;
  background: var(--washi);
  color: var(--ink);
  font-family: var(--display);
  overflow: hidden;
  -webkit-user-select: none;
  user-select: none;
}

.chrome {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  padding: 0.9rem 1.2rem;
}

header.chrome {
  justify-content: space-between;
}

.mark {
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: 0.24em;
  text-transform: lowercase;
}

.day {
  font-size: 0.85rem;
  color: var(--ink-faint);
  letter-spacing: 0.08em;
  font-variant-numeric: oldstyle-nums;
}

button {
  font-family: var(--utility);
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: lowercase;
  background: none;
  border: 1px solid var(--ink-whisper);
  color: var(--ink);
  padding: 0.5rem 1rem;
  border-radius: 2px;
  cursor: pointer;
  transition: border-color 160ms ease, background-color 160ms ease;
}

button:hover {
  border-color: var(--ink-faint);
}

button:focus-visible {
  outline: 2px solid var(--seal);
  outline-offset: 2px;
}

button.quiet {
  border-color: transparent;
  color: var(--ink-faint);
}

button.quiet:hover {
  border-color: var(--ink-whisper);
}

main {
  position: relative;
  flex: 1;
  min-height: 0;
}

#board {
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  cursor: crosshair;
}

/* The scroll signature: the work's title, hung vertically like a scroll
   inscription along the right margin. */
.scroll-signature {
  position: absolute;
  top: 50%;
  right: 0.6rem;
  transform: translateY(-50%);
  writing-mode: vertical-rl;
  font-size: 0.72rem;
  letter-spacing: 0.9em;
  color: var(--ink-whisper);
  pointer-events: none;
}

footer.chrome {
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  min-height: 4.2rem;
  justify-content: flex-start;
  text-align: center;
}

.hint {
  font-size: 0.95rem;
  font-style: italic;
  color: var(--ink-faint);
}

.stats {
  font-family: var(--utility);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  color: var(--ink-whisper);
}

/* The share panel: a slip of paper laid over the painting's lower edge. */
.share {
  position: fixed;
  left: 50%;
  bottom: 0.9rem;
  transform: translateX(-50%);
  background: var(--washi);
  border: 1px solid var(--ink-whisper);
  padding: 1.1rem 1.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  align-items: center;
  box-shadow: 0 2px 24px rgba(0, 0, 0, 0.09);
  animation: share-rise 480ms ease-out;
}

@keyframes share-rise {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .share {
    animation: none;
  }
}

.share[hidden] {
  display: none;
}

.share pre {
  font-family: var(--display);
  font-size: 1rem;
  line-height: 1.75;
  text-align: center;
  user-select: text;
  -webkit-user-select: text;
}

.breakdown {
  font-family: var(--utility);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  color: var(--ink-whisper);
}

.breakdown:empty {
  display: none;
}

.share-actions {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  justify-content: center;
}

@media (max-width: 480px) {
  .chrome {
    padding: 0.7rem 0.9rem;
  }
  .scroll-signature {
    display: none;
  }
  .share {
    width: calc(100% - 1.6rem);
    bottom: 0.8rem;
  }
}
