:root {
  --serif: 'Cormorant Garamond', 'Didot', 'Bodoni 72', Georgia, serif;
  --sans: 'Helvetica Neue', 'Inter', Arial, sans-serif;
}

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: #04040c;
  color: #e6ebff;
  font-family: var(--sans);
}

canvas { display: block; touch-action: none; }

.labels {
  position: absolute;
  top: 0;
  left: 0;
  pointer-events: none;
}

.label { pointer-events: none; transition: opacity 0.3s; }

.label-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  color: rgba(210, 222, 255, 0.55);
  transition: transform 0.4s ease, color 0.4s ease, text-shadow 0.4s ease;
  white-space: nowrap;
}

.label .sym { font-size: 16px; line-height: 1; }
.label .name { font-family: var(--serif); font-size: 14px; letter-spacing: 0.25em; text-transform: uppercase; }
.label .dates { font-size: 9px; letter-spacing: 0.2em; opacity: 0; transition: opacity 0.4s; }

.label.active .label-inner {
  transform: translateY(18px) scale(1.25);
  color: var(--accent);
  text-shadow: 0 0 12px var(--accent);
}
.label.active .dates { opacity: 0.8; }

.label .cta { display: none; margin-top: 4px; font-size: 8px; letter-spacing: 0.3em; text-transform: uppercase; }
body.touch .label .cta { display: block; opacity: 0; transition: opacity 0.4s; }
body.touch .label.active .cta { opacity: 0.7; animation: pulse 2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: 0.3; } }

.brand {
  position: fixed;
  top: 28px;
  left: 32px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  pointer-events: none;
}
.brand-title { font-family: var(--serif); font-size: 24px; letter-spacing: 0.4em; text-transform: uppercase; }
.brand-sub { font-size: 10px; letter-spacing: 0.6em; opacity: 0.5; }

#hint {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 12px;
  letter-spacing: 0.3em;
  opacity: 0.5;
  pointer-events: none;
  transition: opacity 0.6s;
}
#hint.hidden { opacity: 0; }

#panel {
  --accent: #fff;
  position: fixed;
  top: 50%;
  right: 8vw;
  width: min(360px, 84vw);
  transform: translateY(-50%);
  padding: 36px 32px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  background: rgba(8, 8, 24, 0.35);
  backdrop-filter: blur(14px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}
#panel.hidden {
  opacity: 0;
  transform: translateY(-46%);
  pointer-events: none;
}

#panel .symbol { font-size: 40px; color: var(--accent); text-shadow: 0 0 20px var(--accent); }
#panel h1 { margin: 12px 0 4px; font-family: var(--serif); font-weight: 400; font-size: 38px; letter-spacing: 0.15em; text-transform: uppercase; }
#panel .subtitle { font-size: 11px; letter-spacing: 0.5em; text-transform: uppercase; opacity: 0.6; }
#panel .dates { margin-top: 18px; font-size: 13px; letter-spacing: 0.2em; color: var(--accent); }
#panel .meta { display: flex; gap: 18px; margin-top: 8px; font-size: 12px; opacity: 0.7; }
#panel .motto { margin: 24px 0; font-family: var(--serif); font-style: italic; font-size: 19px; line-height: 1.6; opacity: 0.9; }
#panel .keywords { display: flex; gap: 8px; flex-wrap: wrap; }
#panel .keywords span {
  padding: 4px 12px;
  border: 1px solid color-mix(in srgb, var(--accent) 50%, transparent);
  border-radius: 999px;
  font-size: 12px;
  letter-spacing: 0.15em;
}

#back {
  margin-top: 28px;
  padding: 0;
  border: none;
  background: none;
  color: rgba(230, 235, 255, 0.6);
  font: inherit;
  font-size: 12px;
  letter-spacing: 0.25em;
  cursor: pointer;
  transition: color 0.3s;
}
#back:hover { color: var(--accent); }

@media (max-width: 720px) {
  #panel { top: auto; bottom: 24px; right: 50%; transform: translateX(50%); padding: 24px; }
  #panel.hidden { transform: translate(50%, 4%); }
}
