:root {
  --ink: #f4efe8;
  --ink-soft: rgba(244, 239, 232, 0.66);
  --panel: rgba(17, 15, 20, 0.66);
  --line: rgba(255, 255, 255, 0.10);
  --accent: #f08a3c;
  --accent-ink: #1b0f05;
  --serif: 'Fraunces', 'Iowan Old Style', Georgia, serif;
  --sans: 'Inter', 'Segoe UI', system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; background: #07060b; color: var(--ink); overflow: hidden; }
body { font-family: var(--sans); -webkit-font-smoothing: antialiased; }
button { font: inherit; color: inherit; }

#gl { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }

/* a soft lens falloff over the picture */
#grade {
  position: fixed; inset: 0; pointer-events: none;
  background: radial-gradient(120% 95% at 52% 46%, transparent 55%, rgba(6, 4, 12, 0.42) 100%);
}

#veil {
  position: fixed; inset: 0; background: #07060b; display: grid; place-items: center;
  transition: opacity 1.1s ease; z-index: 50;
}
#veil.gone { opacity: 0; pointer-events: none; }
#veil-name { font-family: var(--serif); font-weight: 300; font-size: 22px; letter-spacing: 0.01em; color: var(--ink-soft); }

#ui { position: fixed; inset: 0; pointer-events: none; transition: opacity 0.45s ease; }
#ui.away { opacity: 0; }
#ui.away * { pointer-events: none !important; }

.top { position: absolute; left: 28px; top: 22px; right: 28px; }
#name { margin: 0; font-family: var(--serif); font-weight: 400; font-size: 30px; letter-spacing: -0.01em; line-height: 1.1; text-shadow: 0 1px 18px rgba(0, 0, 0, 0.55); }
#tagline { margin: 6px 0 14px; font-size: 13.5px; color: var(--ink-soft); text-shadow: 0 1px 12px rgba(0, 0, 0, 0.7); }

#pills { display: flex; flex-wrap: wrap; gap: 8px; pointer-events: auto; max-width: 720px; }
.pill {
  border: 1px solid var(--line); background: var(--panel); color: var(--ink);
  padding: 7px 13px; border-radius: 999px; font-size: 12.5px; font-weight: 500; cursor: pointer;
  backdrop-filter: blur(14px) saturate(1.3); -webkit-backdrop-filter: blur(14px) saturate(1.3);
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}
.pill:hover { border-color: rgba(255, 255, 255, 0.28); transform: translateY(-1px); }
.pill.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.pill:focus-visible, .enter:focus-visible, .marker:focus-visible, .card-link:focus-visible, .card-x:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* the small dots that float above things you can open */
.marker {
  position: absolute; left: 0; top: 0; width: 26px; height: 26px; margin: -13px 0 0 -13px; padding: 0;
  border: 0; background: none; cursor: pointer; pointer-events: auto; will-change: transform;
}
.marker::before {
  content: ''; position: absolute; inset: 9px; border-radius: 50%; background: #fff;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.25), 0 0 14px rgba(255, 220, 180, 0.9);
}
.marker::after {
  content: ''; position: absolute; inset: 3px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, 0.7);
  animation: ping 2.6s ease-out infinite;
}
.marker.on::before { background: var(--accent); }
.marker.hot::after { animation-duration: 1.1s; }
@keyframes ping { 0% { transform: scale(0.5); opacity: 0.9; } 100% { transform: scale(1.5); opacity: 0; } }

.enter {
  position: absolute; left: 0; top: 0; pointer-events: auto; cursor: pointer; white-space: nowrap;
  border: 0; border-radius: 999px; padding: 9px 16px; font-size: 13px; font-weight: 600;
  background: var(--accent); color: var(--accent-ink);
  box-shadow: 0 8px 26px rgba(240, 138, 60, 0.35), 0 2px 6px rgba(0, 0, 0, 0.4);
  transition: filter 0.2s ease, opacity 0.5s ease; will-change: transform;
}
.enter:hover { filter: brightness(1.08); }
.enter[hidden] { display: none; }

.card {
  position: absolute; left: 28px; bottom: 28px; width: min(340px, calc(100vw - 56px)); pointer-events: auto;
  padding: 18px 20px 20px; border-radius: 14px; border: 1px solid var(--line); background: var(--panel);
  backdrop-filter: blur(20px) saturate(1.3); -webkit-backdrop-filter: blur(20px) saturate(1.3);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
  animation: rise 0.45s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.card[hidden] { display: none; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.card-where { margin: 0 0 6px; font-size: 11.5px; color: var(--ink-soft); }
.card-title { margin: 0 0 8px; font-family: var(--serif); font-weight: 400; font-size: 27px; letter-spacing: -0.01em; }
.card-text { margin: 0; font-size: 13.5px; line-height: 1.5; color: var(--ink-soft); }
.card-link {
  display: inline-block; margin-top: 14px; padding: 7px 13px; border-radius: 999px; font-size: 12.5px; font-weight: 600;
  background: var(--accent); color: var(--accent-ink); text-decoration: none;
}
.card-link[hidden] { display: none; }
.card-x {
  position: absolute; right: 10px; top: 10px; width: 26px; height: 26px; border-radius: 50%; border: 0; cursor: pointer;
  background: rgba(255, 255, 255, 0.07); color: var(--ink-soft); display: grid; place-items: center;
}
.card-x:hover { background: rgba(255, 255, 255, 0.16); color: var(--ink); }

@media (max-width: 640px) {
  .top { left: 16px; right: 16px; top: 14px; }
  #name { font-size: 24px; }
  #tagline { font-size: 12.5px; }
  .pill { padding: 6px 11px; font-size: 12px; }
  .card { left: 16px; bottom: 16px; width: calc(100vw - 32px); }
}
@media (prefers-reduced-motion: reduce) {
  .marker::after { animation: none; }
}
