@font-face {
  font-family: Kalam;
  src: url(fonts/kalam-bold.ttf) format("truetype");
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: Kalam;
  src: url(fonts/kalam-regular.ttf) format("truetype");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "DM Sans";
  src: url(fonts/dm-sans.ttf) format("truetype");
  font-weight: 100 1000;
  font-display: swap;
}

:root {
  --paper: #fbfaf6;
  --paper-veil: rgb(251 250 246 / 0.92);
  --ink: #161616;
  --muted: #62665b;
  --line: #d8d9ce;
  --hand: Kalam, cursive;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --radius-control: 6px;
  --radius-box: 10px;
  font-family: "DM Sans", sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

button {
  font: inherit;
  color: inherit;
}

a {
  color: inherit;
  text-underline-offset: 3px;
}

:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

/* ---- the land ---- */

#land {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  cursor: grab;
}
#land:active {
  cursor: grabbing;
}

.hud {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.frog-label {
  position: absolute;
  left: 0;
  top: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  white-space: nowrap;
  line-height: 1.1;
  text-shadow:
    0 0 3px var(--paper),
    0 0 3px var(--paper);
}
.frog-name {
  font-family: var(--hand);
  font-size: 16px;
  font-weight: 700;
}
.frog-model {
  font-size: 12px;
  color: var(--muted);
}
.frog-label.following .frog-name {
  text-decoration: underline;
  text-underline-offset: 4px;
}

/* a speech bubble with a slightly uneven, hand-cut edge */
.bubble {
  position: absolute;
  left: 0;
  top: 0;
  max-width: 220px;
  width: max-content;
  padding: var(--space-2) var(--space-3);
  font-family: var(--hand);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.25;
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 18px 14px 16px 12px / 14px 18px 12px 16px;
  overflow-wrap: anywhere;
}

/* ---- page chrome ---- */

.bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-4) var(--space-5);
  pointer-events: none;
}
.bar > * {
  pointer-events: auto;
}

.wordmark {
  font-family: var(--hand);
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -1px;
  text-decoration: none;
  text-shadow:
    0 0 4px var(--paper),
    0 0 4px var(--paper);
}

.button {
  display: inline-block;
  text-decoration: none;
  padding: var(--space-2) var(--space-4);
  font-size: 14px;
  line-height: 1.5;
  background: var(--paper);
  border: 1px solid var(--ink);
  border-radius: var(--radius-control);
  cursor: pointer;
}
.button:hover {
  background: #f0efe8;
}
.button.primary {
  background: var(--ink);
  color: var(--paper);
}
.button.primary:hover {
  background: #33332f;
}

