* {
  margin:0;
  padding:0;
  box-sizing:border-box;
  font-family: "punto", sans-serif;
  font-weight: 700;
  font-style: normal;
}

body {
  background:#121212;
  color:whitesmoke;
}

.topbar {
  position:fixed;
  top:14px;
  left:18px;
  right:14px;
  display:flex;
  gap:18px;
  align-items:center;
  z-index:6;
}

h1 {
  font-size:44px;
  font-weight:600;
}

.modes button {
  border:1px dashed rgba(255,255,255,.2);
  background:#121212;
  color:whitesmoke;
  border-radius:10px;
  padding:6px 10px;
  cursor:pointer;
  font-size:18px;
}

.modes button.active {
  border-color: whitesmoke;
  color: whitesmoke;
}

#brain-stage{
  position:fixed;
  inset:0;
  overflow:hidden;
  transform:scale(1);
  transform-origin:50% 50%;
  transition:transform .45s ease;
}

.dot{
  position:absolute;
  z-index:1;
  width:14px;
  height:14px;
  border-radius:50%;
  background-size:cover;
  background-position:center;
  cursor:pointer;
  opacity:.95;
  animation:pulse 5.5s ease-in-out infinite;
  transition:transform .25s ease, opacity .25s ease;
  padding:12px;
  will-change: transform;
}

.dot.big{
  transform: scale(1.9);
  animation-play-state: paused;
}

.dot:hover{
  transform: scale(2.6);
  animation-play-state: paused;
  z-index: 3;
  filter: brightness(1.12);
}

.dot.big:hover{
  transform: scale(2.6);
}

.dot.hidden{
  opacity:0.3;
  pointer-events:none;
}

@keyframes pulse{
  0%{  transform:scale(.9);  }
  50%{ transform:scale(1.15);}
  100%{transform:scale(.9);  }
}

.dot.burst { animation:burst .9s ease-out; }
@keyframes burst{
  0%{transform:scale(1);   filter:brightness(1.1);}
  60%{transform:scale(1.9); filter:brightness(1.5);}
  100%{transform:scale(1);  filter:brightness(1);}
}

.dot.t-coincidence {box-shadow:0 0 0 1px #4CBB17}
.dot.t-abstract    {box-shadow:0 0 0 1px #9c67ff}
.dot.t-micro-macro {box-shadow:0 0 0 1px #38B9FF}
.dot.t-me-fam-frnds{box-shadow:0 0 0 1px #ff3de8}
.dot.t-pure-joy    {box-shadow:0 0 0 1px #FFF42B}
.dot.t-muse-inspo  {box-shadow:0 0 0 1px #F52727}

#labels {
  position:fixed;
  left:0;
  right:0;
  bottom:0;
  pointer-events:none;
  z-index:2;
}

.home-label {
  position:absolute;
  transform:translate(-50%,-50%);
  font-size:13px;
  opacity:.9;
  pointer-events:auto;
  cursor:pointer;
}

#key {
  position:fixed;
  left:10px;
  bottom:14px;
  z-index:9;
  pointer-events:auto;
  padding:10px 12px;
  font-size:12px;
}

#key .title {
  opacity:.9;
  margin:0 0 8px 0;
  font-size:15px;
}

#key ul {
  list-style:none;
  margin:6.5px 0 0 0;
  padding:0;
  display:flex;
  flex-wrap:wrap;
  gap:6px;
}

#key li {
  --c:#fff;
  display:inline-flex;
  align-items:center;
  padding:6px 10px;
  border-radius:8px;
  border:1.5px solid var(--c);
  color:var(--c);
  background:rgba(255,255,255,.04);
  cursor:pointer;
  user-select:none;
  transition:background .2s, color .2s, transform .05s, box-shadow .2s;
}

#key li:hover {
  box-shadow:0 0 0 3px rgba(255,255,255,.08) inset;
}

#key li:active {
  transform:scale(.98);
}

#key li.active {
  background:var(--c);
  color:#111;
  box-shadow:0 0 0 1px var(--c);
}

#key .coincidence{ --c:#4CBB17; }
#key .abstract   { --c:#9c67ff; }
#key .micro      { --c:#38B9FF; }
#key .family     { --c:#ff3de8; }
#key .joy        { --c:#FFF42B; }
#key .muse       { --c:#F52727; }

#key-reset {
  margin-top:8px;
  padding:6px 10px;
  font-size:12px;
  background:#121212;
  color:#fff;
  border:1px solid rgba(255,255,255,.35);
  border-radius:8px;
  cursor:pointer;
  transition:background .2s, transform .05s;
}

#key-reset:hover { background:#121212; }
#key-reset:active { transform:scale(.98); }
#key-reset.hide { display:none; }

