:root {
  color-scheme: dark;
  --ink: #0a0a0a;
  --paper: #fdfdfd;
  --wow-gold: #ffd100;
  --runedex: #d9a441;
}

::selection {
  background: rgba(181, 154, 99, 0.45);
  color: #fff;
}

body {
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  background-color: var(--ink);
  color: var(--paper);
  font-family: 'Clash Grotesk', sans-serif;
}

:focus-visible {
  outline: 2px solid #3de8ff;
  outline-offset: 2px;
}

.font-serif-italic {
  font-family: 'Sentient', serif;
  font-style: italic;
}

.font-mono {
  font-family: 'JetBrains Mono', monospace;
}

#canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  background: #000;
}

.content-layer {
  position: relative;
  z-index: 10;
  pointer-events: none;
}

.on-fluid {
  text-shadow: 0 0 10px rgba(0, 0, 0, 0.85), 0 0 3px rgba(0, 0, 0, 0.9);
}

.title-halo {
  text-shadow: 0 0 16px rgba(0, 0, 0, 0.95), 0 0 5px rgba(0, 0, 0, 0.95), 0 0 2px rgba(0, 0, 0, 1);
}

.interactive,
.tappable {
  pointer-events: auto;
}

.tappable {
  cursor: pointer;
}

.title-dim { color: #8d8d92; }
.title-slate { color: #7f9bb5; }
.title-sand { color: #b59a63; }

.tap-area {
  position: relative;
}

.tap-area::after {
  content: '';
  position: absolute;
  inset: -14px -5px;
}

.tap-area-round::after {
  inset: -8px;
  border-radius: 50%;
}

.page-dot {
  display: inline-block;
  pointer-events: auto;
  cursor: pointer;
}

.portrait {
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: var(--ink);
}

.tag-chip {
  font-size: 0.65rem;
  padding: 2px 6px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.shelf-item {
  background: var(--ink);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

a.shelf-item:hover {
  border-color: rgba(255, 255, 255, 0.5);
  transform: translateY(-4px);
}

a.wayfinder:hover {
  border-color: var(--wow-gold);
}

.wayfinder-title,
.wayfinder-icon { color: var(--wow-gold); }
.wayfinder-chip {
  color: var(--wow-gold);
  border-color: rgba(255, 209, 0, 0.45);
}

.contact-link {
  color: var(--accent);
  background: #0e0e0e;
  border: 1px solid var(--border);
}

.contact-link:hover {
  background: var(--hover-bg);
  border-color: var(--accent);
}

.contact-discord {
  --accent: #7289da;
  --border: rgba(114, 137, 218, 0.45);
  --hover-bg: #14162e;
}

.contact-github {
  --accent: #ffffff;
  --border: rgba(255, 255, 255, 0.3);
  --hover-bg: #1c1c1c;
}

.contact-email {
  --accent: #ea4335;
  --hover-bg: #1f1210;
  border: 1px solid transparent;
  border-image: linear-gradient(90deg, #ea4335, #fbbc04, #34a853, #4285f4) 1;
}

.contact-email:hover {
  border-color: transparent;
}

.bubble {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 14px);
  z-index: 30;
  width: max-content;
  max-width: min(280px, 78vw);
  padding: 0.7rem 1rem;
  border-radius: 1.1rem;
  background: #fff;
  color: #000;
  font-family: 'Sentient', serif;
  font-style: italic;
  font-size: 1.125rem;
  line-height: 1.2;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%) scale(0.9);
  transform-origin: 50% 100%;
  transition: opacity 0.18s, transform 0.18s;
  filter: drop-shadow(0 0 1px #000) drop-shadow(0 0 1px #000);
}

.bubble::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 100%;
  margin-left: -9px;
  border: 9px solid transparent;
  border-top-color: #fff;
  border-bottom: 0;
}

.bubble.visible {
  opacity: 1;
  transform: translateX(-50%) scale(1);
}

.bubble.on-card {
  bottom: calc(100% + 12px);
}

.bubble.on-card.inside {
  bottom: auto;
  top: 14px;
}

.bubble.on-card.inside::after {
  display: none;
}

.halo {
  position: fixed;
  z-index: 5;
  display: none;
  width: 100px;
  height: 100px;
  margin: -50px 0 0 -50px;
  border-radius: 50%;
  background: #fff;
  transform: scale(0);
  pointer-events: none;
}

a.devlog-card:hover {
  border-color: #3de8ff;
}

.devlog-title {
  color: #3de8ff;
}

.home-link {
  --accent: #7f9bb5;
  --border: rgba(127, 155, 181, 0.45);
  --hover-bg: #12171c;
}

.entry {
  padding: 2rem;
  background: var(--ink);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

@media (prefers-reduced-motion: reduce) {
  .bubble {
    transition: none;
  }
}

@media (min-width: 768px) and (max-width: 1023px) {
  .portrait .bubble {
    max-width: 220px;
  }
}

.entry a {
  color: #b59a63;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.entry a:hover {
  color: var(--wow-gold);
}

a.collab:hover {
  border-color: var(--runedex);
}

.collab-title {
  color: var(--runedex);
}

.collab-chip {
  color: var(--runedex);
  border-color: rgba(217, 164, 65, 0.45);
}

.runedex-mark {
  display: flex;
  gap: 0.2em;
  font-family: 'RuneScape UF', sans-serif;
  font-size: clamp(2.25rem, 7vw, 3.5rem);
  font-weight: 900;
  font-style: italic;
  letter-spacing: -0.05em;
  line-height: 1;
  color: var(--runedex);
  text-shadow: 0 0 20px rgba(0, 0, 0, 0.55), 0 0 40px #000;
  user-select: none;
}

.runedex-mark span {
  display: inline-block;
}

.runedex-mark.reveal-ready span {
  opacity: 0;
  transform: translateY(0.35em) scale(0.9);
  filter: blur(6px);
}

.runedex-mark.revealed span {
  opacity: 1;
  transform: none;
  filter: none;
  transition: opacity 0.5s ease, transform 0.5s ease, filter 0.5s ease;
}

.runedex-mark.revealed span:nth-child(2) {
  transition-delay: 90ms;
}

.runedex-mark.revealed span:nth-child(3) {
  transition-delay: 180ms;
}

.runedex-mark.revealed span:nth-child(4) {
  transition-delay: 270ms;
}

.runedex-mark.revealed span:nth-child(5) {
  transition-delay: 360ms;
}

.runedex-mark.revealed span:nth-child(6) {
  transition-delay: 450ms;
}

.runedex-mark.revealed span:nth-child(7) {
  transition-delay: 540ms;
}

.credit-link {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.credit-link:hover {
  color: var(--runedex);
}