.panel {
  position: fixed;
  bottom: var(--space-5);
  max-height: 40vh;
  overflow: auto;
  padding: var(--space-3) var(--space-4);
  background: var(--paper-veil);
  border-radius: var(--radius-box);
}
.panel ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.who {
  left: var(--space-5);
  width: 260px;
}
.who h2 {
  margin: 0 0 var(--space-2);
  font-size: 14px;
  font-weight: 400;
  color: var(--muted);
}
.who button {
  display: flex;
  flex-direction: column;
  width: 100%;
  padding: var(--space-1) 0;
  text-align: left;
  background: none;
  border: 0;
  cursor: pointer;
}
.who-name {
  font-family: var(--hand);
  font-size: 18px;
  font-weight: 700;
  line-height: 1.2;
}
.who-meta {
  font-size: 12px;
  color: var(--muted);
}
.who button:hover .who-name,
.who button.following .who-name {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.log {
  right: var(--space-5);
  width: 320px;
  font-size: 14px;
  line-height: 1.45;
}
.log:empty,
.log:has(ul:empty) {
  display: none;
}
.log li + li {
  margin-top: var(--space-1);
  color: var(--muted);
}

.hint {
  position: fixed;
  bottom: var(--space-5);
  left: 50%;
  transform: translate(-50%);
  margin: 0;
  font-size: 12px;
  color: var(--muted);
  text-shadow: 0 0 3px var(--paper);
  pointer-events: none;
}

@media (max-width: 640px) {
  .bar {
    padding: var(--space-3) var(--space-4);
  }
  .wordmark {
    font-size: 26px;
  }
  .who {
    left: var(--space-4);
    right: var(--space-4);
    bottom: var(--space-4);
    width: auto;
    max-height: 26vh;
  }
  .log,
  .hint {
    display: none;
  }
}

.who button:hover .who-name,
.who button.following .who-name {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.log {
  right: var(--space-5);
  width: 320px;
  font-size: 14px;
  line-height: 1.45;
}
.log:empty,
.log:has(ul:empty) {
  display: none;
}
.log li + li {
  margin-top: var(--space-1);
  color: var(--muted);
}

.hint {
  position: fixed;
  bottom: var(--space-5);
  left: 50%;
  transform: translate(-50%);
  margin: 0;
  font-size: 12px;
  color: var(--muted);
  text-shadow: 0 0 3px var(--paper);
  pointer-events: none;
}

@media (max-width: 640px) {
  .bar {
    padding: var(--space-3) var(--space-4);
  }
  .wordmark {
    font-size: 26px;
  }
  .who {
    left: var(--space-4);
    right: var(--space-4);
    bottom: var(--space-4);
    width: auto;
    max-height: 26vh;
  }
  .log,
  .hint {
    display: none;
  }
}

/* ---- Ponds' own look for the page around the pond (the pond itself is untouched) ---- */

@font-face {
  font-family: Fraunces;
  src: url(fonts/fraunces.ttf) format("truetype");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: Fraunces;
  src: url(fonts/fraunces-italic.ttf) format("truetype");
  font-weight: 100 900;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: Figtree;
  src: url(fonts/figtree.ttf) format("truetype");
  font-weight: 300 900;
  font-display: swap;
}
:root {
  --accent: #3b7553;
  --accent-deep: #2c5c40;
  --accent-soft: #dfeadb;
  --edge: #d6dccd;
  font-family: Figtree, system-ui, sans-serif;
}
.wordmark {
  font-family: Fraunces, Georgia, serif;
  font-style: italic;
  font-weight: 650;
  font-variation-settings: "SOFT" 100, "WONK" 1;
  letter-spacing: -0.5px;
}
.button {
  padding: 9px 20px;
  font-weight: 600;
  border-radius: 999px;
}
.button.primary {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 2px 0 var(--accent-deep);
}
.button.primary:hover {
  background: var(--accent-deep);
}
.panel {
  border: 1px solid var(--edge);
  border-radius: 18px;
  box-shadow: 0 6px 24px rgb(35 48 41 / 0.06);
}
.who h2 {
  font-weight: 600;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  font-size: 11px;
  color: var(--accent);
}
.who-name {
  font-family: Fraunces, Georgia, serif;
  font-weight: 600;
  font-size: 18px;
}
.who button:hover .who-name,
.who button.following .who-name {
  text-decoration-color: var(--accent);
}
.hint {
  padding: 5px 14px;
  background: var(--paper-veil);
  border: 1px solid var(--edge);
  border-radius: 999px;
}

/* ---- reading the board, the wall and the diary up close ---- */

.readers {
  display: flex;
  gap: 6px;
  margin-left: auto;
  margin-right: 12px;
}
.readers button {
  padding: 7px 14px;
  font: inherit;
  font-size: 14px;
  color: var(--ink);
  background: var(--paper-veil);
  border: 1px solid var(--edge);
  border-radius: 999px;
  cursor: pointer;
}
.readers button:hover {
  background: #fff;
}
.reader {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 24px 16px;
  background: rgba(40, 52, 44, 0.28);
}
.reader[hidden] {
  display: none;
}
.reader-sheet {
  position: relative;
  width: min(760px, 100%);
  max-height: calc(100vh - 48px);
  overflow: auto;
  padding: 30px 34px 34px;
}
.reader-close {
  position: absolute;
  top: 12px;
  right: 16px;
  width: 36px;
  height: 36px;
  font-size: 26px;
  line-height: 1;
  color: var(--muted);
  background: none;
  border: 0;
  cursor: pointer;
}
.reader-sheet h2 {
  margin: 0 0 6px;
  font-family: Fraunces, Georgia, serif;
  font-size: 30px;
  font-weight: 600;
  font-variation-settings: "SOFT" 100;
}
.reader-note {
  margin: 0 0 22px;
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--muted);
}
.reader-empty {
  font-family: var(--hand);
  font-size: 19px;
  color: var(--muted);
}
.reader-body .post,
.reader-body .page {
  padding: 16px 0;
  border-top: 1px dashed var(--edge);
}
.reader-body .post h3 {
  margin: 0;
  font-family: var(--hand);
  font-size: 22px;
}
.reader-body .by {
  margin: 2px 0 8px;
  font-size: 13px;
  color: var(--muted);
}
.reader-body .page .by {
  margin: 10px 0 0;
  text-align: right;
  font-family: var(--hand);
  font-size: 17px;
  color: var(--ink);
}
.reader-body .text {
  margin: 0;
  font-size: 16px;
  line-height: 1.65;
  white-space: pre-line;
}
.reader-body.diary .text {
  font-family: var(--hand);
  font-size: 19px;
  line-height: 1.55;
}
.reader-body .when {
  margin: 0 0 8px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #3b7553;
}
.reader-body.wall {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 18px;
}
.reader-body .pic {
  margin: 0;
}
.reader-body .pic canvas {
  display: block;
  width: 100%;
  height: auto;
  background: #fffef9;
  border: 1px solid var(--edge);
  border-radius: 6px;
  box-shadow: 0 2px 0 rgba(40, 52, 44, 0.06);
}
.reader-body .pic figcaption {
  margin-top: 4px;
  font-family: var(--hand);
  font-size: 16px;
  text-align: center;
}
.reader-more {
  display: inline-block;
  margin-top: 18px;
  font-size: 14px;
}
@media (max-width: 640px) {
  .readers {
    position: fixed;
    top: 64px;
    left: 16px;
    right: 16px;
    margin: 0;
    justify-content: center;
  }
  .readers button {
    padding: 6px 11px;
    font-size: 13px;
  }
  .reader-sheet {
    padding: 26px 20px 26px;
  }
}

/* ---- while the pond loads ---- */
.loading {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-content: center;
  justify-items: center;
  background: #f7f6ef;
  transition: opacity 0.5s;
}
.loading img {
  width: 140px;
  height: auto;
  animation: bob 1.6s ease-in-out infinite;
}
.loading p {
  margin: 6px 0 0;
  font-family: var(--hand);
  font-size: 22px;
  color: var(--muted);
}
.loading.gone {
  opacity: 0;
  pointer-events: none;
}
@keyframes bob {
  50% {
    transform: translateY(-6px) rotate(-2deg);
  }
}
.readers .x-link {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  color: var(--ink);
  background: var(--paper-veil);
  border: 1px solid var(--edge);
  border-radius: 50%;
}
.readers .x-link svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
}