body.seq-mode #key {
  top: 7.5px;
  right: 14px;
  left: auto;
  bottom: auto;
}

body.seq-mode #key-reset { 
  display: none !important; 
}

@media (max-width: 640px) {
  body.seq-mode #key {
    top: 72px;
    right: 10px;
  }
}

#sequence-grid {
  position:fixed;
  top:68px;
  left:12px;
  right:12px;
  bottom:12px;
  z-index:5;
  display:none;
  overflow:auto;
}

#sequence-grid .item {
  width:200px;
  height:200px;
  margin:6px;
  display:inline-block;
  vertical-align:top;
  border-radius:10px;
  background-size:cover;
  background-position:center;
  box-shadow:0 0 8px rgba(0,0,0,.8);
  cursor:pointer;
}

.viewer {
  position:fixed;
  inset:0;
  background: rgba(0,0,0,.4);
  display:none;
  align-items:center;
  justify-content:center;
  padding:14px;
  z-index:10;
}

.viewer.open {
  display:flex;
}

.viewer-box {
  width:auto;
  max-width:96vw;
  max-height:92vh;
  padding:16px;
  background: rgba(18,18,18,.88);
  border-radius:14px;
  box-shadow:0 20px 60px rgba(0,0,0,.6);
  position:relative;
  overflow:hidden;
}

.viewer-content {
  display:grid;
  grid-template-columns:minmax(0,1fr) 300px;
  gap:14px;
  align-items:start;
  height:auto;
  max-height:calc(92vh - 32px);
  overflow:hidden;
}

.viewer-content > *{ min-width:0; min-height:0; }

.viewer-content img {
  display:block;
  width:auto;
  height:auto;
  max-width: calc(96vw - 32px - 14px - 300px);
  max-height: calc(92vh - 32px);
  object-fit: contain;
  border-radius:10px;
  background:#121212;
  justify-self:center;
  align-self:center;
}

.viewer-meta{
  width:300px;
  max-height: calc(92vh - 32px);
  overflow:auto;
  color:whitesmoke;
  align-self:start;
}

.viewer-meta h3 {
  color:whitesmoke;
  font-size:30px;
  margin-bottom:9px;
}

.viewer-meta p { 
  line-height: 1.28;
  margin:12px 0; 
}

.close-btn {
  position:absolute;
  top:8px;
  right:8px;
  width:35px;
  height:35px;
  padding:0;
  font-size:35px;
  line-height:1;
  display:flex;
  align-items:center;
  justify-content:center;
  border:1px solid rgba(255,255,255,.5);
  background:#121212;
  color:whitesmoke;
  border-radius:5px;
  cursor:pointer;
}

@media (max-width: 640px) {
  .viewer-content {grid-template-columns:minmax(0,1fr) 240px;}
  .viewer-meta {width:240px; max-height: calc(92vh - 32px);}
  .viewer-content img {
    max-width: calc(96vw - 32px - 14px - 240px);
    max-height: calc(92vh - 32px);
  }
}

.dot.seen::after,
#sequence-grid .item.seen::after {
  content: none !important;
  display: none !important;
}

.dot.seen,
#sequence-grid .item.seen {
  filter: grayscale(100%) contrast(0.92) brightness(0.4);
  opacity: 0.75;
  transition: filter .2s ease, opacity .2s ease;
}

.dot.seen:hover,
#sequence-grid .item.seen:hover {
  filter: grayscale(100%) contrast(0.98) brightness(1.0);
  opacity: 0.9;
}

#statement-page {
  position:fixed;
  top:250px;
  left:12px;
  right:12px;
  bottom:12px;
  display:none;
  overflow:auto;
  z-index:5;
}

.statement-wrap {
  max-width:750px;
  margin:0 auto;
  padding:10px 6px 32px;
}

#statement-page h2 {
  font-size:34px;
  margin-bottom:14px;
}

#statement-page .main-statement {
  font-size:18px;
  line-height:1.6;
  opacity:.95;
  margin-bottom:18px;
}

body.statement-mode #key {
  display:none;
}

.link-layer {
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  pointer-events:none;
  z-index:2;
}

.link-line {
  vector-effect: non-scaling-stroke;
  stroke-linecap: round;
}

#toggle-lines {
  position:fixed;
  right:14px;
  bottom:23px;
  z-index:9;
  padding:7px 12px;
  font-size:12px;
  border-radius:8px;
  border:1px solid rgba(255,255,255,.35);
  background:#121212;
  color:whitesmoke;
  cursor:pointer;
  transition:transform .08s ease, background .3s ease, opacity .3s ease;
}

#toggle-lines:active {
  transform:scale(.98);
}

#toggle-lines:hover {
  background:#171717;
}

body.seq-mode #toggle-lines,
body.statement-mode #toggle-lines{ display:none; }