/* Ryan Lagasse: shared styles. Quiet paper, one accent, patterns do the talking. */
:root {
  --paper: #f7f5ef;
  --paper-2: #fbfaf6;
  --ink: #1f1d1a;
  --sub: #6b665c;
  --dim: #9a9488;
  --rule: #e4e0d5;
  --accent: #c15f3c;
  --accent-soft: rgba(193, 95, 60, 0.12);
  --cell: 31, 29, 26;
  --trail: 193, 95, 60;
  --serif: "Newsreader", "Iowan Old Style", Georgia, serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #15140f; --paper-2: #1b1a15; --ink: #ebe7dc; --sub: #a39d90; --dim: #6f6a60;
    --rule: #2c2a23; --accent: #e08a62; --accent-soft: rgba(224, 138, 98, 0.14);
    --cell: 235, 231, 220; --trail: 224, 138, 98; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #15140f; --paper-2: #1b1a15; --ink: #ebe7dc; --sub: #a39d90; --dim: #6f6a60;
  --rule: #2c2a23; --accent: #e08a62; --accent-soft: rgba(224, 138, 98, 0.14);
  --cell: 235, 231, 220; --trail: 224, 138, 98; color-scheme: dark;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 19px;
  line-height: 1.6;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: underline; text-decoration-color: var(--rule); text-decoration-thickness: 1px; text-underline-offset: 3px; transition: color .15s, text-decoration-color .15s; }
a:hover { color: var(--accent); text-decoration-color: var(--accent); }
::selection { background: var(--accent-soft); }

.wrap { max-width: 640px; margin: 0 auto; padding: 0 20px; }

.label {
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--dim);
}

/* top bar: a mark and a theme toggle, nothing else */
.bar { display: flex; align-items: center; justify-content: space-between; padding: 28px 0 0; }
.mark { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-size: 16px; }
.mark canvas { width: 18px; height: 18px; }
.theme {
  background: none; border: 1px solid var(--rule); color: var(--sub); border-radius: 999px;
  width: 30px; height: 30px; cursor: pointer; display: grid; place-items: center;
}
.theme:hover { color: var(--accent); border-color: var(--accent); }
.theme svg { width: 14px; height: 14px; fill: currentColor; }

footer.foot { margin: 88px 0 48px; padding-top: 22px; border-top: 1px solid var(--rule); display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
footer.foot .label a { text-decoration: none; }
footer.foot .label a:hover { color: var(--accent); }

@media (max-width: 520px) { body { font-size: 18px; } }

/* ---- crabs ---- */
.bar-r { display: inline-flex; align-items: center; gap: 8px; }
.crab-btn {
  background: none; border: 1px solid var(--rule); border-radius: 999px; width: 30px; height: 30px;
  padding: 0; cursor: pointer; display: grid; place-items: center; overflow: hidden; transition: border-color .15s, transform .15s;
}
.crab-btn:hover { border-color: var(--accent); transform: translateY(-1px); }
.crab-btn:active { transform: scale(0.92); }
.crab-btn img { width: 30px; height: 30px; image-rendering: pixelated; margin-top: -8px; }
.crab-layer { position: fixed; inset: 0; pointer-events: none; z-index: 50; overflow: hidden; }
.crab-layer img {
  position: absolute; left: 0; top: 0; image-rendering: pixelated; pointer-events: auto; cursor: grab;
  user-select: none; -webkit-user-drag: none; touch-action: none; will-change: transform;
}
.crab-layer img.held { cursor: grabbing; }
.crab-fx { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.crab-tools {
  position: fixed; right: 16px; bottom: 14px; z-index: 51;
  display: flex; flex-direction: column; align-items: flex-end; gap: 6px;
}
.crab-tools[hidden] { display: none; }
.crab-tool {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--sub); background: var(--paper-2); border: 1px solid var(--rule); border-radius: 999px;
  padding: 6px 12px; cursor: pointer; transition: color .15s, border-color .15s, transform .12s;
}
.crab-tool:hover { color: var(--accent); border-color: var(--accent); }
.crab-tool:active { transform: scale(0.94); }
.crab-bubble {
  position: absolute; left: 0; top: 0; pointer-events: none; white-space: nowrap;
  font-family: var(--mono); font-size: 12px; font-weight: 500; letter-spacing: 0.02em; color: var(--ink);
  background: var(--paper-2); border: 1.5px solid var(--ink); border-radius: 10px; padding: 3px 9px;
  opacity: 0; scale: 0.6; transform-origin: 25% 100%; transition: opacity .18s, scale .22s cubic-bezier(.3,1.6,.5,1);
}
.crab-bubble.on { opacity: 1; scale: 1; }
.crab-bubble::after {
  content: ""; position: absolute; left: 18%; bottom: -6px; width: 9px; height: 9px;
  background: var(--paper-2); border-right: 1.5px solid var(--ink); border-bottom: 1.5px solid var(--ink);
  transform: rotate(45deg);
}
